From ef213e34d4e9e2384c1ae092abe2ada628869154 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Thu, 2 Nov 2023 16:12:06 -0400 Subject: [PATCH] Invoice UI Update: Bolded Due Date, Moved Subtotal to the top added - sign in front of discount, do not subtract the discount from the subtotal as this is reservered for total, do not show tax discount or paid in pdf if they are 0 --- guest_view_invoice.php | 60 ++++++++++++++++++++++++++++++---------- invoice.php | 63 ++++++++++++++++++++++++++++++++---------- quote.php | 2 +- 3 files changed, 95 insertions(+), 30 deletions(-) diff --git a/guest_view_invoice.php b/guest_view_invoice.php index 0e1d19ae..981da396 100644 --- a/guest_view_invoice.php +++ b/guest_view_invoice.php @@ -185,7 +185,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it Date - + Due
@@ -212,7 +212,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it + + + + 0) { ?> - + - - - - - - 0) { ?> + + + + 0) { ?> @@ -397,11 +399,11 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it {}, { text: 'Due', - style: 'invoiceDateTitle' + style: 'invoiceDueDateTitle' }, { text: , - style: 'invoiceDateValue' + style: 'invoiceDueDateValue' }, ], ] @@ -520,7 +522,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it ], [ { - rowSpan: 5, + rowSpan: '*', text: , style: 'notesText' }, @@ -533,6 +535,20 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it style: 'itemsFooterSubValue' } ], + 0) { ?> + [ + {}, + { + text: 'Discount', + style: 'itemsFooterSubTitle' + }, + { + text: , + style: 'itemsFooterSubValue' + } + ], + + 0) { ?> [ {}, { @@ -544,6 +560,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it style: 'itemsFooterSubValue' } ], + [ {}, { @@ -555,6 +572,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it style: 'itemsFooterSubValue' } ], + 0) { ?> [ {}, { @@ -566,6 +584,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it style: 'itemsFooterSubValue' } ], + [ {}, { @@ -631,7 +650,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it alignment: 'right', margin: [0,0,0,30] }, - // Invoice Dates + // Invoice Date invoiceDateTitle: { fontSize: 10, alignment: 'left', @@ -642,6 +661,19 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it alignment: 'right', margin: [0,5,0,5] }, + // Invoice Due Date + invoiceDueDateTitle: { + fontSize: 10, + bold: true, + alignment: 'left', + margin: [0,5,0,5] + }, + invoiceDueDateValue: { + fontSize: 10, + bold: true, + alignment: 'right', + margin: [0,5,0,5] + }, // Items Header itemsHeader: { fontSize: 10, diff --git a/invoice.php b/invoice.php index b5983fb6..8b1471eb 100644 --- a/invoice.php +++ b/invoice.php @@ -242,7 +242,7 @@ if (isset($_GET['invoice_id'])) { - + @@ -403,28 +403,31 @@ if (isset($_GET['invoice_id'])) {
Subtotal
Discount-
Subtotal
Tax
Total
Paid
Date
Due
+ + + + 0) { ?> - + - - - - - - 0) { ?> - + + + + + 0) { ?> @@ -680,11 +683,11 @@ require_once "footer.php"; {}, { text: 'Due', - style: 'invoiceDateTitle' + style: 'invoiceDueDateTitle' }, { text: , - style: 'invoiceDateValue' + style: 'invoiceDueDateValue' }, ], ] @@ -803,7 +806,7 @@ require_once "footer.php"; ], [ { - rowSpan: 5, + rowSpan: '*', text: , style: 'notesText' }, @@ -816,6 +819,20 @@ require_once "footer.php"; style: 'itemsFooterSubValue' } ], + 0) { ?> + [ + {}, + { + text: 'Discount', + style: 'itemsFooterSubTitle' + }, + { + text: , + style: 'itemsFooterSubValue' + } + ], + + 0) { ?> [ {}, { @@ -827,6 +844,7 @@ require_once "footer.php"; style: 'itemsFooterSubValue' } ], + [ {}, { @@ -838,6 +856,7 @@ require_once "footer.php"; style: 'itemsFooterSubValue' } ], + 0) { ?> [ {}, { @@ -849,6 +868,7 @@ require_once "footer.php"; style: 'itemsFooterSubValue' } ], + [ {}, { @@ -858,7 +878,7 @@ require_once "footer.php"; { text: , - style: 'itemsFooterTotalTitle' + style: 'itemsFooterTotalValue' } ], ] @@ -914,7 +934,7 @@ require_once "footer.php"; alignment: 'right', margin: [0,0,0,30] }, - // Invoice Dates + // Invoice Date invoiceDateTitle: { fontSize: 10, alignment: 'left', @@ -925,6 +945,19 @@ require_once "footer.php"; alignment: 'right', margin: [0,5,0,5] }, + // Invoice Due Date + invoiceDueDateTitle: { + fontSize: 10, + bold: true, + alignment: 'left', + margin: [0,5,0,5] + }, + invoiceDueDateValue: { + fontSize: 10, + bold: true, + alignment: 'right', + margin: [0,5,0,5] + }, // Items Header itemsHeader: { fontSize: 10, diff --git a/quote.php b/quote.php index 650a9034..c644944d 100644 --- a/quote.php +++ b/quote.php @@ -234,7 +234,7 @@ if (isset($_GET['quote_id'])) { - +
Subtotal
Discount-
Subtotal
Tax
Total
Paid
Date
Expire