From 4b8b778a55bb482af4f4ed3932c51574038bece9 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 12 Oct 2024 17:54:44 +0530 Subject: [PATCH] worked on alignment issue in amendment po -vadivel J --- app/Views/editCapitalAmendPO.php | 9164 +++++++++++++++--------------- app/Views/editImportAmendPO.php | 30 +- app/Views/editRevenueAmendPO.php | 5 + app/Views/editServiceAmendPO.php | 21 +- 4 files changed, 4765 insertions(+), 4455 deletions(-) diff --git a/app/Views/editCapitalAmendPO.php b/app/Views/editCapitalAmendPO.php index 49acae38..565b3e63 100755 --- a/app/Views/editCapitalAmendPO.php +++ b/app/Views/editCapitalAmendPO.php @@ -1,915 +1,1272 @@ - "NO", "value" => "0"), - array("name" => "YES", "value" => "1") - ); - $requestedBy = $requestedBy[0]->FirstName; +$insuranceStatus = array( + array("name" => "NO", "value" => "0"), + array("name" => "YES", "value" => "1") +); +$requestedBy = $requestedBy[0]->FirstName; - // $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - // $CurrentDate = $dt->format('Y-m-d'); - $res_arr_values = array(); - $DeliverOption = ''; - $SupId = ''; - $SupName = ''; - $Address = ''; - $PODate = ''; - $TotalCgst = ''; - $TotalSgst = ''; - $TotalIgst = ''; - $DeliveryAddress = ''; - $POStatus = ''; - $PONO = ''; - $PaymentOtherDescription = ''; - $TotalSGST = 0.0; - $TotalCGST = 0.0; - $TotalIGST = 0.0; - $Totalotherallowances = 0.0; - $TotalDiscountedAmt = 0.0; +// $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); +// $CurrentDate = $dt->format('Y-m-d'); +$res_arr_values = array(); +$DeliverOption = ''; +$SupId = ''; +$SupName = ''; +$Address = ''; +$PODate = ''; +$TotalCgst = ''; +$TotalSgst = ''; +$TotalIgst = ''; +$DeliveryAddress = ''; +$POStatus = ''; +$PONO = ''; +$PaymentOtherDescription = ''; +$TotalSGST = 0.0; +$TotalCGST = 0.0; +$TotalIGST = 0.0; +$Totalotherallowances = 0.0; +$TotalDiscountedAmt = 0.0; - $TotalFreightvalue = 0.0; - $TotalFrieght = 0; +$TotalFreightvalue = 0.0; +$TotalFrieght = 0; - $totigst = 0; - $totSubtotal = 0; - $totassesable = 0; +$totigst = 0; +$totSubtotal = 0; +$totassesable = 0; - $TotalSummary = 0.0; - $TotalBasicAmount = 0.0; - $scopeofwork = ''; - $Import_DispatchDetails = ''; - $Import_PlaceofOrgin = ''; - $CapitalRange = ''; +$TotalSummary = 0.0; +$TotalBasicAmount = 0.0; +$scopeofwork = ''; +$Import_DispatchDetails = ''; +$Import_PlaceofOrgin = ''; +$CapitalRange = ''; - $Deliverydt = ''; - $DeliverSchedule = ''; - $MaxPoDate = ''; - $AvlAmount = 0; - $currentCurrencyType = ''; - $exchangeRate = ''; - $exchangeRate = $ExchangeRate; - $ConfigValue = ''; +$Deliverydt = ''; +$DeliverSchedule = ''; +$MaxPoDate = ''; +$AvlAmount = 0; +$currentCurrencyType = ''; +$exchangeRate = ''; +$exchangeRate = $ExchangeRate; +$ConfigValue = ''; - $tt = 0.0; +$tt = 0.0; - $TotalLanding = 0; - $tothighseas = 0; - $totcustom = 0; - $totexciseduty = 0; - $totexcisedutyED = 0; - $totexciseSH = 0; - $totcustomED = 0; - $totcustomSH = 0; - $totaddtnlexcise = 0; - $totgrossduty = 0; - $totavlmodvat = 0; - $totgrossexpense = 0; - $totordervalue = 0; - $ExchangeRate = 0; - $totorder = 0; - $ExchangeRate = ''; - $PaymentTerms = ''; - $PaymentDays = ''; - $PayableAT = ''; - $ExchangeDate = ''; - $ExchangeRateOn = ''; - $UpdatedOn; - $CapitalRange = ''; - $PoStatusName = ''; - $ModeOfShipment = ''; - $SupplierReference = ''; - $SuppliersOfferNo = ''; - $OtherReferences = ''; - $InsuranceOptions = ''; - $InsuranceNumber = ''; - $ServiceTypeOptions = ''; - $FinalTotalBasic = 0; +$TotalLanding = 0; +$tothighseas = 0; +$totcustom = 0; +$totexciseduty = 0; +$totexcisedutyED = 0; +$totexciseSH = 0; +$totcustomED = 0; +$totcustomSH = 0; +$totaddtnlexcise = 0; +$totgrossduty = 0; +$totavlmodvat = 0; +$totgrossexpense = 0; +$totordervalue = 0; +$ExchangeRate = 0; +$totorder = 0; +$ExchangeRate = ''; +$PaymentTerms = ''; +$PaymentDays = ''; +$PayableAT = ''; +$ExchangeDate = ''; +$ExchangeRateOn = ''; +$UpdatedOn; +$CapitalRange = ''; +$PoStatusName = ''; +$ModeOfShipment = ''; +$SupplierReference = ''; +$SuppliersOfferNo = ''; +$OtherReferences = ''; +$InsuranceOptions = ''; +$InsuranceNumber = ''; +$ServiceTypeOptions = ''; +$FinalTotalBasic = 0; - $BudgetType = ''; - $PrePOFile = ''; +$BudgetType = ''; +$PrePOFile = ''; - $INR = ''; - $INRSYM = ''; - if (!empty($INRSYMBOL)) { - foreach ($INRSYMBOL as $INR) { - $INRSYM = $INR->Currency_Code; - $INR = $INR->FontCode2000; +$INR = ''; +$INRSYM = ''; +if (!empty($INRSYMBOL)) { + foreach ($INRSYMBOL as $INR) { + $INRSYM = $INR->Currency_Code; + $INR = $INR->FontCode2000; + } +} + +//echo $INR; + +if (!empty($MaxPODate)) { + foreach ($MaxPODate as $date) { + $MaxPoDate = $date->PODate; + } +} +if (!empty($POItem)) { + //print_r($POItem); +} +if (!empty($POMaster)) { + //print_r($POMaster); + + foreach ($POMaster as $Req) { + + $SupId = $Req->SupplierID; + + $SupName = $Req->SupplierName; + $Address = $Req->MSME ? "MSME : " . $Req->MSME . "\n" . $Req->Address : $Req->Address; + $pdt = new DateTime($Req->PODate); + $PODate = $pdt->format('d-m-Y'); + $DeliverOption = $Req->DeliveryOption; + //echo $DeliverOption; + + $DeliverSchedule = $Req->DeliverySchedule; + //echo $DeliverSchedule; + // $Deliverydt=$Req->DeliveryDate; + if (!empty($Req->DeliveryDate)) { + $Ddt = new DateTime($Req->DeliveryDate); + $Deliverydt = $Ddt->format('d-m-Y'); + } else { + $Deliverydt = null; } + + + $DeliveryAddress = $Req->DeliveryAddress; + $POStatus = $Req->StatusCode; + $PoStatusName = $Req->StatusName; + $PONO = $Req->PONO; + $scopeofwork = $Req->ServiceDescription; + //$PayableAT=$Req->PayableAT; + $ExchangeRateOn1 = new DateTime($Req->ExchangeRateCalculatedon); + $ExchangeRateOn = $ExchangeRateOn1->format('d-m-Y'); + // $PaymentDays=$Req->PaymentDays; + $PaymentOtherDescription = $Req->PaymentOtherDescription; + $PaymentTerms = $Req->PaymentTerms; + //echo $PaymentTerms; + $UpdatedOn = $Req->UpdatedOn; + $CapitalRange = $Req->CapitalRange; + $Import_DispatchDetails = $Req->Import_DispatchDetails; + $Import_PlaceofOrgin = $Req->Import_PlaceofOrgin; + $CapitalRange = $Req->CapitalRange; + if ($CapitalRange == '0') { + $ExitExchangeRate = $Req->ExchangeRate; + $ExitTotalOrderValue = number_format($Req->TotalOrderValue * $ExitExchangeRate, 2, '.', ''); + } else { + $ExitTotalOrderValue = $Req->TotalOrderValue; + } + $ModeOfShipment = $Req->Mode_Of_Shipment; + $SupplierReference = $Req->Supplier_Reference; + $SuppliersOfferNo = $Req->Supplier_Offer_No; + $OtherReferences = $Req->Other_Reference; + $InsuranceOptions = $Req->InsuranceStatus; + $InsuranceNumber = $Req->InsuranceNumber; + $ServiceTypeOptions = $Req->POSubType; + $BudgetType = $Req->BudgetType; + $PrePOFile = $Req->POFile; + } +} + +//echo $CapitalRange; +if (!empty($POItem) && $CapitalRange == '1') { + + $currentPoBasicAmt = 0; + $currentPoDiscountedAmt = 0; + foreach ($POItem as $getTotalAmt) { + + $currentPoBasicAmt = $currentPoBasicAmt + ($getTotalAmt->Rate * $getTotalAmt->Quantity); + $currentPoDiscountedAmt = $currentPoDiscountedAmt + $getTotalAmt->Afterdiscountval; + } + if (!empty($AvlBudAmt)) { + + $AvlAmount = number_format($AvlCapitalBudAmt + $currentPoBasicAmt - $currentPoDiscountedAmt, 2, '.', ''); + } +} else { + $AvlAmount = number_format($AvlCapitalBudAmt + $ExitTotalOrderValue, 2, '.', ''); +} +?> + + + - #editpackagingcalmodel { - margin-top: 200px; - z-index: 1080 !important; - } - - - - - - - - - -
-
- -
- -
-
-
-

