siddharth_application/application/views/importpopdf.php
venbatechnologies@gmail.com 119d6f02f5 service description
2017-07-13 10:23:29 +05:30

367 lines
13 KiB
PHP
Executable File

<?php
$PONO = '';
$postatus ='';
$CompanyAddress = '';
$CompanyName = '';
$SuplierName = '';
$SuplierAddress = '';
$DeliveryAddress = '';
$Podt = '';
$DeliveryDate ='';
$ServiceDescription = '';
$ReqBy='';
$PaymentTerms='';
$PaymentDays='';
$PayableAT='';
$index=0;
if(!empty($CompanyDetails))
{
foreach ($CompanyDetails as $CO)
{
$CompanyName = $CO->CompanyName;
$CompanyAddress = $CO->Address;
}
}
if(!empty($POItem))
{
foreach ($POItem as $PO)
{
$ReqNo=$PO->ReqNo;
$PONO = $PO->PONO;
$postatus= $PO->Status;
$SuplierName = $PO->SupplierName;
$SuplierAddress = $PO->Address;
$DeliveryAddress = $PO->DeliveryAddress;
$dt = new DateTime($PO->PODate, new DateTimeZone('Asia/Kolkata'));
$Podt = $dt->format('d-m-Y');
$dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata'));
$DeliveryDate = $dtDe->format('d-m-Y');
$ServiceDescription =$PO->ServiceDescription;
$CostCenterCode=$PO->CostCenterCode;
//$ReqBy=$PO->Requestedby;
$PaymentTerms = $PO->PaymentTerms;
$PaymentDays=$PO->PaymentDays;
$PayableAT=$PO->PayableAT;
}
}
if(!empty($Requestername))
{
foreach ($Requestername as $Reqname)
{
$ReqBy=$Reqname->FirstName;
}
}
$CurrencyCode='';
$CurrencyName='';
if(!empty($Currencytype))
{
foreach ($Currencytype as $CURRE)
{
$CurrencyCode=$CURRE->Currency_Code;
$CurrencyName=$CURRE->FontCode2000;
}
}
// echo $CurrencyCode;
$DEPNAME='';
if(!empty($DEPCODE))
{
foreach ($DEPCODE as $DEP)
{
$DEPNAME=$DEP->DepartmentName;
}
}
?>
<style>
@page { margin: 310px 50px 30px 50px; }
.header { position: fixed; left: 0px; top: -310px; 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">
<table>
<tr>
<td>
<img width="80" height="80" 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>
<td><center><h2>IMPORT PURCHASE ORDER</h2><a style="color:#515151">PO NO:<?php echo $PONO?> </a><br/><b style="color:#3c8dbc"><?php echo $CompanyName; ?></b><br/> <?php echo $CompanyAddress; ?></center></td>
<td>
<?php
if ($postatus == 'ST026')
{}
else
{
echo '<div><br/><br/>This is Draft Version For Internal Purpose</div>';
}
?>
</td>
</tr>
</table>
<table style="border-collapse: collapse;font-size:12px;" cellpadding="0" cellspacing="0" border="1" width="100%">
<!-- <tr><th>Payment Terms</th><th>Payable At</th><th>Payment Days</th><th>Delivery Date</th><th>PO Date</th></tr> -->
<tr><td><?php echo $PaymentTerms;?></td><td><?php echo $PayableAT;?></td><td><?php echo $PaymentDays;?></td><td><?php echo $DeliveryDate;?></td><td><?php echo $Podt?></td></tr>
</table>
<br/>
<table style="border-collapse: collapse;font-size:12px;" cellpadding="0" cellspacing="0" border="1" width="100%">
<tr>
<td>
<a style="color:#3c8dbc">Vendor Address :</a> <br/> <?php echo $SuplierName?> <br/><?php echo $SuplierAddress ?>
</td>
<td>
<a style="color:#3c8dbc">Delivery To :</a><br/> <?php echo $DeliveryAddress?>
</td>
</td>
</tr>
</table>
</div>
<div class="page">
<table style="border-collapse:collapse;" cellpadding="0" cellspacing="0" border="1" width="100%" >
<tr style="background:#8c8c8c;color:#fff;">
<th>#</th>
<th>Item and Description</th>
<th>Qty</th>
<th>Rate per unit in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Basic Price in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Total Amount in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<!--<th>Landing Charge</th>
<th>High Seas Sales charge</th>
<th>Custom duty (A) </th>
<th>Excise duty (b)</th>
<th>Excise duty ED_cess (C)</th>
<th>Excise duty S & H cess (d) </th>
<th>Custom ED_cess (e)</th>
<th>Custom S & H cess (f)</th>
<th>Additional Excise duty (g)</th>
<th>Gross duty payable</th>
<th>Available Modvat-set-off on import(b + c + d + g)</th>
<th>Gross expenses due to custom duty</th>
<th>purchase rate </th>
<th>Quantity</th>
<th>Custom Duty Expenses</th>
<th>RMC Including Customers</th>
<th>Total Amount</th> -->
</tr>
<?php
if(!empty($POItem))
{
$BasicValue=0;
$ProductPrice = 0;
$AfterLandingCharge= 0;
$AfterHighSeasSalesCharge= 0;
$AfterCustomDuty = 0;
$AfterCustomEdCess = 0;
$AfterCustomSHCess = 0;
$AfterExciseDuty = 0;
$AfterExciseDutyEdCess = 0;
$ExciseDutySHCess = 0;
$AfterAddlExciseDuty = 0;
$Grossdutypayable = 0;
$AvailableModvat = 0;
$Grossexpensesduetocustomduty = 0;
$purchaseratePerKG=0;
$CustomDutyExpensesPerKG=0;
$RMCIncludingCustomersPerKG=0;
$AfterExciseDutySHCess=0;
$TotalOrderValue=0;
$index=0;
foreach($POItem as $record)
{
$index = $index + 1;
?>
<tr>
<td><?php echo $index ; ?></td>
<td><?php echo $record->MaterialName ; ?></td>
<td align="right"><?php echo $record->Quantity ; ?></td>
<td align="right"><?php echo $record->Rate ; ?></td>
<td align="right"><?php $BasicValue=($record->Quantity*$record->Rate);
echo number_format($BasicValue,2) ; ?></td>
<td align="right"><?php echo $record->ProductPrice; ?></td>
<!--<td align="right"><?php echo $record->AfterLandingCharge; ?></td>
<td align="right"><?php echo $record->AfterHighSeasSalesCharge ; ?></td>
<td align="right"><?php echo $record->AfterCustomDuty ; ?></td>
<td align="right"><?php echo $record->AfterExciseDuty ; ?></td>
<td align="right"><?php echo $record->AfterExciseDutyEdCess ; ?></td>
<td align="right"><?php echo $record->AfterExciseDutySHCess ; ?></td>
<td align="right"><?php echo $record->AfterCustomEdCess ; ?></td>
<td align="right"><?php echo $record->AfterCustomSHCess ; ?></td>
<td align="right"><?php echo $record->AfterAddlExciseDuty ; ?></td>
<td align="right"><?php echo $record->Grossdutypayable ; ?></td>
<td align="right"><?php echo $record->AvailableModvat ; ?></td>
<td align="right"><?php echo $record->Grossexpensesduetocustomduty ; ?></td>
<td align="right"><?php echo $record->purchaseratePerKG ; ?></td>
<td align="right"><?php echo $record->CustomDutyExpensesPerKG ; ?></td>
<td align="right"><?php echo $record->RMCIncludingCustomersPerKG ; ?></td>
<td align="right"><?php echo $record->QuantityKG ; ?></td>
<td align="right"><?php echo $record->TotalOrderValue; ?></td> -->
</tr>
<?php
$AfterLandingCharge= $AfterLandingCharge+$record->AfterLandingCharge;
$AfterHighSeasSalesCharge=$AfterHighSeasSalesCharge+$record->AfterHighSeasSalesCharge ;
$AfterCustomDuty = $AfterCustomDuty+$record->AfterCustomDuty ;
$AfterCustomEdCess = $AfterCustomEdCess+$record->AfterCustomEdCess ;
$AfterCustomSHCess = $AfterCustomSHCess+$record->AfterCustomSHCess ;
$AfterExciseDuty = $AfterExciseDuty+$record->AfterExciseDuty ;
$AfterExciseDutyEdCess = $AfterExciseDutyEdCess+$record->AfterExciseDutyEdCess ;
$AfterAddlExciseDuty = $AfterAddlExciseDuty+$record->AfterAddlExciseDuty ;
$Grossdutypayable = $Grossdutypayable+$record->Grossdutypayable ;
$AvailableModvat = $AvailableModvat+$record->AvailableModvat ;
$Grossexpensesduetocustomduty = $Grossexpensesduetocustomduty+$record->Grossexpensesduetocustomduty ;
$purchaseratePerKG = $purchaseratePerKG+$record->purchaseratePerKG ;
$CustomDutyExpensesPerKG = $CustomDutyExpensesPerKG+$record->CustomDutyExpensesPerKG ;
$RMCIncludingCustomersPerKG = $RMCIncludingCustomersPerKG+$record->RMCIncludingCustomersPerKG ;
$AfterExciseDutySHCess= $AfterExciseDutySHCess+$record->AfterExciseDutySHCess ;
$TotalOrderValue = $record->TotalOrderValue;
}
}
?>
</table>
<div align="right">
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
<!--<tr>
<td align="right">Landing charge :</td>
<td align="right"><?php echo number_format($AfterLandingCharge,2);?></td>
<br/>
</tr>
<tr>
<td align="right">High seas sales charge:</td>
<td align="right"><?php echo number_format($AfterHighSeasSalesCharge,2);?></td>
<br/>
</tr>
<tr>
<td align="right">Custom duty : </td>
<td align="right"><?php echo number_format($AfterCustomDuty,2);?></td>
</tr>
<tr>
<td align="right">Excise duty :</td>
<td align="right"><?php echo number_format($AfterExciseDuty,2);?></td>
</tr>
<tr>
<td align="right">Excise duty ED_cess : </td>
<td align="right"><?php echo number_format($AfterExciseDutyEdCess,2);?></td>
</tr>
<tr>
<td align="right">Excise duty S & H cess :</td>
<td align="right"><?php echo number_format($AfterExciseDutySHCess,2);?></td>
</tr>
<tr>
<td align="right">Custom ED_cess : </td>
<td align="right"><?php echo number_format($AfterCustomEdCess,2);?></td>
</tr>
<tr>
<td align="right">Custom S & H cess :</td>
<td align="right"><?php echo number_format($AfterCustomSHCess,2);?></td>
</tr>
<tr>
<td align="right">Additional Excise duty :</td>
<td align="right"><?php echo number_format($AfterAddlExciseDuty,2);?></td>
</tr>
<tr>
<td align="right">Gross duty payable :</td>
<td align="right"><?php echo number_format($Grossdutypayable,2);?></td>
</tr>
<tr>
<td align="right">Available Modvat set-off on import :</td>
<td align="right"><?php echo number_format($AvailableModvat,2);?></td>
</tr>
<tr>
<td align="right">Gross expenses due to custom duty :</td>
<td align="right"><?php echo number_format($Grossexpensesduetocustomduty ,2);?></td>
</tr>
<tr>
<td align="right">Purchase Rate :</td>
<td align="right"><?php echo number_format($purchaseratePerKG,2);?></td>
</tr>
<tr>
<td align="right">Custom Duty Expenses :</td>
<td align="right"><?php echo number_format($CustomDutyExpensesPerKG,2);?></td>
</tr>
<tr>
<td align="right">RMC Including Customers :</td>
<td align="right"><?php echo number_format($RMCIncludingCustomersPerKG ,2);?></td>
</tr>
-->
<tr>
<td align="right"><p><b>Total Order Amount </b></p></td>
<td align="right"><?php echo "$CurrencyCode ($CurrencyName)$TotalOrderValue";?></td>
</tr>
</table>
</div>
<table>
<tr>
<td>Total Amount In Words:</td>
<td><?php echo $TotalAmountInWords." "."Only.";?></td>
</tr>
</table>
<!-- table to show req detail , Data should come from DB , now i am hard coded the data-->
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
<tr>
<td>Requition Number :<br/><?php echo $ReqNo;?></td>
<td>Requested by :<br/><?php echo $ReqBy;?></td>
<td>Requisted Department :<br/><?php echo $DEPNAME?></td>
<td>Cost center :<br/><?php echo $CostCenterCode?></td>
</tr>
</table>
<p>
<div align="Left"> <b>Service Description:</b><br/><br/><?php echo $ServiceDescription;?></div></p>
</div>