This commit is contained in:
venbatechnologies@gmail.com 2017-08-03 17:07:57 +05:30
parent 0992dc306e
commit cb4ec4b86b
5 changed files with 119 additions and 116 deletions

View File

@ -1413,7 +1413,7 @@ public function mririmportpoprint($PONO)
// $this->load->View("importpopdf", $data);
$this->load->View("mririmportpopdf", $data);
$this->load->View("mrirsimportpopdf", $data);
// Add header to pdf
@ -2602,7 +2602,7 @@ function addNewImportPurchaseOrder()
$this->load->View("capitalpopdf", $data);
$this->load->View("mrircapitalpopdf", $data);
// Add header to pdf
//$this->load->view('includes/pdffooter');

View File

@ -738,7 +738,7 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
$subQuery='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails,
Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount ,
ProductPrice,Tax.*,LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,AdvanceAmount
ProductPrice,Tax.*,LineItem.CostCenterCode ,Date(ReqMast.ReqDate) as ReqDate,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,AdvanceAmount
FROM T_PurchaseOrder_LineItem LineItem
join T_Requestion_Master ReqMas on ReqMas.ReqNo=LineItem.ReqNo
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
@ -746,6 +746,7 @@ join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO
join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID
left join T_PurchaseOrder_AdvanceRequest PurAdv on POMaster.PONO=PurAdv.PONO
join T_Requestion_Master ReqMast on LineItem.ReqNo=ReqMast.ReqNo
where LineItem.PONO =?';
$query = $this->db->query($subQuery,array($PONO));
@ -1332,13 +1333,14 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
$subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue ,
LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.Address,Payment.PaymentID,Payment.PaymentTerms
LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.Address,Payment.PaymentID,Payment.PaymentTerms,AdvanceAmount
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO
join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID
join T_PaymentTerms Payment on Payment.PaymentID = POMaster.PaymentTerms
left join T_PurchaseOrder_AdvanceRequest PurAdv on POMaster.PONO=PurAdv.PONO
where LineItem.PONO =?';
$query = $this->db->query($subQuery,array($PONO));
@ -1412,6 +1414,7 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
$this->db->where('ReqMast.ReqNo',$ReqNo);
$Reqresult=$this->db->get();
$Details['RequistionNo']= $Reqresult->result()[0]->ReqNo;
$Detaisl['ReqDate']=$Reqresult->result()[0]->ReqDate;
$Details['RequestedName']= $Reqresult->result()[0]->FirstName;
$Details['RequestedDept']= $Reqresult->result()[0]->DepartmentName;
$Details['CostCenterCode']= $Reqresult->result()[0]->CostCenterCode;

View File

