253 lines
6.0 KiB
PHP
Executable File
253 lines
6.0 KiB
PHP
Executable File
<?php
|
|
|
|
|
|
|
|
$PONO = '';
|
|
$postatus ='';
|
|
$CompanyAddress = '';
|
|
$CompanyName = '';
|
|
$SuplierName = '';
|
|
$SuplierAddress = '';
|
|
$DeliveryAddress = '';
|
|
$Podt = '';
|
|
$DeliveryDate ='';
|
|
$ServiceDescription = '';
|
|
$index=0;
|
|
$PaymentDays='';
|
|
$PayableAT='';
|
|
$PaymentTerms='';
|
|
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;
|
|
$PaymentDays=$PO->PaymentDays;
|
|
$PayableAT=$PO->PaymentTerms;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
$currencyCode ='';
|
|
$currencyName='';
|
|
if(!empty($CurrencySymbol))
|
|
{
|
|
foreach ($CurrencySymbol as $Curr)
|
|
{
|
|
|
|
$currencyCode = $Curr->FontCode2000;
|
|
$currencyName = $Curr->Currency_Code;
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
<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">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> <b style="color:#3c8dbc"><?php echo $CompanyName; ?></b><br/> <?php echo $CompanyAddress; ?></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>
|
|
<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>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
<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 in <?php echo "$currencyName"."("."$currencyCode".")"?></th>
|
|
|
|
<th>Total Amount in <?php echo "$currencyName"."("."$currencyCode".")"?></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">
|
|
|
|
<p>Total Order Amount in <?php echo "$currencyName"."("."$currencyCode".")"?>:<?php echo number_format($TotalOrderValue,2);?></p>
|
|
|
|
<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 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/>
|
|
|
|
<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>
|
|
</div>
|