FIX_Tracker Issues fixes : ps

This commit is contained in:
VE10-Sanjeev 2024-11-12 07:16:10 +00:00
parent c5d43763b8
commit ae584f91ae
4 changed files with 44 additions and 42 deletions

View File

@ -631,7 +631,7 @@ class Invoice extends BaseController
$lineitem_html .= '<p>' . $inv->title . ' x ' . $inv->quantity . ' => ' . $inv->subtotal . '</p>'; $lineitem_html .= '<p>' . $inv->title . ' x ' . $inv->quantity . ' => ' . $inv->subtotal . '</p>';
} }
// print_r($title);die; // print_r($title);die;
$records['subject'] = $invoice_serial_number . " - Approval Notification"; $records['subject'] = $invoice_serial_number . " - Invoice Notification";
$records['description'] = "<html> $records['description'] = "<html>
@ -644,7 +644,7 @@ class Invoice extends BaseController
<h2><img src='https://pbs.twimg.com/profile_images/1116902407332450304/QEQWyRq2_400x400.jpg'alt='Company Logo' style='max-width: 100px; margin-bottom: -20%;;'></h2> <h2><img src='https://pbs.twimg.com/profile_images/1116902407332450304/QEQWyRq2_400x400.jpg'alt='Company Logo' style='max-width: 100px; margin-bottom: -20%;;'></h2>
<p style='color: red; <p style='color: red;
font-size: larger;'><b>THANKS FOR YOUR ORDER!!<b></p> font-size: larger;'><b>THANKS FOR YOUR ORDER!!<b></p>
<p>Order Number:#$invoice_serial_number</p> <p>Invoice Number:#$invoice_serial_number</p>
<p>Total Amount:$total_amount</p> <p>Total Amount:$total_amount</p>
<!-- Download Invoice Button --> <!-- Download Invoice Button -->

View File