@ -18,6 +18,7 @@
$PayableAT='';
$Placeoforigin='';
$Import_DispatchDetails='';
$ReqDate='';
@ -38,6 +39,7 @@
foreach ($POItem as $PO)
{
$ReqNo=$PO->ReqNo;
$ReqDate=$PO->ReqDate;
$PONO = $PO->PONO;
$postatus= $PO->Status;
$SuplierName = $PO->SupplierName;
@ -171,7 +173,7 @@
<tr>
<td><?php echo $ReqNo;?></td>
<td>01/08/2017</td><!--Requistion Date code should come from DB-->
<td><?php echo $ReqDate;?></td><!--Requistion Date code should come from DB-->
<td><?php echo $ReqBy;?></td>
<td><?php echo $DEPNAME?></td>
<td><?php echo $CostCenterCode?></td>

View File

@ -121,7 +121,7 @@
?>
</div>
<center> <span style="font-size:24px;">PURCHASE ORDER - <a style="color:#515151">PO NO:<?php echo $PONO?> </a></span></center>
<center> <span style="font-size:24px;">PURCHASE ORDER - <a style="color:#515151">PO NO:<?php echo $PONO?>/C </a></span></center>
<table style="border-collapse: collapse;font-size:12px;" border="1" width="100%" cellspacing="0" cellpadding="0">
@ -147,13 +147,13 @@
<?php if ($CapitalRange =='0') { ?>
<tr>
<td>PO DATE :<?php echo $Podt; ?></td>
<td>DISPATCH / SCHEDULE BY :<?php echo $Import_DispatchDetails.$DeliverySchedule;?></td>
<td>PLACE OF ORIGIN:<?php echo $Placeoforigin; ?></td>
<td>EXCHANGE RATE:<?php echo $ExchangeRate; ?></td>
<td>DISPATCH / SCHEDULE BY : <?php echo $Import_DispatchDetails.$DeliverySchedule;?></td>
<td colspan="2">PLACE OF ORIGIN: <?php echo $Placeoforigin; ?></td>
<!--<td>EXCHANGE RATE:<?php echo $ExchangeRate; ?></td> -->
</tr><?php } else {?>
<tr>
<td>PO DATE :<?php echo $Podt; ?></td>
<td colspan="3">DELIVERY DATE/ SCHEDULE BY :<?php echo $DeliveryDate.$DeliverySchedule;?></td>
<td colspan="3">DELIVERY DATE/ SCHEDULE BY : <?php echo $DeliveryDate.$DeliverySchedule;?></td>
</tr><?php }?>
</tbody>
@ -161,12 +161,13 @@
</div>
<p>&nbsp;</p>
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>Requistion Number</td>
<td>Requistion Date</td>
<td>Requested By</td>
<td>Requested Department</td>
<td>Cost Center &nbsp;</td>
@ -181,6 +182,9 @@
?>
<tr>
<td><?php echo $ReqDetails['RequistionNo']; ?></td>
<!-- <td>2017/8/2</td> -->
<td><?php echo $ReqDetails['ReqDate'];?></td>
<td><?php echo $ReqDetails['RequestedName']; ?></td>
<td><?php echo $ReqDetails['RequestedDept']; ?></td>
<td><?php echo $ReqDetails['CostCenterCode']; ?></td>
@ -200,8 +204,10 @@
<th>#</th>
<th>Item Code</th>
<th>Item Name</th>
<th>Qty</th>
<th>HSN Code</th>
<th>UOM</p>
<th>Qty</th>
<?php if($currencyName!='INR'){ ?>
<th>Rate Per Unit in <?php echo "$currencyName"."("."$currencyCode".")"?></th>
@ -251,8 +257,10 @@
<td><?php echo $index ; ?></td>
<td> <?php echo $record->MaterialCode ; ?></td>
<td><?php echo $record->MaterialName ; ?></td>
<td align="right"><?php echo $record->Quantity ; ?></td>
<td>0989776</td>
<td align="right"><?php echo $record->UOM ; ?></td>
<td align="right"><?php echo $record->Quantity ; ?></td>
<td align="right"><?php echo number_format(($record->Rate),2, '.', '') ; ?></td>
<td align="right"><?php echo number_format(($record->Quantity * $record->Rate),2, '.', '');?></td>
@ -273,51 +281,37 @@
</tbody>
</table>
<p><strong>Payment Terms</strong></p>
<p><?php echo $PaymentTerms;?></p>
<p><strong>Special Instruction:</strong></p>
<p><?php echo $ServiceDescription;?></p>
<p>&nbsp;</p>
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
<tbody>
<tr>
<td style="text-align: center;" rowspan="4" ><strong>Total Amount In Words</strong><br /><br /><em><?php echo $TotalAmountInWords." "."Only.";?></em></td>
<td style="text-align: center;" rowspan="3" ><strong>Total Amount In Words</strong><br /><br /><em><?php echo $TotalAmountInWords." "."Only.";?></em></td>
<td style="text-align: right;" ><strong><?php if($currencyName!='INR'){ ?>
Total Order Amount in <?php echo "$currencyName"."("."$currencyCode".")" ?><?php } else { ?><b>Total Order Amount in <?php echo "$currencyName"; ?><?php } ?> </b></strong></td>
<td align="right"><?php if($currencyName!='INR'){ ?><?php echo number_format($OrderValue,2); } else {?> <?php echo number_format($OrderValue,2, '.', '');}?></td>
</tr>
<tr>
<td style="text-align: right;"><strong>Advance Amount Paid </strong></td>
<td align="right"><?php echo $AdvanceAmount?></td>
</tr>
<tr>
<td style="text-align: right;" colspan="3" ><?php if($currencyName!='INR'){ ?>
Total Order Amount in <?php echo "$currencyName"."("."$currencyCode".")" ?><?php } else { ?><b>Total Order Amount in <?php echo "$currencyName"; ?><?php } ?> </b> <br/><?php if($currencyName!='INR'){ ?><?php echo number_format($OrderValue,2); } else {?> <?php echo number_format($OrderValue,2, '.', '');}?></td>
</tr>
<tr>
<td colspan="3" style="text-align: right;"><strong>Advance Anount Paid: <?php echo $AdvanceAmount?></strong></td>
</tr>
<tr>
<td colspan="3" style="text-align: right;"><strong>Total Amount To Be Paid:<?php echo number_format(($OrderValue-$AdvanceAmount),2)?></strong></td>
<td style="text-align: right;"><strong>Total Amount To Pay In INR</strong></td>
<td align="right"><?php echo number_format(($OrderValue-$AdvanceAmount),2)?></td>
</tr>
<tr>
<td>
<p><strong>Payment Terms</strong></p>
<p><?php echo $PaymentTerms;?></p>
</td>
<td style="text-align: center;" colspan="3">
<p><font size="1">Certified that the particulars given above are true and correct</font></p>
<p><?php echo $CompanyName; ?></p>
<p>&nbsp;</p>
<p>Authorized Signatory</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><strong>Special Instruction:</strong></p>
<p><?php echo $ServiceDescription;?></p>
<p>&nbsp;</p>
<?php
<?php
if(!empty($releasedetails)){
@ -328,19 +322,7 @@
?>
<!-- <table width="100%">
<tbody>
<tr>
<td><b>Released By:</b></td>
<td style="text-align:right;"><b>Released On:</b></td>
</tr>
<tr>
<td><?php echo $detail->FirstName;?></td>
<td style="text-align:right;"><?php echo $releasedOn->format('d-m-Y');?></td>
</tr>
</tbody>
</table> -->
<p>&nbsp;</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>
@ -354,3 +336,17 @@
<?php } ?>
</td>
<td style="text-align: center;" colspan="2">
<p><font size="1">Certified that the particulars given above are true and correct</font></p>
<p><?php echo $CompanyName; ?></p>
<p>&nbsp;</p>
<p>Authorized Signatory</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>

View File

@ -18,9 +18,12 @@
$PayableAT='';
$Placeoforigin='';
$Import_DispatchDetails='';
$ReqDate='';
$AdvanceAmount=0.00;
$color='';
$ReqDate='';
$index=0;
if(!empty($CompanyDetails))
{
@ -38,6 +41,7 @@
foreach ($POItem as $PO)
{
$ReqNo=$PO->ReqNo;
$ReqDate=$PO->ReqDate;
$PONO = $PO->PONO;
$postatus= $PO->Status;
$SuplierName = $PO->SupplierName;
@ -50,7 +54,6 @@
$DeliveryDate = $dtDe->format('d-m-Y');
$ServiceDescription =$PO->ServiceDescription;
$CostCenterCode=$PO->CostCenterCode;
$AdvanceAmount=$PO->AdvanceAmount;
//$ReqBy=$PO->Requestedby;
$PaymentTerms = $PO->PaymentTerms;
@ -60,21 +63,11 @@
// $PaymentDays=$PO->PaymentDays;
// $PayableAT=$PO->PayableAT;
$DeliverySchedule=$PO->DeliverySchedule;
$AdvanceAmount=$PO->AdvanceAmount;
}
}
if($AdvanceAmount>0)
{
$color="green";
}
else
{
$color="black";
}
//echo $DeliverySchedule;
if(!empty($Requestername))
@ -137,7 +130,7 @@
?>
</div>
<div>&nbsp;</div>
<center> <span style="font-size:24px;">PURCHASE ORDER - <a>PO NO:<?php echo $PONO?> </a></span></center>
<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;font-size:12px;" border="1" width="100%" cellspacing="0" cellpadding="0">
@ -161,9 +154,9 @@
</td>
</tr>
<tr>
<td>PO DATE :<?php echo $Podt?></td>
<td>DELIVERY DATE / SCHEDULE BY :<?php echo $Import_DispatchDetails.$DeliverySchedule;?></td>
<td>PLACE OF ORIGIN:<?php echo $Placeoforigin; ?></td>
<td>PO DATE :&nbsp;&nbsp;<?php echo $Podt?></td>
<td>DELIVERY DATE / SCHEDULE BY :&nbsp;&nbsp;<?php echo $Import_DispatchDetails.$DeliverySchedule;?></td>
<td>PLACE OF ORIGIN:&nbsp;&nbsp;<?php echo $Placeoforigin; ?></td>
</tr>
</tbody>
</table>
@ -174,15 +167,18 @@
<div class="page" style="font-size:12px;">
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
<tbody>
<tr style="background:#8c8c8c;color:#fff;">
<tr bgcolor="#8c8c8c" color="#fff">
<td>Requistion Number</td>
<td>Requistion Date</td>
<td>Requested By</td>
<td>Requested Department</td>
<td>Cost Center</td>
<td>Cost Center Code</td>
</tr>
<tr>
<td><?php echo $ReqNo;?></td>
<!-- <td>01/08/2017</td> --><!--Requistion Date code should come from DB-->
<td><?php echo $ReqDate;?></td>
<td><?php echo $ReqBy;?></td>
<td><?php echo $DEPNAME?></td>
<td><?php echo $CostCenterCode?></td>
@ -191,15 +187,17 @@
</tbody>
</table>
<table style="border-collapse:collapse;" cellpadding="0" cellspacing="0" border="0" width="100%" >
<tr style="background:#8c8c8c;color:#fff;">
<th>#</th>
<th>Item and Description</th>
<th>Qty</th>
<th>UOM</p>
<th>Rate per unit in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Basic Price in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Total Amount in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<table style="border-collapse:collapse;" cellpadding="0" cellspacing="0" border="1" width="100%" >
<tr bgcolor="#8c8c8c" color="#fff">
<th align="center">#</th>
<th align="center">Item and Description</th>
<th align="center">HSN Code</th>
<th align="center">Qty</th>
<th align="center">UOM</p>
<th align="center">Rate per unit in&nbsp; <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th align="center">Basic Price in&nbsp; <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th align="center">Total Amount in&nbsp; <?php echo "$CurrencyCode ($CurrencyName)"?></th>
</tr>
@ -237,15 +235,17 @@
<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->UOM ; ?></td>
<td align="right"><?php echo number_format(($record->Rate),2) ; ?></td>
<td align="right"><?php $BasicValue=($record->Quantity*$record->Rate);
<td align="center"><?php echo $index ; ?></td>
<td align="center"><?php echo $record->MaterialName ; ?></td>
<td align="center">000666</td><!--HSN code should come from DB-->
<td align="center"><?php echo $record->Quantity ; ?></td>
<td align="center"><?php echo $record->UOM ; ?></td>
<td align="center"><?php echo number_format(($record->Rate),2) ; ?></td>
<td align="center"><?php $BasicValue=($record->Quantity*$record->Rate);
echo number_format($BasicValue,2) ; ?></td>
<!-- <td align="right"><?php echo number_format(($record->TotalOrderValue),2); ?></td> -->
<td align="right"><?php $BasicValue=($record->Quantity*$record->Rate);
<td align="center"><?php $BasicValue=($record->Quantity*$record->Rate);
echo number_format($BasicValue,2) ; ?></td>
</tr>
@ -275,21 +275,23 @@
?>
</table>
<p>&nbsp;</p>
<p><strong>Payment Terms:</strong>&nbsp;<?php echo $PaymentTerms;?></p>
<div align="Left"> <b>Special Instructions :</b><br/><?php echo $ServiceDescription;?></div>
<p>&nbsp;</p>
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
<tbody>
<tr>
<td style="text-align: center;" rowspan="4"><strong>Total Amount In Words</strong><br /><br /><em><?php echo $TotalAmountInWords." "."Only.";?></em></td>
</tr>
<tr>
<td style="text-align: right;" colspan="3" ><strong>Total Amount In <?php echo "$CurrencyCode ($CurrencyName)" ;?> <?php echo $TotalOrderValue;?> </strong></td>
<td style="text-align: right;" colspan="3" ><strong>Total Amount In <?php echo "$CurrencyCode ($CurrencyName)" ;?> <?php echo $TotalOrderValue;?> </strong></td>
</tr>
@ -297,28 +299,15 @@
<td style="text-align: right;" colspan="3"><strong>Advance Amount :<?php echo "$CurrencyCode ($CurrencyName)" ;?> <?php echo number_format($AdvanceAmount,2)?></strong></td>
</tr>
<tr>
<td style="text-align: right;" colspan="3"><strong>Amount to Pay:<?php echo "$CurrencyCode ($CurrencyName)" ;?><?php echo number_format(($TotalOrderValue-$AdvanceAmount),2)?></strong></td>
</tr>
<tr>
<td>
<p><strong>Payment Terms</strong></p>
<p><?php echo $PaymentTerms;?></p>
</td>
<td style="text-align: center;" colspan="3">
<p><font size="1">Certified that the particulars given above are true and correct</font></p>
<p><?php echo $CompanyName; ?></p>
<p>&nbsp;</p>
<p>Authorized Signatory</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<div align="Left"> <b>Special Instructions :</b><br/><?php echo $ServiceDescription;?></div>
<?php
if(!empty($releasedetails)){
@ -331,8 +320,8 @@
<p>&nbsp;</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>
<div align="Left"> <b>&nbsp;Released By : </b><?php echo $detail->FirstName;?></div>
<div align="Left"> <b>&nbsp;Released On : </b><?php echo $releasedOn->format('d-m-Y');?></div>
<?php
}
}
@ -341,7 +330,20 @@
?>
<?php } ?>
<?php } ?>
</td>
<td style="text-align: center;" colspan="3">
<p><font size="1">Certified that the particulars given above are true and correct</font></p>
<p><?php echo $CompanyName; ?></p>
<p>&nbsp;</p>
<p>Authorized Signatory</p>
</td>
</tr>
</tbody>
</table>
</div>