siddharth_application/application/views/importpopdf.php
venbatechnologies@gmail.com 3650012dcb capital po updates done
2017-06-30 20:49:26 +05:30

306 lines
10 KiB
PHP
Executable File

<?php
$PONO = '';
$postatus ='';
$CompanyAddress = '';
$CompanyName = '';
$SuplierName = '';
$SuplierAddress = '';
$DeliveryAddress = '';
$Podt = '';
$DeliveryDate ='';
$ServiceDescription = '';
$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;
}
}
?>
<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">
<div><center>
<h2>IMPORT PURCHASE ORDER</h2>
<a style="color:#515151">PO NO:<?php echo $PONO?> </a></center>
</div>
<?php
if ($postatus == 'ST026')
{}
else
{
echo '<div>Draft</div>';
}
?>
<div align="right"> <?php echo $Podt?> </div>
<p>
<b style="color:#3c8dbc"><?php echo $CompanyName; ?></b><br/> <?php echo $CompanyAddress; ?></p>
<table style="border-collapse: collapse;" 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>
<td> <a style="color:#3c8dbc">Delivery Date :</a><br/><?php echo $DeliveryDate?>
</tr>
</table>
</div>
<div class="page">
<table style="border-collapse:collapse;" cellpadding="0" cellspacing="0" border="1" width="100%" >
<tr style="background:#000;color:#fff;">
<th>#</th>
<th>Item and Description</th>
<th>Qty</th>
<th>Rate per unit</th>
<th>Basic Price</th>
<th>Total Amount</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->TotalOrderValue; ?></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 = $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 number_format($TotalOrderValue,2);?></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/>Store</td>-->
<td>Cost center :<br/><?php echo $CostCenterCode?></td>
</tr>
</table>
</div>
<!-- This day should comes from po it is editable in po screen-->
<div> Payment Terms *<br/><?php echo $PaymentTerms;?></div>
</div>