diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 07dd895d..1a89c03f 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -103,105 +103,130 @@ class purchaseorder extends BaseController /** * This function used to show the Purchase Order Screen */ - function CreatePurchaseOrder() + function CreatePurchaseOrder() { - - $this->form_validation->set_rules('txtReqNo', 'txtReqNo', 'callback_Req_validate'); - - if($this->form_validation->run() == FALSE) + + $this->form_validation->set_rules('txtReqNo', 'txtReqNo', 'callback_Req_validate'); + + if($this->form_validation->run() == FALSE) { $this->requisition(); - + } else { - + $this->global['pageTitle'] = 'Siddharth : Purchase order' ; - $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); - $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); - $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); - //$data['Payment']=$this->purchaseorder_model->getSupplierPayment('C009'); - $data['Payment']=$this->purchaseorder_model->getPaymentTermsDetails(); - //$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); - $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); - + $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); + $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); + $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); + $data['Payment']=$this->purchaseorder_model->getSupplierPayment('C009'); + $data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); + + + foreach ($data['WorkStatus'] as $WST) + { + + $WStatus=$WST->ConfigValue; + //print_r($WStatus); - - - $SelectedReq = json_decode($this->input->post('txtReqNo')); - - $Req = $SelectedReq->Req; - $data['ReqList'] = $Req ; - $ReqArray = array(); - $ReqType = $this->input->post('txtReqType'); - $result = array(); - - foreach ($Req as $SID): - $ReqArray[] = $SID->ReqNo ; - $result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo); - if($ReqType == '') - { - $ReqType = $SID->ReqType; - } - - endforeach; - - - $data['MaterialList'] = $result; - //print_r($data['MaterialList']); - /* Cost code from Requisition - Client Review Fix - Start here */ - $ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray); - $data['RequistionDetails'] = $ReqDetails; - - $CostCode = ''; - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - $Year = $dt->format('Y'); - - foreach ($ReqDetails as $Rs): - $CostCode = $Rs->CostCenterCode; - endforeach; - - $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); - - - if(count($AvlBudget)>0) - { - $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; - } - /* End Here */ - - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - // $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); - $data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate(); - $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); - $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); - //print_r($data['INRSYMBOL']); + } + + + //print_r($data['WorkStatus']); + // foreach ($data['Suplist'] as $SUP) + // { + // $Detail=$SUP->PaymentTerms; + // } + + //print_r($data['Payment']); + //print_r($data['Suplist']); + $SelectedReq = json_decode($this->input->post('txtReqNo')); + + $Req = $SelectedReq->Req; + $data['ReqList'] = $Req ; + $ReqArray = array(); + $ReqType = $this->input->post('txtReqType'); + $result = array(); + + foreach ($Req as $SID): + $ReqArray[] = $SID->ReqNo ; + $result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo); + if($ReqType == '') + { + $ReqType = $SID->ReqType; + } + + endforeach; + + + $data['MaterialList'] = $result; + //print_r($data['MaterialList']); + /* Cost code from Requisition - Client Review Fix + Start here */ + $ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray); + $data['RequistionDetails'] = $ReqDetails; + $CostCode = ''; + $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); + + $Year = $dt->format('Y'); + + foreach ($ReqDetails as $Rs): + $CostCode = $Rs->CostCenterCode; + endforeach; + + $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); + + + if(count($AvlBudget)>0) + { + $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; + } + /* End Here */ + + $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); + //print_r($data['CompanyDetails']); + // $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); + $data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate(); + $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); + $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); + //print_r($data['INRSYMBOL']); + + $AvlimportBudget = $this->purchaseorder_model->GetAvailableImportBudgetAmount($CostCode,$Year,$ReqType); + + //print_r($AvlimportBudget); + + + if(count($AvlimportBudget)>0) + { + $data['AvlimportBudAmt'] = $AvlimportBudget[0]['BudgetAmount'] - $AvlimportBudget[0]['TotalValue']; + } + + //print_r($data['AvlimportBudAmt']); // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; //$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); - - $ViewName = ''; - if($ReqType == REVENUE) - { - $ViewName = 'purchaseorder'; - } + + $ViewName = ''; + if($ReqType == REVENUE) + { + $ViewName = 'purchaseorder'; + } else if($ReqType == SERVICE) - { - $ViewName = 'servicePurchaseorder'; - } - else if($ReqType == IMPORT) - { - $ViewName = 'importpo'; - } - else if($ReqType == CAPITAL) - { - $ViewName = 'capitalpurchaseorder'; - } + { + $ViewName = 'servicePurchaseorder'; + } + else if($ReqType == IMPORT) + { + $ViewName = 'importpo'; + } + else if($ReqType == CAPITAL) + { + $ViewName = 'capitalpurchaseorder'; + } $this->loadViews($ViewName, $this->global,$data, NULL); - } + } } function CreatePOPrint() { diff --git a/application/views/Amendedimportpopdf.php b/application/views/Amendedimportpopdf.php new file mode 100644 index 00000000..3f9db5e8 --- /dev/null +++ b/application/views/Amendedimportpopdf.php @@ -0,0 +1,397 @@ +CompanyName; + $CompanyAddress = $CO->Address; + } + } + + + if(!empty($POItem)) + { + + foreach ($POItem as $PO) + { + $ReqNo=$PO->ReqNo; + $PONO = $PO->PONO; + $postatus= $PO->Status; + $SuplierName = $PO->SupplierName; + $SuplierAddress = $PO->Address; + $DeliveryAddress = $PO->DeliveryAddress; + + $dt = new DateTime($PO->PODate, new DateTimeZone('Asia/Kolkata')); + $Podt = $dt->format('d-m-Y'); + $dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata')); + $DeliveryDate = $dtDe->format('d-m-Y'); + $ServiceDescription =$PO->ServiceDescription; + $CostCenterCode=$PO->CostCenterCode; + //$ReqBy=$PO->Requestedby; + + $PaymentTerms = $PO->PaymentTerms; + $PaymentDays=$PO->PaymentDays; + $PayableAT=$PO->PayableAT; + } + } + + + if(!empty($Requestername)) + + { + foreach ($Requestername as $Reqname) + { + $ReqBy=$Reqname->FirstName; + } + } + + $CurrencyCode=''; + $CurrencyName=''; + + if(!empty($Currencytype)) + { + foreach ($Currencytype as $CURRE) + { + $CurrencyCode=$CURRE->Currency_Code; + $CurrencyName=$CURRE->FontCode2000; + } + + } + + // echo $CurrencyCode; + + $DEPNAME=''; + + if(!empty($DEPCODE)) + { + foreach ($DEPCODE as $DEP) + { + $DEPNAME=$DEP->DepartmentName; + } + } + + + + + +?> + + + +
+
+ DRAFT
'; + + } + + ?> +
+
 
