| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2bzend/application/views/scripts/publicmiscellaneous/ |
Upload File : |
<?php
$post = $this->post;
$postD = $this->postD;
$AgencyData = $this->AgencyData;
$AgencySysId = $AgencyData['AgencySysId'];
$AgencyPhoto = isset($AgencyData['AgencyPhoto']) ? trim($AgencyData['AgencyPhoto']) : '';
$AddressAgency = $this->AddressAgency;
$BankDetailsAgency = $this->BankDetailsAgency;
$emailID = isset($post['EmailId']) ? $post['EmailId'] : '';
$customerId = isset($post['customerId']) ? $post['customerId'] : '';
$countrycode = isset($post['countrycode']) ? $post['countrycode'] : '';
$custphone = isset($post['Contacts']) ? $post['Contacts'] : '';
$markupDisplayType = isset($post['isDisplayMarkup']) ? $post['isDisplayMarkup'] : 0;
$custname = isset($post['FullName']) ? $post['FullName'] : '';
$AgEmailId = isset($post['AgEmailId']) ? $post['AgEmailId'] : '';
$AgContact = isset($post['AgContact']) ? $post['AgContact'] : '';
$CompanyName = isset($post['CompanyName']) ? $post['CompanyName'] : '';
$IsB2BAgent = isset($post['IsB2BAgent']) ? $post['IsB2BAgent'] : '';
$Address = isset($post['Address']) ? $post['Address'] : '';
$AgAddress = isset($post['AgAddress']) ? $post['AgAddress'] : '';
$PinCode = isset($post['PinCode']) ? $post['PinCode'] : '';
$AgPinCode = isset($post['AgPinCode']) ? $post['AgPinCode'] : '';
$CityName = isset($post['CityName']) ? $post['CityName'] : '';
$AgCityName = isset($post['AgCityName']) ? $post['AgCityName'] : '';
$stateName = isset($post['stateName']) ? $post['stateName'] : '';
$dateofissue = isset($post['InvoiceDate']) ? $post['InvoiceDate'] : '';
$PaymentDueDate = isset($post['PaymentDueDate']) ? $post['PaymentDueDate'] : '';
$duedates = isset($post['PaymentDueDate']) ? $post['PaymentDueDate'] : '';
$invoice_no = isset($post['InvoiceNumber']) ? trim($post['InvoiceNumber']) : '';
$ClientGST = isset($post['ClientGST']) ? $post['ClientGST'] : 'NA';
$client_gst_no = isset($post['ClientGSTNumber']) ? $post['ClientGSTNumber'] : 'NA';
$TaxLabelId = (isset($AgencyData['TaxLabelId'])) ? $AgencyData['TaxLabelId'] : 1;
$ProposalID = isset($post['ProposalID']) ? $post['ProposalID'] : '';
if ($IsB2BAgent == '1') {
$custname = $CompanyName;
$Address = $AgAddress;
$PinCode = $AgPinCode;
$custphone = $AgContact;
$emailID = $AgEmailId;
$CityName = $AgCityName;
} else {
$custname = $custname;
$Address = $Address;
$PinCode = $PinCode;
$custphone = '+'.ltrim($countrycode,'+').' '.$custphone;
$emailID = $emailID;
$CityName = $CityName;
}
$misxItems_name = isset($postD['MisxItems_name']) ? $postD['MisxItems_name'] : '';
$description = isset($postD['Description']) ? $postD['Description'] : '';
$qty = isset($postD['ItemQty']) ? $postD['ItemQty'] : '';
$rates = isset($postD['ItemRates']) ? $postD['ItemRates'] : '';
$total = isset($postD['Total']) ? $postD['Total'] : '';
$discount_type = isset($postD['DiscountType']) ? $postD['DiscountType'] : '';
$discount = isset($postD['Discount']) ? $postD['Discount'] : '';
$totaldiscount = isset($postD['TotalDiscount']) ? $postD['TotalDiscount'] : '';
$totalamount = isset($postD['TotalAmount']) ? $postD['TotalAmount'] : '';
$markup_type = isset($postD['MarkupType']) ? $postD['MarkupType'] : '';
$markup = isset($postD['Markup']) ? $postD['Markup'] : '';
$totalmarkup = isset($postD['TotalMarkup']) ? $postD['TotalMarkup'] : '';
$subtotal = isset($postD['SubTotal']) ? $postD['SubTotal'] : '';
$servicefeetotal = isset($postD['ServiceFeeTotal']) ? $postD['ServiceFeeTotal'] : '';
$GSTPercentage = isset($postD['GSTPercentage']) ? $postD['GSTPercentage'] : '';
$totalGST = isset($postD['TotalGST']) ? $postD['TotalGST'] : '';
$sgst = isset($postD['SGST']) ? $postD['SGST'] : '';
$cgst = isset($postD['CGST']) ? $postD['CGST'] : '';
$igst = isset($postD['IGST']) ? $postD['IGST'] : '';
$subtotals = isset($post['TotalInvoiceValue']) ? $post['TotalInvoiceValue'] : '';
$InvoiceValue = isset($post['InvoiceValue']) ? $post['InvoiceValue'] : '';
$totalCGST = isset($post['TotalCGST']) ? $post['TotalCGST'] : '';
$totalSGST = isset($post['TotalSGST']) ? $post['TotalSGST'] : '';
$totalIGST = isset($post['TotalIGST']) ? $post['TotalIGST'] : '';
$Sumdiscount = isset($post['SumdiscountItem']) ? $post['SumdiscountItem'] : '';
$totalpayable = isset($post['TotalDueAmount']) ? $post['TotalDueAmount'] : '';
$Advance = isset($post['TotalAdvance']) ? $post['TotalAdvance'] : '';
$other_discount = isset($post['OtherDiscount']) ? $post['OtherDiscount'] : '';
$TcsAmount = isset($post['TcsAmount']) ? number_format($post['TcsAmount'], 2) : 0;
$otherDiscountVal = isset($post['otherDiscountVal']) ? $post['otherDiscountVal'] : '';
$notes = isset($post['notes']) ? $post['notes'] : '';
$termsandcondition = isset($post['termsandcondition']) ? $post['termsandcondition'] : '';
$totalpayableWords = '';
if($totalpayable > 0){
$totalpayableWords = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->convertAmountToWords($totalpayable + '0');
}
$checkIsExistInvoice = $_SERVER['DOCUMENT_ROOT'] . '/public/upload/media/agency/' . $AgencyData['AgencySysId'] . '/' . $AgencyData['InvoiceSignature'];
$checkIsExist = $_SERVER['DOCUMENT_ROOT'] . '/public/upload/media/agency/' . $AgencyData['AgencySysId'] . '/' . $AgencyData['Logo'];
$show_Total = ($InvoiceValue);
$NewPrice = isset($this->IsNewPrice) ? $this->IsNewPrice : 0;
//echo '<pre>';print_r($AddressAgency);
//echo '<pre>';print_r($post);echo '</pre>';die;
?>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<title>Invoice - <?= $invoice_no ?></title>
<style>
.flight-card {
width: 100%;
/*max-width: 900px;*/
border: 1px solid #ccc;
border-radius: 6px;
font-family: Arial, sans-serif;
font-size: 13px;
color: #666666;
line-height: 20px;
}
.flight-card td {
padding: 10px;
vertical-align: top;
}
.header td {
background: #2f7fc1;
color: #fff;
font-weight: bold;
}
.header td:first-child {
text-align: left;
}
.header .pnr {
background: #000;
text-align: right;
white-space: nowrap;
}
.segment td {
border-bottom: 1px dashed #bbb;
}
.segment:last-child td {
border-bottom: none;
}
.left, .right {
width: 30%;
}
.middle {
width: 40%;
text-align: center;
/*color: #666;*/
}
.left strong,
.right strong {
/*font-size: 15px;*/
}
.dotted-underline {
display: inline-block;
padding-bottom: 2px;
border-bottom: 1px dotted #777;
}
</style>
</head>
<body onload="window.print();" style='font-family: "Source Sans Pro",sans-serif,Calibri,helvetica,Cantarell,arial,tahoma,verdana; color: #565656;margin:0; padding:0;'>
<div id="content" class="table-responsive ls-table" style="width:862px; margin:auto;">
<table width="100%" align="center" border="0" style="border: solid 1px #ccc; padding: 10px; overflow: hidden;" cellpadding="0" cellspacing="0">
<tr>
<?php if (file_exists($checkIsExist)) { ?>
<td style="padding:5px 8px;width: 68%;"><img height="50" src="<?php echo $this->baseUrl('public/upload/media/agency/' . $AgencyData['AgencySysId'] . '/' . $AgencyData['Logo']); ?>" /></td>
<td align="right" style="width: 32%;">
<span style="float: right !important; font-size: 13px;"><strong style="font-size: 15px; font-weight: bold;"><?= $AgencyData['Title'] ?></strong><br />
<?php
$add = explode('___', $AddressAgency['Address']);
echo $add[0];
echo (isset($add[1]) ? '<br>' . $add[1] : '');
?><br>
<?php echo $AddressAgency['CityName'] ?> - <?php echo trim($AddressAgency['Pincode']); ?><?php if($AddressAgency['CountrySysId'] == '101') { ?>, <?php echo $AddressAgency['StateName'] ?>
<?php } ?>(<?php echo $AddressAgency['CountryName'] ?>)
<br />
<strong>Email ID:</strong> <?php echo $AgencyData['SecondaryEmail'] ?><br />
<strong>Contact No.:</strong> <?php echo '+'.ltrim($AgencyData['countrycode'],'+') . ' ' .$AgencyData['ContactNo2']; ?><br />
<strong>Website URL:</strong> <?php echo $AgencyData['Url'] ?></span>
</td>
<?php } else { ?>
<td style="padding:5px 8px; font-size: 18px; font-weight: bold;width: 68%;">Invoice</td>
<td align="left" style="width: 32%;">
<span style=" font-size: 13px;"><strong style="font-size: 15px; font-weight: bold;"><?= $AgencyData['Title'] ?></strong><br />
<?php
$add = explode('___', $AddressAgency['Address']);
echo $add[0];
echo (isset($add[1]) ? '<br>' . $add[1] : '');
?><br />
<?php echo $AddressAgency['CityName'] ?> - <?php echo trim($AddressAgency['Pincode']); ?><?php if($AddressAgency['CountrySysId'] == '101') { ?>, <?php echo $AddressAgency['StateName'] ?>
<?php } ?>(<?php echo $AddressAgency['CountryName'] ?>)
<br />
<strong>Email ID:</strong> <?php echo $AgencyData['SecondaryEmail'] ?><br />
<strong>Contact No.:</strong> <?php echo '+'.ltrim($AgencyData['countrycode'],'+') . ' '.$AgencyData['ContactNo2']; ?><br />
<strong>Website URL:</strong> <?php echo $AgencyData['Url'] ?></span>
</td>
<?php } ?>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">
<table border="0" style="padding:5px 8px; font-size:12px; border: solid 1px #ccc; padding: 0px; width: 100% !important;" cellpadding="0" cellspacing="0">
<tr>
<td width="56%" rowspan="5" valign="top" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">
<strong style="font-size: 15px; font-weight: bold;">Customer Name</strong><br />
<?= $custname ?><br>
<?= $emailID ?><br />
<?= $custphone ?><br>
<?= $Address ?><?php echo !empty($PinCode) ? ', ' . $PinCode : '' ?> <br>
<?= $CityName ?>,
<?= $stateName ?>
</td>
<td width="23%" style=" padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Invoice No.</td>
<td width="21%" style=" padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= $invoice_no ?></td>
</tr>
<tr>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Invoice / Due Date</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= $dateofissue ?> / <?= $PaymentDueDate ?></td>
</tr>
<?php if($TaxLabelId == 1) { ?>
<tr>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">PAN NO.</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= $AgencyData['PanCardNo'] ?></td>
</tr>
<tr>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">GSTIN Number</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= $AgencyData['ServiceTaxNo'] ?></td>
</tr>
<tr>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Client GST</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= $client_gst_no ?></td>
</tr>
<?php } ?>
<tr>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">Proposal ID</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;"><?= $ProposalID ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<?php if(isset($this->bookingDataByAPI) && !empty($this->bookingDataByAPI)){
$TotalBooking = count($this->bookingDataByAPI);
$FirstSegment = $this->bookingDataByAPI[0]['Segments'];
$OriginAirportCode = $FirstSegment[0]['OriginAirportCode'];
$originCityName = $FirstSegment[0]['originCityName'].' ('.$OriginAirportCode.')';
$FirstSegmentR = array_reverse($FirstSegment);
$DestAirportCode = $FirstSegmentR[0]['DestAirportCode'];
$destinationCityName = $FirstSegmentR[0]['destinationCityName'].' ('.$DestAirportCode.')';
$AirlineRefPNRArray = array_column($this->bookingDataByAPI, 'AirlineRefPNR');
$AirlineRefPNR = (!empty($AirlineRefPNRArray)) ? implode(', ',array_unique($AirlineRefPNRArray)) : '';
if(!empty($OriginAirportCode)){
?>
<tr>
<td colspan="2">
<table class="flight-card" cellpadding="0" cellspacing="0">
<!-- Header -->
<tr class="header">
<td colspan="2">
<?php echo $originCityName;?> to <?php echo $destinationCityName;?>
</td>
<td class="pnr">
PNR: <?php echo $AirlineRefPNR;?>
</td>
</tr>
<?php foreach($this->bookingDataByAPI as $key => $value){
$Segments = $value['Segments'];
foreach($Segments as $sgkey => $sgvalue){
?>
<!-- Segment 1 -->
<tr class="segment">
<td class="left" style="text-align: left;">
<strong><?php echo $sgvalue['OriginAirportCode'];?></strong>
<br>
<?php echo $sgvalue['originAirportName'];?>
<br>
<strong>Departure Terminal: <?php echo $sgvalue['DepTerminal'];?></strong>
<br>
<strong><?php echo date('D, d M Y, H:i',strtotime($sgvalue['originDepTime']));?></strong>
</td>
<td class="middle">
<img src="<?php echo $this->baseUrl('public/upload/AirlineLogo/'.trim($sgvalue['AirlineCode']).'.png');?>" style="margin-right:10px; vertical-align: middle; width: 30px" width="30" /><strong><?php echo $sgvalue['FlightNumber'];?></strong> (<?php echo $sgvalue['AirlineName'];?>)<br>
<strong><span class="dotted-underline" style="margin-bottom: 7px;width: 70%;"></span></strong><br>
<strong>Class: <?php echo $sgvalue['cabinClass'];?></strong>
<br>
<strong>Airline PNR: []</strong>
</td>
<td class="right" style="text-align: right;">
<strong><?php echo $sgvalue['DestAirportCode'];?></strong>
<br>
<?php echo $sgvalue['destinationAirportName'];?>
<br>
<strong>Arrival Terminal: <?php echo $sgvalue['ArrTerminal'];?></strong>
<br>
<strong><?php echo date('D, d M Y, H:i',strtotime($sgvalue['destinationArrTime']));?></strong>
</td>
</tr>
<?php } }?>
</table>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<?php } } ?>
<?php if($NewPrice == 1){ ?>
<tr>
<td colspan="2" >
<table border="0" style=" font-size:12px; border: solid 1px #ccc; padding: 0px;width:100%; " cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600; width: 80%;">Pax Name</td>
<td bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600; text-align: right;width: 20%;">Price</td>
</tr>
<tr>
<?php
foreach ($postD as $key => $value) {
$GSTPercentage = $value['GSTPercentage'];
?>
<tr>
<?php if ($markupDisplayType == 0) {
$value['ItemRates'] = round($value['ItemRates'] + ($value['TotalMarkup'] / $value['ItemQty']), 2);
$value['Total'] = $value['Total'] + $value['TotalMarkup'];
} ?>
<td style="line-height:20px;padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600; ">
<?= $value['MisxItems_name'] ?> <br />
</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 500; text-align: right; "><?= number_format(($value['SubTotal'] + $value['TotalGST']), 2, '.', '') ?></td>
</tr>
<?php
}
// $colspan = "colspan = '" . $colspan . "'";
$colspan = "";
$totalpayableWords = '';
if ($totalpayable > 0) {
$totalpayableWords = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->convertAmountToWords($totalpayable);
}
?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">Total Invoice Value</td>
<td align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 500;"><?= $post['Symbol'] ?> <?= number_format($subtotals + '0', 2) ?></td>
</tr>
<?php if (empty($AddressAgency['StateSysId']) || $post['client_state'] != $AddressAgency['StateSysId']) {
if ($totalIGST > 0 || ($totalCGST + $totalSGST) > 0) {
?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;"><?php echo ($TaxLabelId == 2) ? 'VAT' : 'IGST'; ?></td>
<td align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 500;"><?php if ($totalIGST > 0) {
echo number_format($totalIGST, 2);
} else {
echo number_format($totalCGST + $totalSGST, 2);
} ?></td>
</tr>
<?php }
} else {
if ($totalCGST > 0) { ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">CGST</td>
<td align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 500;"><?= number_format($totalCGST, 2) ?></td>
</tr>
<?php }
if ($totalSGST > 0) { ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">SGST</td>
<td align="right" align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 500;"><?= number_format($totalSGST, 2) ?></td>
</tr>
<?php }
} ?>
<?php if ($other_discount > '0') { ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">Other Discount(<?= $other_discount ?>)</td>
<td align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 500;"> -<?= $otherDiscountVal ?></td>
</tr>
<?php } ?>
<?php if ($TcsAmount > '0') { ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">TCS</td>
<td align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 500;"><?= $TcsAmount ?></td>
</tr>
<?php } ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">Total</td>
<td align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 500;"><?= $post['Symbol'] ?><?= number_format($show_Total + '0', 2) ?></td>
</tr>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">Amount Paid</td>
<td align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 500;"><?= $post['Symbol'] ?><?= number_format($Advance + '0', 2) ?></td>
</tr>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">Balance to be paid</td>
<td align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;"><?= $post['Symbol'] ?><?= number_format($totalpayable + '0', 2) ?></td>
</tr>
<?php if ($totalpayableWords != '') { ?>
<tr>
<td colspan="2" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">Amount in Words: <?php echo ($totalpayableWords != '') ? ucwords($totalpayableWords) . ' Only/-' : 'Nil'; ?></td>
<!-- <td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;"></td> -->
</tr>
<?php } ?>
</table>
</td>
</tr>
<?php }else{ ?>
<tr>
<td colspan="2">
<table width="100%" border="0" style="padding:5px 8px; font-size:12px; border: solid 1px #ccc; padding: 0px;" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Description of Goods\Services</td>
<td bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Qty</td>
<td bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Rate</td>
<td bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Total</td>
<?php
if ($Sumdiscount > '0') {
if (empty($AddressAgency['StateSysId']) || $post['client_state'] != $AddressAgency['StateSysId']) {
$colspan = 7;
} else {
$colspan = 8;
}
?>
<td bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">Discount</td>
<?php
} else {
if($TaxLabelId == 1) {
if (empty($AddressAgency['StateSysId']) || $post['client_state'] != $AddressAgency['StateSysId']) {
$colspan = 5;
} else {
$colspan = 6;
}
} else {
$colspan = 5;
}
}
if ($markupDisplayType != 1) {
//$colspan = $colspan - 1;
}
if($TaxLabelId == 1) {
if(($totalCGST + $totalSGST) == 0){
if ($post['client_state'] != $AddressAgency['StateSysId']) {
$colspan = $colspan - 1;
} else {
$colspan = $colspan - 2;
}
}
} else {
$colspan = $colspan - 1;
}
//echo $colspan; exit;
if ($markupDisplayType == 1) {
?>
<td bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Service Fee</td>
<?php }
if (empty($AddressAgency['StateSysId']) || $post['client_state'] != $AddressAgency['StateSysId']) {
if ($totalIGST > 0 || ($totalCGST + $totalSGST) > 0) { ?>
<td colspan="2" bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;font-weight: 600;text-align: center;"><?php echo ($TaxLabelId == 2) ? 'VAT' : 'IGST'; ?></td>
<?php }
} else { ?>
<?php if ($totalCGST > 0) { ?>
<td colspan="2" bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;font-weight: 600; text-align: center;">CGST</td>
<?php }
if ($totalSGST > 0) { ?>
<td colspan="2" bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600; text-align: center;">SGST</td>
<?php }
} ?>
<td bgcolor="#E8F8FF" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;" nowrap="nowrap">Total Price</td>
</tr>
<?php
foreach ($postD as $key => $value) {
?>
<tr>
<?php if ($markupDisplayType == 0) {
$value['ItemRates'] = round($value['ItemRates'] + ($value['TotalMarkup'] / $value['ItemQty']), 2);
$value['Total'] = $value['Total'] + $value['TotalMarkup'];
} ?>
<td style="width: 40%; padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">
<?= $value['MisxItems_name'] ?> <?php echo !empty($value['ItemsSACCode']) ? '(' . $value['ItemsSACCode'] . ')' : ''; ?><br />
<?= $value['Description'] ?>
</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= $value['ItemQty'] ?></td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= number_format($value['ItemRates'], 2, '.', '') ?></td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= number_format($value['Total'], 2, '.', '') ?></td>
<?php if ($Sumdiscount > '0') { ?>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= number_format($value['TotalDiscount'], 2, '.', '') ?></td>
<?php }
if ($markupDisplayType == 1) { ?>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= number_format($value['TotalMarkup'], 2, '.', '') ?></td>
<?php }
if ($post['client_state'] != $AddressAgency['StateSysId']) {
if ($totalIGST > 0 || ($totalCGST + $totalSGST) > 0) {
?>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= number_format($value['TotalGST'], 2, '.', '') ?></td>
<?php } } else {
if($totalCGST > 0){ ?>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= number_format($value['CGST'], 2, '.', '') ?></td>
<?php }
if($totalSGST > 0){ ?>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= number_format($value['SGST'], 2, '.', '') ?></td>
<?php } }?>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= number_format(($value['SubTotal'] + $value['TotalGST']), 2, '.', '') ?></td>
</tr>
<?php
}
$colspan = 'colspan="' . $colspan . '"';
// $colspan = "colspan = '" . $ . "'";
?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Total Invoice Value</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= $post['Symbol'] ?> <?= number_format($subtotals + '0', 2) ?></td>
</tr>
<?php
$CheckTotal = 0;
if ($post['client_state'] != $AddressAgency['StateSysId']) {
if ($totalIGST > 0 || ($totalCGST + $totalSGST) > 0) {
$CheckTotal = 1;
?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; "><?php if($TaxLabelId == 1) { echo "IGST"; } else { echo "VAT";} ?></td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; "><?php if ($totalIGST > 0) {
echo number_format($totalIGST, 2);
} else {
echo number_format($totalCGST + $totalSGST, 2);
} ?></td>
</tr>
<?php } } else {
if($totalCGST > 0){ $CheckTotal = 1; ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">CGST</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= number_format($totalCGST, 2) ?></td>
</tr>
<?php }
if($totalSGST > 0){ $CheckTotal = 1; ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">SGST</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= number_format($totalSGST, 2) ?></td>
</tr>
<?php } } ?>
<?php if ($other_discount > '0') { $CheckTotal = 1; ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Other Discount(<?= $other_discount ?>)</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"> -<?= $otherDiscountVal ?></td>
</tr>
<?php } ?>
<?php if ($TcsAmount > '0') { $CheckTotal = 1; ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 600;">TCS</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc; font-weight: 500;"><?= $TcsAmount ?></td>
</tr>
<?php } ?>
<?php if($CheckTotal == 1){ ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Total</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;" nowrap="nowrap"><?= $post['Symbol'] ?><?= number_format($show_Total + '0', 2) ?></td>
</tr>
<?php } ?>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Amount Paid</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= $post['Symbol'] ?><?= number_format($Advance + '0', 2) ?></td>
</tr>
<tr>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Balance to be paid</td>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?= $post['Symbol'] ?><?= number_format($totalpayable + '0', 2) ?></td>
</tr>
<?php if($totalpayableWords != ''){ ?>
<tr>
<td style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;">Amount in Words:</td>
<td <?= $colspan ?> align="right" style="padding:5px 8px; font-size:12px; border-right: solid 1px #ccc; border-bottom: solid 1px #ccc;"><?php echo ucwords($totalpayableWords); ?> Only/-</td>
</tr>
<?php } ?>
</table>
</td>
</tr>
<?php } ?>
<tr>
<td colspan="2" style="padding:5px 8px; font-size:12px; border-bottom: solid 1px #ccc; font-weight: 600;">Notes: </td>
</tr>
<tr>
<td colspan="2" style="padding:5px 8px; font-size:13px; border-bottom: solid 1px #ccc;">
<?php echo str_replace(' ',' ',$post['notes']); ?>
</td>
</tr>
<tr>
<td colspan="2" style="padding:5px 8px; font-size:12px; border-bottom: solid 1px #ccc;font-weight: 600;">Payment Terms: </td>
</tr>
<tr>
<td colspan="2" style="padding:5px 8px; font-size:12px; border-bottom: solid 1px #ccc;">
<?php echo str_replace(' ',' ',$post['termsandcondition']); ?>
</td>
</tr>
<tr>
<td colspan="2" style="padding:5px 8px; font-size:12px;" align="right"> For <?= $AgencyData['Title'] ?></td>
</tr>
<td> </td>
</tr>
<?php if (file_exists($checkIsExistInvoice)) { ?>
<tr>
<td colspan="2" style="padding:5px 8px; font-size:12px; font-weight: 600; width: 100%" align="right"><img src="<?php echo $this->baseUrl('public/upload/media/agency/' . $AgencyData['AgencySysId'] . '/' . $AgencyData['InvoiceSignature']); ?>" width="120px" height="120px" /></td>
</tr>
<?php } else { ?>
<tr>
<td style="padding:5px 8px; font-size:12px; border-bottom: solid 1px #ccc; font-weight: 600;" align="right">- Digital Copy -</td>
</tr>
<?php } ?>
<tr>
<td> </td>
</tr>
<tr>
<td colspan="2" style="padding:5px 8px; font-size:12px; border-bottom: solid 1px #ccc;" align="right">Authorized Signatory </td>
</tr>
<?php if($AgencyPhoto != ''){ ?>
<tr>
<td style="">
<img style="margin-right: 5%;margin-top: 5px;" src="<?php echo $this->baseUrl('public/upload/media/agency/' . $AgencySysId . '/photo/' . $AgencyPhoto); ?>" alt="AgencyPhoto">
</td>
</tr>
<?php } ?>
<tr>
<td colspan="2" style="padding:5px 8px; font-size:12px;" align="center">Note:- This is an electronically generated invoice and does not require a physical signature</td>
</tr>
</table>
</div>
</body>
</html>