service po pdf changes done

This commit is contained in:
venbatechnologies@gmail.com 2017-08-03 10:37:01 +05:30
parent 0f29cec833
commit 45d890fa67
2 changed files with 371 additions and 320 deletions

View File

@ -607,9 +607,9 @@ function purchaseorderListing($forwhat='')
function GetServicePurchaseOrderDetailsForPrint($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.ServiceMaterialDescription,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,
$subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.ServiceMaterialDescription,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Mat.HSNCODE,
LineItem.Quantity,LineItem.Rate,(LineItem.Quantity *LineItem.Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount
,TotalValue,After_CGST,After_SGST,After_IGST,otherallowance,LineItem.CostCenterCode,sup.SupplierName,sup.Address,POMaster.DeliveryAddress,POMaster.DeliveryDate,POMaster.Status,POMaster.PODate,POMaster.PONO,POMaster.ServiceDescription,ReqMat.NumberOfService,ReqMat.Service_Period,ReqMat.Schedule_Type,Payment.PaymentID,Payment.PaymentTerms,AdvanceAmount FROM
,TotalValue,CGST,SGST,IGST,After_CGST,After_SGST,After_IGST,otherallowance,LineItem.CostCenterCode,sup.SupplierName,sup.Address,POMaster.DeliveryAddress,POMaster.DeliveryDate,POMaster.Status,POMaster.PODate,POMaster.PONO,POMaster.ServiceDescription,POMaster.PaymentOtherDescription,ReqMat.NumberOfService,ReqMat.Service_Period,ReqMat.Schedule_Type,Payment.PaymentID,Payment.PaymentTerms,AdvanceAmount FROM
T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
@ -1405,7 +1405,7 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
}
else{
$ReqNo = $res->ReqNo;
$this->db->select('ReqMast.ReqNo,ReqMast.CostCenterCode,re.FirstName,Dept.DEPCode,Dept.DepartmentName');
$this->db->select('ReqMast.ReqNo,ReqMast.CostCenterCode,ReqMast.ReqDate,ReqMast.Schedule_Type,ReqMast.NumberOfService,ReqMast.Service_Period,re.FirstName,Dept.DEPCode,Dept.DepartmentName');
$this->db->from('T_Requestion_Master ReqMast');
$this->db->join('T_Employee_Details re','re.EmpID=ReqMast.Requestedby');
$this->db->join('T_DepartmentDetails Dept', 're.Departmentcode = Dept.DEPCode');
@ -1415,6 +1415,18 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
$Details['RequestedName']= $Reqresult->result()[0]->FirstName;
$Details['RequestedDept']= $Reqresult->result()[0]->DepartmentName;
$Details['CostCenterCode']= $Reqresult->result()[0]->CostCenterCode;
$date = new DateTime($Reqresult->result()[0]->ReqDate,new DateTimeZone('Asia/Kolkata'));
$retDate = $date->format('d-m-Y');
$Details['ReqDate']= $retDate;
$ScheduleType = $Reqresult->result()[0]->Schedule_Type;
if($ScheduleType!='Recurring'){
$Details['Frequency']= $Reqresult->result()[0]->Schedule_Type;
}
else{
$Details['Frequency']= $Reqresult->result()[0]->Service_Period.' - '.$Reqresult->result()[0]->NumberOfService;
}
$ResultArray[]=$Details;
}

View File

@ -67,7 +67,12 @@
$dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata'));
$DeliveryDate = $dtDe->format('d-m-Y');
$ServiceDescription =$PO->ServiceDescription;
if($PO->PaymentID!='PT08'){
$PaymentTerms = $PO->PaymentTerms;
}
else{
$PaymentTerms = $PO->PaymentTerms . ' ( '.$PO->PaymentOtherDescription.' ) ';
}
}
@ -98,7 +103,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?>/S </a></span></center>
<table style="border-collapse: collapse;font-size:12px;" border="1" width="100%" cellspacing="0" cellpadding="0">
@ -122,13 +127,11 @@
</td>
</tr>
<tr>
<td>PO DATE :<?php echo $Podt; ?></td>
<td colspan="2">DELIVERY DATE / SCHEDULE BY :<?php echo $DeliveryDate.$DeliverySchedule;?></td>
<td>PO DATE :&nbsp;&nbsp;<?php echo $Podt; ?></td>
<td colspan="2">DELIVERY DATE / SCHEDULE BY :&nbsp;&nbsp;<?php echo $DeliveryDate.$DeliverySchedule;?></td>
</tr>
</tbody>
</table>
</div>
<div class="page" style="font-size:12px;">
@ -136,15 +139,17 @@
<tbody>
<tr style="background:#8c8c8c;color:#fff;">
<tr bgcolor="#8c8c8c" color="#fff">
<td>Requistion Number</td>
<td style="text-align: center;">Requistion Number</td>
<td style="text-align: center;">Frequency</td>
<td style="text-align: center;">Requistion Date</td>
<td>Requested By</td>
<td style="text-align: center;">Requested By</td>
<td>Requested Department</td>
<td style="text-align: center;">Requested Department</td>
<td>Cost Center Code</td>
<td style="text-align: center;">Cost Center Code</td>
</tr>
@ -159,10 +164,12 @@
?>
<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>
<td style="text-align: center;"><?php echo $ReqDetails['RequistionNo']; ?></td>
<td style="text-align: center;"><?php echo $ReqDetails['Frequency']; ?></td>
<td style="text-align: center;"><?php echo $ReqDetails['ReqDate']; ?></td>
<td style="text-align: center;"><?php echo $ReqDetails['RequestedName']; ?></td>
<td style="text-align: center;"><?php echo $ReqDetails['RequestedDept']; ?></td>
<td style="text-align: center;"><?php echo $ReqDetails['CostCenterCode']; ?></td>
</tr>
<?php
}
@ -179,35 +186,31 @@
<p>&nbsp;</p>
<table style="border-collapse: collapse;" border="0" width="100%" cellspacing="0" cellpadding="0">
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr style="background:#8c8c8c;color:#fff;">
<tr bgcolor="#8c8c8c" color="#fff">
<td>#</td>
<td style="text-align: center;">#</td>
<td>Item Code</td>
<td>Service Description</td>
<td>UOM</td>
<td style="text-align: center;">Item Description</td>
<td>Qty</td>
<td style="text-align: center;">HSN Code</td>
<td>Rate In INR</td>
<td style="text-align: center;">UOM</td>
<td>Basic Value In INR</td>
<td>CGST In INR</td>
<td>SGST In INR</td>
<td style="text-align: center;">Qty</td>
<td>IGST In INR</td>
<td style="text-align: center;">Rate In INR</td>
<td style="text-align: center;">Basic Value In INR</td>
<td>Other Allow In INR</td>
<td>Total Amount In INR</td>
</tr>
@ -227,10 +230,12 @@
?>
<tr style="line-height: 1.5em;">
<td><?php echo $index ; ?></td>
<td><?php echo $record->MaterialCode ; ?></td>
<td><?php echo $record->ServiceMaterialDescription ; ?></td>
<td align="right"><?php echo $record->UOM ; ?></td>
<td style="text-align: center;"><?php echo $index ; ?></td>
<td style="text-align: center;"><?php echo $record->ServiceMaterialDescription ; ?></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 number_format($record->Rate, 2, '.', ''); ?></td>
@ -245,11 +250,7 @@
$SubTotalAmount = $SubTotalAmount + $record->BasicValue * $record->NumberOfService + $record->otherallowance;
}
?></td>
<td align="right"><?php echo $record->After_SGST ; ?></td>
<td align="right"><?php echo $record->After_CGST ; ?></td>
<td align="right"><?php echo $record->After_IGST ; ?></td>
<td align="right"><?php echo $record->otherallowance ; ?></td>
<td align="right"><?php echo number_format($TotalAmount, 2, '.', ''); ?></td>
</tr>
<?php
@ -274,6 +275,72 @@
<p>&nbsp;</p>
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="text-align: center;" rowspan="2"><strong>HSN</strong><br /></td>
<td style="text-align: center;" colspan="2"><strong>CGST</strong> <br /><br /></td>
<td style="text-align: center;" colspan="2"><strong>SGST</strong> <br /><br /></td>
<td style="text-align: center;" colspan="2"><strong>IGST</strong> <br /><br /></td>
<td style="text-align: center;" rowspan="2"><strong>Tax Amt In INR</strong><br /></td>
<td style="text-align: center;" rowspan="2"><strong>Other Allow In INR</strong><br /></td>
<td style="text-align: center;" rowspan="2"><strong>Total Amount In INR</strong></td>
</tr>
<tr style="line-height: 1.5em;">
<td style="text-align: center;"><strong>IN%</strong></td>
<td style="text-align: center;"><strong>Amt</strong></td>
<td style="text-align: center;"><strong>IN%</strong></td>
<td style="text-align: center;"><strong>Amt</strong></td>
<td style="text-align: center;"><strong>IN%</strong></td>
<td style="text-align: center;"><strong>Amt</strong></td>
</tr>
<?php if(!empty($POItem)) {
foreach($POItem as $record1)
{
?>
<tr style="line-height: 1.5em;">
<td style="text-align: center;"><?php echo $record1->HSNCODE ; ?></td>
<td style="text-align: right;"><?php echo $record1->CGST ; ?></td>
<td style="text-align: right;"><?php echo number_format($record1->After_CGST, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo $record1->SGST ; ?></td>
<td style="text-align: right;"><?php echo number_format($record1->After_SGST, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo $record1->IGST ; ?></td>
<td style="text-align: right;"><?php echo number_format($record1->After_IGST, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo number_format($record1->Taxamount, 2, '.', ''); ?></td>
<td style="text-align: right;"><?php echo number_format($record1->otherallowance, 2, '.', ''); ?></td>
<td align="right"><?php if($record->NumberOfService==0 || $record->NumberOfService==''){
echo number_format($record->BasicValue + $record1->Taxamount + $record1->otherallowance, 2, '.', '');
}
else{
echo number_format($record->BasicValue * $record->NumberOfService + $record1->Taxamount + $record1->otherallowance, 2, '.', '');
}
?></td>
</tr>
<?php }
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<p><strong>Payment Terms:</strong> <?php echo $PaymentTerms;?></p>
<br/>
<p><strong>Scope Of Work As Per Annexure:</strong></p>
<p><?php echo $ServiceDescription;?></p>
@ -307,8 +374,20 @@
<td style="text-align: right;"><strong>Total Amount Before Tax In INR - <?php echo number_format($SubTotalAmount, 2, '.', '');?></strong></td>
<td style="text-align: right;"><strong>Total Amount Before Tax In INR &nbsp;</strong></td>
<td align="right"><strong><?php echo number_format($SubTotalAmount, 2, '.', '');?>&nbsp;</strong></td>
</tr>
<tr>
<td style="text-align: right;"><strong>Total Tax Amount In INR &nbsp;</strong></td>
<td align="right"><strong><?php echo number_format($TotalTax, 2, '.', '');?>&nbsp;</strong></td>
</tr>
@ -319,21 +398,9 @@
<td style="text-align: right;"><strong>Total Tax Amount In INR - <?php echo number_format($TotalTax, 2, '.', '');?></strong></td>
</tr>
<tr>
<td style="text-align: right;"><strong>Total Amount After Tax In INR - <?php echo number_format($OrderValue, 2, '.', '');?></strong></td>
<td style="text-align: right;"><strong>Total Amount After Tax In INR &nbsp;</strong></td>
<td align="right"><strong><?php echo number_format($OrderValue, 2, '.', '');?>&nbsp;</strong></td>
</tr>
@ -344,15 +411,33 @@
<td>
<p>&nbsp;</p>
<?php
if(!empty($releasedetails)){
$releasedOn = '';
foreach($releasedetails as $detail){
$releasedOn= new DateTime($detail->ReleasedOn, new DateTimeZone('Asia/Kolkata'));
?>
<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
}
}
else {
?>
<?php } ?>
<p><strong>Payment Terms&nbsp;</strong></p>
<p><?php echo $PaymentTerms;?></p>
@ -360,7 +445,7 @@
<td>
<td style="text-align: center;" colspan="2">
@ -385,51 +470,5 @@
</tbody>
</table>
<br/>
<br/>
<p><strong>Scope Of Work:</strong></p>
<p><?php echo $ServiceDescription;?></p>
<?php
if(!empty($releasedetails)){
$releasedOn = '';
foreach($releasedetails as $detail){
$releasedOn= new DateTime($detail->ReleasedOn, new DateTimeZone('Asia/Kolkata'));
?>
<!-- <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> -->
<br/>
<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>
<?php
}
}
else {
?>
<?php } ?>
</div>