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
| + | +
+
+ |
+
+ = $value->company_address . ',' . $value->company_city . ($value->company_postal_code ? " - " . $value->company_postal_code : "") ?> += $value->company_email . ' | ' . $value->company_mobile_no ?> + |
+
-
|
-
-
|
+
+ 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 : = date('d/m/y', strtotime($item->from_subscription)) ?> + To Subscription : = date('d/m/y', strtotime($item->to_subscription)) ?> + + + |
| Billing Address | -Shipping Address | -
|---|---|
|
-
- = $value->customer_name ?> - customer_bill_address && ($value->baddr_id !== null || $value->baddr_id !== '')){ ?> - = $value->customer_bill_address ? $value->customer_bill_address." ," : ""?> - = $value->customer_bill_city ? $value->customer_bill_city : "" ?> = $value->customer_bill_state ? $value->customer_bill_state : "" ?> - = $value->customer_bill_postal_code ? " - " . $value->customer_bill_postal_code : ""; ?> - = $value->customer_bill_country ? $value->customer_bill_country . "." : $value->bcountry ?> - baddr_id === null || $value->baddr_id === '') { - echo $value->billing_address ? ' '.$value->billing_address.' ' : ''; - } ?> - = $value->mobile_no ? $value->mobile_no." ." : "" ?> - - |
-
-
- = $value->customer_name ?> - customer_ship_address && ($value->saddr_id !== null || $value->saddr_id !== '')){ ?> - = $value->customer_ship_address ? $value->customer_ship_address." ," : "" ?> - = $value->customer_ship_city ? $value->customer_ship_city : "" ?> = $value->customer_ship_state ? $value->customer_bill_state : "" ?> - = $value->customer_ship_postal_code ? " - " . $value->customer_ship_postal_code : ""; ?> - = $value->customer_ship_country ? $value->customer_ship_country . "." : $value->scountry ?> - saddr_id === null || $value->saddr_id === '') { - echo $value->shipping_address ? ' '.$value->shipping_address.' ' : ''; - } ?> - = $value->mobile_no ? $value->mobile_no." ." : "" ?> - - |
-
| S.no | Item Name | Qty | -Rate | - -Total | +Rate(₹) | +Total(₹) |
|---|---|---|---|---|---|---|
| = $serialNumber++; ?> - | -= $item->title ?> - description != ''){?>description ?> + description != '') { ?>description ?> |
= $item->quantity ?> | -₹= number_format($item->unit_price, 2, '.', ',') ?> | - - -₹= number_format($item->subtotal, 2, '.', ',') ?> | += number_format($item->unit_price, 2, '.', ',') ?> | += number_format($item->subtotal, 2, '.', ',') ?> |
| Subtotal : ₹= number_format($value->subtotal, 2, '.', ',') ?> | +
+
+
+ reason)) : ?>
+
+
+
+
+ notes)) : ?>
+ Reason+ reason); ?> +
+
+
+ payment_note)) : ?>
+ Notes+ notes); ?> +
+
+
+ terms)) : ?>
+ Payment Notes+ payment_note); ?> ++ = $row->terms ?> ++ + + + |
+
+
|
||||||||||||||||||||||||||||
| Discount=$dis_percent;?> : = $dis_value ? "-₹". number_format($dis_value, 2, '.', ',') : "₹".number_format(0, 2, '.', ',') ?> | -||||||||||||||||||||||||||||||
| = $value->shipping_label ?> : ₹= number_format($value->shipping_charge, 2, '.', ',') ?> | -||||||||||||||||||||||||||||||
| Rounding : = $sign . number_format($difference, 2, '.', ',') ?> | -||||||||||||||||||||||||||||||
| Total : ₹= number_format($value->total_amount, 2, '.', ',') ?> | -||||||||||||||||||||||||||||||
| Balance : ₹= number_format($value->total_amount, 2, '.', ',') ?> | -||||||||||||||||||||||||||||||
| Paid : ₹= number_format($value->total_amount, 2, '.', ',') ?> | -||||||||||||||||||||||||||||||
|
+
+
+ Bank Details+ + |
+
+
+
+
+
+
+ Authorized Signatory+ |
+ |||||||||||||||||||||||||||||
Reason: = $value->reason; ?>
- - terms)) { ?> -- = $row->terms ?> -- -
|
+ |
+
+
|
+
+
|
+
| Billing Address | +Shipping Address | +
|---|---|
|
+
+ = $value->customer_name ?> + customer_bill_address && ($value->baddr_id !== null || $value->baddr_id !== '')){ ?> + = $value->customer_bill_address ? $value->customer_bill_address." ," : ""?> + = $value->customer_bill_city ? $value->customer_bill_city : "" ?> = $value->customer_bill_state ? $value->customer_bill_state : "" ?> + = $value->customer_bill_postal_code ? " - " . $value->customer_bill_postal_code : ""; ?> + = $value->customer_bill_country ? $value->customer_bill_country . "." : $value->bcountry ?> + baddr_id === null || $value->baddr_id === '') { + echo $value->billing_address ? ' '.$value->billing_address.' ' : ''; + } ?> + = $value->mobile_no ? $value->mobile_no." ." : "" ?> + + |
+
+
+ = $value->customer_name ?> + customer_ship_address && ($value->saddr_id !== null || $value->saddr_id !== '')){ ?> + = $value->customer_ship_address ? $value->customer_ship_address." ," : "" ?> + = $value->customer_ship_city ? $value->customer_ship_city : "" ?> = $value->customer_ship_state ? $value->customer_bill_state : "" ?> + = $value->customer_ship_postal_code ? " - " . $value->customer_ship_postal_code : ""; ?> + = $value->customer_ship_country ? $value->customer_ship_country . "." : $value->scountry ?> + saddr_id === null || $value->saddr_id === '') { + echo $value->shipping_address ? ' '.$value->shipping_address.' ' : ''; + } ?> + = $value->mobile_no ? $value->mobile_no." ." : "" ?> + + |
+
| S.no | +Item Name | +Qty | +Rate | + +Total | +
|---|---|---|---|---|
| + = $serialNumber++; ?> + + | + += $item->title ?> + description != ''){?>description ?> + |
+ = $item->quantity ?> | +₹= number_format($item->unit_price, 2, '.', ',') ?> | + + +₹= number_format($item->subtotal, 2, '.', ',') ?> | +
| Subtotal : ₹= number_format($value->subtotal, 2, '.', ',') ?> | +||||
| Discount=$dis_percent;?> : = $dis_value ? "-₹". number_format($dis_value, 2, '.', ',') : "₹".number_format(0, 2, '.', ',') ?> | +||||
| = $value->shipping_label ?> : ₹= number_format($value->shipping_charge, 2, '.', ',') ?> | +||||
| Rounding : = $sign . number_format($difference, 2, '.', ',') ?> | +||||
| Total : ₹= number_format($value->total_amount, 2, '.', ',') ?> | +||||
| Balance : ₹= number_format($value->total_amount, 2, '.', ',') ?> | +||||
| Paid : ₹= number_format($value->total_amount, 2, '.', ',') ?> | +
Reason: = $value->reason; ?>
+ + terms)) { ?> ++ = $row->terms ?> ++ +