- Back -
+ }); + +
+
+ +
+ +
+
+
+

+ Back
- - -
-
-
-
- 'form-label-left CapitalPO ', 'name' => 'CapitalPO', 'id' => 'CapitalPO', 'enctype' => 'multipart/form-data'); - echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?> +
+ + +
+
+
+
+ 'form-label-left CapitalPO ', 'name' => 'CapitalPO', 'id' => 'CapitalPO', 'enctype' => 'multipart/form-data'); + echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?> -
-
- - +
+ + 'Selected Requisition Numbers'); - if (!empty($ReqList)) { + $options = array("0" => 'Selected Requisition Numbers'); + if (!empty($ReqList)) { - foreach ($ReqList as $SID) : + foreach ($ReqList as $SID): - $options[$SID->ReqNo] = $SID->ReqNo; + $options[$SID->ReqNo] = $SID->ReqNo; - endforeach; - } - echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"'); + endforeach; + } + echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"'); - ?> -
-
- - - - 'POType', 'value' => set_value('POType', CAPITAL), 'id' => 'POType', 'class' => 'form-control', 'readonly' => 'true'); - echo form_input($data); - ?> - -
-
- - SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName; - endforeach; - } - echo form_dropdown('drpSupplier', $options2, set_value('drpSupplier', $SupId), 'id="drpSupplier" required="true" class="form-control select2"'); - ?> -
-
- - - 'SupAddress', 'value' => set_value('SupAddress', $Address), 'id' => 'SupAddress', 'class' => 'form-control', 'readonly' => 'true', 'rows' => '3', 'cols' => '40'); - echo Form_textarea($data); - ?> - -
+ ?>
- -
-
- - + - if (!empty($Currency)) { + 'POType', 'value' => set_value('POType', CAPITAL), 'id' => 'POType', 'class' => 'form-control', 'readonly' => 'true'); + echo form_input($data); + ?> - // $currentCurrencyType=$CurrencyDetail[0]->CurrencyCode; - $options1[$Currency[0]->Currency_Code] = $Currency[0]->Currency_Code . ' ' . ' - ' . ' ' . $Currency[0]->Country_and_Currency; +
+
+ + SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName; + endforeach; + } + echo form_dropdown('drpSupplier', $options2, set_value('drpSupplier', $SupId), 'id="drpSupplier" required="true" class="form-control select2"'); + ?> +
+
+ - foreach ($Currency as $Cur) - if ($Currency[0]->Currency_Code != $Cur->Currency_Code) { - $options1[$Cur->Currency_Code] = $Cur->Currency_Code . ' ' . ' - ' . ' ' . $Cur->Country_and_Currency; - } - } + 'SupAddress', 'value' => set_value('SupAddress', $Address), 'id' => 'SupAddress', 'class' => 'form-control', 'readonly' => 'true', 'rows' => '3', 'cols' => '40'); + echo Form_textarea($data); + ?> - echo form_dropdown('currencytype', $options1, set_value('currencytype', $currentCurrencyType), 'id="currencytype" class="form-control select2" required="true"'); +
+
- ?> +
+
+ + -
- Select Delivery By -
-
- - -
- 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?> -
+ if (!empty($Currency)) { + + // $currentCurrencyType=$CurrencyDetail[0]->CurrencyCode; + $options1[$Currency[0]->Currency_Code] = $Currency[0]->Currency_Code . ' ' . ' - ' . ' ' . $Currency[0]->Country_and_Currency; + + foreach ($Currency as $Cur) + if ($Currency[0]->Currency_Code != $Cur->Currency_Code) { + $options1[$Cur->Currency_Code] = $Cur->Currency_Code . ' ' . ' - ' . ' ' . $Cur->Country_and_Currency; + } + } + + echo form_dropdown('currencytype', $options1, set_value('currencytype', $currentCurrencyType), 'id="currencytype" class="form-control select2" required="true"'); + + ?> + + +
+
+ Select Delivery By +
+
+ + +
+ 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?>
- - -
- - - 'Dispatch','value' => set_value('Dispatch',$Import_DispatchDetails),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true'); - // echo form_input($data); - - $data = array('name' => 'Dispatch', 'value' => set_value('Dispatch', $Import_DispatchDetails), 'id' => 'Dispatch', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110'); - echo Form_textarea($data); - ?> - -
-
- - - 'DeliveryAddr', 'value' => set_value('DeliveryAddr', $DeliveryAddress), 'id' => 'DeliveryAddr', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40'); - echo Form_textarea($data); - ?> - -
+