GWM - live issue

This commit is contained in:
Gowtham M 2024-12-16 14:12:27 +05:30
parent eeb67ed799
commit cb9de30f6f

View File

@ -161,6 +161,7 @@
$modShp = (!empty($POItem) && !empty($POItem[0]->Mode_Of_Shipment)) ? $POItem[0]->Mode_Of_Shipment : "-";
$insNo = (!empty($POItem) && !empty($POItem[0]->InsuranceNumber)) ? $POItem[0]->InsuranceNumber : 'No';
$PaymentTerms = (!empty($POItem) && !empty($POItem[0]->PaymentTerms)) ? ($POItem[0]->PaymentTerms == 'Others' ? $POItem[0]->PaymentOtherDescription : $POItem[0]->PaymentTerms) : "";
$CurrencyType = (!empty($POItem) && !empty($POItem[0]->CurrencyType)) ? $POItem[0]->CurrencyType : "";
$purchaseorderDate = (!empty($POItem) && !empty($POItem[0]->PODate)) ? new DateTime($POItem[0]->PODate, new DateTimeZone('Asia/Kolkata')) : "";
$poDate = $purchaseorderDate ? $purchaseorderDate->format('d-m-Y') : "-";
$IsOpenOrder = (!empty($POItem) && !empty($POItem[0]->IsOpenOrder)) ? $POItem[0]->IsOpenOrder : "";
@ -212,7 +213,7 @@
$invoiceTotalAmountInWords = '-';
// For Converting number to words
function convertNumber($amt)
function convertNumber($amt,$CurrencyType)
{
$ShowPaise = '0';
$totalAmt = explode(".", $amt);
@ -271,10 +272,10 @@
if ($ShowPaise == '0') {
$amountInWords = "Rupees " . $result . " Only";
$amountInWords = $CurrencyType ." ". $result . " Only";
} else {
$amountInWords = "Rupees " . $result . " Paise " . $points . " Only";
$amountInWords = $CurrencyType ." ". $result . " Paise " . $points . " Only";
}
@ -737,7 +738,7 @@
<?php
$invoiceTotalBasic = array_sum($basic);
if ($invoiceTotalAmount > 0) {
$invoiceTotalAmountInWords = convertNumber(abs(round($invoiceTotalAmount)));
$invoiceTotalAmountInWords = convertNumber(abs(round($invoiceTotalAmount)) , $CurrencyType);
}
echo $invoiceTotalAmountInWords; ?>
</p>