diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 0742e3ed..e3bcfdff 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -736,9 +736,10 @@ class purchaseorder extends BaseController $createddt = $dt->format('Y-m-d H:i:s'); $PaymentTerms=$this->input->post('PaymentTerms'); + $OtherPayment=$this->input->post('Otherpayment'); $Local_Interstate=$this->input->post('Range'); // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment); $POMaster = $this->purchaseorder_model->addPOMaster($POList); @@ -771,6 +772,7 @@ class purchaseorder extends BaseController $FreightType = $this->input->post('FreightType'.$i); $FreightValue = $this->input->post('FreightVal'.$i); $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); + $NOOfTrip = $this->input->post('NoOfTrip'.$i); $InsuranceValue = $this->input->post('Insval'.$i); $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); $CostCenter = $this->input->post('costCode'.$i); @@ -811,7 +813,7 @@ class purchaseorder extends BaseController if(trim($POType) == REVENUE ) { // echo 'Success'; - $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst); + $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip); $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); //echo 'Revenue tax Success'; @@ -834,14 +836,14 @@ class purchaseorder extends BaseController $dt = $this->input->post('Deliverydt'); //$Deliverydt = $this->getDateformat($dt); $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } + if($DeliveryOption==1){ + $Deliverydt = ''; + $DeliverySchedule = $this->input->post('Scheduleby'); + } + else{ + $Deliverydt = $this->getDateformat($dt); + $DeliverySchedule = ''; + } @@ -863,18 +865,17 @@ class purchaseorder extends BaseController $updateddt = $dt->format('Y-m-d H:i:s'); $PaymentTerms=$this->input->post('PaymentTerms'); + $OtherPayment=$this->input->post('Otherpayment'); $Local_Interstate=$this->input->post('Range'); // PO Master // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); $LineItemStatus = REQITEM_NEW; - - //echo $RowCount; for ($i = 1; $i <= $RowCount; $i++) { @@ -899,7 +900,8 @@ class purchaseorder extends BaseController $FreightType = $this->input->post('FreightType'.$i); $FreightValue = $this->input->post('FreightVal'.$i); $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); - $InsuranceValue = $this->input->post('Insval'.$i); + $NOOfTrip = $this->input->post('NoOfTrip'.$i); + $InsuranceValue = $this->input->post('Insval'.$i); $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); $POLineItemNo = $this->input->post('LineItemNo'.$i); $CostCenter = $this->input->post('costCode'.$i); @@ -921,10 +923,12 @@ class purchaseorder extends BaseController } } + if($SkipInsert == "False") { + if(strlen($POLineItemNo) == 0) - { + { $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); if(count($POLineItem)>0) @@ -935,6 +939,7 @@ class purchaseorder extends BaseController } else { + $LineItemNo = $POLineItemNo; $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter); @@ -944,14 +949,15 @@ class purchaseorder extends BaseController $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,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst); + $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip); $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); } else { - $RevenueTaxList = array('DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'CreatedBy'=>$updatedBy); + + $RevenueTaxList = array('DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'CreatedBy'=>$updatedBy,'NoOfTrip'=>$NOOfTrip); $this->purchaseorder_model->updateRevenueTax($LineItemNo,$RevenueTaxList); diff --git a/application/controllers/servicepurchaseorder.php b/application/controllers/servicepurchaseorder.php index f56fc376..80380352 100755 --- a/application/controllers/servicepurchaseorder.php +++ b/application/controllers/servicepurchaseorder.php @@ -158,7 +158,7 @@ class servicepurchaseorder extends BaseController function addNewServicePurchaseOrder() { - + $POdt =$this->input->post('PODate'); $PODate = $this->getDateformat($POdt); $SupplierID = $this->input->post('drpSupplier'); @@ -177,7 +177,7 @@ class servicepurchaseorder extends BaseController } $PaymentTerms=$this->input->post('PaymentTerms'); - + $OtherPayment=$this->input->post('Otherpayment'); $POType = $this->input->post('POType'); @@ -196,7 +196,7 @@ class servicepurchaseorder extends BaseController $WorkStatus=$this->input->post('workstatus'); // 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,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus,'POType'=>$POType ); + $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,'ServiceWorkStatus'=>$WorkStatus,'POType'=>$POType,'PaymentOtherDescription'=>$OtherPayment); $POMaster = $this->purchaseorder_model->addPOMaster($POList); @@ -274,6 +274,7 @@ class servicepurchaseorder extends BaseController echo 'Service Purchase Order Created Successfully!The PO NO Is: '.$PONO; } + //update service po function UpdateServicePurchaseOrder() { $PONO =$this->input->post('txtPONO'); @@ -285,20 +286,20 @@ class servicepurchaseorder extends BaseController $DeliveryAddr = $this->input->post('txtDeliveryAddress'); $dt = $this->input->post('Deliverydt'); $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } + if($DeliveryOption==1){ + $Deliverydt = ''; + $DeliverySchedule = $this->input->post('Scheduleby'); + } + else{ + $Deliverydt = $this->getDateformat($dt); + $DeliverySchedule = ''; + } - $PaymentTerms=$this->input->post('PaymentTerms'); - $Payableat=$this->input->post('PayableAT'); + $PaymentTerms=$this->input->post('PaymentTerms'); + $OtherPayment=$this->input->post('Otherpayment'); $POType = $this->input->post('POType'); @@ -317,7 +318,7 @@ class servicepurchaseorder extends BaseController // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus ); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus,'PaymentOtherDescription'=>$OtherPayment); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index d3cafa48..7e68d149 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -354,7 +354,7 @@ function purchaseorderListing($forwhat='') */ function getRequistionNoFromPO($PONO='') { - + $this->db->distinct(); $this->db->select('ReqNo,'); $this->db->from('T_PurchaseOrder_LineItem'); if($PONO != '') diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index b1287f73..09076dcb 100755 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -2,7 +2,7 @@ $DeliverOption=''; $SupId = ''; - $SupName = ''; + $SupName = ''; $Address = ''; $PODate = ''; @@ -17,13 +17,14 @@ $DeliverOption=''; $TotalBasicAmount = 0.0; $ServiceDescription = ''; $OtherAmt = 0.0; -$Deliverydt=''; -$DeliverSchedule=''; -$MaxPoDate = ''; -$AvlAmount = 0; -$Value="₹"; + + $Deliverydt=''; + $DeliverSchedule=''; + $MaxPoDate = ''; + $AvlAmount = 0; + $Value="₹"; -$StatusName=''; + $StatusName=''; if(!empty($INRSYMBOL)) @@ -67,6 +68,7 @@ if(!empty($POMaster)) $WrkStatus=$Req->ServiceWorkStatus; $StatusName=$Req->StatusName; + $otherPayment = $Req->PaymentOtherDescription; } } @@ -143,6 +145,16 @@ $('#Deliverydt').val(''); $('#Scheduleby').val(SchName); } +var PaymentOther = ''; +var PayTerms = ''; +if(PayTerms=='PT08'){ + $('#otheroptiondiv').show(); + $('#Otherpayment').val(PaymentOther); +} +else{ +$('#otheroptiondiv').hide(); + $('#Otherpayment').val(''); +} }); \ No newline at end of file diff --git a/application/views/alterpurchaseorder.php b/application/views/alterpurchaseorder.php index d3e18b16..27ed2433 100755 --- a/application/views/alterpurchaseorder.php +++ b/application/views/alterpurchaseorder.php @@ -333,8 +333,31 @@ var SelectedMaterialList = { } }); + $('#drpEditFreight').change(function() { + var FreightType =$("#drpEditFreight").val(); + alert(FreightType); + if (FreightType == "PER TRIP") + { + + $('#EditTripsValue').show(); + } + else { + + $('#EditTripsValue').hide(); + } + }); $('#drpFreight').change(function() { - + var FreightType =$("#drpFreight").val(); + alert(FreightType); + if (FreightType == "PER TRIP") + { + + $('#TripsValue').show(); + } + else { + + $('#TripsValue').hide(); + } selValue = $("#drpFreight").val() ; @@ -1754,7 +1777,9 @@ function SetExciseCalculationCancel() } } $(document).ready(function(){ - + + $("#PaymentMethod").select2(); + //Initialize Select2 Elements $("#purpose").select2(); $("#DepartmentName").select2(); @@ -1873,7 +1898,8 @@ function populateValueMainFormForDeleteItem(rowid) echo form_open($this->config->base_url().'/purchaseorder/addalterPO/',$attributes); ?> -
+
+

