434 lines
14 KiB
PHP
Executable File
434 lines
14 KiB
PHP
Executable File
<?php
|
|
|
|
$PONO = '';
|
|
$postatus ='';
|
|
$CompanyAddress = '';
|
|
$CompanyName = '';
|
|
$SuplierName = '';
|
|
$SuplierAddress = '';
|
|
$DeliveryAddress = '';
|
|
$Podt = '';
|
|
$DeliveryDate ='';
|
|
$DeliverySchedule='';
|
|
$postatus='';
|
|
$ServiceDescription = '';
|
|
$PaymentTerms = '';
|
|
$PaymentOtherDescription='';
|
|
$type='';
|
|
$value='';
|
|
$amt='';
|
|
$totaltaxonly=0;
|
|
$advance=0;
|
|
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;
|
|
$advance=$PO->AdvanceAmount;
|
|
$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;
|
|
if($PaymentTerms=='Others'){
|
|
$PaymentOtherDescription=$PO->PaymentOtherDescription;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
$currencyName='INR';
|
|
$currencyCode ='';
|
|
if(!empty($CurrencySymbol))
|
|
{
|
|
foreach ($CurrencySymbol as $Curr)
|
|
{
|
|
|
|
$currencyCode = $Curr->FontCode2000;
|
|
//$currencyName = $currencyName;
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!empty($ParentMaster)){
|
|
foreach($ParentMaster as $pm){
|
|
$PPaymentTerms = $pm->PaymentTerms;
|
|
|
|
$PDeliverydate= $pm->DeliveryDate;
|
|
$dtDe = new DateTime($PDeliverydate, new DateTimeZone('Asia/Kolkata'));
|
|
$PDeliverydate = $dtDe->format('d-m-Y');
|
|
$PDeliverySchedule=$pm->DeliverySchedule;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
?>
|
|
<style>
|
|
@page { margin: 240px 50px 30px 50px; }
|
|
.header { position: fixed; left: 0px; top: -240px; 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 style="text-align:right;">
|
|
<?php
|
|
if ($postatus == PO_RELEASED || $postatus == PO_SERVICE_COMPLETED || $postatus == MRIR_APPROVED || $postatus == MRIR_REJECTED || $postatus == IGR_CREATED)
|
|
{}
|
|
else
|
|
{
|
|
echo '<div><b>DRAFT</b> </div>';
|
|
|
|
}
|
|
|
|
?>
|
|
</div>
|
|
<div> </div>
|
|
<center> <span style="font-size:24px;">PURCHASE ORDER - <a style="color:#515151">PO NO:<?php echo $PONO?>/R </a></span></center>
|
|
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr>
|
|
<td style="width:1px;"><img width="125" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA11JREFUeNrsnT9IH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a2GaCQRIgARIESABEiABUgRIgARYRoAVYtBWBfcL/xb8hwS6av8VYADVjF2M5sTWJAAAAABJRU5ErkJggg=="></td>
|
|
|
|
<td colspan="3">
|
|
<p style="text-align: center; color:#3c8dbc;font-size:16px;""><?php echo $CompanyName; ?></p>
|
|
<p style="text-align: center;"><?php echo $CompanyAddress; ?></p>
|
|
</td>
|
|
<td colspan="1">
|
|
<p>PO NO:<?php echo $PONO?></p>
|
|
<p>Date: <?php echo $Podt?></p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>Supplier :</p>
|
|
|
|
</td>
|
|
<td colspan="3" style="text-align: center;"><?php echo $SuplierName?><br /><?php echo $SuplierAddress ?> </td>
|
|
<td colspan="1">DELIVERY DATE / SCHEDULE BY: <?php echo $DeliveryDate.$DeliverySchedule;?><br /><br /></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div class="page" style="font-size:12px;">
|
|
|
|
<?php
|
|
if(!empty($RequistionDetails))
|
|
{
|
|
|
|
foreach($RequistionDetails as $ReqDetails)
|
|
{
|
|
|
|
?>
|
|
|
|
<p>Indent ref: <?php echo $ReqDetails['RequistionNo']; ?>/<?php $date = new DateTime($ReqDetails['ReqDate'],new DateTimeZone('Asia/Kolkata')); $date=$date->format("Y-m-d"); echo $date; ?>/ dept:<?php echo $ReqDetails['RequestedDept']; ?> / ccd:<?php echo $ReqDetails['CostCenterCode']; ?> </p>
|
|
<?php
|
|
}
|
|
}
|
|
|
|
?>
|
|
<!-- <table style="border-collapse: collapse;" border="1" width="50%%" cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<!-- <tr style="background:#8c8c8c;color:#fff;">
|
|
<td style="text-align: center;">Requisition Number</td>
|
|
<td style="text-align: center;">Requisition Date</td>
|
|
<td style="text-align: center;">Requested Department</td>
|
|
<td style="text-align: center;">Cost Center</td>
|
|
</tr>
|
|
<?php
|
|
if(!empty($RequistionDetails))
|
|
{
|
|
//print_r($RequistionDetails);die();
|
|
foreach($RequistionDetails as $ReqDetails)
|
|
{
|
|
|
|
?>
|
|
<tr style="">
|
|
<td style="text-align: center;"><?php echo $ReqDetails['RequistionNo']; ?></td>
|
|
<td style="text-align: right;"><?php $date = new DateTime($ReqDetails['ReqDate'],new DateTimeZone('Asia/Kolkata')); $date=$date->format("Y-m-d"); echo $date; ?></td>
|
|
|
|
<td style="text-align: center;"><?php echo $ReqDetails['RequestedDept']; ?></td>
|
|
<td style="text-align: center;"><?php echo $ReqDetails['CostCenterCode']; ?></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
}
|
|
|
|
?>
|
|
</tbody>
|
|
</table> -->
|
|
|
|
<p>Please arrange to deliver the materials listed below as per schedule to our works</p><!--Data should be come-->
|
|
|
|
|
|
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="background:#8c8c8c;color:#fff;">
|
|
<td style="text-align: center;">S No</td>
|
|
<td style="text-align: center;">Item code</td>
|
|
<td style="text-align: center;">Item Name/ Description</td>
|
|
<td style="text-align: center;">HSN Code</td>
|
|
<td style="text-align: center;">UOM</td>
|
|
|
|
<td style="text-align: center;">Quanitity</td>
|
|
<td style="text-align: center;">Unit Rate</td>
|
|
<!-- <td style="text-align: center;">Basic Value In INR</td> -->
|
|
<td style="text-align: center;">Discount</td>
|
|
|
|
<td style="text-align: center;">IGST%</td>
|
|
<td style="text-align: center;">SGST%</td>
|
|
<td style="text-align: center;">CGST%</td>
|
|
<td style="text-align: center;">Packing</td>
|
|
<!-- <td style="text-align: center;">Insurance In INR</td> -->
|
|
<td style="text-align: center;">Freight</td>
|
|
<!-- <td style="text-align: center;">Total Amount In INR</td> -->
|
|
</tr>
|
|
|
|
<?php
|
|
if(!empty($POItem))
|
|
{
|
|
|
|
$SubTotalAmount = 0;
|
|
$index = 0;
|
|
$TotalAmount = 0;
|
|
$OrderValue = 0;
|
|
|
|
$AfterSGST = 0;
|
|
$AfterCGST = 0;
|
|
$AfterIGST = 0;
|
|
$Insurance = 0;
|
|
$AfterFreightValue = 0;
|
|
$AfterDiscount = 0;
|
|
$AfterPackaging = 0;
|
|
|
|
foreach($POItem as $record)
|
|
{
|
|
$index = $index + 1;
|
|
|
|
?>
|
|
<tr>
|
|
<td style="text-align: center;"><?php echo $index ; ?></td>
|
|
<td style="text-align: center;"><?php echo $record->MaterialCode ; ?></td>
|
|
<td style="text-align: center;"><?php echo $record->MaterialName ; ?></td>
|
|
<td style="text-align: center;"><?php if(!empty($record->HSNCODE)){echo $record->HSNCODE;}else{echo "NIL";} ; ?></td>
|
|
<td style="text-align: center;"><?php echo $record->UOM ; ?></td>
|
|
|
|
<td align="right"><?php echo $record->Quantity ; ?></td>
|
|
<td align="right"><?php echo $record->Rate ; ?></td>
|
|
<!-- <td align="right"><?php echo number_format($record->BasicValue,2,'.','') ; ?></td> -->
|
|
|
|
<td style="text-align: right;"><?php if($record->DiscountType == 'PERCENTAGE'){$type="%";}else if($record->DiscountType == 'LUMP SUM'){$type="LS";}else if($record->DiscountType == 'NIL'){$type='';} echo $record->DiscountValue . $type;?></td>
|
|
|
|
<td style="text-align: right;"><?php echo $record->IGST."%";?></td>
|
|
<td style="text-align: right;"><?php echo $record->SGST."%";?></td>
|
|
<td style="text-align: right;"><?php echo $record->CGST."%";?></td>
|
|
<td style="text-align: right;"><?php if($record->PackagingType == 'PERCENTAGE'){$type="%";}else if($record->PackagingType == 'LUMP SUM'){$type="LS";}else if($record->PackagingType == 'NIL'){$type='';} echo $record->PackagingValue . $type;?></td>
|
|
<!-- <td style="text-align: right;"><?php echo $l->Insurance;?></td> -->
|
|
<td style="text-align: right;"><?php if($record->FreightType == 'PER TRIP'){$type="TRIP"; echo $record->FreightValue ."*" . $record->NoOfTrip . $type;}else{ if($record->FreightType == 'LUMP SUM'){$type="LS";}else if($record->FreightType == 'NIL'){$type='';}else if($record->FreightType == 'PER UOM'){$type='UOM';}else if($record->FreightType == 'PERCENTAGE'){$type='%';} echo $record->PackagingValue . $type;}?></td>
|
|
<!-- <td style="text-align: right;"><?php echo number_format((($l->BasicValue + $tax)-($l->AfterDiscount)),2,'.','');?></td> -->
|
|
<?php
|
|
$SubTotalAmount = $SubTotalAmount + $record->BasicValue;
|
|
|
|
$AfterCGST =$AfterCGST + $record->AfterCGST;
|
|
$AfterSGST =$AfterSGST + $record->AfterSGST;
|
|
$AfterIGST =$AfterIGST + $record->AfterIGST;
|
|
|
|
$Insurance =$Insurance + $record->Insurance;
|
|
$AfterFreightValue =$AfterFreightValue + $record->AfterFreightValue;
|
|
$AfterDiscount = $AfterDiscount + $record->AfterDiscount ;
|
|
$AfterPackaging=$AfterPackaging+$record->AfterPackagingValue;
|
|
$totaltaxonly=($AfterCGST+$AfterSGST+$AfterIGST+$Insurance+$AfterFreightValue+$AfterPackaging);
|
|
}
|
|
|
|
$OrderValue = (( $SubTotalAmount + $AfterCGST +$AfterIGST+$AfterSGST +$Insurance +$AfterFreightValue+$AfterPackaging) - $AfterDiscount) ;
|
|
}?>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<?php
|
|
$i=0;
|
|
if(!empty($POItem))
|
|
{
|
|
foreach($POItem as $x){
|
|
if($x->ParentPO != ''){
|
|
$i++;
|
|
}
|
|
}
|
|
}
|
|
if($i>0){
|
|
?>
|
|
<table style="border-collapse: collapse;font-size:12px;" cellpadding="0" cellspacing="0" border="1" width="100%">
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align: center;" colspan="3">
|
|
<p>Amended Details</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3">
|
|
<?php
|
|
if(!empty($POItem))
|
|
{
|
|
|
|
foreach($POItem as $v)
|
|
{
|
|
echo "<b>" . $v->AmendedDetails . "</b>";
|
|
break;
|
|
}
|
|
}?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: center;"><strong>Item Description</strong></td>
|
|
<td style="text-align: center;" rowspan="2"><strong>Previous Details</strong></td><td style="text-align: center;" rowspan="2" ><strong>Current Details</strong></td>
|
|
</tr>
|
|
|
|
|
|
|
|
<?php if(!empty($POItem))
|
|
{
|
|
|
|
foreach($POItem as $record)
|
|
{
|
|
echo $record->LineAmend ;
|
|
}
|
|
} ?>
|
|
</tbody>
|
|
</table>
|
|
<?php
|
|
}?>
|
|
|
|
<p> <b>Payment Terms :</b> <?php echo $PaymentTerms ." ".$PaymentOtherDescription;?> </p>
|
|
<div> <b>Special Instruction:</b><br/><?php echo $ServiceDescription;?></div>
|
|
|
|
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align: center;" rowspan="5">
|
|
<p><strong>Total Amount In Words :</strong><br /><br /><b><i><?php echo $TotalAmountInWords;?></i></b></p>
|
|
<p> </p>
|
|
</td>
|
|
<td style="text-align: right;"> <strong>Total Amount Before Tax In INR </strong></td>
|
|
<td style="text-align: right;"><?php echo number_format(($SubTotalAmount-$AfterDiscount),2,'.',''); ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;"> <strong>Total Tax Amount In INR <strong></td>
|
|
<td style="text-align: right;"><?php echo number_format($totaltaxonly,2,'.','');?></td>
|
|
</tr>
|
|
<tr>
|
|
|
|
<td style="text-align: right;"> <strong>Total Amount After Tax In INR </strong></td>
|
|
<td style="text-align: right;"> <?php echo number_format($OrderValue,2,'.','');?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;"><strong>Advance Amount Paid In INR </strong></td>
|
|
<td style="text-align: right;"><?php echo number_format($advance,2,'.','');?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;"><strong>Balance Needs to be pay In INR </strong></td>
|
|
<td style="text-align: right;"><?php echo number_format(($OrderValue-$advance),2,'.','');?></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
|
|
|
|
|
|
<?php
|
|
if(!empty($releasedetails)){
|
|
$releasedOn = '';
|
|
foreach($releasedetails as $detail){
|
|
$releasedOn= new DateTime($detail->ReleasedOn, new DateTimeZone('Asia/Kolkata'));
|
|
|
|
|
|
?>
|
|
|
|
<p> </p>
|
|
<div align="Left"> <b>Released By : </b><?php echo $detail->FirstName;?></div>
|
|
<div align="Left"> <b>Released On : </b><?php echo $releasedOn->format('d-m-Y');?></div>
|
|
<?php
|
|
}
|
|
}
|
|
else {
|
|
|
|
?>
|
|
|
|
|
|
<?php } ?>
|
|
</td>
|
|
<td style="text-align: center;" colspan="2">
|
|
|
|
<p> </p>
|
|
<p>Authorized Signatory</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
<p></p>
|
|
|
|
<p>Note: Please acknowledge receipt of this order for acceptance</p>
|
|
<p> Material to be delivered to our stores before 3pm </p>
|
|
<p> Please refer order number and item code in your challan/invoice </p>
|
|
<p> </p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|