+
PURCHASE ORDER - PO NO:
+ + + + + + + + + + + + + + + + + + + +
+

+

+
+

Vendor Address :

+


+
+

Delivery To :

+

+
PO DATE :DELIVERY DATE / SCHEDULE BY :PLACE OF ORIGIN: UAE
+ + + + +
+ + + + + + + + + + + + + + + + + +
Requistion NumberRequested ByRequested DepartmentCost Center
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + AfterLandingCharge; + $AfterHighSeasSalesCharge=$AfterHighSeasSalesCharge+$record->AfterHighSeasSalesCharge ; + $AfterCustomDuty = $AfterCustomDuty+$record->AfterCustomDuty ; + $AfterCustomEdCess = $AfterCustomEdCess+$record->AfterCustomEdCess ; + $AfterCustomSHCess = $AfterCustomSHCess+$record->AfterCustomSHCess ; + $AfterExciseDuty = $AfterExciseDuty+$record->AfterExciseDuty ; + $AfterExciseDutyEdCess = $AfterExciseDutyEdCess+$record->AfterExciseDutyEdCess ; + $AfterAddlExciseDuty = $AfterAddlExciseDuty+$record->AfterAddlExciseDuty ; + $Grossdutypayable = $Grossdutypayable+$record->Grossdutypayable ; + $AvailableModvat = $AvailableModvat+$record->AvailableModvat ; + $Grossexpensesduetocustomduty = $Grossexpensesduetocustomduty+$record->Grossexpensesduetocustomduty ; + $purchaseratePerKG = $purchaseratePerKG+$record->purchaseratePerKG ; + $CustomDutyExpensesPerKG = $CustomDutyExpensesPerKG+$record->CustomDutyExpensesPerKG ; + $RMCIncludingCustomersPerKG = $RMCIncludingCustomersPerKG+$record->RMCIncludingCustomersPerKG ; + $AfterExciseDutySHCess= $AfterExciseDutySHCess+$record->AfterExciseDutySHCess ; + $TotalOrderValue = $TotalOrderValue+$record->BasicPriceInMTon; + } + } + + ?> + +
#Item and DescriptionQtyUOM