Siddharth Industries - Emergency Purchase Order

@@ -2010,7 +2036,7 @@ function populateValueMainFormForDeleteItem(rowid)
- +
'AvalBuget','value' => set_value('AvalBuget'),'id'=>'AvalBuget', 'class' => 'form-control num' ,'required' => 'true' ,'readonly' => 'true'); @@ -2193,7 +2219,7 @@ function populateValueMainFormForDeleteItem(rowid) Payment Details
- Payable Terms + 'Select Payment method'); //print_r( $options); @@ -2209,7 +2235,16 @@ function populateValueMainFormForDeleteItem(rowid) echo form_dropdown('PaymentMethod', $options1,set_value('PaymentMethod'),'id="PaymentMethod"' ,'class="form-control"'); ?>
-
+ +
@@ -2225,7 +2260,7 @@ function populateValueMainFormForDeleteItem(rowid)
\ No newline at end of file diff --git a/application/views/editRevenuepurchaseorder.php b/application/views/editRevenuepurchaseorder.php index a8e6fb6f..ce6c48bf 100755 --- a/application/views/editRevenuepurchaseorder.php +++ b/application/views/editRevenuepurchaseorder.php @@ -26,7 +26,7 @@ if(!empty($CompanyDetails)) if(!empty($AvlBudAmt)) { - $AvlAmount = $AvlBudAmt; + $AvlAmount = number_format($AvlBudAmt, 2, '.', ''); } @@ -65,6 +65,7 @@ foreach ($PaymentTerms as $TER) $ServiceDescription = ''; $CapitalRange = ''; + $otherPayment=''; if(!empty($POMaster)) { foreach ($POMaster as $Req) @@ -87,6 +88,7 @@ if(!empty($POMaster)) $ServiceDescription = $Req->ServiceDescription; $CapitalRange = $Req->CapitalRange; $StatusName=$Req->StatusName; + $otherPayment = $Req->PaymentOtherDescription; } } @@ -174,6 +176,16 @@ $('#Deliverydt').val(''); $('#Scheduleby').val(SchName); } +var PaymentOther = ''; +var PayTerms = ''; +if(PayTerms=='PT08'){ + $('#otheroptiondiv').show(); + $('#Otherpayment').val(PaymentOther); +} +else{ +$('#otheroptiondiv').hide(); + $('#Otherpayment').val(''); +} }); \ No newline at end of file diff --git a/application/views/editServiceAmendPO.php b/application/views/editServiceAmendPO.php index d0e01813..c5b48689 100755 --- a/application/views/editServiceAmendPO.php +++ b/application/views/editServiceAmendPO.php @@ -60,10 +60,10 @@ if(!empty($POMaster)) $PODate = $pdt->format('Y-m-d'); $DeliverOption = $Req->DeliveryOption; $DeliverSchedule = $Req->DeliverySchedule; - echo "*" . $Req->DeliveryDate . "*"; + // echo "*" . $Req->DeliveryDate . "*"; $Ddt = new DateTime($Req->DeliveryDate); $Deliverydt = $Ddt->format('Y-m-d'); - echo "-" . $Deliverydt . "-"; + // echo "-" . $Deliverydt . "-"; $DeliveryAddress =$Req->DeliveryAddress; $PONOStatus = $Req->StatusCode; $PONO = $Req->PONO; @@ -123,11 +123,11 @@ foreach ($PaymentTerms as $TER) tinymce.init({ - selector: "textarea#txtSpcialInstruction", + selector: "textarea#ScopeofWork", menubar: false, statusbar: false, - toolbar: false - //plugins: "link image" + toolbar: false, + // plugins: "link image" }); var DelOpt = ''; var SchName = ''; @@ -148,17 +148,7 @@ $('#Scheduleby').val(SchName); } }); - - + @@ -576,6 +566,9 @@ function clearEditTaxField() } $(document).ready(function () { + + $("#PaymentTerms").select2(); + $('#Date').click(function () { //for Date range selection $('#Schedulediv').hide(); @@ -741,7 +734,10 @@ $(document).ready(function () {

