Fix #180 - No Company logo breaks Invoice/Quotes

This commit is contained in:
johnny@pittpc.com 2021-03-27 16:07:42 -04:00
parent cd2ea38c5b
commit 8b1e374148
4 changed files with 23 additions and 8 deletions

View File

@ -61,7 +61,9 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){
}
$company_email = $row['company_email'];
$company_logo = $row['company_logo'];
$company_logo_base64 = base64_encode(file_get_contents($row['company_logo']));
if(!empty($company_logo)){
$company_logo_base64 = base64_encode(file_get_contents($row['company_logo']));
}
$config_invoice_footer = $row['config_invoice_footer'];
$config_stripe_enable = $row['config_stripe_enable'];
$config_stripe_publishable = $row['config_stripe_publishable'];
@ -533,10 +535,12 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){
// Header
{
columns: [
<?php if(!empty($company_logo_base64)){ ?>
{
image: '<?php echo "data:image;base64,$company_logo_base64"; ?>',
width: 120
},
<?php } ?>
[
{
@ -911,4 +915,4 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){
}
?>
<?php include("guest_footer.php"); ?>
<?php include("guest_footer.php"); ?>

View File

@ -60,7 +60,9 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
}
$company_email = $row['company_email'];
$company_logo = $row['company_logo'];
$company_logo_base64 = base64_encode(file_get_contents($row['company_logo']));
if(!empty($company_logo)){
$company_logo_base64 = base64_encode(file_get_contents($row['company_logo']));
}
$quote_footer = $row['quote_footer'];
$ip = get_ip();
@ -279,10 +281,12 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
// Header
{
columns: [
<?php if(!empty($company_logo_base64)){ ?>
{
image: '<?php echo "data:image;base64,$company_logo_base64"; ?>',
width: 120
},
<?php } ?>
[
{
@ -609,4 +613,4 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
echo "GTFO";
} ?>
<?php include("guest_footer.php");
<?php include("guest_footer.php");

View File

@ -65,8 +65,9 @@ if(isset($_GET['invoice_id'])){
$company_email = $row['company_email'];
$company_website = $row['company_website'];
$company_logo = $row['company_logo'];
$company_logo_base64 = base64_encode(file_get_contents($row['company_logo']));
if(!empty($company_logo)){
$company_logo_base64 = base64_encode(file_get_contents($row['company_logo']));
}
$sql_history = mysqli_query($mysqli,"SELECT * FROM history WHERE invoice_id = $invoice_id ORDER BY history_id DESC");
$sql_payments = mysqli_query($mysqli,"SELECT * FROM payments, accounts WHERE payments.account_id = accounts.account_id AND payments.invoice_id = $invoice_id ORDER BY payments.payment_id DESC");
@ -520,10 +521,12 @@ include("footer.php");
// Header
{
columns: [
<?php if(!empty($company_logo_base64)){ ?>
{
image: '<?php echo "data:image;base64,$company_logo_base64"; ?>',
width: 120
},
<?php } ?>
[
{

View File

@ -60,7 +60,9 @@ if(isset($_GET['quote_id'])){
$company_email = $row['company_email'];
$company_website = $row['company_website'];
$company_logo = $row['company_logo'];
$company_logo_base64 = base64_encode(file_get_contents($row['company_logo']));
if(!empty($company_logo)){
$company_logo_base64 = base64_encode(file_get_contents($row['company_logo']));
}
$sql_history = mysqli_query($mysqli,"SELECT * FROM history WHERE quote_id = $quote_id ORDER BY history_id DESC");
@ -418,11 +420,13 @@ var docDefinition = {
// Header
{
columns: [
<?php if(!empty($company_logo_base64)){ ?>
{
image: '<?php echo "data:image;base64,$company_logo_base64"; ?>',
width: 120
},
<?php } ?>
[
{
text: 'QUOTE',