Siddharth Industries - Edit Service Purchase Order - - For Amendment
Siddharth Industries - Amendment Service Purchase Order -
+
-
+
-
-
+
diff --git a/application/controllers/amendmentpurchaseorder.php b/application/controllers/amendmentpurchaseorder.php
index 5146e01f..11713e38 100755
--- a/application/controllers/amendmentpurchaseorder.php
+++ b/application/controllers/amendmentpurchaseorder.php
@@ -458,14 +458,15 @@ function UpdateAmendServicePurchaseOrder()
{
$PONO =$this->input->post('txtPONO');
-
+ $MAD='';
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
-
+ //echo $PODate;
$SupplierID = $this->input->post('drpSupplier');
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
$dt = $this->input->post('Deliverydt');
$DeliveryOption = $this->input->post('DateRange');
+
if($DeliveryOption==1){
$Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby');
@@ -474,29 +475,60 @@ function UpdateAmendServicePurchaseOrder()
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
+
+ $ddate=$this->input->post('Deliverydt');
+ $beforeddate=$this->input->post('beforeDeliverydt');
+
+ $dschedule=$this->input->post('Scheduleby');
+ $beforedschedule=$this->input->post('beforeScheduleby');
+
+ if($ddate != $beforeddate)
+ {
+ $MAD.="Amended Delivery Date : " . $beforeddate . "
";
+ }
+
+ if($dschedule != $beforedschedule)
+ {
+ $MAD.="Amended Delivery Schedule : " . $beforedschedule . "
";
+ }
+ // if(($ddate != $beforeddate) || ($dschedule != $beforedschedule) )
+ // {
+ // $beforeddate2=new DateTime($beforeddate, new DateTimeZone('Asia/Kolkata'));
+ // $beforeddate3 = $beforeddate2->format('d-m-Y');
+ // echo $beforeddate3;
+
+ // //die();
+ // $MAD.="Amended Delivery Option : " . $beforeddate ."".$beforedschedule. "
";
+ // }
$PaymentTerms=$this->input->post('PaymentTerms');
-
+ $beforePaymentTerms=$this->input->post('beforePaymentTerms');
+ if($PaymentTerms != $beforePaymentTerms)
+ {
+ $MAD.="Amended PaymentTerms : ". $beforePaymentTerms ."
";
+ }
+ //echo "MAD IS" . $MAD . "
";
$POType = $this->input->post('POType');
- $SpcialInstruction = $this->input->post('SpcialInstruction');
+ $scopeofwork = $this->input->post('ScopeofWork');
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary');
$POStatus = $this->input->post('txtStatus');
$updatedBy = $this->session->userdata ( 'userId' );
$RowCount = $this->input->post('txtRowCount');
-
+ //echo 'RowCount is' . $RowCount;
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$updateddt = $dt->format('Y-m-d H:i:s');
$WorkStatus=$this->input->post('workstatus');
// PO Master
- $POMaster = array('ParentPO'=>$PONO,'POType'=>$POType,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt);
+ $POMaster = array('ParentPO'=>$PONO,'POType'=>$POType,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>PO_RELEASED,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$scopeofwork,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt,'AmendedDetails'=>$MAD);
//print_r($POMaster);
+
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster,$updatedBy,$PONO);
//print_r($LastPO);
$NewPO = '';
@@ -517,32 +549,87 @@ function UpdateAmendServicePurchaseOrder()
{
//echo "Inside Loop";
-
+ $CAD='';
$MaterialCode = $this->input->post('materialCode'.$i);
$Quantity = $this->input->post('quantity'.$i);
+ $beforeQuantity = $this->input->post('beforequantity'.$i);
$Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i);
- $ServiceTax = $this->input->post('ServiceTax'.$i);
- $EduCess = $this->input->post('EduCess'.$i);
- $SecHighTax = $this->input->post('SecHighTax'.$i);
- $KrishiTax = $this->input->post('KrishiTax'.$i);
- $SwachhTax = $this->input->post('SwachhTax'.$i);
+ $beforeitemRate = $this->input->post('beforeitemRate'.$i);
+
+ $AfterSGST = $this->input->post('AfterSgst'.$i);
+ $beforeSGSTvalue = $this->input->post('beforeSgstvalue'.$i);
+ $AfterCGST = $this->input->post('AfterCgst'.$i);
+ $beforeCGSTvalue = $this->input->post('beforeCgstvalue'.$i);
+ $AfterIGST = $this->input->post('AfterIgst'.$i);
+ $beforeIGSTvalue = $this->input->post('beforeIgstvalue'.$i);
+ $SGST = $this->input->post('Sgst'.$i);
+ $beforeSGST = $this->input->post('beforeSgst'.$i);
+ $CGST = $this->input->post('Cgst'.$i);
+ $beforeCGST = $this->input->post('beforeCgst'.$i);
+ $IGST = $this->input->post('Igst'.$i);
+ $beforeIGST = $this->input->post('beforeIgst'.$i);
+ $otherallowance = $this->input->post('otherallowance'.$i);
+ $beforeotherallowance = $this->input->post('beforeotherallowance'.$i);
+ $servicematerialdescription = $this->input->post('servicematerialdescription'.$i);
+
$CostCenter = $this->input->post('costCode'.$i);
$POLineItemNo = $this->input->post('LineItemNo'.$i);
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
$ServiceFrequency=$this->input->post('Frequency'.$i);
-
$LineItemNo = '';
$RecQtyvalue=0;
- $ReceivedQty = $this->purchaseorder_model->GetLineItemReceivedQty($PONO,$MaterialCode);
+ $rowspanvalue=0;
+ $ReceivedQty = $this->purchaseorder_model->GetLineItemReceivedQty($PONO,$MaterialCode);
+ if(count($ReceivedQty)>0)
+ {
+ $RecQtyvalue = $ReceivedQty[0]['ReceivedQuantity'];
+ }
+
+ if($Quantity != $beforeQuantity)
+ {
+ $rowspanvalue++;
+ $CAD.="
|
+ + + |
+||
|
+ Vendor Address : + |
+
+ Delivery To : + + |
+|
| PO DATE : | +DELIVERY DATE / SCHEDULE BY : | +|
| Requistion Number | +Requested By | +Requested Department | +Cost Center | +
| + | + | + | + |
| # | +Item Code | +Service Description | +Qty | +UOM | +Rate In INR | +Basic Amount In INR | +SGST In INR | +CGST In INR | +IGST In INR | +Other Allow In INR | +Total Amount In INR | +
|---|---|---|---|---|---|---|---|---|---|---|---|
| + | MaterialName ; ?> | +ServiceMaterialDescription ; ?> | +Quantity ; ?> | +UOM ; ?> | +Rate ; ?> | +BasicValue ; ?> | +After_SGST ; ?> | +After_CGST ; ?> | +After_IGST ; ?> | +otherallowance ; ?> | + ++ |
|
+ Amended Details + |
+ ||
| +" . $v->AmendedDetails . ""; + break; + } +}?> + | +||
| Item Description | +Previous Details | Current Details | +
| Total Amount In Words |
+ Total Amount Before Tax In INR - | +
| Total Tax Amount In INR - | +|
| Total Amount After Tax In INR - | +|
|
+ Payment Terms + + |
+
+ Certified that the particulars given above are true and correct + ++ Authorized Signatory + |
+
+
+