diff --git a/application/controllers/amendmentpurchaseorder.php b/application/controllers/amendmentpurchaseorder.php index 5ebda2b2..6f633543 100755 --- a/application/controllers/amendmentpurchaseorder.php +++ b/application/controllers/amendmentpurchaseorder.php @@ -250,21 +250,9 @@ class amendmentpurchaseorder extends BaseController $POType = $this->input->post('POType'); $PoRange = $this->input->post('txtPoRange'); $PaymentTerms=$this->input->post('PaymentTerms'); - $PayableAT=$this->input->post('PayableAT'); - $PaymentDate=$this->input->post('Payment'); + - if($PaymentDate==1) - { - $PaymentDays='After'; - } - else - { - $PaymentDays='Before'; - } - // echo $PaymentTerms; - // echo $PayableAT; - // echo $PaymentDays; - // echo "FINAL"; + $SpcialInstruction = $this->input->post('SpcialInstruction'); $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); @@ -273,12 +261,7 @@ class amendmentpurchaseorder extends BaseController $updatedBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('txtRowCount'); - //echo $RowCount; - - - //$DeletedRow = $this->input->post('txtDeletedRow'); - - // $comma_separated = explode(':', $DeletedRow); + $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $updateddt = $dt->format('Y-m-d H:i:s'); // PO Master @@ -347,68 +330,21 @@ class amendmentpurchaseorder extends BaseController $LineItemNo = ''; - // $SkipInsert = "False"; - // if( count($comma_separated) > 0) - // { - // for($j = 1; $j < count($comma_separated); $j++) - // { - // $deletedRow = $comma_separated[$j] ; - - // if($deletedRow == $i ) - // { - // $SkipInsert = "True"; - // break; - // } - - // } - // } - // if($SkipInsert == "False") - // { - // if(strlen($POLineItemNo) == 0) - // { + $POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter); - //print_r($POLineItemList); - //die(); + $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - //print_r($POLineItem); - // if(count($POLineItem)>0) - // { + foreach($POLineItem as $line): $LineItemNo = $line['LineItemNo']; endforeach; - //echo "Lineitem no is" . $LineItemNo; - //print_r($LineItemNo); - - // } - - //} - // else - // { - // $LineItemNo = $POLineItemNo; - - // $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter); - // $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList); - - // } - // $isExists = $this->purchaseorder_model->LineItemExistsinRevenueTax($LineItemNo); - // if(count($isExists) == 0) - // { $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt); $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); - //echo "DONE ALL"; - - // } - // else - // { - // $RevenueTaxList = array('DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt); - // $this->purchaseorder_model->updateRevenueTax($LineItemNo,$RevenueTaxList); - - // } } echo 'Purchase Order Amended Successfully! PO Number Is: '.$PONO .'- New PO Number is'.$NewPO;