siddharth_application/application/views/revenuepopdf.php
saravanakumar_kandasami 6adbd1ee89 updated code used in demo
2017-07-11 11:58:06 +05:30

346 lines
11 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;
$PaymentTerms = $PO->PaymentTerms;
$PaymentDays=$PO->PaymentDays;
$PayableAT=$PO->PayableAT;
}
}
$currencyName='INR';
$currencyCode ='';
if(!empty($CurrencySymbol))
{
foreach ($CurrencySymbol as $Curr)
{
$currencyCode = $Curr->FontCode2000;
//$currencyName = $currencyName;
}
}
?>
<style>
@page { margin: 300px 50px 30px 50px; }
.header { position: fixed; left: 0px; top: -300px; 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,iVBORw0KGgoAAA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S1MSjYW73ww3SXMVXOobsk4MU80GQZc5DQbl5tOzWRRpS8nJqy1tUAzWZ7ecvKDdfdggWfTV0GbdnA4JB1UdhbHjo0LesAS6YWa2GaCQRIgARIESABEiABUgRIgARYRoAVYtBWBfcL/xb8hwS6av8VYADVjF2M5sTWJAAAAABJRU5ErkJggg==">
</td>
<td><center><h2>REVENUE 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/Schedule</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.$DeliverySchedule;?></td><td><?php echo $Podt?></td></tr>
<br/>
</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" style="font-size:12px;">
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
<tr style="background:#8c8c8c;color:#fff;">
<th>#</th>
<th>Item Description</th>
<th>Qty</th>
<th>Rate In INR</th>
<th>Amount In INR</th>
<th>Discount</th>
<th>Excise Duty</th>
<th>Vat</th>
<th>CST</th>
<th>Packaging</th>
<th>GST</th>
<th>Other Taxes</th>
<th>Insurance</th>
<th>Freight</th>
<th>Total Amount In INR</th>
<th></th>
</tr>
<?php
if(!empty($POItem))
{
$SubTotalAmount = 0;
$index = 0;
$TotalAmount = 0;
$OrderValue = 0;
$AfterExciseDuty = 0;
$AfterVAT = 0;
$AfterCST = 0;
$AfterGST = 0;
$AfterOtherTaxes = 0;
$Insurance = 0;
$AfterFreightValue = 0;
$AfterDiscount = 0;
$AfterPackaging = 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 echo $record->BasicValue ; ?></td>
<td align="right"><?php echo $record->AfterDiscount; ?></td>
<td align="right"><?php echo $record->AfterExciseDuty ; ?></td>
<td align="right"><?php echo $record->AfterVAT ; ?></td>
<td align="right"><?php echo $record->AfterCST ; ?></td>
<td align="right"><?php echo $record->AfterPackagingValue ; ?></td>
<td align="right"><?php echo $record->AfterGST ; ?></td>
<td align="right"><?php echo $record->AfterOtherTaxes ; ?></td>
<td align="right"><?php echo $record->Insurance ; ?></td>
<td align="right"><?php echo $record->AfterFreightValue ; ?></td>
<td align="right"><?php $TotalAmount = (($record->BasicValue+$record->AfterExciseDuty
+ $record->AfterVAT+$record->AfterCST+$record->AfterGST + $record->AfterOtherTaxes + $record->Insurance+ $record->AfterFreightValue+$record->AfterPackagingValue)- $record->AfterDiscount);
echo number_format($TotalAmount,2) ; ?></td>
</tr>
<?php
$SubTotalAmount = $SubTotalAmount + $record->BasicValue;
$AfterExciseDuty =$AfterExciseDuty + $record->AfterExciseDuty;
$AfterVAT =$AfterVAT + $record->AfterVAT;
$AfterCST = $AfterCST + $record->AfterCST;
$AfterGST =$AfterGST + $record->AfterGST;
$AfterOtherTaxes =$AfterOtherTaxes + $record->AfterOtherTaxes;
$Insurance =$Insurance + $record->Insurance;
$AfterFreightValue =$AfterFreightValue + $record->AfterFreightValue;
$AfterDiscount = $AfterDiscount + $record->AfterDiscount ;
$AfterPackaging=$AfterPackaging+$record->AfterPackagingValue;
}
$OrderValue = (( $SubTotalAmount + $AfterVAT + $AfterCST+$AfterGST+$AfterOtherTaxes +$Insurance +$AfterFreightValue+$AfterExciseDuty+$AfterPackaging) - $AfterDiscount ) ;
}
?>
</table>
<div align="right">
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="0" width="100%">
<!--<tr>
<td align="right">Sub Total Amount :</td>
<td align="right"><?php echo number_format($SubTotalAmount,2);?></td>
<br/>
</tr>
<tr>
<td align="right">Discount :</td>
<td align="right"><?php echo number_format($AfterDiscount,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">Vat :</td>
<td align="right"><?php echo number_format($AfterVAT,2);?></td>
</tr>
<tr>
<td align="right">CST :</td>
<td align="right"><?php echo number_format($AfterCST,2);?></td>
</tr>
<tr>
<td align="right">GST :</td>
<td align="right"><?php echo number_format($AfterGST,2);?></td>
</tr>
<tr>
<td align="right">Other Taxes:</td>
<td align="right"><?php echo number_format($AfterOtherTaxes,2);?></td>
</tr>
<tr>
<td align="right">Insurance :</td>
<td align="right"><?php echo number_format($Insurance,2);?></td>
</tr>
<tr>
<td align="right">Freight :</td>
<td align="right"><?php echo number_format($AfterFreightValue,2);?></td>
</tr> -->
<tr>
<td align="right"><p><b>Total Order Amount In INR :</b></p></td>
<td align="right"><b><?php echo number_format($OrderValue,2);?></b></td>
</tr>
</table>
<table>
<tr>
<td><b>Total Amount In Words:<b></td>
<td><b><?php echo $TotalAmountInWords." "."Only.";?></b></td>
</tr>
</table>
<br>
<br>
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
<tr style="background:#8c8c8c;color:#fff;">
<th>Requistion Number</th>
<th>Requested by</th>
<th>Requested Department</th>
<th>Cost center</th>
</tr>
<?php
if(!empty($RequistionDetails))
{
foreach($RequistionDetails as $ReqDetails)
{
?>
<tr>
<td><?php echo $ReqDetails['RequistionNo']; ?></td>
<td><?php echo $ReqDetails['RequestedName']; ?></td>
<td><?php echo $ReqDetails['RequestedDept']; ?></td>
<td><?php echo $ReqDetails['CostCenterCode']; ?></td>
</tr>
<?php
}
}
?>
</table>
<br/>
<br/>
<p>
<div align="Left"> <b>Service Description:</b><br/><br/><?php echo $ServiceDescription;?></div></p>
<?php
if(!empty($releasedetails)){
$releasedOn = '';
foreach($releasedetails as $detail){
$releasedOn= new DateTime($detail->ReleasedOn, new DateTimeZone('Asia/Kolkata'));
?>
<table width="200%">
<tr>
<td><b>ReleasedBy:</b></td>
<td><b>ReleasedOn:</b></td>
</tr>
<tr>
<td><?php echo $detail->FirstName;?></td>
<td><?php echo $releasedOn->format('d-m-Y');?></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<?php
}
}
else {
?>
<table width="200%">
<tr>
<td><b>Till Release State:</b></td>
</tr>
</table>
<?php } ?>
</div>
</div>