- + +
'Deliverydt','value' => set_value('Deliverydt',$Deliverydt),'id'=>'Deliverydt', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;'); @@ -802,8 +798,17 @@ $(document).ready(function () { - -
+ +
+ @@ -848,7 +853,7 @@ $(document).ready(function () {
- +
'EditCostCenter','value' => set_value('EditCostCenter'),'id'=>'EditCostCenter', 'class' => 'form-control' ,'readonly' => 'true'); @@ -1209,7 +1214,38 @@ $(document).ready(function () {
-
+ +
+
+
@@ -1252,7 +1288,8 @@ $(document).ready(function () {
- + + 'txtTotalOrderValueSummary','value' => set_value('txtTotalOrderValueSummary',number_format($TotalSummary, 2, '.', '')),'id'=>'txtTotalOrderValueSummary', 'class' => 'form-control num' ,'readonly' => 'true'); echo form_input($data); @@ -1268,7 +1305,7 @@ $(document).ready(function () { 'ScopeofWork','value' => set_value('ScopeofWork',$ServiceDescription),'id'=>'ScopeofWork', 'class' => 'form-control', 'rows' => '10', 'cols' => '40' ); echo form_textarea($data); - ?> + ?>
@@ -1284,42 +1321,46 @@ $(document).ready(function () { -

+ -
-
-
+
+
+
+
- Request On + 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;'); - echo form_input($data); - ?> + $data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true','readonly' => 'true'); + echo form_input($data); + ?>
-
- Request By +

+
+
+
'RequestBy','value' => set_value('RequestBy',$RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true'); + $data = array('name' => 'RequestBy','value' => set_value('RequestBy', $RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true'); echo form_input($data); ?>
-
- Status +

+ +
+
'Select Status'); - // echo form_dropdown('Status', $options,set_value('Status'),'id="Status"' ,'required="true"' ,'class="form-control select2') - // $options = array("0"=>$PONOStatus); - // echo form_dropdown('Status', $options,set_value('Status',$StatusName),'id="Status"' ,'required="true"' ,'class="form-control select2') - - + $data = array('name' => 'Status','value' => set_value('Status',$StatusName),'id'=>'Status', 'class' => 'form-control' ,'readonly' => 'true'); echo form_input($data); ?> -
+

-
+
+ +
+
+ @@ -1865,11 +1906,12 @@ function validateServiceTax() } // -// \ No newline at end of file diff --git a/application/views/purchaseorder.php b/application/views/purchaseorder.php index e8c11608..6c05c405 100755 --- a/application/views/purchaseorder.php +++ b/application/views/purchaseorder.php @@ -395,6 +395,7 @@ $("#txtEditBasicValue").val(''); $('#PackagingType').val("0"); $('#Rate').focus(); } + calculateDiscount(0); }); @@ -427,6 +428,7 @@ $('#EditDiscountType').change(function() { $('#EditDiscountType').val("0"); $('#EditRate').focus(); } + calculateDiscount(1); }); $('#PackagingType').change(function() { @@ -462,6 +464,7 @@ $('#PackagingType').change(function() { $('#PackagingType').val("0"); $('#Rate').focus(); } + calculatePackaging(0); }); @@ -488,6 +491,7 @@ $('#EditPackagingType').change(function() { $('#txtEditPackaging').removeAttr( 'readonly','true' ); } } + calculatePackaging(1); }); @@ -576,6 +580,7 @@ $('#drpFreight').change(function() { $('#drpFreight').val("0"); $('#Rate').focus(); } + calculateFreight(0); }); $('#drpEditFreight').change(function() { @@ -616,6 +621,7 @@ $('#drpEditFreight').change(function() { $('#drpEditFreight').val("0"); $('#EditRate').focus(); } +calculateFreight(1); }); }); @@ -1535,7 +1541,7 @@ var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val()); $('#txtFreight').val(''); $("#drpFreight").focus(); } - else if( $('#txtFreight').val() != "0" && $('#txtFreight').val() != '') + else if( $('#txtFreight').val() != "0" && $('#txtFreight').val() != '') { var FreightValue = parseFloat($('#txtFreight').val()); var UOM = parseFloat($('#UOM').val()); @@ -1559,8 +1565,23 @@ var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val()); AfterFreight = ; } else if(FreightType == '') - { - AfterFreight = ; + { + if($('#NOOfTrips').val()==''){ + alert('Please Enter No of Trip'); + + $("#NOOfTrips").focus(); + $('#txtFreight').val(0) + AfterFreight=0; + $('#txtAfterFreight').val("0.00"); + return false; + } + else{ + var noOftrip = $("#NOOfTrips").val(); + AfterFreight = ; + AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2); + } + + } else { AfterFreight = $("#txtFreight").val(); @@ -1603,7 +1624,7 @@ var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val()); $('#txtEditFreight').val(''); $("#drpEditFreight").focus(); } - else if( $('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '') + else if( $('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '') { var FreightValue = parseFloat($('#txtEditFreight').val()); var UOM = parseFloat($('#EditUOM').val()); @@ -1628,7 +1649,20 @@ var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val()); } else if(FreightType == '') { - AfterFreight = ; + if($('#EditNOOfTrips').val()==''){ + alert('Please Enter No of Trip'); + + $("#EditNOOfTrips").focus(); + $('#txtEditFreight').val(0) + AfterFreight=0; + $('#txtEditAfterFreight').val("0.00"); + return false; + } + else{ + var noOftrip = $("#EditNOOfTrips").val(); + AfterFreight = ; + AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2); + } } else { AfterFreight = $("#txtEditFreight").val(); @@ -2503,7 +2537,7 @@ function calculateEditTaxValue()
'NOOfTrips','value' => set_value('NOOfTrips'),'id'=>'NOOfTrips', 'class' => 'form-control num' ); + $data = array('name' => 'NOOfTrips','value' => set_value('NOOfTrips'),'id'=>'NOOfTrips', 'class' => 'form-control num' ,'onchange'=>'calculateFreight(0);'); echo form_input($data); ?>
@@ -2856,7 +2890,7 @@ function calculateEditTaxValue()
'EditNOOfTrips','value' => set_value('EditNOOfTrips'),'id'=>'EditNOOfTrips', 'class' => 'form-control num' ); + $data = array('name' => 'EditNOOfTrips','value' => set_value('EditNOOfTrips'),'id'=>'EditNOOfTrips', 'class' => 'form-control num' ,'onchange'=>'calculateFreight(1);'); echo form_input($data); ?>
@@ -3131,8 +3165,17 @@ $("#EDITREVENUE").on("shown.bs.modal", function(e) { $('#txtEditFreight').val($('#FreightVal'+userid).val()); $('#txtEditAfterFreight').val($('#AfterFreightVal'+userid).val()); + $('#EditNOOfTrips').val($('#NoOfTrip'+userid).val()); $('#txtEditInsurance').val($('#Insval'+userid).val()); + var FreightType =$('#FreightType'+userid).val(); + + if (FreightType == "PER TRIP"){ + $('#EditTripsValue').show(); + } + else{ + $('#EditTripsValue').hide(); + } $('#txtEditTotalOrderValue').val($('#TotalOrderValue'+userid).val()); $('#EditAfterCgst').val($('#RevenueAfterCgst'+userid).val()); $('#EditAfterSgst').val($('#RevenueAfterSgst'+userid).val()); @@ -3225,10 +3268,10 @@ $('.AddRevenue').click(function(){ - var FreightType = $("#drpFreight").val(); + var FreightType = $("#drpFreight").val(); var FreightVal = $("#txtFreight").val(); var AfterFreightVal = $("#txtAfterFreight").val(); - + var NoOfTrip = $("#NOOfTrips").val(); var basicval = $("#txtBasicValue").val(); var Insval = parseFloat($('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val()).toFixed(2); @@ -3295,6 +3338,8 @@ $('.AddRevenue').click(function(){ addHidden(theForm,"FreightType"+temp,FreightType); addHidden(theForm,"FreightVal"+temp,FreightVal); addHidden(theForm,"AfterFreightVal"+temp,AfterFreightVal); + addHidden(theForm,"NoOfTrip"+temp,NoOfTrip); + addHidden(theForm,"basicval"+temp,basicval); addHidden(theForm,"Insval"+temp,Insval); addHidden(theForm,"TotalOrderValue"+temp,TotalOrderValue); @@ -3337,7 +3382,7 @@ $('.AddRevenue').click(function(){ var FreightType = $("#drpEditFreight").val(); var FreightVal = $("#txtEditFreight").val(); var AfterFreightVal = $("#txtEditAfterFreight").val(); - + var NoOfTrip = $("#EditNOOfTrips").val(); var basicval = $("#txtEditBasicValue").val(); var Insval = $("#txtEditInsurance").val(); var TotalOrderValue = $("#txtEditTotalOrderValue").val(); @@ -3376,7 +3421,9 @@ $('.AddRevenue').click(function(){ $('#RevenueIgst'+userid).val(Igst); $('#RevenueAfterIgst'+userid).val(AfterIgst); $('#FreightType'+userid).val(FreightType); - $('#FreightVal'+userid).val(FreightVal); + $('#FreightVal'+userid).val(FreightVal); + $('#NoOfTrip'+userid).val(NoOfTrip); + $('#AfterFreightVal'+userid).val(AfterFreightVal); $('#basicval'+userid).val(basicval); $('#Insval'+userid).val(Insval); @@ -3540,7 +3587,7 @@ function clearRevenueModalFields() $("#drpFreight").val('0'); $("#txtFreight").val(''); $("#txtAfterFreight").val(''); - + $("#NOOfTrips").val(''); $("#txtBasicValue").val(''); $("#txtInsurance").val(''); $("#txtTotalOrderValue").val(''); @@ -3692,6 +3739,11 @@ $('#SpcialInstruction').val(splinstr); $('#Deliverydt').focus(); return false; } + else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){ + alert('Please Enter Payable Terms Description'); + $('#Otherpayment').focus(); + return false; + } else { @@ -3885,7 +3937,8 @@ $("#PaymentTerms").change(function() { $('#otheroptiondiv').show(); } else { - $('#otheroptiondiv').hide(); + $('#otheroptiondiv').hide(); + $('#Otherpayment').val(''); } }); diff --git a/application/views/servicePurchaseorder.php b/application/views/servicePurchaseorder.php index 95faf0d6..d8c4ddad 100755 --- a/application/views/servicePurchaseorder.php +++ b/application/views/servicePurchaseorder.php @@ -487,6 +487,9 @@ function clearEditTaxField() } $(document).ready(function () { + + $("#PaymentTerms").select2(); + $('#Date').click(function () { //for Date range selection $('#Schedulediv').hide(); @@ -497,7 +500,9 @@ function clearEditTaxField() $('#Deliverydtdiv').hide(); $('#Schedulediv').show(); }); + clearTotalItemValues(); }); +