FIX_Mpdf : ps

This commit is contained in:
VE10-Sanjeev 2024-05-20 09:43:45 +00:00
parent 4f5d68de9a
commit ca8083bef9
6 changed files with 138 additions and 126 deletions

View File

@ -163,6 +163,7 @@ class Companycontroller extends BaseController
$Exiseregistration = $this->request->getPost('Exiseregistration1');
$TIN = $this->request->getPost('TIN');
$PAN = $this->request->getPost('PAN');
$MSME = $this->request->getPost('MSME');
$GSTNO = $this->request->getPost('GSTNO');
$GSTRange = $this->request->getPost('GSTRange');
$CollectrateAddress = $this->request->getPost('CollectrateAddress');
@ -198,7 +199,7 @@ class Companycontroller extends BaseController
//$createdDate=$this->request->getPost('createdDate');
//$Company = array('CompID'=>$CompID,'CompanyName'=>$CompanyName,'Address'=>$Address,'ContactNumber'=>$ContactNumber,'AlternateContactNumber'=>$AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNO'=>$GSTNO,'GSTRange'=>$GSTRange,'UANumber'=>$UANumber,'PaymentTerms'=>$Payment ,'PaymentDays'=>$PaymentDays ,'PayableAT'=>$PayableAT ,'Createdby'=>$createdby,'ProfilePic'=>$Picture,'Exiseregistration'=>$Exiseregistration,'CollectrateAddress'=>$CollectrateAddress,'FiscalYearStartOn'=>$financialstart,'FiscalYearEndsOn'=> $financialend);
$Company = array('CompID' => $CompID, 'CompanyName' => $CompanyName, 'Address' => $Address, 'ContactNumber' => $ContactNumber, 'AlternateContactNumber' => $AlternateContactNumber, 'EmailAddress' => $EmailAddress, 'TIN' => $TIN, 'PAN' => $PAN, 'GSTNO' => $GSTNO, 'GSTRange' => $GSTRange, 'UANumber' => $UANumber, 'Createdby' => $createdby, 'ProfilePic' => $Picture, 'Exiseregistration' => $Exiseregistration, 'CollectrateAddress' => $CollectrateAddress, 'FiscalYearStartOn' => $financialstart, 'FiscalYearEndsOn' => $financialend, 'paymentID' => $PaymentId, 'companyWebsite' => $companywebsite, 'UpdatedBY' => $updatedby, 'Updatedon' => $updateddt);
$Company = array('CompID' => $CompID, 'CompanyName' => $CompanyName, 'Address' => $Address, 'ContactNumber' => $ContactNumber, 'AlternateContactNumber' => $AlternateContactNumber, 'EmailAddress' => $EmailAddress, 'TIN' => $TIN, 'PAN' => $PAN, 'GSTNO' => $GSTNO, 'GSTRange' => $GSTRange, 'UANumber' => $UANumber, 'MSME' => $MSME , 'Createdby' => $createdby, 'ProfilePic' => $Picture, 'Exiseregistration' => $Exiseregistration, 'CollectrateAddress' => $CollectrateAddress, 'FiscalYearStartOn' => $financialstart, 'FiscalYearEndsOn' => $financialend, 'paymentID' => $PaymentId, 'companyWebsite' => $companywebsite, 'UpdatedBY' => $updatedby, 'Updatedon' => $updateddt);
if (!empty($file)) {
$myfile = array('CompID' => $CompID, 'filename' => $file, 'ID' => $ID, 'filedescription' => $filedescription1, 'createdDate' => $createddt);

View File

@ -369,11 +369,12 @@ class Purchaseorder extends BaseController
// $html = view('pdf_view', $data);
// $mpdf->WriteHTML($html); // Use WriteHTML() method to add body content
$html = view('po_pdf', $data);
// echo $html; die;
$mpdf->WriteHTML($html); // Use WriteHTML() method to add body content
// Set HTML footer
// $HTMLFooter = view('includes/pdffooter', $data);
// $mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}");
// $mpdf->setFooter('' . "Page {PAGENO} of {nb}");
// Output PDF
$mpdf->Output('POReport' . $PONO . '.pdf', 'D');

View File

@ -54,7 +54,7 @@ if (!function_exists('generateCopyrightNotice')) {
}
}
}
function format_currency($amount)
function number_alignment($amount)
{
if ($amount) {
@ -130,4 +130,4 @@ if (!function_exists('trans')) {
return $lang_string;
}
}
}

