153 lines
3.9 KiB
PHP
Executable File
153 lines
3.9 KiB
PHP
Executable File
<?php
|
|
|
|
$RequestedBy= $requestedBy[0]->FirstName;
|
|
$RequestedByDept=$requestedBy[0]->DepartmentName ;
|
|
|
|
$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;
|
|
|
|
$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>CAPITAL PURCHASE ORDER</h2>
|
|
<a style="color:#515151"><?php echo $PONO?></a></center>
|
|
Purchase Order Date :<?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?>. </td>
|
|
<td><a style="color:#3c8dbc">Delivery To</a><br/> <?php echo $DeliveryAddress?>. </td>
|
|
<td> Delivery Date :<?php echo $DeliveryDate?> </td>
|
|
</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>Total Amount(INR)</th>
|
|
</tr>
|
|
|
|
<?php
|
|
if(!empty($POItem))
|
|
{
|
|
|
|
$TotalOrderValue=0;
|
|
$index=0;
|
|
$BasicValue=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>
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
$TotalOrderValue = $TotalOrderValue+$BasicValue;
|
|
}
|
|
}
|
|
|
|
?>
|
|
</table>
|
|
|
|
|
|
|
|
<br>
|
|
<br>
|
|
<div align="right">
|
|
<hr/>
|
|
<p>Sub Total Amount(INR):<?php echo number_format($TotalOrderValue,2);?></p>
|
|
<hr/>
|
|
<table>
|
|
<tr>
|
|
<td>Total Amount In Words:</td>
|
|
<td><?php echo $TotalAmountInWords." "."Only.";?></td>
|
|
|
|
</tr>
|
|
</table>
|
|
<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 $RequestedBy; ?></td></td>
|
|
<td>Requisted Department :<br/><?php echo $RequestedByDept; ?></td>
|
|
<td>Cost center :<br/><?php echo $CostCenterCode ; ?></td>
|
|
</tr>
|
|
|
|
</table>
|
|
<div> Payment Terms *<br/><?php echo $PaymentTerms;?></div>
|
|
<div></div>
|
|
|
|
</div>
|
|
</div>
|