siddharth_application/application/views/revenuepopdf.php
venbatechnologies@gmail.com d07a318b15 listing issues fix
2017-08-07 11:39:12 +05:30

384 lines
13 KiB
PHP
Executable File

<?php
$PONO = '';
$postatus ='';
$CompanyAddress = '';
$CompanyName = '';
$SuplierName = '';
$SuplierAddress = '';
$DeliveryAddress = '';
$Podt = '';
$DeliveryDate ='';
$postatus='';
$ServiceDescription = '';
$PaymentTerms = '';
$PaymentDays='';
$PayableAT='';
$DeliverySchedule='';
if(!empty($CompanyDetails))
{
foreach ($CompanyDetails as $CO)
{
$CompanyName = $CO->CompanyName;
$CompanyAddress = $CO->Address;
}
}
if(!empty($POItem))
{
foreach ($POItem as $PO)
{
$PONO = $PO->PONO;
$postatus= $PO->Status;
$SuplierName = $PO->SupplierName;
$SuplierAddress = $PO->Address;
$DeliveryAddress = $PO->DeliveryAddress;
$postatus= $PO->Status;
$dt = new DateTime($PO->PODate, new DateTimeZone('Asia/Kolkata'));
$Podt = $dt->format('d-m-Y');
if($PO->DeliveryOption=='1'){
$DeliveryDate = '';
$DeliverySchedule = $PO->DeliverySchedule;
}
else{
$dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata'));
$DeliveryDate = $dtDe->format('d-m-Y');
$DeliverySchedule = '';
}
$ServiceDescription =$PO->ServiceDescription;
if($PO->PaymentID!='PT08'){
$PaymentTerms = $PO->PaymentTerms;
}
else{
$PaymentTerms = $PO->PaymentTerms . ' ( '.$PO->PaymentOtherDescription.' ) ';
}
}
}
$currencyName='INR';
$currencyCode ='';
if(!empty($CurrencySymbol))
{
foreach ($CurrencySymbol as $Curr)
{
$currencyCode = $Curr->FontCode2000;
//$currencyName = $currencyName;
}
}
?>
<style>
@page { margin: 280px 50px 30px 50px; }
.header { position: fixed; left: 0px; top: -280px; right: 0px; height: 550px;text-align: center; }
.footer { position: fixed; bottom: 0px; }
.pagenum:before { content: counter(page); }
</style>
<div class="footer">Page: <span class="pagenum"></span></div>
<div class="header">
<div style="text-align:right;">
<?php
if ($postatus == 'ST026')
{}
else
{
echo '<div><b>DRAFT</b> </div>';
}
?>
</div>
<center> <span style="font-size:24px;">PURCHASE ORDER - <a style="color:#515151">PO NO:<?php echo $PONO?>/R </a></span></center>
<table style="border-collapse: collapse;font-size:12px;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="2">
<p style="color:#3c8dbc;font-size:16px;"><strong><?php echo $CompanyName; ?></strong></p>
<p> <?php echo $CompanyAddress; ?></p>
</td>
<td align="right"><img width="100" height="100" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA11JREFUeNrsnT9IHEEYxWfFw8rgpUhlo5URi2gTbIUUSrq1ui4oRLRIY9JIKrGKTQrBgJLuuutEi4CtSSOpPIuATdIEcid2YpN9C3sc8c6bf7uZmX0P7k7ultm7337zzXxvZjGaiaIfQoiqoHTUHk6eniSPUbLQUmUoebojB23dDZGBmQiQAAmQAAmQIkACJEACpAiweA3bbvDV5mb6+iKOxfTc3MDjf15dicbBQfr3591d7wBGM1H0J3l9bNLI84UFsby6mkIzFWACJMCafJ9PJyfSx29vbHQuoqJaxl34zc5O+mVtwIPi5EIcXV52IjnoLvx+by/9wXkIF8aHbq0dgYi4vOB1Q7QV2c4BXM4Z3r+RGBTAR9VqmqhVBoZnIyOdx9taTXqQGJ+YUDqXFwBV4WGU69aXRkNsr69LtyEzHfIKIKJCVl9PT3u+/63P+6bnC64SuWm3jdsYn5xkKcdamCJAAiwjQJcHAC8ATs/OBg1Qy0y4ub6WPhb1cuPwUFycn9/77OPWlvXzeQGw2QPGQ9o/PhZrS0v3IPpooFrpwgChYniidq6fnTnvrBSaA3Uc3A/1uvPuSmEA0f0uFLsyBKcZDjaisvSj8DsFW6pbcHPQpV12WQoBCHhri4taEOGwhJAXjeeBgFebn1eyp0LKi1Ym0rCsXieRqLk06HVetFqJwHmWnRz3yotHzabT9n0hpRxGZ0SjjpGKCEQkxgUtWDlbCyMfIi/qTHMgrDf7srCem5mQDS5YQNKRD2vCuQLMhCVM3bwIiK4PLIUYqrp5EXPFeGWFALO8CEdGddId7NYOHWFQUa1cUO4Fty78/fZW6tFrjx7gqfqAT0PbmWAqVCwq+bDUOxMeyokh6L8B1J1kE2BgIkACJMDyAbSx56/cACV3CoyOjfX9rNSrcrI7E/qVYYCnYhKY3LXkJECVOdx+Us51m6Nwm7HVQyUCf4UGEJuFZPMgIhC+XlYfw21WWQ/GxXJ50q09iBS1MSjYW73ww3SXMVXOobsk4MU80GQZc5DQbl5tOzWRRpS8nJqy1tUAzWZ7ecvKDdfdggWfTV0GbdnA4JB1UdhbHjo0LesAS6YWa2GaCQRIgARIESABEiABUgRIgARYRoAVYtBWBfcL/xb8hwS6av8VYADVjF2M5sTWJAAAAABJRU5ErkJggg=="></td>
</tr>
<tr>
<td>
<p><strong>Vendor Address :</strong></p>
<p><?php echo $SuplierName; ?><br /><?php echo $SuplierAddress; ?></p>
</td>
<td colspan="2">
<p><strong>Delivery To :</strong></p>
<p><?php echo $DeliveryAddress; ?></p>
</td>
</tr>
<tr>
<td>PO DATE :&nbsp;&nbsp;&nbsp;<?php echo $Podt; ?></td>
<td colspan="2">DELIVERY DATE / SCHEDULE BY :&nbsp;&nbsp;&nbsp;<?php echo $DeliveryDate.$DeliverySchedule;?></td>
</tr>
</tbody>
</table>
</div>
<div class="page" style="font-size:12px;">
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr bgcolor="#8c8c8c" color="#fff">
<td style="text-align: center;">Requistion Number</td>
<td style="text-align: center;">Requistion Date</td>
<td style="text-align: center;">Requested By</td>
<td style="text-align: center;">Requested Department</td>
<td style="text-align: center;">Cost Center &nbsp;</td>
</tr>
<?php
if(!empty($RequistionDetails))
{
foreach($RequistionDetails as $ReqDetails)
{
?>
<tr>
<td style="text-align: center;"><?php echo $ReqDetails['RequistionNo']; ?></td>
<td style="text-align: center;"><?php echo $ReqDetails['ReqDate']; ?></td>
<td style="text-align: center;"><?php echo $ReqDetails['RequestedName']; ?></td>
<td style="text-align: center;"><?php echo $ReqDetails['RequestedDept']; ?></td>
<td style="text-align: center;"><?php echo $ReqDetails['CostCenterCode']; ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr bgcolor="#8c8c8c" color="#fff">
<td style="text-align: center;">#</td>
<td style="text-align: center;">Item Code</td>
<td style="text-align: center;">Item &nbsp;Name</td>
<td style="text-align: center;">HSN Code</td>
<td style="text-align: center;">UOM</td>
<td style="text-align: center;">Qty</td>
<td style="text-align: center;">Rate In INR</td>
<td style="text-align: center;">Basic Value In INR</td>
</tr>
<?php
if(!empty($POItem))
{
$index = 0;
$TotalAmount = 0;
$OrderValue = 0;
$TotalTax = 0;
$SubTotalAmount = 0;
foreach($POItem as $record)
{
$index = $index + 1;
$TotalAmount = $record->BasicValue+$record->Taxamount;
?>
<tr style="line-height: 1.5em;">
<td style="text-align: center;"><?php echo $index ; ?></td>
<td style="text-align: center;"><?php echo $record->MaterialCode ; ?></td>
<td style="text-align: center;"><?php echo $record->MaterialName ; ?></td>
<td style="text-align: center;"><?php echo $record->HSNCODE ; ?>
<td style="text-align: center;"><?php echo $record->UOM ; ?></td>
<td align="right"><?php echo $record->Quantity ; ?></td>
<td align="right"><?php echo $record->Rate ; ?></td>
<td align="right"><?php echo number_format($record->BasicValue, 2, '.', '') ;?></td>
</tr>
<?php
$SubTotalAmount = $SubTotalAmount + $record->BasicValue-$record->AfterDiscount;
$TotalTax = $TotalTax+$record->Taxamount;
$OrderValue = $SubTotalAmount + $TotalTax;
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr style="line-height: 1.5em;">
<td style="text-align: center;" rowspan="2"><strong>HSN Code</strong><br /><br /></td>
<td style="text-align: center;" colspan="2"><strong>Discount In INR</strong><br /><br /></td>
<td style="text-align: center;" colspan="2"><strong>SGST</strong>&nbsp;<br /><br /></td>
<td style="text-align: center;" colspan="2"><strong>CGST&nbsp;</strong>&nbsp;<br /><br /></td>
<td style="text-align: center;" colspan="2"><strong>IGST</strong><br /><br /></td>
<td style="text-align: center;" colspan="2"><strong>Packaging In INR</strong>&nbsp;&nbsp;</td>
<td style="text-align: center;" rowspan="2"><strong>Insurance In INR</strong>&nbsp;&nbsp;</td>
<td style="text-align: center;" colspan="2">&nbsp;&nbsp;<strong>Freight In INR&nbsp;</strong></td>
<td style="text-align: center;" rowspan="2"><strong>Tax Amt In INR</strong><br /></td>
<td style="text-align: center;" rowspan="2"><strong>&nbsp;Total Amount In INR</strong>&nbsp;</td>
</tr>
<tr style="line-height: 2.5em;">
<td style="text-align: center;"><strong>Type</strong></td>
<td style="text-align: center;"><strong>Amt</strong></td>
<td style="text-align: center;"><strong>Type</strong></td>
<td style="text-align: center;"><strong>Amt</strong></td>
<td style="text-align: center;"><strong>Type</strong></td>
<td style="text-align: center;"><strong>Amt</strong></td>
<td style="text-align: center;"><strong>Type</strong></td>
<td style="text-align: center;"><strong>Amt</strong></td>
<td style="text-align: center;"><strong>Type</strong></td>
<td style="text-align: center;"><strong>Amt</strong></td>
<td style="text-align: center;"><strong>Type</strong></td>
<td style="text-align: center;"><strong>Amt</strong></td>
</tr>
<?php if(!empty($POItem)) {
foreach($POItem as $record1)
{
?>
<tr style="line-height: 1.5em;">
<td style="text-align: right;"><?php echo $record1->HSNCODE ; ?></td>
<td style="text-align: right;"><?php echo $record1->DiscountType.'-'.$record1->DiscountValue; ?></td>
<td style="text-align: right;"><?php echo number_format($record1->AfterDiscount, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo $record1->SGST ; ?></td>
<td style="text-align: right;"><?php echo number_format($record1->AfterSGST, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo $record1->CGST ; ?></td>
<td style="text-align: right;"><?php echo number_format($record1->AfterCGST, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo $record1->IGST ; ?></td>
<td style="text-align: right;"><?php echo number_format($record1->AfterIGST, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo $record1->PackagingType.'-'. $record1->PackagingValue ; ?></td>
<td style="text-align: right;"><?php echo number_format($record1->AfterPackagingValue, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo number_format($record1->Insurance, 2, '.', ''); ?></td>
<?php if($record1->FreightType=='PER TRIP'){ ?>
<td style="text-align: right;"><?php echo $record1->FreightType.'('.$record1->NoOfTrip.')-'. $record1->FreightValue;?></td>
<?php } ?>
<?php if($record1->FreightType!='PER TRIP'){ ?>
<td style="text-align: right;"><?php echo $record1->FreightType.'-'. $record1->FreightValue;?></td>
<?php } ?>
<td style="text-align: right;"><?php echo number_format($record1->AfterFreightValue, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo number_format($record1->Taxamount, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo number_format(($record1->BasicValue+$record1->Taxamount-$record1->AfterDiscount), 2, '.', ''); ?></td>
</tr>
<?php }
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<p><strong>Payment Terms:</strong>&nbsp;<?php echo $PaymentTerms;?></p>
<p><strong>Special Instructions:</strong></p>
<p><?php echo $ServiceDescription;?></p>
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="text-align: center;" rowspan="3">
<p><strong>Total Amount In Words&nbsp;</strong><br /><br /><br /></p>
<p><em><strong><?php echo $TotalAmountInWords;?></strong></em></p>
</td>
<td style="text-align: right;"><strong>Total Amount Before Tax In INR &nbsp;</strong></td>
<td style="text-align: right;"><strong><?php echo number_format($SubTotalAmount, 2, '.', '');?>&nbsp;</strong></td>
</tr>
<tr>
<td style="text-align: right;"><strong>Total Tax Amount In INR &nbsp;</strong></td>
<td style="text-align: right;"><strong><?php echo number_format($TotalTax, 2, '.', '');?>&nbsp;</strong></td>
</tr>
<tr>
<td style="text-align: right;"><strong>Total Amount After Tax In INR &nbsp;</strong></td>
<td style="text-align: right;"><strong><?php echo number_format($OrderValue, 2, '.', '');?>&nbsp;</strong></td>
</tr>
<tr>
<td>
<?php
if(!empty($releasedetails)){
$releasedOn = '';
foreach($releasedetails as $detail){
$releasedOn= new DateTime($detail->ReleasedOn, new DateTimeZone('Asia/Kolkata'));
?>
<p>&nbsp;</p>
<div align="Left"> <b>&nbsp;Released By : </b><?php echo $detail->FirstName;?></div>
<div align="Left"> <b>&nbsp;Released On : </b><?php echo $releasedOn->format('d-m-Y');?></div>
<?php
}
}
else {
?>
<?php } ?>
</td>
<td style="text-align: center;" colspan="2">
<p style="text-align: center;">Certified that the particulars given&nbsp;above are true and correct</p>
<p style="text-align: center;"><strong><?php echo $CompanyName; ?></strong></p>
<p>&nbsp;</p>
<p style="text-align: center;">Authorized Signatory</p>
</td>
</tr>
</tbody>
</table>
<br/>
<br/>
</div>