diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 412ef556..62981559 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -1705,7 +1705,7 @@ function addNewImportPurchaseOrder() } } /* Add capital Po*/ - function addNewCapitalPurchaseOrder() + function addNewCapitalPurchaseOrder() { @@ -1730,38 +1730,47 @@ function addNewImportPurchaseOrder() $DeliveryOption = $this->input->post('DateRange'); - //echo $DeliveryOption; - //die(); + $DeliverySchedule=''; $Dispatch=''; + $Deliverydt=''; if($DeliveryOption==1) { $Dispatch=''; + $Deliverydt=''; $DeliverySchedule = $this->input->post('Scheduleby'); } - - + else if($DeliveryOption==2) + { + $Deliverydt=''; + $DeliverySchedule = ''; + $Dispatch = $this->input->post('Dispatch'); + } + else { - $Dispatch = $this->input->post('Dispatch'); + $Dispatch = ''; $DeliverySchedule = ''; + $Deliverydt = $this->getDateformat($dt); } $capitalType = $this->input->post('capitalType'); if($capitalType=='Domestic'){ $CapitalRange = '1'; $ExchangeRateOn = ''; $ExchangeRate=''; + $Palaceoforigin=''; } else{ $CapitalRange = '0'; $ExchangeRateOn = $this->input->post('ExchangeRateOn'); $ExchangeRate=$this->input->post('ExchangeRt'); + $Palaceoforigin=$this->input->post('PlaceOforigin'); } $PaymentMethod = $this->input->post('PaymentMethod'); - $Palaceoforigin=$this->input->post('PlaceOforigin'); + @@ -1781,7 +1790,7 @@ function addNewImportPurchaseOrder() $createddt = $dt->format('Y-m-d H:i:s'); $currencytypeID = $this->input->post('currencytype'); - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt); // $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin); @@ -1945,21 +1954,27 @@ function addNewImportPurchaseOrder() $DeliveryOption = $this->input->post('DateRange'); - //echo $DeliveryOption; - //die(); $DeliverySchedule=''; $Dispatch=''; + $Deliverydt=''; if($DeliveryOption==1) { $Dispatch=''; + $Deliverydt=''; $DeliverySchedule = $this->input->post('Scheduleby'); } - - + else if($DeliveryOption==2) + { + $Deliverydt=''; + $DeliverySchedule = ''; + $Dispatch = $this->input->post('Dispatch'); + } + else { - $Dispatch = $this->input->post('Dispatch'); + $Dispatch = ''; $DeliverySchedule = ''; + $Deliverydt = $this->getDateformat($dt); } @@ -2001,7 +2016,7 @@ function addNewImportPurchaseOrder() $updateddt = $dt->format('Y-m-d H:i:s'); - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index be380164..7913ba9b 100755 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -121,9 +121,10 @@ foreach ($PaymentTerms as $TER) - - + \ No newline at end of file diff --git a/application/views/editCapitalPo.php b/application/views/editCapitalPo.php index 0dc352ba..64924a14 100755 --- a/application/views/editCapitalPo.php +++ b/application/views/editCapitalPo.php @@ -157,8 +157,9 @@ if(!empty($AvlBudAmt)) var DelDt = ''; $(document).ready(function () { if(DelOpt=="0"){ - $('#Deliverydtdiv').show(); + $('#Deliverydtdiv').hide(); $('#Schedulediv').hide(); +$('#deliverydateby').show(); $('#Deliverydt').val(DelDt); } @@ -167,6 +168,14 @@ $('#Deliverydt').val(DelDt); $('#Schedulediv').show(); $('#Deliverydt').val(''); +$('#Scheduleby').val(SchName); +} +else if(DelOpt=="2"){ + $('#Deliverydtdiv').show(); + $('#Schedulediv').hide(); + $('#deliverydateby').hide(); +$('#Deliverydt').val(''); + $('#Scheduleby').val(SchName); } }); @@ -190,7 +199,10 @@ window.onload = function() document.getElementById('EditModalImportTaxHide').style.display = 'none'; document.getElementById('ExchangeRateModalViewDiv').style.display = 'none'; document.getElementById('ViewModalImportTaxHide').style.display = 'none'; - + document.getElementById('PlaceOforigindiv').style.display = 'none'; + document.getElementById('dispatchinternational').style.display = 'none'; + document.getElementById('datedomestic').style.display = 'block'; + capitalType='Domestic'; @@ -207,6 +219,9 @@ document.getElementById('ExchangeRateModalViewDiv').style.display = 'block'; capitalType='International'; document.getElementById('currencyTypeDiv').style.display = 'block'; document.getElementById('ViewModalImportTaxHide').style.display = 'block'; + document.getElementById('dispatchinternational').style.display = 'block'; + document.getElementById('datedomestic').style.display = 'none'; + } } @@ -234,15 +249,24 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; minDate : 'now', dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' }); - $('#Date').click(function () { - //for Date range selection + $('#Date').click(function () { + //for Dispatch range selection $('#Schedulediv').hide(); $('#Deliverydtdiv').show(); + $('#deliverydateby').hide(); }); $('#Schedule').click(function () { //for schedule range selection $('#Deliverydtdiv').hide(); $('#Schedulediv').show(); + $('#deliverydateby').hide(); + }); + + $('#DeliverycheckDate').click(function () { + //for Delivery Date selection + $('#Schedulediv').hide(); + $('#deliverydateby').show(); + $('#Deliverydtdiv').hide(); }); }); @@ -386,12 +410,16 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; Select Delivery By
+ + 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?> @@ -400,7 +428,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; +

@@ -459,7 +496,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
-
+
- + @@ -2640,7 +2677,6 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- @@ -2663,6 +2699,17 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
+
+
+ + + 'CapitalToatlOrder','value' => set_value('CapitalToatlOrder',number_format($totalCapitalOrder, 2, '.', '')),'id'=>'CapitalToatlOrder', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+
+
'txtSpcialInstruction','value' => set_value('txtSpcialInstruction',$ServiceDescription),'id'=>'txtSpcialInstruction', 'class' => 'form-control','rows' => '10', 'cols' => '40' ); @@ -5258,4 +5305,4 @@ function calculateIgstTax(varBasicValue,Igst) } - + \ No newline at end of file diff --git a/application/views/servicePurchaseorder.php b/application/views/servicePurchaseorder.php index 1a02c2f5..668c7a95 100755 --- a/application/views/servicePurchaseorder.php +++ b/application/views/servicePurchaseorder.php @@ -96,6 +96,7 @@ $('#drpSupplier').change(function() { $.each(y, function(idx, obj) { if(obj.SupplierID === id) { + $("#SupAddress").val(obj.Address); $("#SupAddress").val(obj.Address);