diff --git a/application/controllers/MRIRcontroller.php b/application/controllers/MRIRcontroller.php old mode 100644 new mode 100755 diff --git a/application/controllers/emergencypurchaseorder.php b/application/controllers/emergencypurchaseorder.php index b229edd2..ae3048c7 100755 --- a/application/controllers/emergencypurchaseorder.php +++ b/application/controllers/emergencypurchaseorder.php @@ -64,6 +64,8 @@ class emergencypurchaseorder extends BaseController $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); + $data['Payment']=$this->purchaseorder_model->getSupplierPayment('C009'); + $data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); $this->loadViews("alterpurchaseorder", $this->global, $data, Null); @@ -130,6 +132,14 @@ class emergencypurchaseorder extends BaseController $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $createddt = $dt->format('Y-m-d H:i:s'); + $PaymentTerms=$this->input->post('PaymentMethod'); + $PayableAT=$this->input->post('PayableAT'); + + $PaymentDays=$this->input->post('paymentDateOptions'); + $ServiceWorkStatus=$this->input->post('workStatus'); + + + //create T_Requestion_Master $Request = array('ReqType'=>$POType, 'Requestedby'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$SpcialInstruction,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy); @@ -143,7 +153,7 @@ class emergencypurchaseorder extends BaseController // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt ); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'ServiceWorkStatus'=>$ServiceWorkStatus,'POType'=>$POType); $POMaster = $this->purchaseorder_model->addPOMaster($POList); $PONO = ''; @@ -172,6 +182,7 @@ class emergencypurchaseorder extends BaseController $CostCenter = $this->input->post('costCode'.$i); $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); + $ServiceFrequency=$this->input->post('Frequency'.$i); $SkipInsert = "False"; if( count($comma_separated) > 0) { @@ -198,7 +209,7 @@ class emergencypurchaseorder extends BaseController - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); + $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); $LineItemNo = ''; if(count($POLineItem)>0) @@ -243,6 +254,7 @@ class emergencypurchaseorder extends BaseController function addNewRevenuePurchaseOrder() { + $POdt =$this->input->post('PODate'); $PODate = $this->getDateformat($POdt); $SupplierID = $this->input->post('drpSupplier'); @@ -276,7 +288,10 @@ class emergencypurchaseorder extends BaseController $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $createddt = $dt->format('Y-m-d H:i:s'); - + $PaymentTerms=$this->input->post('PaymentMethod'); + $PayableAT=$this->input->post('PayableAT'); + + $PaymentDays=$this->input->post('paymentDateOptions'); //add requistion $Request = array('ReqType'=>$POType, 'Requestedby'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$SpcialInstruction,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy); @@ -288,7 +303,7 @@ class emergencypurchaseorder extends BaseController $RegNo = $Req[0]['ReqNo']; } // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt ); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'POType'=>$POType ); $POMaster = $this->purchaseorder_model->addPOMaster($POList); @@ -1091,3 +1106,4 @@ class emergencypurchaseorder extends BaseController } ?> + diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 57244602..9caa777c 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -270,7 +270,7 @@ class purchaseorder extends BaseController endforeach; $data['MaterialList'] = $result;//$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray); $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); - $data['Payment']=$this->purchaseorder_model->getSupplierPayment(); + $data['Payment']=$this->purchaseorder_model->getSupplierPayment('C009'); $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); /* Cost code from Requisition - Client Review Fix Start here */ diff --git a/application/logs/log-2017-07-06.php b/application/logs/log-2017-07-06.php new file mode 100644 index 00000000..03c5920a --- /dev/null +++ b/application/logs/log-2017-07-06.php @@ -0,0 +1,6 @@ + + +ERROR - 2017-07-06 07:52:20 --> Severity: Notice --> Undefined variable: RequistionDetails /opt/lampp/htdocs/Git_Server/siddharth_application/application/views/alterpurchaseorder.php 138 +ERROR - 2017-07-06 07:52:20 --> Severity: Notice --> Undefined variable: MaterialList /opt/lampp/htdocs/Git_Server/siddharth_application/application/views/alterpurchaseorder.php 140 +ERROR - 2017-07-06 07:52:20 --> Severity: Notice --> Undefined variable: MaterialList /opt/lampp/htdocs/Git_Server/siddharth_application/application/views/alterpurchaseorder.php 186 +ERROR - 2017-07-06 07:58:05 --> Severity: Warning --> mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given /opt/lampp/htdocs/Git_Server/siddharth_application/system/database/drivers/mysqli/mysqli_result.php 38 diff --git a/application/models/mrir_model.php b/application/models/mrir_model.php old mode 100644 new mode 100755 diff --git a/application/models/store_model.php b/application/models/store_model.php old mode 100644 new mode 100755 diff --git a/application/views/Editmaterialinspectionreport.php b/application/views/Editmaterialinspectionreport.php old mode 100644 new mode 100755 diff --git a/application/views/alterpurchaseorder.php b/application/views/alterpurchaseorder.php index d4b0b791..0e11b813 100755 --- a/application/views/alterpurchaseorder.php +++ b/application/views/alterpurchaseorder.php @@ -1975,6 +1975,30 @@ function populateValueMainFormForDeleteItem(rowid) + +
+
+ Payment Details + +
+ Payable Terms + 'Select Payment method'); + //print_r( $options); + + if(!empty($payment)) + { + foreach ($payment as $payment): + + + $options1[$rl->ConfigValue] = $rl->ConfigValue.' '.' - '.' '.$rl->ConfigValue; + + endforeach; + } + + echo form_dropdown('PaymentMethod', $options1,set_value('PaymentMethod'),'id="PaymentMethod"' ,'class="form-control"'); + + ?> +
+ +
+ Payable AT + + 'PayableAT','value' => set_value('PayableAT'),'id'=>'PayableAT', 'class' => 'form-control' ,'required' => 'true'); + echo form_input($data); + ?> + +
+ + +
+ Payment Date
+ + + "Payment", "id"=>"Before", "value"=>"0", 'checked'=>set_radio('Payment', '0', TRUE))); ?>     + + "Payment", "id"=>"After", "value"=>"1", 'checked'=>set_radio('Payment', '1', FALSE))); ?> + + + +
+ +
+
+
Add Line Item @@ -2735,7 +2813,7 @@ function populateValueMainFormForDeleteItem(rowid)
-
+
-
+
-
+
-
+
+ +
+ + 'Frequency','value' => set_value('Frequency'),'id'=>'Frequency', 'class' => 'form-control'); + echo form_input($data); + ?> +
+
+
+
+
-
+
-
+
; + + $.each(paymentList, function(idx1, obj1) { + + + if(obj1.ConfigValue == supPaymentTerms ) + { + $("#PaymentMethod").append( $('').val(obj1.ConfigValue).html(obj1.ConfigValue)); + $("#PayableAT").val(supPaymentAT); + + + + + } + + + }); + + $.each(paymentList, function(idx, obj) { + + + if(obj.ConfigValue != supPaymentTerms ) + { + $("#PaymentMethod").append( $('').val(obj.ConfigValue).html(obj.ConfigValue)); + $("#PayableAT").val(supPaymentAT); + + + + } + + + }); } else @@ -5358,7 +5504,7 @@ function populateValueMainFormForDeleteItem(rowid) var uom = $("#ServiceUOM").val(); var quantity = $("#ServiceQuantity").val(); var itemRate = $("#ServiceRate").val(); - + var AfterServiceTax = $("#AfterServiceTax").val(); @@ -5378,10 +5524,10 @@ function populateValueMainFormForDeleteItem(rowid) var basicval = $("#ServiceBasAmt").val(); - - + var Frequency =$("#Frequency").val(); + var TotalTaxValue = calculateTaxValue(); - + $('#ServiceMaterialCode option[value='+materialCode+']').remove(); SelectedMaterialCode[CollIndex] = materialCode; @@ -5416,6 +5562,7 @@ function populateValueMainFormForDeleteItem(rowid) addHidden(theForm,"KrishiTax"+temp,AfterKrishiTax); addHidden(theForm,"SwachhTax"+temp,AfterSwachhTax); addHidden(theForm,"TotalOrderValue"+temp,TotalOrderValue); + addHidden(theForm,"Frequency"+temp,Frequency); $('#txtRowCount').val(temp); @@ -5560,6 +5707,7 @@ function populateValueMainFormForDeleteItem(rowid) $('#EditAfterKrishiTax').val($('#KrishiTax'+userid).val()); $('#EditAfterSwachhTax').val($('#SwachhTax'+userid).val()); $('#EditTotalOrderValue').val(cellval[8].innerHTML); + @@ -5910,7 +6058,17 @@ $('#content').loader('hide'); var TextTotalOrderValueSummaryService = $('#txtTotalOrderValueSummaryService').val(); var TextSpcialInstruction = $('#txtSpcialInstruction').val(); var TextStatus = stat; - + var PaymentMethod = $('#PaymentMethod').val(); + var PayableAT = $('#PayableAT').val(); + var paymentDateOptions =''; + if($("input:radio[name='Payment']:checked").val=='0'){ + paymentDateOptions="Before"; + } + else{ + paymentDateOptions="After"; + } + var workStatus=$('#workstatusValue').val(); + if(validate()) { @@ -5929,7 +6087,7 @@ $('#content').loader('hide'); { $('#content').loader('show'); $.ajax({ - data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextStatus="+TextStatus, + data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextStatus="+TextStatus+"&PaymentMethod="+PaymentMethod+"&PayableAT="+PayableAT+"&paymentDateOptions="+paymentDateOptions+"&workStatus="+workStatus, type:"POST", url:"emergencypurchaseorder/addNewServicePurchaseOrder", success:function(data) { @@ -5984,7 +6142,15 @@ $('#content').loader('hide'); var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val(); var TextSpcialInstruction = $('#txtSpcialInstruction').val(); var TextStatus = stat; - + var PaymentMethod = $('#PaymentMethod').val(); + var PayableAT = $('#PayableAT').val(); + var paymentDateOptions =''; + if($("input:radio[name='Payment']:checked").val=='0'){ + paymentDateOptions="Before"; + } + else{ + paymentDateOptions="After"; + } if(validate()) { if(document.getElementById('serviceTax').rows.length < 2) @@ -6002,7 +6168,7 @@ $('#content').loader('hide'); { $('#content').loader('show'); $.ajax({ - data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeletedRowCount="+TextDeletedRowCount+"&txtTotalOrderValueSummary="+txtTotalOrderValueSummary+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextStatus="+TextStatus, + data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeletedRowCount="+TextDeletedRowCount+"&txtTotalOrderValueSummary="+txtTotalOrderValueSummary+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextStatus="+TextStatus+"&PaymentMethod="+PaymentMethod+"&PayableAT="+PayableAT+"&paymentDateOptions="+paymentDateOptions, type:"POST", url:"emergencypurchaseorder/addNewRevenuePurchaseOrder", success:function(data) { diff --git a/application/views/capitalpurchaseorder.php b/application/views/capitalpurchaseorder.php index ba7b8f1b..cac2330d 100755 --- a/application/views/capitalpurchaseorder.php +++ b/application/views/capitalpurchaseorder.php @@ -82,6 +82,7 @@ $paymentCheckDays1='After'; }); }); +document.getElementById("Date").checked = true;
- +
@@ -215,7 +216,7 @@ $paymentCheckDays1='After'; Select Delivery By
- "DateRange", "id"=>"Date", "value"=>"0", 'checked'=>set_radio('DateRange', '0', TRUE))); ?>     + "DateRange", "id"=>"Date", "value"=>"0", 'checked'=>'checked')); ?>     "DateRange", "id"=>"Schedule", "value"=>"1", 'checked'=>set_radio('DateRange', '1', FALSE))); ?> @@ -326,12 +327,11 @@ $paymentCheckDays1='After';
Payment Date
+ + + "Payment", "id"=>"Before", "value"=>"Before", 'checked'=>set_radio('Payment', 'Before', TRUE))); ?>     - - 'Payment', 'value' => 'Before', 'checked' => ('Before'==$paymentCheckDays) ? TRUE : FALSE, 'id' => 'Before')); ?> - - - 'Payment', 'value' => 'After', 'checked' => ('After'==$paymentCheckDays1) ? TRUE : FALSE, 'id' => 'After')); ?> + "Payment", "id"=>"After", "value"=>"After", 'checked'=>set_radio('Payment', 'After', FALSE))); ?> @@ -491,7 +491,7 @@ $paymentCheckDays1='After';
- +
'CPRate','value' => set_value('CPRate'),'id'=>'CPRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Ratechange();' ); @@ -1032,7 +1032,7 @@ $paymentCheckDays1='After';
- +
'EditCPRate','value' => set_value('EditCPRate'),'id'=>'EditCPRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'EditRatechange();' ); @@ -1786,6 +1786,17 @@ $paymentCheckDays1='After'; supPaymentTerms=obj.PaymentTerms; supPaymentAT=obj.PayableAT; subPaymentDate=obj.PaymentDays; + + if (subPaymentDate=="After") + { + //alert(); + document.getElementById("After").checked = true; + + } + else{ + document.getElementById("Before").checked = true; + + } } @@ -1799,9 +1810,9 @@ $paymentCheckDays1='After'; $.each(paymentList, function(idx1, obj1) { - if(obj1.PaymentTerms == supPaymentTerms ) + if(obj1.ConfigValue == supPaymentTerms ) { - $("#PaymentMethod").append( $('').val(obj1.PaymentTerms).html(obj1.PaymentTerms)); + $("#PaymentMethod").append( $('').val(obj1.ConfigValue).html(obj1.ConfigValue)); $("#PayableAT").val(supPaymentAT); @@ -1815,9 +1826,9 @@ $paymentCheckDays1='After'; $.each(paymentList, function(idx, obj) { - if(obj.PaymentTerms != supPaymentTerms ) + if(obj.ConfigValue != supPaymentTerms ) { - $("#PaymentMethod").append( $('').val(obj.PaymentTerms).html(obj.PaymentTerms)); + $("#PaymentMethod").append( $('').val(obj.ConfigValue).html(obj.ConfigValue)); $("#PayableAT").val(supPaymentAT); @@ -4136,4 +4147,4 @@ function SetCapitalPo() - \ No newline at end of file + diff --git a/application/views/editCapitalPo.php b/application/views/editCapitalPo.php index 7e8a06ef..e59677fb 100755 --- a/application/views/editCapitalPo.php +++ b/application/views/editCapitalPo.php @@ -429,8 +429,8 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; foreach ($Payment as $rl): - if($PaymentTerms==$rl->PaymentTerms){ - $options6[$rl->PaymentTerms] = $rl->PaymentTerms; + if($PaymentTerms==$rl->ConfigValue){ + $options6[$rl->ConfigValue] = $rl->ConfigValue; } @@ -443,8 +443,8 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; foreach ($Payment as $rl2): - if($PaymentTerms!=$rl2->PaymentTerms){ - $options6[$rl2->PaymentTerms] = $rl2->PaymentTerms; + if($PaymentTerms!=$rl2->ConfigValue){ + $options6[$rl2->ConfigValue] = $rl2->ConfigValue; } endforeach; @@ -2081,9 +2081,9 @@ var myArray = ; $.each(paymentList, function(idx1, obj1) { - if(obj1.PaymentTerms == supPaymentTerms ) + if(obj1.ConfigValue == supPaymentTerms ) { - $("#PaymentMethod").append( $('').val(obj1.PaymentTerms).html(obj1.PaymentTerms)); + $("#PaymentMethod").append( $('').val(obj1.ConfigValue).html(obj1.ConfigValue)); $("#PayableAT").val(supPaymentAT); @@ -4454,4 +4454,4 @@ PaymentDate=$('#After').val(); }); - \ No newline at end of file + diff --git a/application/views/materialinspectionreport.php b/application/views/materialinspectionreport.php old mode 100644 new mode 100755 diff --git a/application/views/viewmaterialinspectionreport.php b/application/views/viewmaterialinspectionreport.php old mode 100644 new mode 100755