From 4bcad0de4bad13c2238d98361a739811506a528a Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 19 Jun 2024 11:15:43 +0000 Subject: [PATCH] FIX_pdf design : ps --- app/Models/InvoiceModel.php | 6 +- app/Models/SubscriptionModel.php | 2 +- app/Views/invoice_form.php | 2 +- app/Views/invoice_form_old_design.php | 2206 +++++++++++++++++ app/Views/invoice_list.php | 20 +- app/Views/invoice_pdf_template.php | 577 ++--- app/Views/invoice_pdf_template_old_design.php | 388 +++ 7 files changed, 2910 insertions(+), 291 deletions(-) create mode 100644 app/Views/invoice_form_old_design.php create mode 100644 app/Views/invoice_pdf_template_old_design.php diff --git a/app/Models/InvoiceModel.php b/app/Models/InvoiceModel.php index fec99f13..d717537f 100644 --- a/app/Models/InvoiceModel.php +++ b/app/Models/InvoiceModel.php @@ -240,12 +240,12 @@ public function getJoinedData($where, $orderby = []) ->join('customer_addresses as S','S.customer_address_id=invoice.shipping_address_id AND S.address_type = 2','left') ->join('states', 'states.state_short_name = A.state AND A.country = "IN"', 'left') ->join('countries', 'countries.country_short_name = A.country', 'left') - ->select('invoice.*,DATE_FORMAT(invoice.invoice_date, "%d/%m/%Y") AS formatted_invoice_date,DATE_FORMAT(invoice.due_date, "%d/%m/%Y") AS formatted_due_date ,CONCAT_WS(" ", C.first_name, C.last_name) as customer_name,C.mobile_no,A.address_1, A.address_2,A.postal_code,A.city, A.state,C.mobile_no as customer_mobile') + ->select('invoice.*,DATE_FORMAT(invoice.invoice_date, "%d/%m/%Y") AS formatted_invoice_date,DATE_FORMAT(invoice.due_date, "%d/%m/%Y") AS formatted_due_date ,CONCAT_WS(" ", C.first_name, C.last_name) as customer_name,C.mobile_no,C.email,A.address_1, A.address_2,A.postal_code,A.city, A.state,C.mobile_no as customer_mobile') ->select('B.title as company_name,B.business_logo,B.terms as company_terms,B.address as company_address,B.city as company_city,B.state as company_state,B.postal_code as company_postal_code,B.email as company_email,B.mobile_no as company_mobile_no') ->select('COALESCE(NULLIF(states.state_name, ""), A.state) AS customer_bill_state') ->select('COALESCE(NULLIF(states.state_name, ""), S.state) AS customer_ship_state') - ->select('concat(A.address_1," ", A.address_2) as customer_bill_address,A.postal_code as customer_bill_postal_code ,A.city as customer_bill_city, countries.country_name as customer_bill_country,A.country as bcountry,A.state as bstate,A.customer_address_id as baddr_id') - ->select('concat(S.address_1," ", S.address_2) as customer_ship_address,S.postal_code as customer_ship_postal_code ,S.city as customer_ship_city, countries.country_name as customer_ship_country,S.country as scountry,S.state as sstate,S.customer_address_id as saddr_id') + ->select('concat(A.address_1," ", A.address_2) as customer_bill_address,A.postal_code as customer_bill_postal_code ,A.city as customer_bill_city, countries.country_name as customer_bill_country,A.country as bcountry,A.state as bstate,A.customer_address_id as baddr_id,A.email as bemail') + ->select('concat(S.address_1," ", S.address_2) as customer_ship_address,S.postal_code as customer_ship_postal_code ,S.city as customer_ship_city, countries.country_name as customer_ship_country,S.country as scountry,S.state as sstate,S.customer_address_id as saddr_id,S.email as semail') ->get() ->getResult(); diff --git a/app/Models/SubscriptionModel.php b/app/Models/SubscriptionModel.php index 76a6bde1..f45d16e6 100644 --- a/app/Models/SubscriptionModel.php +++ b/app/Models/SubscriptionModel.php @@ -390,7 +390,7 @@ public function getSubscriptionDetailsBySchemeName($selectedScheme, $downloadTyp $query = $builder->get(); return $query->getResult(); } - + diff --git a/app/Views/invoice_form.php b/app/Views/invoice_form.php index 521abcc4..b4207166 100644 --- a/app/Views/invoice_form.php +++ b/app/Views/invoice_form.php @@ -473,7 +473,7 @@ if (isset($invoice_item_details[0]['to_subscription']) && !empty($invoice_item_d
-->
- +
diff --git a/app/Views/invoice_form_old_design.php b/app/Views/invoice_form_old_design.php new file mode 100644 index 00000000..b1172eef --- /dev/null +++ b/app/Views/invoice_form_old_design.php @@ -0,0 +1,2206 @@ + + +
+
+
+
+

+
+
" id="myForm"> + + +
+
+
+ customer_id === $invoice_details['customer_id']) { + $displayvalue = $customer->first_name . ' ' . $customer->last_name; + $last_name = $customer->last_name; + $first_name = $customer->first_name; + } + } ?> + + + + + + + + + + + +
Please select customer.
+ +
+ +
+ + +
+ +
+ +
+
+ + + +
+
+ + +
+
+
+
+ + +
+
+
+
+ + + +
+
+ + +
+ + + +
+ + +
+
+ + +
+ +
+
+
+

