siddharth_application/application/views/revenuepopdf.php
2017-07-07 10:47:31 +05:30

252 lines
7.7 KiB
PHP
Executable File

<?php
$PONO = '';
$CompanyAddress = '';
$CompanyName = '';
$SuplierName = '';
$SuplierAddress = '';
$DeliveryAddress = '';
$Podt = '';
$DeliveryDate ='';
$PaymentTerms='';
$ServiceDescription = '';
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;
$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;
}
}
if(!empty($Requestername))
{
foreach ($Requestername as $Reqname)
{
$ReqBy=$Reqname->FirstName;
//$ReqDep=$Reqname->
}
}
$CurrencyCode='';
$CurrencyName='';
if(!empty($Currencytype))
{
foreach ($Currencytype as $CURRE)
{
//$CurrencyCode=$CURRE->Currency_Code;
$CurrencyName=$CURRE->FontCode2000;
}
}
$DEPNAME='';
if(!empty($DEPCODE))
{
foreach ($DEPCODE as $DEP)
{
$DEPNAME=$DEP->DepartmentName;
}
}
?>
<div><center>
<h2>PURCHASE ORDER</h2>
</center>
</div>
<div align="right"> PO NO:<?php echo $PONO?> </div>
<div align="right"> <?php echo $Podt?> </div>
<p>
<b style="color:#3c8dbc"><?php echo $CompanyName; ?></b><br/> <?php echo $CompanyAddress; ?></p>
<table><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>
<p>
<div align="right"> Delivery Date :<?php echo $DeliveryDate?></div></p>
<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</th>
<th>Amount in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Discount in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Excise Duty in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Vat in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>CST in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>GST in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Other Taxes in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Insurance in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Freight in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Total Amount in <?php echo "$CurrencyCode ($CurrencyName)"?></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;
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->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->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 ;
}
$OrderValue = (( $SubTotalAmount + $AfterVAT + $AfterCST+$AfterGST+$AfterOtherTaxes +$Insurance +$AfterFreightValue+$AfterExciseDuty) - $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 :<?php echo "$CurrencyCode ($CurrencyName)"?></td>
<td align="right"><?php echo number_format($SubTotalAmount,2);?></td>
<br/>
</tr>
<tr>
<td align="right">Discount :<?php echo "$CurrencyCode ($CurrencyName)"?></td>
<td align="right"><?php echo number_format($AfterDiscount,2);?></td>
</tr>
<tr>
<td align="right">Excise Duty :<?php echo "$CurrencyCode ($CurrencyName)"?></td>
<td align="right"><?php echo number_format($AfterExciseDuty,2);?></td>
</tr>
<tr>
<td align="right">Vat :<?php echo "$CurrencyCode ($CurrencyName)"?></td>
<td align="right"><?php echo number_format($AfterVAT,2);?></td>
</tr>
<tr>
<td align="right">CST :<?php echo "$CurrencyCode ($CurrencyName)"?></td>
<td align="right"><?php echo number_format($AfterCST,2);?></td>
</tr>
<tr>
<td align="right">GST :<?php echo "$CurrencyCode ($CurrencyName)"?></td>
<td align="right"><?php echo number_format($AfterGST,2);?></td>
</tr>
<tr>
<td align="right">Other Taxes:<?php echo "$CurrencyCode ($CurrencyName)"?></td>
<td align="right"><?php echo number_format($AfterOtherTaxes,2);?></td>
</tr>
<tr>
<td align="right">Insurance :<?php echo "$CurrencyCode ($CurrencyName)"?></td>
<td align="right"><?php echo number_format($Insurance,2);?></td>
</tr>
<tr>
<td align="right">Freight :<?php echo "$CurrencyCode ($CurrencyName)"?></td>
<td align="right"><?php echo number_format($AfterFreightValue,2);?></td>
</tr>
<tr>
<td align="right"><p><b>Total Order Amount :<?php echo "$CurrencyCode ($CurrencyName)"?></b></p></td>
<td align="right"><b><?php echo number_format($OrderValue,2);?></b></td>
</tr>
</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){
?>
<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 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
}
}
?>
</div>