siddharth_application/application/views/revenuepopdf.php
venbatechnologies@gmail.com 81d797031c all pdf check in
2017-07-07 20:08:53 +05:30

300 lines
8.6 KiB
PHP
Executable File

<?php
$PONO = '';
$CompanyAddress = '';
$CompanyName = '';
$SuplierName = '';
$SuplierAddress = '';
$DeliveryAddress = '';
$Podt = '';
$DeliveryDate ='';
$postatus='';
$ServiceDescription = '';
$PaymentTerms = '';
$PaymentDays='';
$PayableAT='';
if(!empty($CompanyDetails))
{
foreach ($CompanyDetails as $CO)
{
$CompanyName = $CO->CompanyName;
$CompanyAddress = $CO->Address;
}
}
if(!empty($POItem))
{
foreach ($POItem as $PO)
{
$PONO = $PO->PONO;
$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');
$dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata'));
$DeliveryDate = $dtDe->format('d-m-Y');
$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;
}
}
?>
<div><center><h2>REVENUE PURCHASE ORDER</h2><a style="color:#515151">PO NO:<?php echo $PONO?> </a></center></div>
<div align="right">
<?php
if ($postatus == 'ST026')
{}
else
{
echo '<div>This is Draft Version For Internal Purpose</div>';
}
?>
<?php echo $Podt?>
</div>
<p><center>
<b style="color:#3c8dbc"><?php echo $CompanyName; ?></b><br/> <?php echo $CompanyAddress; ?></center></p>
<p align="right">Payment Terms :<?php echo $PaymentTerms;?><br/> Payable At:<?php echo $PayableAT;?><br/> Payment Days:<?php echo $PaymentDays;?><br/>Delivery Date :<?php echo $DeliveryDate;?></p>
<br/>
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="105%"><tr><td>
<p><a style="color:#3c8dbc">Vendor Address : </a> <br/> <?php echo $SuplierName?> <br/><?php echo $SuplierAddress ?></p></td><td>
<p><a style="color:#3c8dbc">Delivery To :</a><br/> <?php echo $DeliveryAddress?><p></td>
</tr></table>
<br/>
<br/>
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="105%">
<tr style="background:#000;color:#fff;">
<th>#</th>
<th>Item Description</th>
<th>Qty</th>
<th>Rate <?php echo 'Rate in '.$currencyCode;?></th>
<th>Amount <?php echo 'Rate in '.$currencyCode;?></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 <?php echo 'Rate in '.$currencyCode;?></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="105%">
<!--<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 :</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:#000;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)){
foreach($releasedetails as $detail){
?>
<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 $detail->ReleasedOn;?></td>
</tr>
</table>
<?php
}
}
else {
?>
<table width="200%">
<tr>
<td><b>Till Release State:</b></td>
</tr>
</table>
<?php } ?>
</div>