Item Details

+
+ + + + + + + + + + + + + + + + + $ii_details) : ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Item DetailsQtyRateTaxAmount Discount
+ + + " name="quantity[]" oninput="calculateInvoice(this,)" value="" min="1" /> + " name="rate[]" oninput="calculateInvoice(this,)" value="" /> + " name="tax[]" value="" readonly /> + " name="amount[]" value="" readonly /> + " name="discount_amount[]" oninput="calculateInvoice(this,)" value="" min="0" step="0.001" /> + + + + +
+
+ + + + + + + + + +
+
+ + +
+
+
+
+
+

Calculation

+
+
+ + +
+ +
+ +
+ + 0) { + echo ''; + } + ?> + + + +
+
+
+ +
> +
+ + + > + +
+
+ + + step="0.001" > + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+ +
+ + +
+
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + + + + + +
+ + + + + + + + + + + + + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/Views/invoice_list.php b/app/Views/invoice_list.php index 888124b2..cb8f50b8 100644 --- a/app/Views/invoice_list.php +++ b/app/Views/invoice_list.php @@ -14,9 +14,16 @@ } } #pdfPreviewModal .modal-dialog { - max-width: 148mm; /* A5 width */ - width: auto; - margin: 1.75rem auto; + width: 595px; + height: 842px; + top: -973px; + left: 1018px; + gap: 0px; + opacity: 0px; + + /* max-width: 148mm; /* A5 width */ + /* width: auto; + margin: 1.75rem auto; */ } #pdfPreviewModal .modal-body { font-family: 'Times New Roman', Times, serif; @@ -29,8 +36,11 @@ #printPdfButton .ri-printer-line { font-size: 8px; } - .modal-lg, .modal-xl { - max-width: 678px; + .modal-lg, .modal-xl { + Width : 595px; + Height : 842px; + Top : -973px; + Left : 1018px; } diff --git a/app/Views/invoice_pdf_template.php b/app/Views/invoice_pdf_template.php index e3a80620..c18b75b9 100644 --- a/app/Views/invoice_pdf_template.php +++ b/app/Views/invoice_pdf_template.php @@ -5,52 +5,65 @@ - + +
+ + + + + + + +
+ + + +

company_address . ',' . $value->company_city . ($value->company_postal_code ? " - " . $value->company_postal_code : "") ?>

+

company_email . ' | ' . $value->company_mobile_no ?>

