421 lines
15 KiB
PHP
Executable File
421 lines
15 KiB
PHP
Executable File
<?php
|
|
|
|
|
|
$PONO = '';
|
|
$postatus ='';
|
|
$CompanyAddress = '';
|
|
$CompanyName = '';
|
|
$SuplierName = '';
|
|
$SuplierAddress = '';
|
|
$DeliveryAddress = '';
|
|
$Podt = '';
|
|
$DeliveryDate ='';
|
|
$DeliverySchedule='';
|
|
$ServiceDescription = '';
|
|
$ReqBy='';
|
|
$PaymentTerms='';
|
|
$advance=0;
|
|
|
|
|
|
$index=0;
|
|
if(!empty($CompanyDetails))
|
|
{
|
|
foreach ($CompanyDetails as $CO)
|
|
{
|
|
$CompanyName = $CO->CompanyName;
|
|
$CompanyAddress = $CO->Address;
|
|
}
|
|
}
|
|
|
|
$TotalOrderValue1='';
|
|
$PlaceofOrigin='';
|
|
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;
|
|
$advance=$PO->AdvanceAmount;
|
|
$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;
|
|
//$ReqBy=$PO->Requestedby;
|
|
$TotalOrderValue1=$PO->TotalOrderValue;
|
|
|
|
$PaymentTerms = $PO->Pay;
|
|
//$PaymentDays=$PO->PaymentDays;
|
|
//$PayableAT=$PO->PayableAT;
|
|
$PlaceofOrigin=$PO->Import_PlaceofOrgin;
|
|
|
|
if($PO->DeliveryOption=='1'){
|
|
$DeliveryDate = '';
|
|
$DeliverySchedule = $PO->DeliverySchedule;
|
|
$Import_DispatchDetails='';
|
|
}
|
|
else{
|
|
$dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata'));
|
|
$DeliveryDate = $dtDe->format('d-m-Y');
|
|
$DeliverySchedule = '';
|
|
$Import_DispatchDetails=$PO->Import_DispatchDetails;
|
|
}
|
|
}
|
|
}
|
|
//echo $SuplierName;
|
|
|
|
if(!empty($Requestername))
|
|
|
|
{
|
|
foreach ($Requestername as $Reqname)
|
|
{
|
|
$ReqBy=$Reqname->FirstName;
|
|
}
|
|
}
|
|
|
|
$CurrencyCode='';
|
|
$CurrencyName='';
|
|
|
|
if(!empty($Currencytype))
|
|
{
|
|
foreach ($Currencytype as $CURRE)
|
|
{
|
|
$CurrencyCode=$CURRE->Currency_Code;
|
|
$CurrencyName=$CURRE->FontCode2000;
|
|
}
|
|
|
|
}
|
|
|
|
// echo $CurrencyCode;
|
|
|
|
$DEPNAME='';
|
|
|
|
if(!empty($DEPCODE))
|
|
{
|
|
foreach ($DEPCODE as $DEP)
|
|
{
|
|
$DEPNAME=$DEP->DepartmentName;
|
|
}
|
|
}
|
|
|
|
?>
|
|
<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?>/I </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,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA11JREFUeNrsnT9IHEEYxWfFw8rgpUhlo5URi2gTbIUUSrq1ui4oRLRIY9JIKrGKTQrBgJLuuutEi4CtSSOpPIuATdIEcid2YpN9C3sc8c6bf7uZmX0P7k7ultm7337zzXxvZjGaiaIfQoiqoHTUHk6eniSPUbLQUmUoebojB23dDZGBmQiQAAmQAAmQIkACJEACpAiweA3bbvDV5mb6+iKOxfTc3MDjf15dicbBQfr3591d7wBGM1H0J3l9bNLI84UFsby6mkIzFWACJMCafJ9PJyfSx29vbHQuoqJaxl34zc5O+mVtwIPi5EIcXV52IjnoLvx+by/9wXkIF8aHbq0dgYi4vOB1Q7QV2c4BXM4Z3r+RGBTAR9VqmqhVBoZnIyOdx9taTXqQGJ+YUDqXFwBV4WGU69aXRkNsr69LtyEzHfIKIKJCVl9PT3u+/63P+6bnC64SuWm3jdsYn5xkKcdamCJAAiwjQJcHAC8ATs/OBg1Qy0y4ub6WPhb1cuPwUFycn9/77OPWlvXzeQGw2QPGQ9o/PhZrS0v3IPpooFrpwgChYniidq6fnTnvrBSaA3Uc3A/1uvPuSmEA0f0uFLsyBKcZDjaisvSj8DsFW6pbcHPQpV12WQoBCHhri4taEOGwhJAXjeeBgFebn1eyp0LKi1Ym0rCsXieRqLk06HVetFqJwHmWnRz3yotHzabT9n0hpRxGZ0SjjpGKCEQkxgUtWDlbCyMfIi/qTHMgrDf7srCem5mQDS5YQNKRD2vCuQLMhCVM3bwIiK4PLIUYqrp5EXPFeGWFALO8CEdGddId7NYOHWFQUa1cUO4Fty78/fZW6tFrjx7gqfqAT0PbmWAqVCwq+bDUOxMeyokh6L8B1J1kE2BgIkACJMDyAbSx56/cACV3CoyOjfX9rNSrcrI7E/qVYYCnYhKY3LXkJECVOdx+Us51m6Nwm7HVQyUCf4UGEJuFZPMgIhC+XlYfw21WWQ/GxXJ50q09iBS1MSjYW73ww3SXMVXOobsk4MU80GQZc5DQbl5tOzWRRpS8nJqy1tUAzWZ7ecvKDdfdggWfTV0GbdnA4JB1UdhbHjo0LesAS6YWa2GaCQRIgARIESABEiABUgRIgARYRoAVYtBWBfcL/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">DISPATCH INSTRUCTION / SCHEDULE BY: <?php echo $Import_DispatchDetails.$DeliverySchedule;?><br /><br /></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="page" style="font-size:12px;">
|
|
|
|
|
|
|
|
<p>Indent ref: <?php echo $ReqNo;?>/ dept:<?php echo $DEPNAME; ?> / ccd:<?php echo $CostCenterCode; ?> </p>
|
|
|
|
|
|
|
|
<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;" cellpadding="0" cellspacing="0" border="1" width="100%">
|
|
<tbody>
|
|
<tr bgcolor="#8c8c8c" color="#fff">
|
|
<td style="text-align: center;">Requistion Number</td>
|
|
<td style="text-align: center;">Requistion Date</td>
|
|
<td style="text-align: center;">Requested By</td>
|
|
<td style="text-align: center;">Requested Department</td>
|
|
<td style="text-align: center;">Cost Center</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td style="text-align: center;"><?php echo $ReqNo;?></td>
|
|
<td style="text-align: center;">03/08/2017</td>
|
|
<td style="text-align: center;"><?php echo $ReqBy;?></td>
|
|
<td style="text-align: center;"><?php echo $DEPNAME?></td>
|
|
<td style="text-align: center;"><?php echo $CostCenterCode?></td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table> -->
|
|
|
|
|
|
<table style="border-collapse:collapse;" cellpadding="0" cellspacing="0" border="1" width="100%" >
|
|
<tr style="background:#8c8c8c;color:#fff;">
|
|
<th style="text-align: center;">#</th>
|
|
<th style="text-align: center;">Item and Description</th>
|
|
<th style="text-align: center;">HSN Code</th>
|
|
<th style="text-align: center;">UOM</th>
|
|
<th style="text-align: center;">Qty</th>
|
|
|
|
<th style="text-align: center;">Rate per unit in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
|
|
<th style="text-align: center;">Basic Price in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
|
|
<!-- <th>Total Amount in <?php echo "$CurrencyCode ($CurrencyName)"?></th> -->
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
if(!empty($POItem))
|
|
{
|
|
$BasicValue=0;
|
|
$ProductPrice = 0;
|
|
$AfterLandingCharge= 0;
|
|
$AfterHighSeasSalesCharge= 0;
|
|
$AfterCustomDuty = 0;
|
|
$AfterCustomEdCess = 0;
|
|
$AfterCustomSHCess = 0;
|
|
$AfterExciseDuty = 0;
|
|
$AfterExciseDutyEdCess = 0;
|
|
$ExciseDutySHCess = 0;
|
|
$AfterAddlExciseDuty = 0;
|
|
$Grossdutypayable = 0;
|
|
$AvailableModvat = 0;
|
|
$Grossexpensesduetocustomduty = 0;
|
|
$purchaseratePerKG=0;
|
|
$CustomDutyExpensesPerKG=0;
|
|
$RMCIncludingCustomersPerKG=0;
|
|
$AfterExciseDutySHCess=0;
|
|
$TotalOrderValue=0;
|
|
$index=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->MaterialName ; ?></td>
|
|
<td style="text-align: center;"><?php echo $record->HSNCODE;?></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 $BasicValue=($record->Quantity*$record->Rate);
|
|
echo number_format($BasicValue,2,'.','') ; ?></td>
|
|
<!-- <td align="right"><?php echo $record->TotalOrderValue; ?></td> -->
|
|
|
|
<!-- <td align="right"><?php $TotalOrderValue=($record->Quantity*$record->Rate);
|
|
echo number_format($BasicValue,2) ; ?></td> -->
|
|
|
|
</tr>
|
|
|
|
|
|
<?php
|
|
|
|
$AfterLandingCharge= $AfterLandingCharge+$record->AfterLandingCharge;
|
|
$AfterHighSeasSalesCharge=$AfterHighSeasSalesCharge+$record->AfterHighSeasSalesCharge ;
|
|
$AfterCustomDuty = $AfterCustomDuty+$record->AfterCustomDuty ;
|
|
$AfterCustomEdCess = $AfterCustomEdCess+$record->AfterCustomEdCess ;
|
|
$AfterCustomSHCess = $AfterCustomSHCess+$record->AfterCustomSHCess ;
|
|
$AfterExciseDuty = $AfterExciseDuty+$record->AfterExciseDuty ;
|
|
$AfterExciseDutyEdCess = $AfterExciseDutyEdCess+$record->AfterExciseDutyEdCess ;
|
|
$AfterAddlExciseDuty = $AfterAddlExciseDuty+$record->AfterAddlExciseDuty ;
|
|
$Grossdutypayable = $Grossdutypayable+$record->Grossdutypayable ;
|
|
$AvailableModvat = $AvailableModvat+$record->AvailableModvat ;
|
|
$Grossexpensesduetocustomduty = $Grossexpensesduetocustomduty+$record->Grossexpensesduetocustomduty ;
|
|
$purchaseratePerKG = $purchaseratePerKG+$record->purchaseratePerKG ;
|
|
$CustomDutyExpensesPerKG = $CustomDutyExpensesPerKG+$record->CustomDutyExpensesPerKG ;
|
|
$RMCIncludingCustomersPerKG = $RMCIncludingCustomersPerKG+$record->RMCIncludingCustomersPerKG ;
|
|
$AfterExciseDutySHCess= $AfterExciseDutySHCess+$record->AfterExciseDutySHCess ;
|
|
$TotalOrderValue = $TotalOrderValue+$record->BasicPriceInMTon;
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
</table>
|
|
<p> </p>
|
|
|
|
<p><strong>Payment Terms:</strong> <?php echo $PaymentTerms;?></p>
|
|
|
|
<div align="Left"> <b>Special Instructions :</b><br/><?php echo $ServiceDescription;?></div>
|
|
<?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 } ?>
|
|
|
|
<!-- <table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align: center;" colspan="3"> <strong>Amended Details</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"><strong>Amended Payment Terms :</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: center;"><strong>Item Description</strong></td>
|
|
<td style="text-align: center;">Previous Details</td>
|
|
<td style="text-align: center;">Current Details</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td style="text-align: center;" rowspan="3"> RMT022</td>
|
|
<td> Amended Qty :20.00</td>
|
|
<td> Current Qty : 5.00</td>
|
|
</tr>
|
|
<tr>
|
|
<td> Amended Rate :200.00</td>
|
|
<td> Current rate:500.00</td>
|
|
</tr>
|
|
<tr>
|
|
<td> Amended Insurance value: 40:00</td>
|
|
<td> Current Insurance Value :50:00</td>
|
|
</tr>
|
|
</tbody>
|
|
|
|
</table> -->
|
|
<p> </p>
|
|
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align: center;" rowspan="3"><strong>Total Amount In Words</strong><br /><br /><em><?php echo $TotalAmountInWords." ";?></em></td>
|
|
<td style="text-align: right;" ><strong>Total Amount In </strong></td> <td style="text-align: right;"><?php echo "$CurrencyCode ($CurrencyName)" ;?> <?php echo number_format($TotalOrderValue1,2,'.','');?> </strong></td></tr>
|
|
<tr><td style="text-align: right;" ><strong>Advance Paid In </strong></td> <td style="text-align: right;"><?php echo "$CurrencyCode ($CurrencyName)" ;?> <?php echo number_format($advance,2,'.','');?> </strong></td></tr>
|
|
<tr><td style="text-align: right;" ><strong>Balance amount needs to pay </strong></td> <td style="text-align: right;"> <?php echo "$CurrencyCode ($CurrencyName)" ;?> <?php echo number_format(($TotalOrderValue1 - $advance),2,'.','');?> </strong></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>
|
|
|
|
<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>
|
|
</div>
|