+
Rate per unit in Basic Price in Total Amount in
MaterialName ; ?>Quantity ; ?>UOM ; ?>Rate ; ?>Quantity*$record->Rate); + echo number_format($BasicValue,2) ; ?>TotalOrderValue; ?>
+

 

+ + +

 

+ + + + + + + + + + + + + + + + MaterialName ; + + ?> + + + + + + + + + + + +
+

Amended Details

+
+" . $v->AmendedDetails . ""; + break; + } + + +}?> +
Item Descriptionprevious Details
MaterialName ; ?>AmendedDetails ?>
+ + +

 

+ + + + + + + + + + + + +
Total Amount In Words

Total Amount In
+

Payment Terms

+

+
+

Certified that the particulars given above are true and correct

+

+

 

+

Authorized Signatory

+
+

 

+ +
Special Instructions :
+ + ReleasedOn, new DateTimeZone('Asia/Kolkata')); + + + ?> + + +

 

+
Released By : FirstName;?>
+
Released On : format('d-m-Y');?>
+ + + + + + +
\ No newline at end of file diff --git a/application/views/editImportAmendPO.php b/application/views/editImportAmendPO.php index 1ce1955d..67009ca0 100755 --- a/application/views/editImportAmendPO.php +++ b/application/views/editImportAmendPO.php @@ -113,7 +113,7 @@ if(!empty($POMaster)) $PONOStatus = $Req->StatusCode; $PONO = $Req->PONO; $ServiceDescription = $Req->ServiceDescription; - $ExchangeRate=$Req->ExchangeRate; + $ExchangeRate=number_format(($Req->ExchangeRate),2); $ExchangeRateCalculatedon=$Req->ExchangeRateCalculatedon; $PaymentTerms=$Req->PaymentTerms; @@ -241,7 +241,7 @@ body {
-

Siddharth Industries - Edit Import Purchase Order- - For Amendment

+

Siddharth Industries - Amend Import Purchase Order-

@@ -1459,7 +1465,7 @@ body {
-
Cost of the product Per KG
+
Cost of the product Per UOM

@@ -1588,7 +1594,7 @@ body {
- + 'txttotallanding','value' => set_value('txttotallanding'),'id'=>'txttotallanding', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1597,7 +1603,7 @@ body {
- + 'txttotalhighseas','value' => set_value('txttotalhighseas'),'id'=>'txttotalhighseas', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1606,7 +1612,7 @@ body {
- + 'txttotalcustom','value' => set_value('txttotalcustom'),'id'=>'txttotalcustom', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1615,7 +1621,7 @@ body {
- + 'txttotalexcise','value' => set_value('txttotalexcise'),'id'=>'txttotalexcise', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1624,7 +1630,7 @@ body {
- + 'txttotalexciseED','value' => set_value('txttotalexciseED'),'id'=>'txttotalexciseED', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1634,7 +1640,7 @@ body {
- + 'txttotalexciseSH','value' => set_value('txttotalexciseSH'),'id'=>'txttotalexciseSH', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1643,7 +1649,7 @@ body {
- + 'txttotalcustomED','value' => set_value('txttotalcustomED'),'id'=>'txttotalcustomED', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1652,7 +1658,7 @@ body {
- + 'txttotalcustomSH','value' => set_value('txttotalcustomSH'),'id'=>'txttotalcustomSH', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1661,7 +1667,7 @@ body {
- + 'txttotalAdditionalExciseduty','value' => set_value('txttotalAdditionalExciseduty'),'id'=>'txttotalAdditionalExciseduty', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1671,7 +1677,7 @@ body {
- + 'txttotalgrossduty','value' => set_value('txttotalgrossduty'),'id'=>'txttotalgrossduty', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1680,7 +1686,7 @@ body {
- + 'txttotalavlmodvat','value' => set_value('txttotalavlmodvat'),'id'=>'txttotalavlmodvat', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1690,7 +1696,7 @@ body {
- + 'txttotalgrossexpense','value' => set_value('txttotalgrossexpense'),'id'=>'txttotalgrossexpense', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1702,7 +1708,7 @@ body {
- Total Order Value: 'txtToatlOrder','value' => set_value('txtToatlOrder'),'id'=>'txtToatlOrder', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true','style'=>'text-align:right;'); echo form_input($data); ?> @@ -1786,6 +1792,15 @@ $(document).ready(function () { }); }); +$(document).on('change',".changetodecimal", function(){ + + alert(); + var inputvalues = $(this).val(); + var resultvalues=parseFloat(inputvalues).toFixed(2); + $(this).val(resultvalues); + +}); + var SelectedMaterialCode = []; var RequistQuantity = ''; @@ -2009,11 +2024,11 @@ $.each(symbol,function(idx,obj) document.getElementById("label2").innerHTML ='Basic Value in '+code+'('+sign+')'; document.getElementById("label3").innerHTML ='Basic Value in '+code+'('+sign+')'; document.getElementById("labelRate").innerHTML ='Rate in '+code+'('+sign+')'; - document.getElementById("labelBasicpriceus").innerHTML ='Basic Value In '+code+'('+sign+')'+' per UOM'; - document.getElementById("labelBasicINR").innerHTML ='Basic Price in INR:'+code+'('+sign+')'; + document.getElementById("labelBasicpriceus").innerHTML ='Basic Value In '+code+'('+sign+')'; + document.getElementById("labelBasicINR").innerHTML ='Basic Price INR'; document.getElementById("labelEditRate").innerHTML ='Rate in '+sign; - document.getElementById("labelEditBasicPriceUs").innerHTML ='Basic Value In '+code+'('+sign+')'+' per UOM'; - document.getElementById("labelEditBasicINR").innerHTML ='Basic Price in INR:'+code+'('+sign+')'; + document.getElementById("labelEditBasicPriceUs").innerHTML ='Basic Value In '+code+'('+sign+')'; + document.getElementById("labelEditBasicINR").innerHTML ='Basic Price in INR'; document.getElementById("labelTotalAmount").innerHTML ='Total Amount '+code+'('+sign+')'; document.getElementById("labelEditTotalAmount").innerHTML ='Total Amount '+code+'('+sign+')'; @@ -2025,6 +2040,8 @@ $.each(symbol,function(idx,obj) }); + + function USRate() { @@ -2130,9 +2147,11 @@ function EditRatechange() EditCalculateloadingcharge(); } + +var avalbudAmte= ; function validateEditExceedLimit() { - var avalbudAmt = parseFloat($('#EditAvlBudAmt').val()); + //var avalbudAmt = parseFloat($('#EditAvlBudAmt').val()); var basicAmountRate = parseFloat($('#EdittxtBasicValue').val()); var totalAmount = parseFloat($('#EditTotalExp').val()); var exchangerate=parseFloat($('#EditExchangeRt').val()); @@ -2140,7 +2159,7 @@ function validateEditExceedLimit() exp=basicAmountRate*exchangerate; //console.log(exp); - if(exp > avalbudAmt || totalAmount > avalbudAmt) + if(exp > avalbudAmte || totalAmount > avalbudAmte) { alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); $('#EditRate').focus(); @@ -2155,9 +2174,16 @@ function validateEditExceedLimit() +var avalbudAmt= ; + +//alert(avalbudAmt); + function validateExceedLimit() { - var avalbudAmt = parseFloat($('#AvlBudAmt').val()); + + //alert('ddf'); + //avalbudAmt = parseFloat($('#AvlBudAmt').val()); + var basicAmountRate = parseFloat($('#txtBasicValue').val()); var totalAmount = parseFloat($('#TotalExp').val()); var exchangerate=parseFloat($('#ExchangeRt').val()); @@ -2168,7 +2194,7 @@ function validateEditExceedLimit() if(exp > avalbudAmt || totalAmount > avalbudAmt) { alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditRate').focus(); + $('#Rate').focus(); return false; } else diff --git a/application/views/importpopdf.php b/application/views/importpopdf.php index 7e7fc4b2..f54b793b 100644 --- a/application/views/importpopdf.php +++ b/application/views/importpopdf.php @@ -14,11 +14,10 @@ $ServiceDescription = ''; $ReqBy=''; $PaymentTerms=''; - $Placeoforigin=''; + $PaymentDays=''; + $PayableAT=''; + $Placeoforigin=''; $Import_DispatchDetails=''; - /* $PaymentDays=''; - $PayableAT=''; */ - @@ -53,11 +52,12 @@ $CostCenterCode=$PO->CostCenterCode; //$ReqBy=$PO->Requestedby; - $PaymentTerms = $PO->PaymentTerms; - $PaymentDays=$PO->PaymentDays; - $PayableAT=$PO->PayableAT; - $Placeoforigin=$PO->Import_PlaceofOrgin; - $Import_DispatchDetails=$PO->Import_DispatchDetails; + $PaymentTerms = $PO->PaymentTerms; + + $Placeoforigin=$PO->Import_PlaceofOrgin; + $Import_DispatchDetails=$PO->Import_DispatchDetails; + // $PaymentDays=$PO->PaymentDays; + // $PayableAT=$PO->PayableAT; } } @@ -101,14 +101,14 @@ ?> - - - + + +
DRAFT
'; + } ?>
 
PURCHASE ORDER - PO NO:
-
- - - - - - - -
-


-
+ + + + + + + + + + + + + + + + + + + +
+

+

+
+

Vendor Address :

+


+
+

Delivery To :

+

+
PO DATE :DELIVERY DATE / SCHEDULE BY :PLACE OF ORIGIN:
- - - - - - - - -
Vendor Address :

Delivery To :
- - - - - - - - -
PO DATE :DELIVERY DATE / SCHEDULE BY :PLACE OF ORIGIN :
-
+
-
- +
@@ -168,40 +168,25 @@ - - - - + + +
+
- +
+ - + - + + - - + + @@ -289,34 +259,32 @@ ?>
# Item and Description QtyUOM

Rate per unit in Basic Price in Total Amount in
MaterialName ; ?> Quantity ; ?>Rate ; ?>UOM ; ?>Rate),2) ; ?> Quantity*$record->Rate); echo number_format($BasicValue,2) ; ?>BasicPriceInMTon; ?>TotalOrderValue),2); ?>
-
- - - - - - - - + +

 

+
-
Total Amount In Words
-

-
-
Total Amount
-

-
+ + + + + + + + + + +
Total Amount In Words

Total Amount In
+

Payment Terms

+

+
+

Certified that the particulars given above are true and correct

+

+

 

+

Authorized Signatory

+
- - - - - - - -
Payment Terms

-
Certified that the particulars given above are true and correct






Authorized Signatory
-
- -
Special Instruction:
+

 

+ +
Special Instructions :
- - - - - - - - - - - - -
Released By:Released On:
FirstName;?>format('d-m-Y');?>
+ +

 

+
Released By : FirstName;?>
+
Released On : format('d-m-Y');?>
- -
-
- - - \ No newline at end of file + + + +
\ No newline at end of file