+
+ + + - - +
- - - - - - - - - -
- + + + BILLING TO :
+ customer_name ?>
+ customer_bill_address && ($value->baddr_id !== null || $value->baddr_id !== '')) { ?> + customer_bill_address ? $value->customer_bill_address . " ," : "" ?>
+ customer_bill_city ? $value->customer_bill_city : "" ?> customer_bill_state ? $value->customer_bill_state : "" ?> + customer_bill_postal_code ? " - " . $value->customer_bill_postal_code : ""; ?> + customer_bill_country ? $value->customer_bill_country . "." : $value->bcountry ?>
+ baddr_id === null || $value->baddr_id === '') { + echo $value->billing_address ? '

' . $value->billing_address . '

' : ''; + } ?> + mobile_no ? "Phone : +91" . $value->mobile_no . " ." : "" ?>
+ email ? "Email : " . $value->email . " ." : "" ?> -
-

company_address ?>,
- company_city ?>, - company_state ?> - company_postal_code ? " - " . $value->company_postal_code : "" ?>.

-

company_email ?>

-

company_mobile_no ?>

-
+
- - - - - - - - + - - - - - - - - - - - - - - - -
wp_api_order_id) ? 'Order # ' . $value->invoice_number : 'Invoice # ' . $value->invoice_number; ?>
Invoice Date : formatted_invoice_date ?>
+ + SHIPPING TO :
+ customer_name ?>
+ customer_ship_address && ($value->saddr_id !== null || $value->saddr_id !== '')) { ?> + customer_ship_address ? $value->customer_ship_address . " ," : "" ?>
+ customer_ship_city ? $value->customer_ship_city : "" ?> customer_ship_state ? $value->customer_bill_state : "" ?> + customer_ship_postal_code ? " - " . $value->customer_ship_postal_code : ""; ?> + customer_ship_country ? $value->customer_ship_country . "." : $value->scountry ?>
+ saddr_id === null || $value->saddr_id === '') { + echo $value->shipping_address ? '

' . $value->shipping_address . '

' : ''; + } ?> + mobile_no ? "Phone : +91" . $value->mobile_no . " ." : "" ?>
+ email ? "Email : " . $value->email . " ." : "" ?> - due_date) : ?> -
Due Date : formatted_due_date ?>
From Subscription : from_subscription)) ?>
To Subscription : to_subscription)) ?>
+ +
+ INVOICE :
+ + wp_api_order_id) ? 'Order # ' . $value->invoice_number : 'Invoice No # ' . $value->invoice_number; ?>
+ formatted_invoice_date ?>
+ due_date) : echo "Due Date :". $value->formatted_due_date ?>
+ + + From Subscription : from_subscription)) ?>
+ To Subscription : to_subscription)) ?>
+ + +
- - - - - - - - - - -
Billing AddressShipping Address
- - customer_name ?>
- customer_bill_address && ($value->baddr_id !== null || $value->baddr_id !== '')){ ?> - customer_bill_address ? $value->customer_bill_address." ," : ""?>
- customer_bill_city ? $value->customer_bill_city : "" ?> customer_bill_state ? $value->customer_bill_state : "" ?> - customer_bill_postal_code ? " - " . $value->customer_bill_postal_code : ""; ?> - customer_bill_country ? $value->customer_bill_country . "." : $value->bcountry ?>
- baddr_id === null || $value->baddr_id === '') { - echo $value->billing_address ? '

'.$value->billing_address.'

' : ''; - } ?> - mobile_no ? $value->mobile_no." ." : "" ?> - -
- - customer_name ?>
- customer_ship_address && ($value->saddr_id !== null || $value->saddr_id !== '')){ ?> - customer_ship_address ? $value->customer_ship_address." ," : "" ?>
- customer_ship_city ? $value->customer_ship_city : "" ?> customer_ship_state ? $value->customer_bill_state : "" ?> - customer_ship_postal_code ? " - " . $value->customer_ship_postal_code : ""; ?> - customer_ship_country ? $value->customer_ship_country . "." : $value->scountry ?>
- saddr_id === null || $value->saddr_id === '') { - echo $value->shipping_address ? '

'.$value->shipping_address.'

' : ''; - } ?> - mobile_no ? $value->mobile_no." ." : "" ?> - -
-

+ + - + - - - + + @@ -282,106 +269,134 @@ - - - - - + + - - + + +
+ - + + - - dis_type == "%"){ - $dis_value = ($value->subtotal * $value->discount) / 100; - $dis_percent = '('.$value->discount.$value->dis_type.')'; - }else{ - $dis_value = $value->discount ? $value->discount : 0; - $dis_percent = ''; - } ?> - - - - - shipping_label != '') : ?> - - - - - - - total_amount >= $value->exact_total_amount) ? '+' : '-'; - $difference = abs($value->exact_total_amount - $value->total_amount); - ?> - - - - - - - status === 'Draft') : ?> - - - - - - status === 'Approved') : ?> - - - - - + + + + +
Subtotal :   ₹subtotal, 2, '.', ',') ?> + +
+ reason)) : ?> +
+
Reason
+ reason); ?> +
+ + notes)) : ?> +
+
Notes
+ notes); ?> +
+ + payment_note)) : ?> +
+
Payment Notes
+ payment_note); ?> +
+ + terms)) : ?> +
+                                            terms ?>
+                                            
+ +
+
+ +
+ + + + + + + dis_type == "%") { + $dis_value = ($value->subtotal * $value->discount) / 100; + $dis_percent = '(' . $value->discount . $value->dis_type . ')'; + } else { + $dis_value = $value->discount ? $value->discount : 0; + $dis_percent = ''; + } + ?> + + + + + shipping_label)) : ?> + + + + + + total_amount >= $value->exact_total_amount) ? '₹' : '₹-'; + $difference = abs($value->exact_total_amount - $value->total_amount); + ?> + + + + + + + + + status === 'Draft') : ?> + + + + + + status === 'Approved') : ?> + + + + + + +
Subtotalsubtotal, 2, '.', ',') ?>
Discount
shipping_label) ?>shipping_charge, 2, '.', ',') ?>
Rounding
Totaltotal_amount, 2, '.', ',') ?>
Balancetotal_amount, 2, '.', ',') ?>
Paidtotal_amount, 2, '.', ',') ?>
+
Discount :   
shipping_label ?> :   ₹shipping_charge, 2, '.', ',') ?>
Rounding :   
Total :   ₹total_amount, 2, '.', ',') ?>
Balance :   ₹total_amount, 2, '.', ',') ?>
Paid :   ₹total_amount, 2, '.', ',') ?>
+
+