@ -635,7 +635,8 @@ class Notifications extends BaseController
$emailContent = str_replace("{SCHEME_NAME}", $schemename, $emailContent); $emailContent = str_replace("{SCHEME_NAME}", $schemename, $emailContent);
} }
if (isset($expirydate)) { if (isset($expirydate)) {
$emailContent = str_replace("{EXPIRY_DATE}", $expirydate, $emailContent); $expiryon = $expirydate ? date('d/m/Y', strtotime($expirydate)) : '';
$emailContent = str_replace("{EXPIRY_DATE}", $expiryon, $emailContent);
} }
if (isset($customerId)) { if (isset($customerId)) {
$emailContent = str_replace("{RENEWAL_LINK}", base_url() . 'subscription_renewal/' . $customerId, $emailContent); $emailContent = str_replace("{RENEWAL_LINK}", base_url() . 'subscription_renewal/' . $customerId, $emailContent);
@ -732,7 +733,8 @@ class Notifications extends BaseController
$whatsappContent = str_replace("{SCHEME_NAME}", $schemename, $whatsappContent); $whatsappContent = str_replace("{SCHEME_NAME}", $schemename, $whatsappContent);
} }
if (isset($expirydate)) { if (isset($expirydate)) {
$whatsappContent = str_replace("{EXPIRY_DATE}", $expirydate, $whatsappContent); $expiryon = $expirydate ? date('d/m/Y', strtotime($expirydate)) : '';
$whatsappContent = str_replace("{EXPIRY_DATE}", $expiryon, $whatsappContent);
} }
if (isset($customerId)) { if (isset($customerId)) {
$whatsappContent = str_replace("{RENEWAL_LINK}", base_url() . 'subscription_renewal/' . $customerId, $whatsappContent); $whatsappContent = str_replace("{RENEWAL_LINK}", base_url() . 'subscription_renewal/' . $customerId, $whatsappContent);
@ -1020,7 +1022,8 @@ class Notifications extends BaseController
$notificationContent = str_replace("{SCHEME_NAME}", $dataPointsArray["scheme_name"], $notificationContent); $notificationContent = str_replace("{SCHEME_NAME}", $dataPointsArray["scheme_name"], $notificationContent);
} }
if (isset($dataPointsArray["formatted_due_date"])) { if (isset($dataPointsArray["formatted_due_date"])) {
$notificationContent = str_replace("{EXPIRY_DATE}", $dataPointsArray["formatted_due_date"], $notificationContent); $expiryon = $dataPointsArray["formatted_due_date"] ? date('d/m/Y', strtotime($dataPointsArray["formatted_due_date"])) : '';
$notificationContent = str_replace("{EXPIRY_DATE}", $expiryon, $notificationContent);
} }
if (isset($dataPointsArray["customer_id"])) { if (isset($dataPointsArray["customer_id"])) {
$notificationContent = str_replace("{RENEWAL_LINK}", base_url() . 'subscription_renewal/' . $dataPointsArray["customer_id"], $notificationContent); $notificationContent = str_replace("{RENEWAL_LINK}", base_url() . 'subscription_renewal/' . $dataPointsArray["customer_id"], $notificationContent);

View File

@ -23,19 +23,14 @@
.from-address { .from-address {
text-align: left; text-align: left;
float: left; float: left;
width: 60%; width: 100%;
}
.order-number {
text-align: right;
float: right;
width: 40%;
} }
.to-address { .to-address {
text-align: left; text-align: left;
float: right; float: right;
width: 60%; width: 40%;
clear: both; clear: both;
margin-top: 20px; /* Adjust for spacing in landscape */ /* margin-top: 20px; Adjust for spacing in landscape */
} }
</style> </style>
</head> </head>
@ -43,35 +38,38 @@
<?php foreach ($invoiceData as $value): ?> <?php foreach ($invoiceData as $value): ?>
<div class="label-container"> <div class="label-container">
<!-- From Address on the left --> <table width="100%" style="border-collapse: collapse;">
<div class="from-address"> <tr>
<strong>From :</strong><br> <td width="30%" style="text-align: left;"><strong>From :</strong></td>
<?= $value->company_name; ?><br> <td width="70%" style="text-align: right;">
<?= $value->company_address . ","; ?><br> <?php $label = $value->invoice_number == $value->wp_api_order_id ? "Order Number :" : "Invoice Number :"; ?>
<?= $value->company_city; ?> - <?= $value->company_postal_code . ","; ?><br> <b><?= $label; ?></b> <?= $value->invoice_number; ?>
<?= $value->company_state . "."; ?><br> </td>
<?= $value->company_mobile_no; ?> </tr>
</div> </table>
<!-- Order Number on the right --> <!-- From Address on the left -->
<div class="order-number"> <div class="from-address">
<b> Order : </b><?php echo $value->invoice_number; ?> <?= $value->company_name; ?><br>
</div> <?= $value->company_address . ","; ?><br>
<!-- To Address --> <?= $value->company_city; ?> - <?= $value->company_postal_code . ","; ?><br>
<div class="to-address"> <?= $value->company_state . "."; ?><br>
<strong>To :</strong><br> <?= $value->company_mobile_no; ?>
<?= $value->customer_name ?><br> </div>
<?php if($value->customer_ship_address && ($value->saddr_id !== null || $value->saddr_id !== '')){ ?> <!-- To Address -->
<?= $value->customer_ship_address ? $value->customer_ship_address . " , <br>" : "" ?> <div class="to-address">
<?= $value->customer_ship_city ? $value->customer_ship_city . "&nbsp;" : "" ?> <strong>To :</strong><br>
<?= $value->customer_ship_postal_code ? " - " . $value->customer_ship_postal_code . "<br>" : ""; ?> <?= $value->customer_name ?><br>
<?= $value->customer_ship_state ? $value->customer_ship_state . ". <br>" : "" ?> <?php if($value->customer_ship_address && ($value->saddr_id !== null || $value->saddr_id !== '')){ ?>
<?php }else if ($value->saddr_id === null || $value->saddr_id === '') { <?= $value->customer_ship_address ? $value->customer_ship_address . " , <br>" : "" ?>
echo $value->shipping_address ? $value->shipping_address.'<br>' : ''; <?= $value->customer_ship_city ? $value->customer_ship_city . "&nbsp;" : "" ?>
} ?> <?= $value->customer_ship_postal_code ? " - " . $value->customer_ship_postal_code . "<br>" : ""; ?>
<?= $value->mobile_no ? "Mobile : " . $value->mobile_no . " ." : "" ?> <?= $value->customer_ship_state ? $value->customer_ship_state . ". <br>" : "" ?>
</div> <?php }else if ($value->saddr_id === null || $value->saddr_id === '') {
<div style="clear: both;"></div> echo $value->shipping_address ? $value->shipping_address.'<br>' : '';
} ?>
<?= $value->mobile_no ? "Mobile : " . $value->mobile_no . " ." : "" ?>
</div>
<div style="clear: both;"></div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -237,6 +237,7 @@
} }
</script> </script>
<script> <script>
document.getElementById('myForm').addEventListener('submit', function(event) { document.getElementById('myForm').addEventListener('submit', function(event) {
var form = event.target; var form = event.target;
if (form.checkValidity() === false) { if (form.checkValidity() === false) {