diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 135ee172..8623451c 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -2535,7 +2535,7 @@ function addNewImportPurchaseOrder() /* capital po print/pdf*/ - public function CapitalPoPrint($PONO) + public function CapitalPoPrint($PONO) { @@ -2543,14 +2543,16 @@ function addNewImportPurchaseOrder() $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); $data['POItem'] = $this->purchaseorder_model->GetCapitalPurchaseOrderDetailsForPDF($PONO); - + $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); $CurrencyType=''; + $CapitalRange=1; if(!empty($data['POItem'])){ - $CurrencyType=$data['POItem'][0]->CurrencyType; + $CurrencyType=$data['POItem'][0]->CurrencyType; + $CapitalRange=$data['POItem'][0]->CapitalRange; } - + if($CurrencyType=='' OR $CurrencyType=='0'){ $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); @@ -2571,7 +2573,7 @@ function addNewImportPurchaseOrder() $TotaltoPay=$TotalOrderValue-$AdvanceAmount; $totalAmt=sprintf("%.2f", $TotaltoPay); $data['TotalAmountInWords']= $this->convertNumber($totalAmt); - } + } else{ $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType); @@ -2596,8 +2598,11 @@ function addNewImportPurchaseOrder() $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); - - + if($CapitalRange!=''){ + $data['TaxListDetails'] = $this->purchaseorder_model->GetCapitalTaxListDetails($PONO,$CapitalRange); + } + + $this->load->View("capitalpopdf", $data); diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 1fab0f4c..6e964d2f 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -1321,12 +1321,12 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode } // This Method to get the Capital PO Details for pdf - function GetCapitalPurchaseOrderDetailsForPDF($PONO = '') + function GetCapitalPurchaseOrderDetailsForPDF($PONO = '') { - $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.AmendedDetails as lineamd,ReqNo,Mat.MaterialCode,Mat.MaterialName, + $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.Per,LineItem.AmendedDetails as lineamd,ReqNo,Mat.MaterialCode,Mat.MaterialName, Mat.UOM,Mat.HSNCODE,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue , - LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.Address,Payment.PaymentID,Payment.PaymentTerms,AdvanceAmount,HSNCODE + LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.SupplierID,sup.Address,sup.ContactNumber,sup.EmailAddress,sup.PAN,sup.GSTNO,Payment.PaymentID,Payment.PaymentTerms,AdvanceAmount,HSNCODE FROM T_PurchaseOrder_LineItem LineItem join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode @@ -1579,4 +1579,30 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode return $query->result(); } + // get capital tax listing by po no + + function GetCapitalTaxListDetails($PONO = '',$CapitalRange=''){ + + if($CapitalRange==1){ + $taxQuery ='SELECT group_concat(pl.MaterialCode ORDER BY pl.MaterialCode ASC) as Itemcode,SUM(st.`After_CGST`) AS TotalCGST,SUM(st.`After_SGST`) AS TotalSGST,SUM(st.`After_IGST`) AS TotalIGST,SUM(st.`otherallowance`) AS TotalOtherAllowance,SUM(st.`Afterdiscountval`) AS TotalDiscount,st.discountval,st.Afterdiscountval,st.CGST,st.SGST,st.IGST,st.otherallowance FROM kasiram9_SIADEV.T_Service_Tax st + join T_PurchaseOrder_LineItem pl on pl.LineItemNo=st.LineItemNo + join T_PurchaseOrder_Master pm on pm.PONO=pl.PONO + where pm.POType=? and pm.PONO=? + group by st.discountval,st.CGST,st.SGST,st.IGST,st.otherallowance ORDER BY st.LineItemNo ASC'; + $query = $this->db->query($taxQuery,array("CAPITAL",$PONO)); + + return $query->result(); + } + else if($CapitalRange==0){ + $taxQuery ='SELECT group_concat(pl.MaterialCode ORDER BY pl.MaterialCode ASC) as Itemcode,SUM(it.`AfterFreightValue`) AS TotalFreight,it.FreightValue,it.AfterFreightValue FROM kasiram9_SIADEV.T_Import_Tax it + join T_PurchaseOrder_LineItem pl on pl.LineItemNo=it.LineItemNo + join T_PurchaseOrder_Master pm on pm.PONO=pl.PONO + where pm.POType=? and pm.PONO=? + group by it.FreightValue ORDER BY it.LineItemNo ASC'; + $query = $this->db->query($taxQuery,array("CAPITAL",$PONO)); + + return $query->result(); + } + + } } diff --git a/application/views/capitalpopdf.php b/application/views/capitalpopdf.php index 10bd0908..16523f90 100755 --- a/application/views/capitalpopdf.php +++ b/application/views/capitalpopdf.php @@ -1,12 +1,10 @@ -CompanyName; $CompanyAddress = $CO->Address; + $companyEmail=$CO->EmailAddress; + $companyGst=$CO->GSTNO; + $companyPan=$CO->PAN; + $companyWebsit=$CO->companyWebsite; + $CompanyStateCode=$CO->StateCode; } } @@ -62,13 +87,26 @@ $dispatch=$PO->Import_DispatchDetails; } $ServiceDescription =$PO->ServiceDescription; + $finCap=$PO->Fincap; + $modShp=$PO->Mode_Of_Shipment; + $insNo=$PO->InsuranceNumber; + + $supRef=$PO->Supplier_Reference; + $supOfferNo=$PO->Supplier_Offer_No; + $supplierEmail=$PO->EmailAddress; + $supplierGst=$PO->GSTNO; + $supplierPan=$PO->PAN; + $supplierContact=$PO->ContactNumber; + + $supplierVendor=$PO->SupplierID; $CostCenterCode=$PO->CostCenterCode; $PaymentTerms=$PO->PaymentTerms; if($PaymentTerms=='Others'){ $PaymentOtherDescription=$PO->PaymentOtherDescription; } - + $CapitalRange=$PO->CapitalRange; + $TotalOrderValue=$PO->TotalOrderValue; } } @@ -95,138 +133,147 @@ ?> -
- -+
|
+ + + web: -
-
+ Supplier's Offer No: + |
+ Our Reference : | |||||||||||||||||||||||
| Shipped From: Vendor code: Email ID: PAN: Contact : GSTIN: |
+
+ Shipped To: State code: |
+ Delivery : |
+ ||||||||||||||||||||||
| # | -Item and Description | -HSN Code | -UOM | -Qty | - -Rate Per Unit in | - -Rate Per Unit in | - - - -Total Amount in | - -Total Amount in | +Indent : | ++ | format("d-m-Y"); echo $date; ?> | +Dept: | +CCD: | +Fin cap: |
|---|
Mode of Shipment: By road
+Insurance :
+Please arrange to deliver the materials listed below as per schedule to our works
+| SNo | +ITEM CODE | +ITEM DESCRIPTION | +HSN | +UOM | +QTY | +RATE Rs | +PER | +
| + | MaterialCode;?> | +MaterialName ; ?> | +HSNCODE)){echo $record->HSNCODE;}else {echo "NIL";}?> | +UOM; ?> | +Quantity ; ?> | +Rate ; ?> | +Per ; ?> | +- | MaterialCode;?> - MaterialName ; ?> | -HSNCODE)){echo $record->HSNCODE;}else {echo "NIL";}?> | -UOM; ?> | -Quantity ; ?> | -Rate ; ?> | - -Quantity * $record->Rate); - echo number_format($BasicValue,2) ; ?> | - - - -
-
Payment Terms:
- - -| Total Amount In Words |
-
-
- - Total Order Amount in | Total Order Amount in - - |
| Advance Paid In | ||
| Balance amount needs to pay | - | |
|
-
- ReleasedOn, new DateTimeZone('Asia/Kolkata'));
-
-
- ?>
-
-
-
- - Released By : FirstName;?>
- Released On : format('d-m-Y');?>
-
-
-
-
-
-
-
- |
-
-
- - Authorized Signatory - |
- |
| Item code | +DIS | +CGST% | +SGST% | +IGST% | +OTHER | +TRANSPORT CHARGES | +||||||
| Itemcode;?> | + TotalCGST; + $TotalSgst=$TotalSgst+$st->TotalSGST; + $TotalIgst=$TotalIgst+$st->TotalIGST; + $TotalDiscount=$TotalDiscount+$st->TotalDiscount; + $TotalOtherAllowance=$TotalOtherAllowance+$st->TotalOtherAllowance; + $TotalFreight='-'; + + ?> +discountval;?> | +CGST;?> | +SGST;?> | +IGST;?> | +otherallowance;?> | ++ TotalFreight; + ?> + | + | + | + | + | + | FreightValue;?> | + + + + +
Special instructions:
+ + + +|
+ Payment terms : + |
+ Total Amount in Rs | +Total CGST Amount in Rs | +Total SGST Amount in RS | +Total IGST Amount in RS | +Others in Rs | +Total Tax Amount in Rs | +Order value in Rs | +|||
| + | + | + | + + | + | + + + + | + | + + + | - - - + + + | ||
|
+ Order value in words: + |
+ ||||||||||
Note: Please acknowledge receipt of this order for acceptance
-Material to be delivered to our stores before 3pm
-Please refer order number and item code in your challan/invoice
-\ No newline at end of file + + \ No newline at end of file diff --git a/application/views/editCapitalPo.php b/application/views/editCapitalPo.php index adef76a4..1610836a 100755 --- a/application/views/editCapitalPo.php +++ b/application/views/editCapitalPo.php @@ -1011,7 +1011,7 @@ $("#PaymentMethod").select2(); $TotalIgst = $TotalIgst + $record->After_IGST; $OtherAmt = $OtherAmt + $record->otherallowance; $TotalSummary = $TotalSummary+$record->ServiceTaxamount; - $TotalDiscountedAmt = $TotalDiscountedAmt + $record->Afterdiscountval; + $TotalDiscountedAmt = $record->Afterdiscountval; } $TotalBasicAmount = $TotalBasicAmount+$record->BasicValue; $ServiceDescription = $ServiceDescription;