Bank Details

+ +
+
+
+ +
+
Authorized Signatory
+
+
+
- -
- -
- - -
- - - reason)) { ?> -
-

Reason: reason; ?>

- - terms)) { ?> -
-
-                        terms ?>
-                    
- -
- -
-
-

Bank Details

- - - -
- - - - - - + + + + + + + + diff --git a/app/Views/invoice_pdf_template_old_design.php b/app/Views/invoice_pdf_template_old_design.php new file mode 100644 index 00000000..e3a80620 --- /dev/null +++ b/app/Views/invoice_pdf_template_old_design.php @@ -0,0 +1,388 @@ + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + +
+

company_address ?>,
+ company_city ?>, + company_state ?> + company_postal_code ? " - " . $value->company_postal_code : "" ?>.

+

company_email ?>

+

company_mobile_no ?>

+
+
+ + + + + + + + + + due_date) : ?> + + + + + + + + + + + + + + + + +
wp_api_order_id) ? 'Order # ' . $value->invoice_number : 'Invoice # ' . $value->invoice_number; ?>
Invoice Date : formatted_invoice_date ?>
Due Date : formatted_due_date ?>
From Subscription : from_subscription)) ?>
To Subscription : to_subscription)) ?>
+
+ + + + + + + + + + +
Billing AddressShipping Address
+ + customer_name ?>
+ customer_bill_address && ($value->baddr_id !== null || $value->baddr_id !== '')){ ?> + customer_bill_address ? $value->customer_bill_address." ," : ""?>
+ customer_bill_city ? $value->customer_bill_city : "" ?> customer_bill_state ? $value->customer_bill_state : "" ?> + customer_bill_postal_code ? " - " . $value->customer_bill_postal_code : ""; ?> + customer_bill_country ? $value->customer_bill_country . "." : $value->bcountry ?>
+ baddr_id === null || $value->baddr_id === '') { + echo $value->billing_address ? '

'.$value->billing_address.'

' : ''; + } ?> + mobile_no ? $value->mobile_no." ." : "" ?> + +
+ + customer_name ?>
+ customer_ship_address && ($value->saddr_id !== null || $value->saddr_id !== '')){ ?> + customer_ship_address ? $value->customer_ship_address." ," : "" ?>
+ customer_ship_city ? $value->customer_ship_city : "" ?> customer_ship_state ? $value->customer_bill_state : "" ?> + customer_ship_postal_code ? " - " . $value->customer_ship_postal_code : ""; ?> + customer_ship_country ? $value->customer_ship_country . "." : $value->scountry ?>
+ saddr_id === null || $value->saddr_id === '') { + echo $value->shipping_address ? '

'.$value->shipping_address.'

' : ''; + } ?> + mobile_no ? $value->mobile_no." ." : "" ?> + +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dis_type == "%"){ + $dis_value = ($value->subtotal * $value->discount) / 100; + $dis_percent = '('.$value->discount.$value->dis_type.')'; + }else{ + $dis_value = $value->discount ? $value->discount : 0; + $dis_percent = ''; + } ?> + + + + + shipping_label != '') : ?> + + + + + + + total_amount >= $value->exact_total_amount) ? '+' : '-'; + $difference = abs($value->exact_total_amount - $value->total_amount); + ?> + + + + + + + status === 'Draft') : ?> + + + + + + status === 'Approved') : ?> + + + + + +
Subtotal :   ₹subtotal, 2, '.', ',') ?>
Discount :   
shipping_label ?> :   ₹shipping_charge, 2, '.', ',') ?>
Rounding :   
Total :   ₹total_amount, 2, '.', ',') ?>
Balance :   ₹total_amount, 2, '.', ',') ?>
Paid :   ₹total_amount, 2, '.', ',') ?>
+ +
+ +
+ + +
+ + + reason)) { ?> +
+

Reason: reason; ?>

+ + terms)) { ?> +
+
+                        terms ?>
+                    
+ +
+ +
+
+

Bank Details

+ + + +
+ + + + + + + + + + \ No newline at end of file