ria/app/Views/po_pdf.php
2024-05-17 13:39:31 +00:00

595 lines
26 KiB
PHP
Executable File

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
.center {text-align: center;}
.clearfix:after{content:"";display:table;clear:both}a{color:#375bc8;text-decoration:underline}body{position:relative;width:100%;height:29.7cm;margin:0 auto;color:#3A3A3A;background:#FFFFFF;font-family:sans-serif;font-size:0.8em}header{padding:0px 0;margin-right:-30px;margin-bottom:0px}
main{padding:0px 0;margin-right:-30px;margin-bottom:0px}#logo{text-align:right;}#invoice-logo{max-width: 14em !important;max-height: 10em !important;margin-bottom: 1em;text-align:right} #client{float:left;width:100%; font-size:1em}.invoice-details{text-align:right}.invoice-details table{border-collapse:collapse;border-spacing:0;text-align:right;width:100%;margin:0 0 0 auto;font-size:1em}.invoice-details table td{width:100%;margin:0;padding:0 0 0.5em 0}table.item-table{width:100%;border-spacing:0;margin-bottom:0px;font-size:1em}table.item-table tr:nth-child(2n-1) th{background:#ddd}table.item-table th{padding:10px 5px;border-bottom:1px solid #606060;white-space:nowrap;text-align:left}table.item-table th.text-right{text-align:right}table.item-table td{padding:10px 5px;font-size:1em;}table.item-table .invoice-sums{text-align:right}footer{color:#878686;width:100%;border-top:2px solid #878686;padding:5px 0}.text-right{text-align:right}.text-red{color:#ea5340}.text-green{color:#77b632}
#logo img{display: block !important;margin: 60px auto !important;}
#page_break { page-break-before: always; }
</style>
</head>
<body>
<?php
if (!empty($AmendmentPDF) && isset($AmendmentPDF[0]->parentpostatus) && $AmendmentPDF[0]->parentpostatus == 'ST030') {
$pdftitle = "AMENDMENT PURCHASE ORDER";
} else {
$pdftitle = "PURCHASE ORDER";
}
$CompanyName = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->CompanyName)) ? $CompanyDetails[0]->CompanyName : "-";
$CompanyAddress = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->Address)) ? $CompanyDetails[0]->Address : "-";
$companyEmail = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->EmailAddress)) ? $CompanyDetails[0]->EmailAddress : "-";
$companyGst = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->GSTNO)) ? $CompanyDetails[0]->GSTNO : "-";
$companyPan = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->PAN)) ? $CompanyDetails[0]->PAN : "-";
$companyWebsit = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->companyWebsite)) ? $CompanyDetails[0]->companyWebsite :"-";
$CompanyStateCode = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->StateCode)) ? $CompanyDetails[0]->StateCode : "-";
$currencyName = 'INR';
$currencyCode = (!empty($CurrencySymbol) && !empty($CurrencySymbol[0]->FontCode2000)) ? $CurrencySymbol[0]->FontCode2000 : "-";
$PONO = (!empty($GetPoFormat) && !empty($GetPoFormat[0]->PONO)) ? $GetPoFormat[0]->PONO : "-";
$postatus = (!empty($POItem) && !empty($POItem[0]->Status)) ? $POItem[0]->Status : "-";
$SuplierName = (!empty($POItem) && !empty($POItem[0]->SupplierName)) ? $POItem[0]->SupplierName : "-";
$SuplierAddress = (!empty($POItem) && !empty($POItem[0]->Address)) ? $POItem[0]->Address : "-";
$DeliveryAddress = (!empty($POItem) && !empty($POItem[0]->DeliveryAddress)) ? $POItem[0]->DeliveryAddress : "-";
$ServiceDescription = (!empty($POItem) && !empty($POItem[0]->ServiceDescription)) ? $POItem[0]->ServiceDescription : "-";
$supRef = (!empty($POItem) && !empty($POItem[0]->Supplier_Reference)) ? $POItem[0]->Supplier_Reference : "-";
$supOfferNo = (!empty($POItem) && !empty($POItem[0]->Supplier_Offer_No)) ? $POItem[0]->Supplier_Offer_No : "-";
$supplierEmail = (!empty($POItem) && !empty($POItem[0]->EmailAddress)) ? $POItem[0]->EmailAddress : "-";
$supplierGst = (!empty($POItem) && !empty($POItem[0]->GSTNO)) ? $POItem[0]->GSTNO : "-";
$supplierPan = (!empty($POItem) && !empty($POItem[0]->PAN)) ? $POItem[0]->PAN : "-";
$supplierContact = (!empty($POItem) && !empty($POItem[0]->ContactNumber)) ? $POItem[0]->ContactNumber : "-";
$serviceDescription = (!empty($POItem) && !empty($POItem[0]->Description_Of_Service)) ? $POItem[0]->Description_Of_Service : "-";
$supplierVendor = (!empty($POItem) && !empty($POItem[0]->SupplierID)) ? $POItem[0]->SupplierID : "-";
$ourRef = (!empty($POItem) && !empty($POItem[0]->Other_Reference)) ? $POItem[0]->Other_Reference : "-";
$dispatch = (!empty($POItem) && !empty($POItem[0]->Import_DispatchDetails)) ? $POItem[0]->Import_DispatchDetails : "-";
$advance = (!empty($POItem) && !empty($POItem[0]->AdvanceAmount)) ? $POItem[0]->AdvanceAmount : "-";
$finCap = (!empty($POItem) && !empty($POItem[0]->Fincap)) ? $POItem[0]->Fincap : "-";
$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 ): "-";
$purchaseorderDate = (!empty($POItem) && !empty($POItem[0]->PODate)) ? new DateTime($POItem[0]->PODate, new DateTimeZone('Asia/Kolkata')) : "";
$poDate = $purchaseorderDate ? $purchaseorderDate->format('d-m-Y') : "-";
if(!empty($POItem) && !empty($POItem[0]->DeliveryOption)){
if ($POItem[0]->DeliveryOption == 1) {
$DeliverySchedule = $PO->DeliverySchedule;
$DeliveryDate = "";
} else if ($POItem[0]->DeliveryOption == 0 && !empty($POItem[0]->DeliveryDate)) {
$dtDe = new DateTime($POItem[0]->DeliveryDate, new DateTimeZone('Asia/Kolkata'));
$DeliveryDate = $dtDe ? $dtDe->format('d-m-Y') : "";
$DeliverySchedule = "";
}
}else{
$DeliveryDate = "-";
$DeliverySchedule = "-";
}
$RequistionNo = (!empty($RequistionDetails) && !empty($RequistionDetails[0]['RequistionNo'])) ? $RequistionDetails[0]['RequistionNo'] : "-";
$ReqDate = (!empty($RequistionDetails) && !empty($RequistionDetails[0]['ReqDate'])) ? $RequistionDetails[0]['ReqDate'] : "";
$RequestedDept = (!empty($RequistionDetails) && !empty($RequistionDetails[0]['RequestedDept'])) ? $RequistionDetails[0]['RequestedDept'] : "-";
$CostCenterCode = (!empty($RequistionDetails) && !empty($RequistionDetails[0]['CostCenterCode'])) ? $RequistionDetails[0]['CostCenterCode'] : "-";
$releasedBy = (!empty($releasedetails) && !empty($releasedetails[0]->FirstName)) ? $releasedetails[0]->FirstName : "-";
$releasedDt = (!empty($releasedetails) && !empty($releasedetails[0]->ReleasedOn)) ? new DateTime($releasedetails[0]->ReleasedOn, new DateTimeZone('Asia/Kolkata')) : "";
$releasedOn = $releasedDt ? $releasedDt->format('d-m-Y') : "-";
$invoice_discount_percent = '0.00' ;
$invoice_discount_amount = '0.00' ;
?>
<?php $parent_invoice_number = "testing001"; ?>
<?php
$totalCGST=0;
$totalSGST=0;
$totalIGST=0;
$invoiceTotalAmount=0;
$invoiceTotalAmountInWords='';
// For Converting number to words
function convertNumber($amt){
$ShowPaise='0';
$totalAmt=explode(".",$amt);
$number = $totalAmt[0];
$no = $number;
if(!empty($totalAmt[1]) && $totalAmt[1]!=0){
$point = $totalAmt[1];
$ShowPaise='1';
}
else{
$point=0;
$ShowPaise='0';
}
$hundred = null;
$digits_1 = strlen($no);
$i = 0;
$str = array();
$words = array('0' => '', '1' => 'One', '2' => 'Two',
'3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',
'7' => 'Seven', '8' => 'Eight', '9' => 'Nine',
'10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',
'13' => 'Thirteen', '14' => 'Fourteen',
'15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',
'18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',
'30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',
'60' => 'Sixty', '70' => 'Seventy',
'80' => 'Eighty', '90' => 'Ninety');
$digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');
while ($i < $digits_1) {
$divider = ($i == 2) ? 10 : 100;
$number = floor($no % $divider);
$no = floor($no / $divider);
$i += ($divider == 10) ? 1 : 2;
if ($number) {
$plural = (($counter = count($str)) && $number > 9) ? '' : null;
$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
$str [] = ($number < 21) ? $words[$number] .
" " . $digits[$counter] . $plural . " " . $hundred
:
$words[floor($number / 10) * 10]
. " " . $words[$number % 10] . " "
. $digits[$counter] . $plural . " " . $hundred;
} else $str[] = null;
}
$str = array_reverse($str);
$result = implode('', $str);
$points = ($point) ?
" " . $words[$point / 10] . " " .
$words[$point = $point % 10] : '';
if($ShowPaise=='0'){
$amountInWords = "Rupees " . $result." Only";
}
else{
$amountInWords = "Rupees " . $result ." Paise ". $points." Only";
}
return $amountInWords;
}
?>
<?php
function convertNumbersforextra($amt){
$ShowPaise='0';
$totalAmt=explode(".",$amt);
$number = $totalAmt[0];
$no = $number;
if(!empty($totalAmt[1]) && $totalAmt[1]!=0){
$point = $totalAmt[1];
$ShowPaise='1';
}else{
$point=0;
$ShowPaise='0';
}
$hundred = null;
$digits_1 = strlen($no);
$i = 0;
$str = array();
$words = array('0' => '', '1' => 'One', '2' => 'Two',
'3' => 'Three', '4' => 'Four', '5' => 'Five',
'6' => 'Six', '7' => 'Seven', '8' => 'Eight',
'9' => 'Nine', '10' => 'Ten', '11' => 'Eleven',
'12' => 'Twelve', '13' => 'Thirteen', '14' => 'Fourteen',
'15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',
'18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',
'30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',
'60' => 'Sixty', '70' => 'Seventy',
'80' => 'Eighty', '90' => 'Ninety');
$digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');
while ($i < $digits_1) {
$divider = ($i == 2) ? 10 : 100;
$number = floor($no % $divider);
$no = floor($no / $divider);
$i += ($divider == 10) ? 1 : 2;
if ($number) {
$plural = (($counter = count($str)) && $number > 9) ? '' : null;
$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
$str [] = ($number < 21) ? $words[$number] .
" " . $digits[$counter] . $plural . " " . $hundred
:
$words[floor($number / 10) * 10]
. " " . $words[$number % 10] . " "
. $digits[$counter] . $plural . " " . $hundred;
} else $str[] = null;
}
$str = array_reverse($str);
$result = implode('', $str);
$points = ($point) ?
" " . $words[$point / 10] . " " .
$words[$point = $point % 10] : '';
if($ShowPaise=='0'){
$amountInWords = "Rupees " . $result." Only";
}
else{
$amountInWords = "Rupees " . $result ." Paise ". $points." Only";
}
return $amountInWords;
}
?>
<header class="clearfix">
<table width="100%" class="center"><tr><td><b><h1><?= $pdftitle; ?></h1></b> </td></tr></table>
<div style="text-align: right;"><small>RI/PUR/R 02</small></div>
<table border="1" style="border-collapse: collapse;" width="100%">
<tr>
<td rowspan="5" style="border-right: none; text-align: center;" width="30%">
<div id="logo"><?php echo invoice_logo_pdf(); ?></div>
</td>
<td rowspan="5" style="border-left: none; border-right: none;" width="50%">
<p style="font-size:16px;"><b><?php _htmlsc($CompanyName); ?></b></p>
<?php if ($CompanyAddress) {
echo '<div>'.htmlsc($CompanyAddress) .' '.'</div>';
} ?>
<?php
if ($companyEmail || $companyWebsit || $companyGst || $companyPan ) {
// if ($companyPhone) {
// echo '<div>'.trans('Phone') . ': ' . htmlsc($companyPhone).','.'</div>';
// }
if ($companyEmail) {
echo '<div><b>'.trans('Email') . '</b> : ' . htmlsc($companyEmail).'</div>';
}
if ($companyWebsit ) {
echo '<div><b>'.trans('Website') . '</b> : ' . htmlsc($companyWebsit ).'</div>';
}
if ($companyGst ) {
echo '<div><b>'.trans('GSTIN') . '</b> : ' . htmlsc($companyGst ).'</div>';
}
if ($companyPan ) {
echo '<div><b>'.trans('PAN') . '</b> : ' . htmlsc($companyPan ).'</div>';
}
}
?>
</td>
<td colspan="2" style="border-left: none;">
<?php if($postatus == PO_DRAFT){ ?>
<p style="font-size:0.8em; text-align : right"><b><?php _htmlsc("DRAFT"); ?></b></p> <?php } ?>
</td>
</tr>
</table>
</header>
<main>
<table class="tablepadding" border="1" style="border-collapse: collapse;font-size:1em;" width="100%">
<tr>
<td colspan="2" width="50%">
<table class="tablepadding" border="1" style="border-collapse: collapse;" >
<tr><td style="border:0px;"> <?php echo trans(' Purchase Order No / Date'); ?></td><td style="border:0px;"><?php echo ': ';echo htmlsc($PONO ) . ' / ' . date_from_mysql($poDate , true);?></td></tr>
<tr><td style="border:0px;"> <?php echo trans(' Supplier`s Offer No') ; ?></td><td style="border:0px;"><?php echo ': ';echo _htmlsc($supOfferNo); ?></td></tr>
<tr><td style="border:0px;"> <?php echo trans(' Our Reference') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($ourRef); ?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans(' State Code') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($CompanyStateCode)?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans(' Delivery/Schedule By') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo $DeliveryDate . $DeliverySchedule . $dispatch; ?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans(' Contact') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($supRef)?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans(' Email') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($supplierEmail)?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans(' Mode of Shipment') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($modShp)?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans(' Insurance') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($insNo)?> </td></tr>
</table>
</td>
<td colspan="2" width="50%">
<table class="tablepadding" border="1" style="border-collapse: collapse;" >
<tr><td style="border:0px;"> <?php echo trans('Req Number ') ; ?> </td><td style="border:0px;"><?php echo ': ';echo _htmlsc($RequistionNo) ?></td></tr>
<tr><td style="border:0px;"> <?php echo trans('Date of Supply ') ; ?> </td><td style="border:0px;"> <?php echo ': '.date_from_mysql($ReqDate , true); ?></td></tr>
<tr><td style="border:0px;"> <?php echo trans('Dept') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($RequestedDept);?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans('CCD'); ?></td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($CostCenterCode);?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans('Fin cap') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($finCap); ?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans('Payment Terms') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($PaymentTerms); ?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans('Released By') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($releasedBy); ?> </td></tr>
<tr><td style="border:0px;"> <?php echo trans('Released On') ; ?> </td><td style="border:0px;"> <?php echo ': ';echo _htmlsc($releasedOn); ?> </td></tr>
</table>
</td>
</tr>
</table>
<table class="tablepadding" border="1" style="border-collapse: collapse;font-size:1em;" width="100%">
<tr style="background: #ddd; border-top: none; border-bottom: none;">
<td colspan="2" width="50%"><b>Shipped From</b></td>
<td colspan="2" width="50%"><b>Shipped To</b></td>
</tr>
<tr>
<td colspan="2" width="50%">
<table id="client" class="tablepadding" border="1" style="border-collapse: collapse;" >
<tr>
<td style="border:0px;"> <?php echo trans('Name');?> </td>
<td style="border:0px;"> <?php echo ': '.htmlsc($SuplierName) ; ?> </td>
</tr>
<tr>
<td style="border:0px;"> <?php echo 'Address <br><br><br><br>';?> </td>
<td style="border:0px;"> <?php echo ': '.htmlsc($SuplierAddress).'<br>'; ?>
</td>
</tr>
<tr>
<td style="border:0px;"> <?php echo trans('GSTIN');?> </td>
<td style="border:0px;"> <?php echo ': '.htmlsc($supplierGst) ; ?> </td>
</tr>
<tr>
<td style="border:0px;"> <?php echo trans('PAN');?> </td>
<td style="border:0px;"> <?php echo ': '.htmlsc($supplierPan) ; ?> </td>
</tr>
<tr>
<td style="border:0px;"> <?php echo trans('Vendor Code');?> </td>
<td style="border:0px;"> <?php echo ': '.htmlsc($supplierVendor) ; ?> </td>
</tr>
</table>
</td>
<td colspan="2" width="50%">
<table id="client" class="tablepadding" border="1" style="border-collapse: collapse;" >
<tr>
<td style="border:0px;" ><?php echo 'Name';?></td>
<td style="border:0px;" ><?php echo ': '. htmlsc($CompanyName); ?> </td>
</tr>
<tr>
<td style="border:0px;" ><?php echo 'Address <br><br><br><br>';?></td>
<td style="border:0px;">
<?php echo ': '.htmlsc($CompanyAddress).'<br>'; ?>
</td>
</tr>
<tr>
<td style="border:0px;"> <?php echo trans('GSTIN');?> </td>
<td style="border:0px;"> <?php echo ': '.htmlsc($companyGst) ; ?> </td>
</tr>
<tr>
<td style="border:0px;"> <?php echo trans('PAN');?> </td>
<td style="border:0px;"> <?php echo ': '.htmlsc($companyPan) ; ?> </td>
</tr>
<tr>
<td style="border:0px;"> <?php echo trans('State Code');?> </td>
<td style="border:0px;"> <?php echo ': '.htmlsc($CompanyStateCode); ?> </td>
</tr>
</table>
</td>
</tr>
</table>
<table class="item-table" style="border-collapse: collapse;" border="1" width="100%">
<thead>
<tr>
<th rowspan="2" class="item-name" ><center><?php _trans('S.No'); ?></center></th>
<th rowspan="2" colspan="2" class="item-name"><center><?php _trans('Name of Product /'); ?><br/><?php _trans('Service'); ?></center></th>
<th rowspan="2" class="item-name"><center><?php _trans('HSN'); ?></center></th>
<th rowspan="2" class="item-amount"><center><?php _trans('UOM'); ?></center></th>
<th rowspan="2" class="item-amount"><center><?php _trans('Qty'); ?></center></th>
<th rowspan="2" class="item-price"><center><?php _trans('Rate'); ?><br/> ₹</center></th>
<th rowspan="2" class="item-amount"><center><?php _trans('Total'); ?><br/> ₹</center></th>
<!-- <th rowspan="2" class="item-price"><center><?php _trans('Discount'); ?><br/>₹</center></th> -->
<th colspan="2" class="item-price"><center><?php _trans('CGST'); ?></center></th>
<th colspan="2" class="item-price"><center><?php _trans('SGST'); ?></center></th>
<th colspan="2" class="item-pric"><center><?php _trans('IGST'); ?></center></th>
<th rowspan="2" class="item-total "><center><?php _trans('Total Tax'); ?><br/> ₹</center></th>
</tr>
<tr style="background: #ddd;">
<th><center><?php _trans('Rate'); ?><br/><?php _trans('%'); ?></center></th>
<th><center><?php _trans('Amount'); ?><br/> ₹</center></th>
<th><center><?php _trans('Rate'); ?><br/><?php _trans('%'); ?></center></th>
<th><center><?php _trans('Amount'); ?><br/> ₹</center></th>
<th><center><?php _trans('Rate'); ?><br/><?php _trans('%'); ?></center></th>
<th><center><?php _trans('Amount'); ?><br/> ₹</center></th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$basic = [];
$cgst =[];
$sgst =[];
$igst =[];
$tax = [];
if(!empty($POItem)){
foreach ($POItem as $item) { ?>
<tr>
<td class="center" height="100"><?php echo $i++;?> </td>
<td colspan="2"><?php _htmlsc($item->MaterialCode.'/'.$item->MaterialName.$item->ServiceMaterialDescription);?></td>
<td class="text-right"><?php echo $item->HSNCODE ?? 'N/A'; ?></td>
<td>
<?php if ($item->UOM) : ?>
<small><?php _htmlsc($item->UOM); ?></small>
<?php endif; ?>
</td>
<td class="text-right">
<?php echo _htmlsc($item->Quantity); ?>
</td>
<td class="text-right">
<?php echo format_currency($item->Rate); ?>
</td>
<td class="text-right">
<?php echo format_currency(abs($item->BasicValue));?>
</td>
<!-- <td class="text-right">
<?php //echo format_currency( abs(1)); ?>
</td> -->
<td class="text-right">
<?php _htmlsc($item->CGST); ?><!-- Cgst % --->
</td>
<td class="text-right">
<?php
if ($item->AfterCGST != ''){
echo format_currency(abs($item->AfterCGST));}
else { }
?><!-- Cgst --->
</td>
<td class="text-right">
<?php _htmlsc($item->SGST); ?><!-- Sgst %-->
</td>
<td class="text-right">
<?php
if ($item->AfterSGST != ''){
echo format_currency(abs($item->AfterSGST));}
else { }
?><!-- Sgst-->
</td>
<td class="text-right">
<?php _htmlsc($item->IGST); ?><!-- Igst % -->
</td>
<td class="text-right">
<?php
if ($item->AfterIGST != ''){
echo format_currency(abs($item->AfterIGST)); }
else { }
?><!-- Igst -->
</td>
<td class="text-right">
<?php echo format_currency(abs($item->Taxamount));
$totalBasic = $item->BasicValue;
$totalCGST = $item->AfterCGST ;
$totalSGST = $item->AfterSGST ;
$totalIGST = $item->AfterIGST ;
$totalTax = $item->Taxamount;
?>
</td>
</tr>
<?php
$basic[] = $totalBasic;
$cgst[]=$totalCGST;
$sgst[]=$totalSGST;
$igst[]=$totalIGST;
$tax[] = $totalTax;
}} ?>
<tr>
<!-- <td class="center" height="150"> <br></td>
<td colspan="2"></td><td></td>
<td></td><td></td>
<td></td><td></td>
<td></td><td></td> <td></td> <td></td>
<td></td><td></td> <td></td><td></td>
<td></td>
</tr>
-->
<tr>
<td style="text-align: right;" colspan="7">&nbsp;&nbsp;&nbsp;<strong>&nbsp;TOTAL</strong></td>
<td class="text-right"><?php echo format_currency(abs(array_sum($basic))); ?></td>
<td>&nbsp;</td>
<td class="text-right"><?php if($cgst){echo format_currency(abs(array_sum($cgst)));} else { } ?></td>
<td>&nbsp;</td>
<td class="text-right"><?php if($sgst){echo format_currency(abs(array_sum($sgst)));} else { } ?></td>
<td>&nbsp;</td>
<td class="text-right"><?php if($igst){ echo format_currency(abs(array_sum($igst)));} else { } ?></td>
<td class="text-right">
<b><?php echo format_currency(abs(array_sum($tax)));
$invoiceTotalAmount=array_sum($basic);
if($invoiceTotalAmount>0)
{
$invoiceTotalAmountInWords=convertNumber(abs(round($invoiceTotalAmount)));
}
else
{
$invoiceTotalAmountInWords=convertNumber(abs(round($invoiceTotalAmount)));
}
?></b>
</td>
</tr>
<tr>
<td colspan="8" rowspan="7" style="border-bottom: none;">
<p style="text-align: center;"><strong>TOTAL AMOUNT IN WORDS:</strong>&nbsp;&nbsp;</p>
<?php echo $invoiceTotalAmountInWords; ?>
</td>
<td colspan="5"> <?php _trans('Total Amount Before Tax '); ?></td><td class="text-right">₹</td>
<td class="text-right"><?php echo format_currency(abs($invoiceTotalAmount)); ?></td>
</tr>
<tr>
<td colspan="5">Add :CGST</td><td class="text-right">₹</td>
<td class="text-right"><?php echo format_currency(abs(array_sum($cgst))); ?></td>
</tr>
<tr>
<td colspan="5">Add :SGST</td><td class="text-right">₹</td>
<td class="text-right"><?php echo format_currency(abs(array_sum($sgst))); ?></td>
</tr>
<tr>
<td colspan="5" >Add :IGST</td><td class="text-right">₹</td>
<td class="text-right"><?php echo format_currency(abs(array_sum($igst))); ?></td>
</tr>
<tr>
<td colspan="5" > <?php _trans('Tax Amount : GST'); ?></td><td class="text-right">₹</td>
<?php $invoiceTotalGST = array_sum($cgst) + array_sum($sgst) + array_sum($igst); ?>
<td class="text-right"><?php echo format_currency(abs($invoiceTotalGST)); ?></td>
</tr>
<tr>
<td colspan="5"><?php _trans('Round Off'); ?></td><td class="text-right">₹</td>
<?php $differences = ($invoiceTotalGST + $invoiceTotalAmount)- round($item->TotalOrderValue); ?>
<td class="text-right"><b><?php echo number_format($differences, 2);?></b></td>
</tr>
<tr>
<td colspan="5"><?php _trans('Total Amount'); ?></td><td class="text-right">₹</td>
<td class="text-right"><b><?php echo format_currency(abs(round($item->TotalOrderValue)));?></b></td>
</tr>
<tr>
<td colspan="8" style="border-top: none; border-bottom: none;">
<div class="notes">
<p><b>Note:</b> Please acknowledge receipt of this order for acceptance<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Material to be delivered to our stores before 3pm<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Please refer order number and item code in your challan/invoice</p>
<!-- <?php // echo nl2br(htmlsc("invoice_terms")); ?> -->
</div>
</td>
<td style="text-align:right;" colspan="7" rowspan="2">
<div><center><?php echo authorized_signatory(); ?></center></div>
<div><h6>Authorized Signatory</h6></div>
</td>
</tr>
<tr><td colspan="8">Declaration: We Declare that this invoice shows the actual price of the goods described and that all particulars are true and correct </td></tr>
</tbody>
</table>
</main>
<table width="100%" class="center"><tr><td><b><small>This is a system generated purchase orde</small></b> </td></tr></table>
<!-- <div id="page_break"></div> -->
</body>
</html>