View File

@ -37,6 +37,7 @@ $bankname='';
$bankifsc='';
$bankaddress='';
$bank_isactive = 1 ;
$MSME = '';
//print_r($userRecords);die();
if(!empty($userRecords))
{
@ -57,6 +58,7 @@ if(!empty($userRecords))
$UANumber = $uf->UANumber;
$PaymentTerms = $uf->PaymentTerms ;
$PaymentId = $uf->paymentID;
$MSME = $uf->MSME;
//$PaymentDays = $uf->PaymentDays ;
//$PayableAT = $uf->PayableAT ;
$Createdby = $uf->Createdby;
@ -629,31 +631,36 @@ function ValidateUA() {
<div class="form-group">
<div class="col-md-12 pad">
<div class="col-md-3"><span>UA Number</span>
<div class="col-md-4"><span>UA Number</span>
<input type="text" id="UANumber" name="UANumber" onchange="ValidateUA();" maxlength="15" class="form-control" value="<?php echo $UANumber;?>" pattern="([a-zA-Z]){5}([0-9]){10}" style="text-transform: uppercase">
</div>
<div class="col-md-3"><span>TIN Number</span>
<div class="col-md-4"><span>TIN Number</span>
<input type="text" id="TIN" name="TIN" maxlength="11" class="form-control" value="<?php echo $TIN;?>" pattern="(.){11,11}" onkeypress="return isNumberKey(event)" title="Please Enter 11 digit Number">
</div>
<div class="col-md-3"><span>PAN Number</span><span class="badge">*</span>
<!-- <input type="text" id="PAN" maxlength="10" name="PAN" onchange="validatePAN();" class="form-control" style="text-transform: uppercase" value="<?php echo $PAN;?>" pattern="(?=.*[A-Za-z]).{5,}(?=.*[0-9]).{4,}(?=.*[A-Za-z]).{1,}" required> -->
<input type="text" id="PAN" maxlength="10" name="PAN" onchange="validatePAN();" class="form-control" style="text-transform: uppercase" value="<?php echo $PAN;?>" pattern="([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}" required>
<div class="col-md-4"><span>MSME Number</span>
<input type="text" id="MSME" name="MSME" class="form-control" value="<?php echo $MSME;?>" title="Please Enter MSME" style="text-transform: uppercase">
</div>
<div class="col-md-3"><span>GST Number</span><span class="badge">*</span>
</div>
<div class="col-md-12 pad">
<div class="col-md-4"><span>GST Range</span>
<input type="text" id="GSTRange" name="GSTRange" maxlength="100" class="form-control" value="<?php echo $GSTRange;?>">
</div>
<div class="col-md-4"><span>GST Number</span><span class="badge">*</span>
<!-- <input type="text" id="GSTNO" maxlength="15" onchange="validateGST();" name="GSTNO" class="form-control" style="text-transform: uppercase" value="<?php echo $GSTNO;?>" pattern="(?=.*[0-9]).{2}(?=.*[A-Za-z]).{5}(?=.*[0-9]).{4}(?=.*[A-Za-z]).{1}(?=.*[0-9]).{1}(?=.*[Zz]).{1}(?=.*[A-Za-z0-9]).{1}" required title="Please Enter 2 Digit Number and 5 Character and 4 Digit Numbers and 1 Character and 1 Number and should be 'Z' only and 1 Number"> -->
<input type="text" id="GSTNO" maxlength="15" onchange="validateGST();" name="GSTNO" class="form-control" style="text-transform: uppercase" value="<?php echo $GSTNO;?>" pattern="([0-9]){2}([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}([0-9]){1}([Zz]){1}([A-Za-z0-9]){1}" required title="Please Enter 2 Digit Number and 5 Character and 4 Digit Numbers and 1 Character and 1 Number and should be 'Z' only and 1 Number">
</div>
</div>
<div class="col-md-4"><span>PAN Number</span><span class="badge">*</span>
<!-- <input type="text" id="PAN" maxlength="10" name="PAN" onchange="validatePAN();" class="form-control" style="text-transform: uppercase" value="<?php echo $PAN;?>" pattern="(?=.*[A-Za-z]).{5,}(?=.*[0-9]).{4,}(?=.*[A-Za-z]).{1,}" required> -->
<input type="text" id="PAN" maxlength="10" name="PAN" onchange="validatePAN();" class="form-control" style="text-transform: uppercase" value="<?php echo $PAN;?>" pattern="([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}" required>
</div>
</div>
<br>
<div class="col-md-12 pad">
<div class="col-md-3"><span>GST Range</span>
<input type="text" id="GSTRange" name="GSTRange" maxlength="100" class="form-control" value="<?php echo $GSTRange;?>">
</div>
<!-- <div class="form-group"> -->
<div class="col-md-9"><span>Collectrate Address</span><span class="badge">*</span>
<div class="col-md-12"><span>Collectrate Address</span><span class="badge">*</span>
<input type="text" id="CollectrateAddress" required name="CollectrateAddress" maxlength="500" class="form-control" value="<?php echo $CollectrateAddress;?>" required >
</div>
<!-- </div> -->

View File

@ -49,9 +49,10 @@ if (!empty($currentstock)) {
$todaydatemonth = format_date($date_today, 0, 'm');
$todaydatedate = format_date($date_today, 0, 'd');
$openstockdateyear = format_date($date, 0, 'Y');
$parts = explode('-', $date);
$openstockdatemonth = $parts[1];
$openstockdatedate = $parts[2];
$openstockdatemonth = $parts[1] ?? 0;
$openstockdatedate = $parts[2] ?? '';
if ($openstockdateyear == $todaydateyear) {
@ -110,7 +111,7 @@ if ($total <= $reorder) {
<section class="content">
<div style="text-align:right;margin-right:17px">
<a href="<?php echo base_url() ?>rawmaterialdetails/rawmaterialListing" class="btn btn-success" value="Back" />Back</a>
<a href="<?php echo base_url() ?>rawmaterialListing" class="btn btn-success" value="Back" />Back</a>
</div>
<br />
<!-- <div class="row"> -->
@ -289,7 +290,7 @@ if ($total <= $reorder) {
</div>
<div class="box-footer" style="text-align:right">
<input type="submit" class="btn btn-success" value="Submit" />
<a href="<?php echo base_url() ?>rawmaterialdetails/rawmaterialListing" class="btn btn-success" value="Cancel" />Cancel</a>
<a href="<?php echo base_url() ?>rawmaterialListing" class="btn btn-success" value="Cancel" />Cancel</a>
</div>
</form>
</div><!-- /.box-body -->

View File

@ -1,28 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta charset="UTF-8">
<style>
.center {text-align: center;}
.text-center {text-align: center;}
.text-right{text-align:right}
.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}
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}
footer{color:#878686;width:100%;border-top:2px solid #878686;padding:5px 0}
main{padding:0px 0;margin-right:-30px;margin-bottom:0px}
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;}
#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}
#logo img{display: block !important;margin: 60px auto !important;}
#page_break { page-break-before: always; }
.invoice-details {
text-align: left;
}
.invoice-details p {
margin: 0;
}
.invoice-details .amount {
float: right;
}
</style>
@ -44,7 +45,7 @@ $companyPan = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->PAN)) ? $Co
$companyWebsit = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->companyWebsite)) ? $CompanyDetails[0]->companyWebsite :"-";
$CompanyStateCode = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->StateCode)) ? $CompanyDetails[0]->StateCode : "-";
$companyMsme = (!empty($CompanyDetails) && !empty($CompanyDetails[0]->MSME)) ? $CompanyDetails[0]->MSME : "-";
$address = preg_replace('/SURVEY : [^,]+,/', '', $CompanyAddress);
$address = preg_replace('/SURVEY\s*:\s*[^,]+,/', '', $CompanyAddress);
$currencyName = 'INR';
$currencyCode = (!empty($CurrencySymbol) && !empty($CurrencySymbol[0]->FontCode2000)) ? $CurrencySymbol[0]->FontCode2000 : "-";
@ -65,7 +66,7 @@ $supplierContact = (!empty($POItem) && !empty($POItem[0]->ContactNumber)) ? $POI
$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 : "-";
$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 : "-";
@ -84,8 +85,8 @@ $poDate = $purchaseorderDate ? $purchaseorderDate->format('d-m-Y') : "-";
$DeliverySchedule = "";
}
}else{
$DeliveryDate = "-";
$DeliverySchedule = "-";
$DeliveryDate = "";
$DeliverySchedule = "";
}
$RequistionNo = (!empty($RequistionDetails) && !empty($RequistionDetails[0]['RequistionNo'])) ? $RequistionDetails[0]['RequistionNo'] : "-";
$ReqDate = (!empty($RequistionDetails) && !empty($RequistionDetails[0]['ReqDate'])) ? $RequistionDetails[0]['ReqDate'] : "";
@ -108,8 +109,9 @@ $invoice_discount_amount = '0.00' ;
$totalCGST=0;
$totalSGST=0;
$totalIGST=0;
$invoiceTotalBasic=0;
$invoiceTotalAmount=0;
$invoiceTotalAmountInWords='';
$invoiceTotalAmountInWords='-';
// For Converting number to words
function convertNumber($amt){
@ -249,7 +251,7 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
}
?>
<header class="clearfix">
<table width="100%" class="center"><tr><td><b><h1><?= $pdftitle; ?></h1></b> </td></tr></table>
<table width="100%" class="text-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>
@ -269,19 +271,19 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
// if ($companyPhone) {
// echo '<div>'.trans('Phone') . ': ' . htmlsc($companyPhone).','.'</div>';
// }
if ($companyEmail) {
if ($companyEmail !== '' && $companyEmail !== '-') {
echo '<div><b>'.trans('Email') . '</b> : ' . htmlsc($companyEmail).'</div>';
}
if ($companyWebsit ) {
if ($companyWebsit !== '' && $companyWebsit !== '-') {
echo '<div><b>'.trans('Website') . '</b> : ' . htmlsc($companyWebsit ).'</div>';
}
if ($companyGst ) {
echo '<div><b>'.trans('GSTIN') . '</b> : ' . htmlsc($companyGst ).'</div>';
if ($companyGst !== '' && $companyGst !== '-') {
echo '<div><b>'.trans('GST') . '</b> : ' . htmlsc($companyGst ).'</div>';
}
if ($companyMsme ) {
if ($companyMsme !== '' && $companyMsme !== '-') {
echo '<div><b>'.trans('MSME') . '</b> : ' . htmlsc($companyMsme ).'</div>';
}
if ($companyPan ) {
if ($companyPan !== '' && $companyPan !== '-') {
echo '<div><b>'.trans('PAN') . '</b> : ' . htmlsc($companyPan ).'</div>';
}
@ -298,8 +300,8 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
</table>
</header>
<main>
</header>
<main>
<table border="1" style="border-collapse: collapse; font-size: 1em; width: 100%;">
<tr>
<td width="50%">
@ -310,7 +312,7 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
</tr>
<tr>
<td style="border:0px;"><?php echo trans('Purchase Order Date'); ?></td>
<td style="border:0px;"><?php echo ': '; echo date_from_mysql($poDate, true); ?></td>
<td style="border:0px;"><?php echo ': '; $poDate; ?></td>
</tr>
<tr>
<td style="border:0px;"><?php echo trans('Supplier`s Offer No'); ?></td>
@ -322,7 +324,7 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
</tr>
<tr>
<td style="border:0px;"><?php echo trans('Delivery/Schedule By'); ?></td>
<td style="border:0px;"><?php echo ': '; echo $DeliveryDate . $DeliverySchedule . $dispatch; ?></td>
<td style="border:0px;"><?php echo (empty($DeliveryDate) && empty($DeliverySchedule) && empty($dispatch)) ? ': -' : ': '.$DeliveryDate . $DeliverySchedule . $dispatch; ?></td>
</tr>
<tr>
<td style="border:0px;"><?php echo trans('Contact'); ?></td>
@ -346,7 +348,7 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
</tr>
<tr>
<td style="border:0px;"><?php echo trans('Date of Supply'); ?></td>
<td style="border:0px;"><?php echo ': '; echo date_from_mysql($ReqDate, true); ?></td>
<td style="border:0px;"><?php echo ': '; echo $ReqDate; ?></td>
</tr>
<tr>
<td style="border:0px;"><?php echo trans('State Code'); ?></td>
@ -374,75 +376,87 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
</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>
<td colspan="3" width="50%"><b>Shipped From</b></td>
<td colspan="3" width="50%"><b>Shipped To</b></td>
</tr>
<tr>
<td colspan="2" width="50%">
<td colspan="3" width="50%">
<table id="client" class="tablepadding" border="1" style="border-collapse: collapse; width: 100%;">
<tr>
<td style="border:0px;"><?php echo trans('Name'); ?></td>
<td style="border:0px;"><?php echo ': <b>' . htmlsc($SuplierName) . '</b>'; ?></td>
<td class="text-right" style="border:0px;">:</td>
<td style="border:0px;"><?php echo '<b>' . htmlsc($SuplierName) . '</b>'; ?></td>
</tr>
<tr>
<td style="border:0px; vertical-align: top;"><?php echo trans('Address'); ?></td>
<td style="border:0px;"><?php echo ': ' . nl2br(htmlsc($SuplierAddress)); ?></td>
<td style="border:0px; vertical-align: top;" class="text-right">:</td>
<td style="border:0px;"><p><?php echo nl2br(htmlsc($SuplierAddress)); ?></p></td>
</tr>
<tr>
<td style="border:0px;"><?php echo trans('GSTIN'); ?></td>
<td style="border:0px;"><?php echo ': ' . htmlsc($supplierGst); ?></td>
<td style="border:0px;"><?php echo trans('GST'); ?></td>
<td class="text-right" style="border:0px;">:</td>
<td style="border:0px;"><?php echo htmlsc($supplierGst); ?></td>
</tr>
<tr>
<td style="border:0px;"><?php echo trans('MSME'); ?></td>
<td style="border:0px;"><?php echo ': ' . htmlsc($supplierMsme); ?></td>
<td class="text-right" style="border:0px;">:</td>
<td style="border:0px;"><?php echo htmlsc($supplierMsme); ?></td>
</tr>
<tr>
<td style="border:0px;"><?php echo trans('PAN'); ?></td>
<td style="border:0px;"><?php echo ': ' . htmlsc($supplierPan); ?></td>
<td class="text-right" style="border:0px;">:</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>
<td class="text-right" style="border:0px;">:</td>
<td style="border:0px;"><?php echo htmlsc($supplierVendor); ?></td>
</tr>
</table>
</td>
<td colspan="2" width="50%">
<td colspan="3" width="50%">
<table id="client" class="tablepadding" border="1" style="border-collapse: collapse; width: 100%;">
<tr>
<td style="border:0px;"><?php echo trans('Name'); ?></td>
<td style="border:0px;"><?php echo ': <b>' . htmlsc($CompanyName) . '</b>'; ?></td>
<td class="text-right" style="border:0px;">:</td>
<td style="border:0px;"><?php echo '<b>' . htmlsc($CompanyName) . '</b>'; ?></td>
</tr>
<tr>
<td style="border:0px; vertical-align: top;"><?php echo trans('Address'); ?></td>
<td style="border:0px;"><?php echo ': ' . nl2br(htmlsc($address)); ?></td>
<td style="border:0px; vertical-align: top;" class="text-right">:</td>
<td style="border:0px;"><?php echo nl2br(htmlsc($address)); ?></td>
</tr>
<tr>
<td style="border:0px;"><?php echo trans('GSTIN'); ?></td>
<td style="border:0px;"><?php echo ': ' . htmlsc($companyGst); ?></td>
<td style="border:0px;"><?php echo trans('GST'); ?></td>
<td class="text-right" style="border:0px;">:</td>
<td style="border:0px;"><?php echo htmlsc($companyGst); ?></td>
</tr>
<tr>
<td style="border:0px;"><?php echo trans('MSME'); ?></td>
<td style="border:0px;"><?php echo ': ' . htmlsc($companyMsme); ?></td>
<td class="text-right" style="border:0px;">:</td>
<td style="border:0px;"><?php echo htmlsc($companyMsme); ?></td>
</tr>
<tr>
<td style="border:0px;"><?php echo trans('PAN'); ?></td>
<td style="border:0px;"><?php echo ': ' . htmlsc($companyPan); ?></td>
<td class="text-right" style="border:0px;">:</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>
<td class="text-right" style="border:0px;">:</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%">
<table class="item-table" style="border-collapse: collapse;" border="1" width="100%" style="min-height: 60.25em !important;">
<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" colspan="2" class="item-name" style="width: 200px;"><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('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>
@ -472,109 +486,101 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
if (!empty($POItem)) {
foreach ($POItem as $item) { ?>
<tr>
<td class="center"><?php echo $i++; ?></td>
<td><?php _htmlsc($item->MaterialCode); ?></td>
<td><?php _htmlsc($item->MaterialName . $item->ServiceMaterialDescription); ?></td>
<td class="text-center"><?php echo $i++; ?></td>
<td colspan="2" style="width: 200px;" ><?php _htmlsc($item->MaterialCode.' - ') ._htmlsc($item->MaterialName . $item->ServiceMaterialDescription); ?></td>
<td class="text-right"><?php echo $item->HSNCODE ?? 'N/A'; ?></td>
<td><?php if ($item->UOM) : ?>
<td class="text-right"><?php echo number_alignment($item->Quantity); 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>
<?php endif; ?></td>
<td class="text-right"><?php echo number_alignment($item->Rate); ?></td>
<td class="text-right"><?php echo number_alignment(abs($item->BasicValue)); ?></td>
<td class="text-right"><?php _htmlsc($item->CGST); ?></td>
<td class="text-right"><?php if ($item->AfterCGST != '') {
echo format_currency(abs($item->AfterCGST));
echo number_alignment(abs($item->AfterCGST));
} ?></td>
<td class="text-right"><?php _htmlsc($item->SGST); ?></td>
<td class="text-right"><?php if ($item->AfterSGST != '') {
echo format_currency(abs($item->AfterSGST));
echo number_alignment(abs($item->AfterSGST));
} ?></td>
<td class="text-right"><?php _htmlsc($item->IGST); ?></td>
<td class="text-right"><?php if ($item->AfterIGST != '') {
echo format_currency(abs($item->AfterIGST));
echo number_alignment(abs($item->AfterIGST));
} ?></td>
<td class="text-right"><?php echo format_currency(abs($item->Taxamount)); ?></td>
<td class="text-right"><?php echo number_alignment(abs($item->Taxamount)); ?></td>
</tr>
<?php
$basic[] = $item->BasicValue;
$cgst[] = $item->AfterCGST;
$sgst[] = $item->AfterSGST;
$igst[] = $item->AfterIGST;
$tax[] = $item->Taxamount;
$invoiceTotalAmount=round($item->TotalOrderValue);
?>
<?php }
} ?>
}
else {
echo "<tr><td colspan='14' class='text-center'>No items available.</td></tr>";
} ?>
</tbody>
<tfoot>
<tr>
<td style="text-align: right;" colspan="7"><strong>&nbsp;TOTAL</strong></td>
<td class="text-right"><?php echo format_currency(abs(array_sum($basic))); ?></td>
<tr>&nbsp;
<td style="text-align: right;" colspan="6"><strong>&nbsp;TOTAL</strong></td>
<td class="text-right"><?php echo number_alignment(abs(array_sum($basic))); ?></td>
<td>&nbsp;</td>
<td class="text-right"><?php if ($cgst) {
echo format_currency(abs(array_sum($cgst)));
echo number_alignment(abs(array_sum($cgst)));
} ?></td>
<td>&nbsp;</td>
<td class="text-right"><?php if ($sgst) {
echo format_currency(abs(array_sum($sgst)));
echo number_alignment(abs(array_sum($sgst)));
} ?></td>
<td>&nbsp;</td>
<td class="text-right"><?php if ($igst) {
echo format_currency(abs(array_sum($igst)));
echo number_alignment(abs(array_sum($igst)));
} ?></td>
<td class="text-right"><b><?php echo format_currency(abs(array_sum($tax))); ?></b></td>
<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 class="text-right"><b><?php echo number_alignment(abs(array_sum($tax))); ?></b></td>
</tr>
</tfoot>
</table>
<table class="tablepadding" border="1" style="border-collapse: collapse; font-size: 1em; width: 100%;">
<tr>
<td colspan="6" style="border-top: none; border-bottom: none;">
<td colspan="6" style="border-bottom: none;">
<p style="text-align: center;"><strong>TOTAL AMOUNT IN WORDS:</strong>&nbsp;&nbsp;</p>
<?php echo $invoiceTotalAmountInWords; ?>
<?php
$invoiceTotalBasic=array_sum($basic);
if($invoiceTotalAmount>0)
{
$invoiceTotalAmountInWords=convertNumber(abs(round($invoiceTotalAmount)));
}
echo $invoiceTotalAmountInWords; ?>
</td>
<td colspan="9">
<table id="client" class="tablepadding" border="1" style="border-collapse: collapse; width: 100%;">
<tr>
<td class="text-right" style="border:0px;"><?php _trans('Total Amount Before Tax '); ?></td>
<td class="text-right" style="border:0px;"></td>
<td class="text-right" style="border:0px;"><?php echo format_currency(abs($invoiceTotalAmount)); ?></td>
<td class="text-right" style="border:0px;"><?php echo number_alignment(abs($invoiceTotalBasic)); ?></td>
</tr>
<tr>
<td class="text-right" style="border:0px;"><?php _trans('CGST '); ?></td>
<td class="text-right" style="border:0px;"></td>
<td class="text-right" style="border:0px;"><?php echo format_currency(abs(array_sum($cgst))); ?></td>
<td class="text-right" style="border:0px;"><?php echo number_alignment(abs(array_sum($cgst))); ?></td>
</tr>
<tr>
<td class="text-right" style="border:0px;"><?php _trans('SGST '); ?></td>
<td class="text-right" style="border:0px;"></td>
<td class="text-right" style="border:0px;"><?php echo format_currency(abs(array_sum($sgst))); ?></td>
<td class="text-right" style="border:0px;"><?php echo number_alignment(abs(array_sum($sgst))); ?></td>
</tr>
<tr>
<td class="text-right" style="border:0px;"><?php _trans('IGST '); ?></td>
<td class="text-right" style="border:0px;"></td>
<td class="text-right" style="border:0px;"><?php echo format_currency(abs(array_sum($igst))); ?></td>
<td class="text-right" style="border:0px;"><?php echo number_alignment(abs(array_sum($igst))); ?></td>
</tr>
<tr>
<?php $invoiceTotalGST = array_sum($cgst) + array_sum($sgst) + array_sum($igst); ?>
<?php $differences = ($invoiceTotalGST + $invoiceTotalAmount)- round($item->TotalOrderValue); ?>
<?php $differences = ($invoiceTotalGST + $invoiceTotalBasic)- $invoiceTotalAmount; ?>
<td class="text-right" style="border:0px;"><?php _trans('Round Off'); ?></td>
<td class="text-right" style="border:0px;"></td>
@ -583,7 +589,7 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
<tr>
<td class="text-right" style="border:0px;"><b><?php _trans('Total Amount'); ?></b></td>
<td class="text-right" style="border:0px;"></td>
<td class="text-right" style="border:0px;"><b><?php echo format_currency(abs(round($item->TotalOrderValue)));?></b></td>
<td class="text-right" style="border:0px;"><b><?php echo number_alignment(abs($invoiceTotalAmount));?></b></td>
</tr>
</table>
</td>
@ -603,11 +609,7 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
<td colspan="15" style="text-align:center;">Declaration: We Declare that this invoice shows the actual price of the goods described and that all particulars are true and correct</td>
</tr>
</table>
</main>
<table width="100%" class="center"><tr><td><b><small>This is a system generated purchase order</small></b> </td></tr></table>
<!-- <div id="page_break"></div> -->
<table width="100%" class="text-center"><tr><td><b><small>This is a system generated purchase order</small></b> </td></tr></table>
</main>
</body>
</html>