From 45b1fc64701eee2894a3197363b1c8a970779b85 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Thu, 6 Jul 2017 15:42:28 +0530 Subject: [PATCH] po pdf --- application/controllers/purchaseorder.php | 47 ++++++++++++ application/models/purchaseorder_model.php | 12 ++- application/views/editimportpo.php | 29 +++---- application/views/importpo.php | 10 +-- application/views/revenuepopdf.php | 88 ++++++++++++++++------ application/views/servicepopdf.php | 84 +++++++++++++++------ 6 files changed, 204 insertions(+), 66 deletions(-) diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 9caa777c..81093bdd 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -973,6 +973,25 @@ $DeliveryOption = $this->input->post('DateRange'); $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO); + + foreach ($data['POItem'] as $Reqdby) + { + $Requester=$Reqdby->Requestedby; + + } + + + + $data['Requestername']=$this->purchaseorder_model->GerRequesterName($Requester); + + foreach ($data['Requestername'] as $ReqDep) + { + $Depcode=$ReqDep->Departmentcode; + } + + $data['DEPCODE']=$this->purchaseorder_model->GerRequesterDep($Depcode); + //print_r($data['Requestername']); + $data['Currencytype']=$this->purchaseorder_model->GetINRCurrencytype('INR'); // Add header to pdf @@ -1006,6 +1025,27 @@ $DeliveryOption = $this->input->post('DateRange'); $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetailsForPrint($PONO); $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); + + foreach ($data['POItem'] as $Reqdby) + { + $Requester=$Reqdby->Requestedby; + + } + + + + $data['Requestername']=$this->purchaseorder_model->GerRequesterName($Requester); + + foreach ($data['Requestername'] as $ReqDep) + { + $Depcode=$ReqDep->Departmentcode; + } + + $data['DEPCODE']=$this->purchaseorder_model->GerRequesterDep($Depcode); + //print_r($data['Requestername']); + $data['Currencytype']=$this->purchaseorder_model->GetINRCurrencytype('INR'); + + $this->load->View("servicepopdf", $data); // Add header to pdf @@ -1049,6 +1089,13 @@ public function importpoprint($PONO) } $data['Requestername']=$this->purchaseorder_model->GerRequesterName($Requester); + + foreach ($data['Requestername'] as $ReqDep) + { + $Depcode=$ReqDep->Departmentcode; + } + + $data['DEPCODE']=$this->purchaseorder_model->GerRequesterDep($Depcode); //print_r($data['Requestername']); $data['Currencytype']=$this->purchaseorder_model->GerCurrencyCodeName($Currencycode); diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index b4de241e..4c486b9c 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -585,13 +585,23 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '') function GerRequesterName($Requester='') { - $subQuery='SELECT EmpID,FirstName from T_Employee_Details where EmpID=?'; + $subQuery='SELECT EmpID,FirstName,Departmentcode from T_Employee_Details where EmpID=?'; $query=$this->db->query($subQuery,array($Requester)); return $query->result(); } + + function GerRequesterDep($Depcode='') + { + $subQuery='SELECT DepartmentName from T_DepartmentDetails where DEPCode=?'; + $query=$this->db->query($subQuery,array($Depcode)); + + return $query->result(); + + } + function GerCurrencyCodeName($Currencycode='') { $subQuery='SELECT Currency_Code,FontCode2000 from T_Currency_Details where Currency_Code=?'; diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php index bc9802eb..276fd2b3 100755 --- a/application/views/editimportpo.php +++ b/application/views/editimportpo.php @@ -1616,8 +1616,8 @@ if(!empty($RequistionDetails)) UOM Rate Basic Amount - Tax Amount - Total Order Amount + Action @@ -1641,8 +1641,8 @@ if(!empty($RequistionDetails)) UOM ?> Rate ?> BasicValue ?> - Taxamount?> - TotalOrderValue?> + @@ -1756,8 +1756,8 @@ if(!empty($RequistionDetails)) $totavlmodvat=$totavlmodvat+$record->AvailableModvat; $totgrossexpense=$totgrossexpense+$record->Grossexpensesduetocustomduty; $ExchangeRate=$record->ExchangeRate; - $totorder=$totorder+$record->TotalOrderValue; - + $totorder=$totorder+$record->BasicPriceInMTon; + //alert($totorder); } @@ -1968,8 +1968,8 @@ if(!empty($RequistionDetails)) <%=UOM%> <%=Rate%> <%=BasicAmount%> - <%=Taxvalue%> - <%=TotalValue%> +     @@ -3056,14 +3056,9 @@ function CalculateCtable() $('#RMCIncludingCustomers').val(Math.round(txtrmc)); } total=; - if(isNaN(total)) - { - $('#TotalExp').val(''); - } - else - { - $('#TotalExp').val(Math.round(total)); - } + + $('#TotalExp').val(Math.round(basicamt)); + } @@ -3096,7 +3091,7 @@ function EditCalculateCtable() txtrmc=; $('#EditRMCIncludingCustomers').val(txtrmc); total=; - $('#EditTotalExp').val(total); + $('#EditTotalExp').val(basicamt); } diff --git a/application/views/importpo.php b/application/views/importpo.php index dd8be5e9..454b4223 100755 --- a/application/views/importpo.php +++ b/application/views/importpo.php @@ -1489,8 +1489,8 @@ function vaildateBeforeOpenModal() UOM Rate Basic Amount - Tax Amount - Total Order Amount + Action @@ -1669,8 +1669,8 @@ function vaildateBeforeOpenModal() <%=UOM%> <%=Rate%> <%=BasicAmount%> - <%=Taxvalue%> - <%=TotalValue%> +     @@ -2808,7 +2808,7 @@ function CalculateCtable() } else { - $('#TotalExp').val((total).toFixed(2)); + $('#TotalExp').val((basicprice).toFixed(2)); } } diff --git a/application/views/revenuepopdf.php b/application/views/revenuepopdf.php index f630120d..0f1cfd6c 100755 --- a/application/views/revenuepopdf.php +++ b/application/views/revenuepopdf.php @@ -8,6 +8,7 @@ $DeliveryAddress = ''; $Podt = ''; $DeliveryDate =''; + $PaymentTerms=''; $ServiceDescription = ''; if(!empty($CompanyDetails)) @@ -33,9 +34,45 @@ $dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata')); $DeliveryDate = $dtDe->format('d-m-Y'); $ServiceDescription =$PO->ServiceDescription; + $PaymentTerms=$PO->PaymentTerms; } } + + + + if(!empty($Requestername)) + + { + foreach ($Requestername as $Reqname) + { + $ReqBy=$Reqname->FirstName; + //$ReqDep=$Reqname-> + + } + } + + $CurrencyCode=''; + $CurrencyName=''; + + if(!empty($Currencytype)) + { + foreach ($Currencytype as $CURRE) + { + $CurrencyCode=$CURRE->Currency_Code; + $CurrencyName=$CURRE->FontCode2000; + } + + } + $DEPNAME=''; + + if(!empty($DEPCODE)) + { + foreach ($DEPCODE as $DEP) + { + $DEPNAME=$DEP->DepartmentName; + } + } ?>
@@ -60,16 +97,16 @@ Item Description Qty Rate -Amount -Discount -Excise Duty -Vat -CST -GST -Other Taxes -Insurance -Freight -Total Amount +Amount in +Discount in +Excise Duty in +Vat in +CST in +GST in +Other Taxes in +Insurance in +Freight in +Total Amount in @@ -132,52 +169,52 @@ echo number_format($TotalAmount,2) ; ?> - +
- + - + - + - + - + - + - + - + - + @@ -191,7 +228,14 @@ if(!empty($releasedetails)){ foreach($releasedetails as $detail){ ?> -
Sub Total Amount :Sub Total Amount :
Discount :Discount :
Excise Duty :Excise Duty :
Vat :Vat :
CST :CST :
GST :GST :
Other Taxes:Other Taxes:
Insurance :Insurance :
Freight :Freight :

Total Order Amount :

Total Order Amount :

+ + + + + + + +DeliveryDate, new DateTimeZone('Asia/Kolkata')); $DeliveryDate = $dtDe->format('d-m-Y'); $ServiceDescription =$PO->ServiceDescription; + $CostCenterCode=$PO->CostCenterCode; + $PaymentTerms=$PO->PaymentTerms; + } + + + if(!empty($Requestername)) + + { + foreach ($Requestername as $Reqname) + { + $ReqBy=$Reqname->FirstName; + //$ReqDep=$Reqname-> + + } + } + + $CurrencyCode=''; + $CurrencyName=''; + + if(!empty($Currencytype)) + { + foreach ($Currencytype as $CURRE) + { + $CurrencyCode=$CURRE->Currency_Code; + $CurrencyName=$CURRE->FontCode2000; + } + + } + $DEPNAME=''; + + if(!empty($DEPCODE)) + { + foreach ($DEPCODE as $DEP) + { + $DEPNAME=$DEP->DepartmentName; + } + } + + + } ?> @@ -92,14 +134,14 @@ - - - - - - - - + + + + + + + + - +
- +
- +
- +
- +
- +
- +
Requition Number :
Requested by :
Requisted Department :
Cost center :
# Item Description QtyRateAmountService TaxEducess TaxSec Higher Educess TaxKrishi Kalyan taxSwachh Bharat taxTotal AmountRate per unit in Amount in Service Tax in Educess Tax in Sec Higher Educess Tax in Krishi Kalyan tax in Swachh Bharat taxin Total Amount in
Sub Total Amount :Sub Total Amount :
Service Tax @14% :Service Tax @14% :
Edu. cess @2% on ServiceTax:Edu. cess @2% on ServiceTax:
Sec & Higher cess @1% on ServiceTax:Sec & Higher cess @1% on ServiceTax:
Krishi kalyan Tax @0.5% on Basic Amount:Krishi kalyan Tax @0.5% on Basic Amount:
Swachh Barath Tax @0.5% on Basic Amount :Swachh Barath Tax @0.5% on Basic Amount :
Total Order Amount :Total Order Amount :
- - - - + + + +
Requition Number :
Req004
Requested by :
Sanjeev
Requisted Department :
Store
Cost center :
Fe001
Requition Number :
Requested by :
Requisted Department :
Cost center :
@@ -201,7 +243,7 @@ foreach($releasedetails as $detail){ ?> - +