375 lines
13 KiB
PHP
Executable File
375 lines
13 KiB
PHP
Executable File
<?php
|
|
|
|
|
|
$PONO = '';
|
|
$postatus ='';
|
|
$CompanyAddress = '';
|
|
$CompanyName = '';
|
|
$SuplierName = '';
|
|
$SuplierAddress = '';
|
|
$DeliveryAddress = '';
|
|
$Podt = '';
|
|
$DeliveryDate ='';
|
|
$DeliverySchedule='';
|
|
$ServiceDescription = '';
|
|
$ReqBy='';
|
|
$PaymentTerms='';
|
|
$advance=0;
|
|
$SupEmail='';
|
|
$supplierPAN='';
|
|
$InsuranceNo='';
|
|
$InsuranceStatus='';
|
|
$InsureOpt='';
|
|
|
|
|
|
$index=0;
|
|
if(!empty($CompanyDetails))
|
|
{
|
|
foreach ($CompanyDetails as $CO)
|
|
{
|
|
$CompanyName = $CO->CompanyName;
|
|
$CompanyAddress = $CO->Address;
|
|
$companyEmail=$CO->EmailAddress;
|
|
$companyGst=$CO->GSTNO;
|
|
$companyPan=$CO->PAN;
|
|
$companyWebsit=$CO->companyWebsite;
|
|
$CompanyStateCode=$CO->StateCode;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
foreach ($GetPoFormat[0] as $For)
|
|
{
|
|
$PONO = $For;
|
|
|
|
}
|
|
|
|
|
|
$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;
|
|
$Paydescription='';
|
|
$PaymentTerms = $PO->Pay;
|
|
if($PO->Pay=='Others')
|
|
{
|
|
$PaymentTerms=$PO->PaymentOtherDescription;
|
|
}
|
|
//$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;
|
|
|
|
|
|
}
|
|
|
|
|
|
$supOfferNo=$PO->Supplier_Offer_No;
|
|
|
|
$ourRef=$PO->Other_Reference;
|
|
$SupEmail=$PO->EmailAddress;
|
|
$supplierVendor=$PO->SupplierID;
|
|
$supplierPAN=$PO->PAN;
|
|
$SupplierContact=$PO->ContactNumber;
|
|
$supplierGST=$PO->GSTNO;
|
|
$finCap=$PO->Fincap;
|
|
$ModeOfShipment=$PO->Mode_Of_Shipment;
|
|
$Supplier_Reference=$PO->Supplier_Reference;
|
|
|
|
if($PO->InsuranceStatus=='1')
|
|
{
|
|
$InsuranceStatus='YES';
|
|
$InsuranceNo=$PO->InsuranceNumber;
|
|
}
|
|
|
|
else
|
|
{
|
|
$InsuranceStatus='NO';
|
|
$InsuranceNo='No';
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
//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;
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
<body>
|
|
<br>
|
|
<br>
|
|
|
|
|
|
<div style="overflow: auto;">
|
|
|
|
<table>
|
|
<tr>
|
|
|
|
<td style="border: none;">Please arrange to deliver the materials/ services listed below as per schedule to our works</td>
|
|
</tr>
|
|
</table>
|
|
<table style="border-collapse: collapse;border-bottom:1px solid black;" width="100%">
|
|
<thead style="background-color: #d2d2d2;">
|
|
<tr style="border-right: 1px solid black ;border-top: 1px solid black ;border-bottom: 1px solid black;
|
|
border-left: 1px solid black;background-color: #d2d2d2;">
|
|
<td width="3%" style="text-align: center;border-right: 1px solid black ;"><strong>SNo</strong></td>
|
|
<td width="5%" style="text-align: center;border-right: 1px solid black ;"><strong>Item Code</strong></td>
|
|
<td width="25%" style="text-align: center;border-right: 1px solid black ;"><strong>ITEM DESCRIPTION</strong></td>
|
|
<td width="5%" style="text-align: center;border-right: 1px solid black ;"><strong>HSN</strong></td>
|
|
<td width="5%" style="text-align: center;border-right: 1px solid black ;"><strong>UOM</strong></td>
|
|
<td width="5%" style="text-align: center;border-right: 1px solid black ;"><strong>QTY</strong></td>
|
|
<td width="5%" style="text-align: center;border-right: 1px solid black ;"><strong>Rate <?php echo "$CurrencyCode ($CurrencyName)"?></strong></td>
|
|
<td width="5%" style="text-align: center;border-right: 1px solid black ;"><strong>PER</strong></td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?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 style="border: none;">
|
|
<td style="text-align: center;border-right: 1px solid black;
|
|
border-left: 1px solid black;"><?php echo $index ; ?></td>
|
|
<td style="text-align: center;border-right: 1px solid black;
|
|
border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialCode ; ?></span></td>
|
|
<td style="text-align: center;border-right: 1px solid black;
|
|
border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialName.$record->ServiceMaterialDescription ; ?></span></td>
|
|
<td style="text-align: center;border-right: 1px solid black;
|
|
border-left: 1px solid black;"><?php echo $record->HSNCODE;?></td>
|
|
<td style="text-align: center;border-right: 1px solid black;
|
|
border-left: 1px solid black;"><?php echo $record->UOM ; ?></td>
|
|
<td style="text-align: center;border-right: 1px solid black;
|
|
border-left: 1px solid black;"><?php echo $record->Quantity ; ?></td>
|
|
<td style="text-align: center;border-right: 1px solid black;
|
|
border-left: 1px solid black;"><?php echo $record->Rate ; ?></td>
|
|
<td style="text-align: center;border-right: 1px solid black;
|
|
border-left: 1px solid black;"><?php echo $record->Per ; ?></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;
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
<?php for($index = ++$index;$index <10;$index++) { ?>
|
|
<tr style="border: none;">
|
|
<td style="text-align: center;border-right:1px solid black;
|
|
border-left:1px solid black;border-bottom:1px solid black;"> <br><br></td>
|
|
<td style="text-align: center;border-right:1px solid black;
|
|
border-left:1px solid black;border-bottom:1px solid black;"> </td>
|
|
<td style="text-align: center;border-right:1px solid black;
|
|
border-left:1px solid black;border-bottom:1px solid black;"></td>
|
|
<td style="text-align: center;border-right:1px solid black;
|
|
border-left:1px solid black;border-bottom:1px solid black;"></td>
|
|
<td style="text-align: center;border-right:1px solid black;
|
|
border-left:1px solid black;border-bottom:1px solid black;"></td>
|
|
<td style="text-align: center;border-right:1px solid black;
|
|
border-left:1px solid black;border-bottom:1px solid black;"></td>
|
|
<td style="text-align: center;border-right:1px solid black;
|
|
border-left:1px solid black;border-bottom:1px solid black;"></td>
|
|
<td style="text-align: center;border-right:1px solid black;
|
|
border-left:1px solid black;border-bottom:1px solid black;"></td>
|
|
</tr>
|
|
<?php }?>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
<?php
|
|
$i=0;
|
|
if(!empty($POItem))
|
|
{
|
|
foreach($POItem as $x){
|
|
if($x->ParentPO != ''){
|
|
$i++;
|
|
}
|
|
}
|
|
}
|
|
if($i>0){
|
|
?>
|
|
|
|
<table style="border-collapse: collapse;border-left-style:hidden;border-right-style:hidden;" 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>Current Details</strong></td>
|
|
<td style="text-align: center;" rowspan="2"><strong>Revised Details</strong></td>
|
|
</tr>
|
|
|
|
|
|
|
|
<?php if(!empty($POItem))
|
|
{
|
|
foreach($POItem as $record)
|
|
{
|
|
echo $record->LineAmend ;
|
|
}
|
|
} ?>
|
|
<tr>
|
|
<td style="text-align: center;"><strong>Total</strong></td>
|
|
<td style="text-align: center;" rowspan="2"><b>Current Total Order :<?php echo $AmendmentPDF[0]->partenttotalorder ?></b></td>
|
|
<td style="text-align: center;" rowspan="2"><b>Revised Total Order :<?php echo $AmendmentPDF[0]->TotalOrderValue ?></b></td>
|
|
</tr>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<?php } ?>
|
|
|
|
<div style="text-align: left;padding-left: 2px;"><strong style="padding-left: 1px;">Special instructions:</strong><?php echo $ServiceDescription;?></div>
|
|
</div>
|
|
<div style="position: fixed;bottom:-26px;">
|
|
<table style="border-collapse: collapse; border-bottom-style:hidden;" border="1" width="100%" cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr>
|
|
<td style="width: 40%;" colspan="4" rowspan="3">
|
|
<p><strong style="padding-left: 2px;">Payment terms</strong>:</p>
|
|
<span style="padding-left: 2px;"><?php echo $PaymentTerms?></span>
|
|
</td>
|
|
<td style="text-align: center;background-color: #d2d2d2;" colspan="2"><strong>Total Amount In</strong></td>
|
|
<td style="text-align: center;background-color: #d2d2d2;" colspan="2"><strong>Order Value</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: center;" colspan="2"><?php echo "$CurrencyCode ($CurrencyName)" ;?> <?php echo number_format($TotalOrderValue1,2,'.','');?></td>
|
|
<td style="text-align: center;" colspan="2"><?php echo "$CurrencyCode ($CurrencyName)" ;?> <?php echo number_format($TotalOrderValue1,2,'.','');?></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4"><strong style="padding-left: 2px;"> Order value in words:</strong> <br><span style="padding-left: 2px;"><?php echo $TotalAmountInWords." ";?></span></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
|
|
|
|
|