capital po check in

This commit is contained in:
venbatechnologies@gmail.com 2017-07-05 18:08:07 +05:30
parent 7d9f6ed5ea
commit 229da1d6e9
20 changed files with 7073 additions and 488 deletions

View File

@ -414,19 +414,20 @@ class purchaseorder extends BaseController
$data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO);
$data['requestedBy'] = $this->purchaseorder_model->GetRequesedByDetails($PONO);
//print_r($data['POItem']);
$CapitalRange='';
foreach($data['POItem'] as $Rate)
{
$exRate=$Rate->ExchangeRate;
$CapitalRange=$Rate->CapitalRange;
}
foreach($data['POItem'] as $CUR)
{
@ -436,13 +437,26 @@ class purchaseorder extends BaseController
}
if($CapitalRange=='0'){
$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency);
$data['ExchangeRate']=$exRate;
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
}
else if($CapitalRange=='1'){
$data['CurrencyDetail']='';
$data['ExchangeRate']=$exRate;
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
}
$this->global['pageTitle'] = 'Siddharth : Edit Capital Purchase order form';
$this->loadViews("editCapitalPo", $this->global, $data, NULL);
@ -1536,7 +1550,7 @@ $createddt='';
function addNewCapitalPurchaseOrder()
{
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier');
@ -1555,8 +1569,19 @@ $createddt='';
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
$ExchangeRateOn = $this->input->post('ExchangeRateOn');
$capitalType = $this->input->post('capitalType');
if($capitalType=='Domestic'){
$CapitalRange = '1';
$ExchangeRateOn = '';
$ExchangeRate='';
}
else{
$CapitalRange = '0';
$ExchangeRateOn = $this->input->post('ExchangeRateOn');
$ExchangeRate=$this->input->post('ExchangeRt');
}
$PaymentMethod = $this->input->post('PaymentMethod');
$PayableAT = $this->input->post('PayableAT');
@ -1576,10 +1601,10 @@ $createddt='';
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s');
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'POType'=>$POType);
$currencytypeID = $this->input->post('currencytype');
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>currencytypeID);
$POMaster = $this->purchaseorder_model->addPOMaster($POList);
@ -1599,9 +1624,9 @@ $createddt='';
$Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i);
$Exchangerate = $this->input->post('echangeRate'.$i);
$BasicPriceinmton = $this->input->post('rateInUs'.$i);
$Productprice = $this->input->post('basicval'.$i);
$Productprice = $this->input->post('basicvalInINR'.$i);
$LandingCharge = $this->input->post('beforeLanding'.$i);
$AfterLandingCharge = $this->input->post('landingCharge'.$i);
$HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i);
@ -1635,7 +1660,7 @@ $createddt='';
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i);
$QuantityKG = $this->input->post('PurQuantity'.$i);
$currencytypeID = $this->input->post('currencytype');
$Totalvalueitem=$this->input->post('PerKgExpense'.$i);
//echo $BasicPriceinmton;
@ -1682,7 +1707,7 @@ $createddt='';
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'CurrencyType'=>$currencytypeID,'TotalValue'=>$Totalvalueitem);
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem);
//print_r($ImportTaxList);
//die();
@ -1700,7 +1725,7 @@ $createddt='';
/*Edit Capital po*/
function EditCapitalPurchaseOrder()
{
$PONO =$this->input->post('txtPONO');
$POdt =$this->input->post('PODate');
@ -1722,7 +1747,20 @@ $createddt='';
$DeliverySchedule = '';
}
$ExchangeRateOn = $this->input->post('ExchangeRateOn');
$capitalType = $this->input->post('capitalType');
$currencytypeID = $this->input->post('currencytype');
if($capitalType=='1'){
$CapitalRange = '1';
$ExchangeRateOn = '';
$ExchangeRate='';
}
else{
$CapitalRange = '0';
$ExchangeRateOn = $this->input->post('ExchangeRateOn');
$ExchangeRate=$this->input->post('ExchangeRt');
}
$PaymentMethod = $this->input->post('PaymentMethod');
$PayableAT = $this->input->post('PayableAT');
@ -1744,7 +1782,7 @@ $createddt='';
$createddt = $dt->format('Y-m-d H:i:s');
$updateddt = $dt->format('Y-m-d H:i:s');
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID);
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
@ -1764,7 +1802,7 @@ $createddt='';
$Exchangerate = $this->input->post('echangeRate'.$i);
$BasicPriceinmton = $this->input->post('rateInUs'.$i);
$Productprice = $this->input->post('basicval'.$i);
$Productprice = $this->input->post('basicvalInINR'.$i);
$LandingCharge = $this->input->post('beforeLanding'.$i);
$AfterLandingCharge = $this->input->post('landingCharge'.$i);
$HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i);
@ -1798,7 +1836,7 @@ $createddt='';
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i);
$QuantityKG = $this->input->post('PurQuantity'.$i);
$currencytypeID = $this->input->post('currencytype');
$Totalvalueitem=$this->input->post('PerKgExpense'.$i);
//echo $BasicPriceinmton;
@ -1848,7 +1886,7 @@ $createddt='';
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'CurrencyType'=>$currencytypeID,'TotalValue'=>$Totalvalueitem);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, 'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem);
//print_r($ImportTaxList);
//die();
@ -1870,7 +1908,7 @@ $createddt='';
$ServiceTaxList = array('ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt);
$ServiceTax = $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'CurrencyType'=>$currencytypeID,'TotalValue'=>$Totalvalueitem);
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem);
$ImportList= $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList);
}

View File

@ -115,7 +115,7 @@ class purchaseorder extends BaseController
$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();
$data['Payment']=$this->purchaseorder_model->getSupplierPayment('C009');
$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019');
@ -141,17 +141,20 @@ class purchaseorder extends BaseController
$Req = $SelectedReq->Req;
$data['ReqList'] = $Req ;
$ReqArray = array();
$ReqType = '';
$ReqType = $this->input->post('txtReqType');
$result = array();
foreach ($Req as $SID):
$ReqArray[] = $SID->ReqNo ;
$result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo);
$ReqType = $SID->ReqType;
if($ReqType == '')
{
$ReqType = $SID->ReqType;
}
endforeach;
$data['MaterialList'] = $result;
//print_r($data['MaterialList']);
/* Cost code from Requisition - Client Review Fix
@ -180,7 +183,8 @@ class purchaseorder extends BaseController
// $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
$data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate();
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
//print_r($data['Currency']);
$data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR');
//print_r($data['INRSYMBOL']);
// $data[$Rate->ExchangeRate]=$Rate->ExchangeRate;
@ -267,6 +271,7 @@ class purchaseorder extends BaseController
$data['MaterialList'] = $result;//$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray);
$data['Suplist'] = $this->purchaseorder_model->getSupplierName();
$data['Payment']=$this->purchaseorder_model->getSupplierPayment();
$data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR');
/* Cost code from Requisition - Client Review Fix
Start here */
$ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray);
@ -318,6 +323,11 @@ class purchaseorder extends BaseController
{
$PAYTERM=$TER->PaymentTerms;
}
// foreach ($data['POMaster'] as $STATUSCODE)
// {
// $STATUSNAME=$STATUSCODE->PaymentTerms;
// }
//print_r($PAYTERM);
//print_r($exRate);
//$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
@ -329,6 +339,7 @@ class purchaseorder extends BaseController
$data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO);
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
//$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019');
$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019');
$this->global['pageTitle'] = 'Siddharth : Edit Service Purchase order form';
$this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL);
@ -370,12 +381,21 @@ class purchaseorder extends BaseController
$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency);
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
//print_r($data['PaymentTerms']);
$unicode ='';
foreach ($data['CurrencyDetail'] as $Detail)
{
$unicode=$Detail->FontCode2000;
}
foreach ($data['CurrencyDetail'] as $Detail)
{
$currencycode=$Detail->Currency_Code;
}
//print_r($unicode);
$data['unicode']=$unicode;
$data['currencycode']=$currencycode;
$this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form';
$this->loadViews("editimportpo", $this->global, $data, NULL);
}
@ -394,19 +414,20 @@ class purchaseorder extends BaseController
$data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO);
$data['requestedBy'] = $this->purchaseorder_model->GetRequesedByDetails($PONO);
//print_r($data['POItem']);
$CapitalRange='';
foreach($data['POItem'] as $Rate)
{
$exRate=$Rate->ExchangeRate;
$CapitalRange=$Rate->CapitalRange;
}
foreach($data['POItem'] as $CUR)
{
@ -416,13 +437,26 @@ class purchaseorder extends BaseController
}
if($CapitalRange=='0'){
$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency);
$data['ExchangeRate']=$exRate;
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
}
else if($CapitalRange=='1'){
$data['CurrencyDetail']='';
$data['ExchangeRate']=$exRate;
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
}
$this->global['pageTitle'] = 'Siddharth : Edit Capital Purchase order form';
$this->loadViews("editCapitalPo", $this->global, $data, NULL);
@ -635,7 +669,7 @@ class purchaseorder extends BaseController
$SupplierID = $this->input->post('drpSupplier');
$DeliveryAddr = $this->input->post('DeliveryAddr');
$dt = $this->input->post('Deliverydt');
//$Deliverydt = $this->getDateformat($dt);
$POType = $this->input->post('POType');
$DeliveryOption = $this->input->post('DateRange');
if($DeliveryOption==1){
$Deliverydt = '';
@ -677,7 +711,7 @@ $DeliveryOption = $this->input->post('DateRange');
$PaymentTerms=$this->input->post('PaymentTerms');
$Payableat=$this->input->post('PayableAT');
// 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,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays);
$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,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays,'POType'=>$POType);
$POMaster = $this->purchaseorder_model->addPOMaster($POList);
@ -778,7 +812,7 @@ $DeliveryOption = $this->input->post('DateRange');
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
$dt = $this->input->post('Deliverydt');
//$Deliverydt = $this->getDateformat($dt);
$DeliveryOption = $this->input->post('DateRange');
$DeliveryOption = $this->input->post('DateRange');
if($DeliveryOption==1){
$Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby');
@ -1015,7 +1049,7 @@ public function importpoprint($PONO)
$this->load->library('dompdf_gen');
// Convert to PDF
$this->dompdf->set_paper(array(0, 0, 841.89, 1190.55), 'landscape');
//$this->dompdf->set_paper(array(0, 0, 841.89, 1190.55), 'landscape');
$this->dompdf->load_html($php);
$this->dompdf->render();
$data['Attachment'] = FALSE;
@ -1127,7 +1161,7 @@ function addNewImportPurchaseOrder()
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays,'POType'=>$POType);
//print_r($POList);PaymentDays
//die();
@ -1454,12 +1488,12 @@ $createddt='';
$store = array('Status'=>$StatusCode,'ApprovedOn'=>$ApprovedDate,'Approvedby'=>$ApprovedBy,'Remarks'=>$Remarks);
$this->purchaseorder_model->UpdatePO($store,$PONO);
echo "Successfully Updated the Purchase Order No: ".$PONO;
echo "Successfully Approve the Purchase Order No: ".$PONO;
}
else{
$store = array('Status'=>$StatusCode,'OnHoldOn'=>$ApprovedDate,'OnHoldBy'=>$ApprovedBy,'Remarks'=>$Remarks);
$this->purchaseorder_model->UpdatePO($store,$PONO);
echo "Successfully Updated the Purchase Order No: ".$PONO;
echo "The Purchase Order No: ".$PONO ."is On Hold";
}
@ -1503,12 +1537,12 @@ $createddt='';
$store = array('Status'=>$StatusCode,'ReleasedOn'=>$ReleasedDate,'ReleasedBy'=>$ReleasedBy,'Remarks'=>$Remarks);
$this->purchaseorder_model->UpdatePO($store,$PONO);
echo "Successfully Updated the Purchase Order No: ".$PONO;
echo "Successfully Released the Purchase Order No: ".$PONO;
}
else{
$store = array('Status'=>$StatusCode,'OnHoldOn'=>$ReleasedOn,'OnHoldBy'=>$ReleasedBy,'Remarks'=>$Remarks);
$this->purchaseorder_model->UpdatePO($store,$PONO);
echo "Successfully Updated the Purchase Order No: ".$PONO;
echo "The Purchase Order No: ".$PONO ."is On Hold";
}
}
@ -1516,7 +1550,7 @@ $createddt='';
function addNewCapitalPurchaseOrder()
{
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier');
@ -1535,8 +1569,19 @@ $createddt='';
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
$ExchangeRateOn = $this->input->post('ExchangeRateOn');
$capitalType = $this->input->post('capitalType');
if($capitalType=='Domestic'){
$CapitalRange = '1';
$ExchangeRateOn = '';
$ExchangeRate='';
}
else{
$CapitalRange = '0';
$ExchangeRateOn = $this->input->post('ExchangeRateOn');
$ExchangeRate=$this->input->post('ExchangeRt');
}
$PaymentMethod = $this->input->post('PaymentMethod');
$PayableAT = $this->input->post('PayableAT');
@ -1556,10 +1601,10 @@ $createddt='';
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s');
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption);
$currencytypeID = $this->input->post('currencytype');
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>currencytypeID);
$POMaster = $this->purchaseorder_model->addPOMaster($POList);
@ -1579,9 +1624,9 @@ $createddt='';
$Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i);
$Exchangerate = $this->input->post('echangeRate'.$i);
$BasicPriceinmton = $this->input->post('rateInUs'.$i);
$Productprice = $this->input->post('basicval'.$i);
$Productprice = $this->input->post('basicvalInINR'.$i);
$LandingCharge = $this->input->post('beforeLanding'.$i);
$AfterLandingCharge = $this->input->post('landingCharge'.$i);
$HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i);
@ -1615,7 +1660,7 @@ $createddt='';
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i);
$QuantityKG = $this->input->post('PurQuantity'.$i);
$currencytypeID = $this->input->post('currencytype');
$Totalvalueitem=$this->input->post('PerKgExpense'.$i);
//echo $BasicPriceinmton;
@ -1662,7 +1707,7 @@ $createddt='';
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'CurrencyType'=>$currencytypeID,'TotalValue'=>$Totalvalueitem);
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem);
//print_r($ImportTaxList);
//die();
@ -1680,7 +1725,7 @@ $createddt='';
/*Edit Capital po*/
function EditCapitalPurchaseOrder()
{
$PONO =$this->input->post('txtPONO');
$POdt =$this->input->post('PODate');
@ -1702,7 +1747,20 @@ $createddt='';
$DeliverySchedule = '';
}
$ExchangeRateOn = $this->input->post('ExchangeRateOn');
$capitalType = $this->input->post('capitalType');
$currencytypeID = $this->input->post('currencytype');
if($capitalType=='1'){
$CapitalRange = '1';
$ExchangeRateOn = '';
$ExchangeRate='';
}
else{
$CapitalRange = '0';
$ExchangeRateOn = $this->input->post('ExchangeRateOn');
$ExchangeRate=$this->input->post('ExchangeRt');
}
$PaymentMethod = $this->input->post('PaymentMethod');
$PayableAT = $this->input->post('PayableAT');
@ -1724,7 +1782,7 @@ $createddt='';
$createddt = $dt->format('Y-m-d H:i:s');
$updateddt = $dt->format('Y-m-d H:i:s');
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID);
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
@ -1744,7 +1802,7 @@ $createddt='';
$Exchangerate = $this->input->post('echangeRate'.$i);
$BasicPriceinmton = $this->input->post('rateInUs'.$i);
$Productprice = $this->input->post('basicval'.$i);
$Productprice = $this->input->post('basicvalInINR'.$i);
$LandingCharge = $this->input->post('beforeLanding'.$i);
$AfterLandingCharge = $this->input->post('landingCharge'.$i);
$HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i);
@ -1778,7 +1836,7 @@ $createddt='';
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i);
$QuantityKG = $this->input->post('PurQuantity'.$i);
$currencytypeID = $this->input->post('currencytype');
$Totalvalueitem=$this->input->post('PerKgExpense'.$i);
//echo $BasicPriceinmton;
@ -1828,7 +1886,7 @@ $createddt='';
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'CurrencyType'=>$currencytypeID,'TotalValue'=>$Totalvalueitem);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, 'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem);
//print_r($ImportTaxList);
//die();
@ -1850,7 +1908,7 @@ $createddt='';
$ServiceTaxList = array('ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt);
$ServiceTax = $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'CurrencyType'=>$currencytypeID,'TotalValue'=>$Totalvalueitem);
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem);
$ImportList= $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList);
}

0
application/controllers/storerequisition.php Normal file → Executable file
View File

0
application/controllers/storerequisitionlist.php Normal file → Executable file
View File

2
application/logs/log-2017-07-05.php Normal file → Executable file
View File

@ -115,3 +115,5 @@ ERROR - 2017-07-05 14:05:35 --> Severity: Notice --> Undefined index: Requisiti
ERROR - 2017-07-05 14:05:35 --> Severity: Notice --> Undefined index: RequisitionStatus /opt/lampp/htdocs/siddharth_application/application/views/approvalstorerequisitionslip.php 33
ERROR - 2017-07-05 14:05:35 --> Severity: Notice --> Undefined index: RequisitionStatus /opt/lampp/htdocs/siddharth_application/application/views/approvalstorerequisitionslip.php 33
ERROR - 2017-07-05 14:05:35 --> Severity: Notice --> Undefined index: RequisitionStatus /opt/lampp/htdocs/siddharth_application/application/views/approvalstorerequisitionslip.php 33
ERROR - 2017-07-05 14:33:38 --> 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
ERROR - 2017-07-05 14:34:05 --> Severity: Warning --> explode() expects parameter 2 to be string, array given /opt/lampp/htdocs/Git_Server/siddharth_application/application/third_party/dompdf/include/style.cls.php 948

View File

@ -1075,13 +1075,15 @@ function GetCurrencytype()
}
//This is get the capital po list for edit
function getCapitalPurchaseOrderDetails($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount
Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount
,ServiceTax.TotalValue,ServiceTax,EducessTax,ServiceTax.SecHigherEducessTax,ServiceTax.KrishiKalyantax,ServiceTax.SwachhBharattax,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,CurrencyType,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,POMast.CurrencyType,
Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem
join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO

View File

@ -33,13 +33,16 @@ class purchaseorder_model extends CI_Model
function purchaseorderListing($forwhat='')
{
$this->db->distinct();
$this->db->select('POMast.PONO,supp.SupplierName,TotalOrderValue,PODate,Stat.StatusName,Stat.StatusCode,Req.ReqType,DeliveryDate,DeliverySchedule,DeliveryOption');
$this->db->select('POMast.PONO,supp.SupplierName,TotalOrderValue,PODate,Stat.StatusName,Stat.StatusCode,POMast.POType as ReqType,DeliveryDate,DeliverySchedule,DeliveryOption');
$this->db->from('T_PurchaseOrder_Master POMast');
$this->db->join('T_SupplierDetailsN supp', 'supp.SupplierID = POMast.SupplierID');
$this->db->join('T_Status Stat', 'Stat.StatusCode = POMast.Status');
$this->db->join('T_PurchaseOrder_LineItem LineItem', 'POMast.PONO = LineItem.PONO');
$this->db->join('T_Requestion_Master Req', 'Req.ReqNo = LineItem.ReqNo');
if($forwhat=='amendment')
{
$this->db->where('POMast.Status',PO_RELEASED);
}
$query = $this->db->get();
//print_r( $this->db->last_query());
$result = $query->result();
@ -169,10 +172,15 @@ function purchaseorderListing($forwhat='')
return $query->result_array(); */
$subQuery ='select BudgetAmount, (select ifnull(sum(TotalOrderValue),0) as Totalvalue from
/* $subQuery ='select BudgetAmount, (select ifnull(sum(TotalOrderValue),0) as Totalvalue from
T_PurchaseOrder_Master PO join T_PurchaseOrder_LineItem Item on
Item.PONO = PO.PONO join T_Requestion_Master mast on mast.ReqNo = Item.ReqNo where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue
from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and
BudgetYear = ? and BudgetType =?'; */
$subQuery ='select BudgetAmount, (select ifnull(sum(Quantity*Rate),0) as Totalvalue from
T_PurchaseOrder_LineItem Item join T_Requestion_Master mast on mast.ReqNo = Item.ReqNo where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue
from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and
BudgetYear = ? and BudgetType =?';
$query = $this->db->query($subQuery,array($CostCode,$BudgetType,$CostCode,$Year,$BudgetType));
@ -446,7 +454,7 @@ function purchaseorderListing($forwhat='')
function GetServicePurchaseOrder($PONO = '')
{
$this->db->distinct();
$this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.PaymentDays,POMast.PayableAT,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode');
$this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.PaymentDays,POMast.PayableAT,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,POMast.ServiceWorkStatus,POMast.*');
$this->db->from('T_PurchaseOrder_Master POMast');
$this->db->join('T_SupplierDetailsN supp', 'supp.SupplierID = POMast.SupplierID');
$this->db->join('T_Status Stat', 'Stat.StatusCode = POMast.Status');
@ -465,7 +473,7 @@ function purchaseorderListing($forwhat='')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,Rate,Status,ROUND((Quantity *Rate),2 ) as BasicValue ,ROUND((ServiceTax + EducessTax + SecHigherEducessTax + KrishiKalyantax + SwachhBharattax),2)as Taxamount
,TotalValue,ServiceTax,EducessTax,SecHigherEducessTax,KrishiKalyantax,SwachhBharattax,CostCenterCode
,TotalValue,ServiceTax,EducessTax,SecHigherEducessTax,KrishiKalyantax,SwachhBharattax,CostCenterCode,LineItem.ServiceFrequency
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
@ -546,9 +554,10 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount ,
Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount ,
ProductPrice,Tax.*,CostCenterCode , POMaster.*,sup.SupplierName,sup.Address
FROM T_PurchaseOrder_LineItem LineItem
join T_Requestion_Master ReqMas on ReqMas.ReqNo=LineItem.ReqNo
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO
@ -574,6 +583,23 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
}
function GerRequesterName($Requester='')
{
$subQuery='SELECT EmpID,FirstName from T_Employee_Details where EmpID=?';
$query=$this->db->query($subQuery,array($Requester));
return $query->result();
}
function GerCurrencyCodeName($Currencycode='')
{
$subQuery='SELECT Currency_Code,FontCode2000 from T_Currency_Details where Currency_Code=?';
$query=$this->db->query($subQuery,array($Currencycode));
return $query->result();
}
function GetPOStatus($Status='')
{
$subQuery='SELECT StatusName from T_Status where StatusCode=?';
@ -595,15 +621,26 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
function getSupplierPayment($Currency='')
{
// function getSupplierPayment($Currency='')
// {
$subQuery='select distinct PaymentTerms from T_SupplierDetailsN';
$query=$this->db->query($subQuery,array($Currency));
//print_r($this->db->last_query());
return $query->result();
// $subQuery='select distinct PaymentTerms from T_SupplierDetailsN';
// $query=$this->db->query($subQuery,array($Currency));
// //print_r($this->db->last_query());
// return $query->result();
}
// }
function getSupplierPayment($Config_ID='')
{
// $subQuery='select distinct PaymentTerms from T_SupplierDetailsN';
$subQuery='select ConfigValue from T_ConfigDetails where Config_ID=?';
$query=$this->db->query($subQuery,array($Config_ID));
//print_r($this->db->last_query());
return $query->result();
}
function GetWorkStatus($Config_ID='')
{
@ -622,9 +659,10 @@ function GetImportPurchaseOrderDetails($PONO = '')
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((Quantity *Rate)+(RMCIncludingCustomersPerKG*Quantity),2)as TotalOrderValue,ROUND((ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue,CurrencyType,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((Quantity *Rate)+(RMCIncludingCustomersPerKG*Quantity),2)as TotalOrderValue,ROUND((POMast.ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue,CurrencyType,
Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem
join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo
@ -651,6 +689,15 @@ function GetCurrencytype()
return $query->result();
}
function GetINRCurrencytype($Currency_Code='')
{
$subQuery='select FontCode2000 from T_Currency_Details where Currency_Code=?';
$query=$this->db->query($subQuery,array($Currency_Code));
//print_r($this->db->last_query());
return $query->result();
}
@ -969,11 +1016,11 @@ function GetCurrencytype()
* @return array $result : This is result of the query
join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode
*/
function getPOList($q)
function getPOList($Amendment)
{
$this->db->distinct();
$this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,rmast.ReqType,bud.BudgetAmount,mast.Remarks');
$this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,mast.POType as ReqType,bud.BudgetAmount,mast.Remarks');
$this->db->from('T_PurchaseOrder_Master mast');
$this->db->join('T_Status st', 'st.StatusCode=mast.Status');
$this->db->join('tbl_users tbl', 'mast.createdby=tbl.userid');
@ -982,19 +1029,21 @@ function GetCurrencytype()
$this->db->join('T_Requestion_Master rmast','rmast.ReqNo=req.ReqNo');
$this->db->join('T_CostCenter_Budget bud','bud.CostCenterCode = req.CostCenterCode and bud.BudgetType = rmast.ReqType');
$this->db->join('T_CostCenter_Master ccm','ccm.CostCenterCode = req.CostCenterCode and ccm.CostCenterCode = bud.CostCenterCode');
$this->db->where('mast.Status','ST030'); // EMERGENGY PO
if($q=='A'){
$this->db->where('mast.Status','ST015');//PO CREATED
$this->db->or_where('mast.Status','ST020');//ON HOLD
$this->db->or_where('mast.Status','ST025');// PO APPROVED
$this->db->or_where('mast.Status','ST026');//PO RELEASED
$this->db->or_where('mast.Status','ST024'); // EMERGENGY PO
// $this->db->where('mast.Status',PO_AMENDED); // EMERGENGY PO
if($Amendment=='A'){ //A- Approved
$this->db->or_where('mast.Status',PO_CREATED);//PO CREATED
$this->db->or_where('mast.Status',PO_ONHOLD);//ON HOLD
$this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED
$this->db->or_where('mast.Status',PO_RELEASED);//PO RELEASED
$this->db->or_where('mast.Status',REQITEM_Emergency_PO_CREATED); // EMERGENGY PO
// $this->db->or_where('mast.Status',PO_AMENDED); // EMERGENGY PO
}
else if($q=='R'){
$this->db->or_where('mast.Status','ST025');// PO APPROVED
else if($Amendment=='R'){ // R -RELEASED
$this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED
$this->db->or_where('mast.Status',PO_RELEASED);
}
$result=$this->db->get();
// print_r($result->result());
// print_r($this->db->last_query());
return $result->result();
@ -1026,15 +1075,18 @@ function GetCurrencytype()
}
//This is get the capital po list for edit
function getCapitalPurchaseOrderDetails($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount
Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount
,ServiceTax.TotalValue,ServiceTax,EducessTax,ServiceTax.SecHigherEducessTax,ServiceTax.KrishiKalyantax,ServiceTax.SwachhBharattax,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,CurrencyType,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,POMast.CurrencyType,
Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem
join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Service_Tax ServiceTax on ServiceTax.LineItemNo = LineItem.LineItemNo
join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo

0
application/models/storerequistion_model.php Normal file → Executable file
View File

View File

@ -1,4 +1,4 @@
<span style='color: #900'>10,240 KB</span> <span style='color: #090'>115.7951 ms</span><br /><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<span style='color: #900'>10,240 KB</span> <span style='color: #090'>232.5711 ms</span><br /><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>

0
application/views/addstorerequisitionslip.php Normal file → Executable file
View File

0
application/views/approvalstorerequisitionslip.php Normal file → Executable file
View File

View File

@ -44,6 +44,10 @@ $paymentCheckDays1='After';
.select2{
width:100% ! important;
}
#DomesticNOT {
margin-top:200px;
z-index: 1080 !important;
}
</style>
<script>
@ -52,6 +56,7 @@ $paymentCheckDays1='After';
//Initialize Select2 Elements
$("#drpSupplier").select2();
$("#Reqnumber").select2();
$('#DomesticNOT').modal('show');
$("#CapitalCostCenter").select2();
$("#MaterialCode").select2();
$("#currencytype").select2();
@ -118,7 +123,7 @@ $paymentCheckDays1='After';
?>
</div>
<div class="col-md-12">
<div class="col-md-12" id="currencyOpt">
<label>Currency Type</label>
<div class="form-group">
@ -240,14 +245,14 @@ $paymentCheckDays1='After';
</div>
</div>
<div class="col-md-12">
<div class="col-md-3">
<div class="col-md-12" >
<div class="col-md-3" id="FromOnlineRate">
<div class="col-md-12">
<a href="http://www.xe.com/" target="_blank"><u>Click here to check Today's Foreign Exchange value</u></a>
</div>
</div>
<div class="col-md-9">
<div class="col-md-4">
<div class="col-md-9" >
<div class="col-md-4" id="hideExchangeRateOn">
<label>Exchange Rate On</label>
<div class="form-group">
<?php
@ -256,7 +261,7 @@ $paymentCheckDays1='After';
?>
</div>
</div>
<div class="col-md-4">
<div class="col-md-4" id="hideExchangeRate">
<label id="CurrencySymbol">Exchange Rate</label>
<div class="form-group">
<?php
@ -436,7 +441,7 @@ $paymentCheckDays1='After';
</div>
</div>
</div>
<div class="col-md-2">
<div class="col-md-2" id="hideModalExchange">
<label> Exchange Rate</label>
<div class="form-group">
<?php
@ -486,7 +491,7 @@ $paymentCheckDays1='After';
</div>
</div>
<div class="col-md-2">
<label id="RateIn">Rate(US $/Ton)</label>
<label id="RateIn">Rate(In INR /Ton)</label>
<div class="form-group">
<?php
$data = array('name' => 'CPRate','value' => set_value('CPRate'),'id'=>'CPRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Ratechange();' );
@ -495,7 +500,7 @@ $paymentCheckDays1='After';
</div>
</div>
<div class="col-md-2">
<label>Basic value in INR</label>
<label id="TotalAmount">Basic value in INR</label>
<div class="form-group">
<?php
$data = array('name' => 'CPTotalAmount','value' => set_value('CPTotalAmount'),'id'=>'CPTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
@ -563,7 +568,7 @@ $paymentCheckDays1='After';
<div class="col-md-6" style="padding:0px;">
<div class="col-md-12">
<div class="col-md-4" >
Basic Price:
Basic Price In INR:
</div>
<div class="col-md-4">
<div class="form-group">
@ -977,7 +982,7 @@ $paymentCheckDays1='After';
</div>
</div>
</div>
<div class="col-md-2">
<div class="col-md-2" id="hideModalExchangeEdit">
<label> Exchange Rate</label>
<div class="form-group">
<?php
@ -1027,7 +1032,7 @@ $paymentCheckDays1='After';
</div>
</div>
<div class="col-md-2">
<label id="EditRateIn">Rate(in US $ /Ton)</label>
<label id="EditRateIn">Rate(in INR /Ton)</label>
<div class="form-group">
<?php
$data = array('name' => 'EditCPRate','value' => set_value('EditCPRate'),'id'=>'EditCPRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'EditRatechange();' );
@ -1036,7 +1041,7 @@ $paymentCheckDays1='After';
</div>
</div>
<div class="col-md-2">
<label>Basic value in INR</label>
<label id="EditTotalAmount">Basic value in INR</label>
<div class="form-group">
<?php
$data = array('name' => 'EditCPTotalAmount','value' => set_value('EditCPTotalAmount'),'id'=>'EditCPTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
@ -1104,7 +1109,7 @@ $paymentCheckDays1='After';
<div class="col-md-6" style="padding:0px;">
<div class="col-md-12">
<div class="col-md-4" >
Basic Price:
Basic Price In INR:
</div>
<div class="col-md-4">
<div class="form-group">
@ -1681,8 +1686,41 @@ $paymentCheckDays1='After';
<br/>
</div>
</div>
</section>
<div id="DomesticNOT" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Do You want to create Capital PO for International?</h4>
</div>
<div class="modal-body">
<form>
<div class="radio">
<label><input type="radio" name="optcapital" checked="checked" value="0" id="optcapital">YES</label>
</div>
<div class="radio">
<label><input type="radio" name="optcapital" value="1" id="optcapital">NO</label>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-primary" ID="CapitalForCheck" onclick="SetCapitalPo();" style="margin-top: -24px;">&nbsp;&nbsp;<span class="bold">Ok</span></a>
<a class="btn btn-primary" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
</div>
</div>
</div>
</div>
</div>
</section>
<script src="<?php echo base_url(); ?>assets/js/CreatePOValidation.js" type="text/javascript"></script>
<script type="text/html" id="CapitalList">
<tr id="<%=index%>">
@ -1911,8 +1949,13 @@ $paymentCheckDays1='After';
{
$("#CapitalItemName").val(obj.MaterialName);
$("#CPUOM").val(obj.UOM);
var CPUOMDisplay=obj.UOM;
$("#CPQuantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
RequistQuantity = obj.Quantity;
$('#RateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+CPUOMDisplay+')');
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/Ton)');
}
});
}
@ -1948,8 +1991,12 @@ $paymentCheckDays1='After';
{
$("#EditItemName").val(obj.MaterialName);
$("#EditUOM").val(obj.UOM);
var EDITUOMDisplay=obj.UOM;
$("#EditQuantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
RequistQuantity = obj.Quantity;
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EDITUOMDisplay+')');
$('#CPTotalAmount').html('Basic value in' + " "+obj.FontCode2000);
}
});
}
@ -2012,6 +2059,7 @@ $paymentCheckDays1='After';
*/
function Ratechange(){
if($('#Reqnumber').val() == "0")
{
alert('Please select the Requisition Number');
@ -2033,17 +2081,34 @@ $paymentCheckDays1='After';
//ExceedQuantityCheck();
if(ExceedQuantityCheck()){
if($('#CPQuantity').val() != '' && $('#CPRate').val() != '' && $('#ExchangeRtModal').val() != '')
if($('#CPQuantity').val() != '' && $('#CPRate').val() != '')
{
var txtQuantity = parseFloat( $('#CPQuantity').val());
var txtExchangeRate = parseFloat( $('#ExchangeRtModal').val());
var txtExchangeRate ='';
var RatePerTon = parseFloat( $('#CPRate').val());
//var txtUnitPrice = parseFloat($('#Rate').val());
var Tot = txtQuantity * txtExchangeRate * RatePerTon
if(capitalType=='International'){
txtExchangeRate = parseFloat( $('#ExchangeRtModal').val());
var Tot = txtQuantity * RatePerTon;
}
else{
var Tot = txtQuantity * RatePerTon;
txtExchangeRate = 1;
}
var BasicInINR=Tot * txtExchangeRate;
$('#CPTotalAmount').val(parseFloat(Tot).toFixed(2));
$('#AfterBasicPriceTax').val(Math.round(BasicInINR));
//ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val());
@ -2051,7 +2116,7 @@ $paymentCheckDays1='After';
//Service Tax calculation
$('#AfterServiceTax').val(calculateServiceTax($('#CPTotalAmount').val()));
$('#AfterServiceTax').val(calculateServiceTax($('#AfterBasicPriceTax').val()));
//Edu. cess @2% on service Tax
$('#AfterEduCess').val( calculateEduess($('#AfterServiceTax').val()));
@ -2061,14 +2126,14 @@ $paymentCheckDays1='After';
$('#AfterSecHighTax').val(calculateHigherEdu($('#AfterServiceTax').val()));
//Krishi Kalyan tax
$('#AfterKrishiTax').val(calculateKrishiKalyantax($('#CPTotalAmount').val()));
$('#AfterKrishiTax').val(calculateKrishiKalyantax($('#AfterBasicPriceTax').val()));
//Swachh Bharat tax
$('#AfterSwachhTax').val(calculateSwachhBharattax($('#CPTotalAmount').val()));
$('#AfterSwachhTax').val(calculateSwachhBharattax($('#AfterBasicPriceTax').val()));
// This is for import basic price
$('#AfterBasicPriceTax').val(Math.round($('#CPTotalAmount').val()));
//$('#AfterBasicPriceTax').val(Math.round($('#CPTotalAmount').val()));
if($('#LandingCharge').val()!='' && $('#AfterBasicPriceTax').val()!=''){
$('#AfterLandingCharge').val(calculateLandingCharge($('#LandingCharge').val(),$('#AfterBasicPriceTax').val()));
@ -2544,6 +2609,7 @@ $paymentCheckDays1='After';
var convertRate = $("#CPRate").val();
var itemRate = parseFloat(convertRate * exchangeRate).toFixed(2);
var basicval = parseFloat($("#CPTotalAmount").val()).toFixed(2);
var AfterServiceTax = $("#AfterServiceTax").val();
var AfterEduCess = $("#AfterEduCess").val();
var AfterSecHighTax = $("#AfterSecHighTax").val();
@ -2588,7 +2654,7 @@ var purchaseRate = $('#purchaserate').val();
var TotalOrderValuePerkg = $("#txtTotalOrderValue").val();
var TotalTaxValue = calculateTaxValue();
var basicvalInINR=$('#AfterBasicPriceTax').val();
$('#MaterialCode option[value='+materialCode+']').remove();
@ -2628,6 +2694,7 @@ var purchaseRate = $('#purchaserate').val();
addHidden(theForm,"rateInUs"+temp,convertRate);
addHidden(theForm,"itemRate"+temp,itemRate);
addHidden(theForm,"basicval"+temp,basicval);
addHidden(theForm,"basicvalInINR"+temp,basicvalInINR);
addHidden(theForm,"AfterServiceTax"+temp,AfterServiceTax);
addHidden(theForm,"AfterEduCess"+temp,AfterEduCess);
addHidden(theForm,"AfterSecHighTax"+temp,AfterSecHighTax);
@ -2661,6 +2728,8 @@ var purchaseRate = $('#purchaserate').val();
addHidden(theForm,"beforeAdditionalExciseDuty"+temp,beforeAdditionalExciseDuty);
addHidden(theForm,"PurQuantity"+temp,PurQuantity);
addHidden(theForm,"PerKgExpense"+temp,TotalOrderValuePerkg);
addHidden(theForm,"capitalType",capitalType);
@ -3177,12 +3246,15 @@ function DeleteRow(rowid)
$('#EditCapitalItemName').val($('#materialName'+userid).val());
$('#EditCPUOM').val($('#uom'+userid).val());
var EditUOM = $('#uom'+userid).val();
$('#EditCPQuantity').val($('#quantity'+userid).val());
$('#EditCPRate').val($('#rateInUs'+userid).val());
$('#EditCPTotalAmount').val($('#basicval'+userid).val());
RequistQuantity = $('#quantity'+userid).val();
$('#EditAfterServiceTax').val($('#AfterServiceTax'+userid).val());
$('#EditAfterEduCess').val($('#AfterEduCess'+userid).val());
$('#EditAfterSecHighTax').val($('#AfterSecHighTax'+userid).val());
@ -3190,7 +3262,7 @@ function DeleteRow(rowid)
$('#EditAfterSwachhTax').val($('#AfterSwachhTax'+userid).val());
$('#EditAfterBasicPriceTax').val($('#basicval'+userid).val());
$('#EditAfterBasicPriceTax').val($('#basicvalInINR'+userid).val());
$('#EditAfterLandingCharge').val($('#landingCharge'+userid).val());
$('#EditAfterHighseas').val($('#HighSeasSalesCharge'+userid).val());
$('#EditAfterCustomduty').val($('#CustomDuty'+userid).val());
@ -3346,6 +3418,7 @@ var PayableAT = $('#PayableAT').val();
var Before = $('#Before').val();
var After = $('#After').val();
$('#SpcialInstruction').val(splinstr);
$('#txtDeliveryAddress').val(deladd);
$('#txtStatus').val(stat);
@ -3367,6 +3440,7 @@ $('#txtStatus').val(stat);
type:"POST",
url:"<?php echo base_url() ?>purchaseorder/addNewCapitalPurchaseOrder",
success:function(data) {
alert(data);
if(data)
{
$('#content').loader('hide');
@ -3378,7 +3452,7 @@ $('#txtStatus').val(stat);
$('#CapitalToatlOrder').val('');
clearAfterAddLineItemAdd();
window.location = "purchaseorderListing";
window.location ="purchaseorderListing";
}
else
@ -3453,23 +3527,34 @@ function clearAfterAddLineItemAdd(){
if(EditExceedQuantityCheck()){
if($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '' && $('#EditExchangeRtModal').val() != '')
if($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '')
{
var txtQuantity = parseFloat( $('#EditCPQuantity').val());
var txtExchangeRate = parseFloat( $('#EditExchangeRtModal').val());
var txtExchangeRate = 1;
var RatePerTon = parseFloat( $('#EditCPRate').val());
//var txtUnitPrice = parseFloat($('#Rate').val());
var Tot = txtQuantity * txtExchangeRate * RatePerTon
$('#EditCPTotalAmount').val(parseFloat(Tot).toFixed(2));
if(capitalType=='International'){
txtExchangeRate = parseFloat( $('#EditExchangeRtModal').val());
var Tot = txtQuantity * RatePerTon;
}
else{
var Tot = txtQuantity * RatePerTon;
txtExchangeRate=1;
}
var BasicInINR=Tot * txtExchangeRate;
$('#EditCPTotalAmount').val(parseFloat(Tot).toFixed(2));
$('#EditAfterBasicPriceTax').val(Math.round(BasicInINR));
//ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val());
if(ExceedBudget($('#EditCPTotalAmount').val(),$('#EditCapitalbudAmt').val())){
//Service Tax calculation
$('#EditAfterServiceTax').val(calculateServiceTax($('#EditCPTotalAmount').val()));
$('#EditAfterServiceTax').val(calculateServiceTax($('#EditAfterBasicPriceTax').val()));
//Edu. cess @2% on service Tax
$('#EditAfterEduCess').val( calculateEduess($('#EditAfterServiceTax').val()));
@ -3479,14 +3564,14 @@ function clearAfterAddLineItemAdd(){
$('#EditAfterSecHighTax').val(calculateHigherEdu($('#EditAfterServiceTax').val()));
//Krishi Kalyan tax
$('#EditAfterKrishiTax').val(calculateKrishiKalyantax($('#EditCPTotalAmount').val()));
$('#EditAfterKrishiTax').val(calculateKrishiKalyantax($('#EditAfterBasicPriceTax').val()));
//Swachh Bharat tax
$('#EditAfterSwachhTax').val(calculateSwachhBharattax($('#EditCPTotalAmount').val()));
$('#EditAfterSwachhTax').val(calculateSwachhBharattax($('#EditAfterBasicPriceTax').val()));
// This is for import basic price
$('#EditAfterBasicPriceTax').val(Math.round($('#EditCPTotalAmount').val()));
//$('#EditAfterBasicPriceTax').val(Math.round($('#EditCPTotalAmount').val()));
if($('#EditLandingCharge').val()!='' && $('#EditAfterBasicPriceTax').val()!=''){
$('#EditAfterLandingCharge').val(calculateLandingCharge($('#EditLandingCharge').val(),$('#EditAfterBasicPriceTax').val()));
@ -3671,7 +3756,7 @@ function clearAfterAddLineItemAdd(){
var beforeAdditionalExciseDuty =$('#EditAdditionalExciseduty').val();
var PurQuantity = $('#EditPurQuantity').val();
var basicvalInINR=$('#EditAfterBasicPriceTax').val();
@ -3688,6 +3773,7 @@ function clearAfterAddLineItemAdd(){
$('#rateInUs'+userid).val(convertRate);
$('#basicval'+userid).val(basicval);
$('#basicvalInINR'+userid).val(basicvalInINR);
RequistQuantity = $('#quantity'+userid).val();
$('#AfterServiceTax'+userid).val(AfterServiceTax);
@ -3713,6 +3799,7 @@ function clearAfterAddLineItemAdd(){
$('#CustomDutyExpenses'+userid).val(CustomDutyExpenses);
$('#RMCIncludingCustomers'+userid).val(RMCIncludingCustomers);
$('#CapitalToatlOrder'+userid).val(basicval);
$('#CapitalToatlOrder'+userid).val(basicval);
@ -3976,6 +4063,7 @@ function validateEditCapitalTax()
}
$("#CurrencySymbol").val('');
var DisplayCurrencySymbol='';
$('#currencytype').change(function(){
var SelectCurrency = $('#currencytype').val();
var currency = <?php echo json_encode($Currency, JSON_PRETTY_PRINT) ?>;
@ -3983,10 +4071,14 @@ var currency = <?php echo json_encode($Currency, JSON_PRETTY_PRINT) ?>;
$.each(currency, function(idx, obj) {
if(obj.Currency_Code === SelectCurrency)
{
$("#CurrencySymbol").val(obj.FontCode2000);
$('#CurrencySymbol').html('Exchange Rate In' + " "+obj.FontCode2000);
$('#RateIn').html('Rate(in' + " "+obj.FontCode2000 + '/Ton)');
$('#EditRateIn').html('Rate(in' + " "+obj.FontCode2000 + '/Ton)');
$('#RateIn').html('Rate(in' + " "+obj.FontCode2000);
$('#EditRateIn').html('Rate(in' + " "+obj.FontCode2000);
$('#TotalAmount').html('Basic value in' + " "+obj.FontCode2000);
$('#EditTotalAmount').html('Basic value in' + " "+obj.FontCode2000);
DisplayCurrencySymbol=obj.FontCode2000;
$("p").html(obj.FontCode2000);
@ -4004,6 +4096,43 @@ PaymentDate=$('#After').val();
});
var capitalType = '';
function SetCapitalPo()
{
capitalType1 = $("input:radio[name='optcapital']:checked").val();
if(capitalType1 == 0)
{
capitalType='International';
$('#DomesticNOT').modal('hide');
}
else
{
capitalType='Domestic';
$('#DomesticNOT').modal('hide');
$('#currencyOpt').hide();
$('#FromOnlineRate').hide();
$('#hideExchangeRateOn').hide();
$('#hideExchangeRate').hide();
$('#currencytype').val('');
$('#hideModalExchange').hide();
$('#hideModalExchangeEdit').hide();
$('#ExchangeRtModal').val('1');
}
}
</script>

File diff suppressed because it is too large Load Diff

View File

@ -51,6 +51,8 @@
$ExchangeDate='';
$ExchangeRateOn='';
$UpdatedOn;
$CapitalRange='';
$PoStatusName='';
if(!empty($MaxPODate))
{
@ -81,14 +83,17 @@ if(!empty($POMaster))
$DeliveryAddress =$Req->DeliveryAddress;
$POStatus = $Req->StatusCode;
$PoStatusName=$Req->StatusName;
$PONO = $Req->PONO;
$ServiceDescription = $Req->ServiceDescription;
$PayableAT=$Req->PayableAT;
$ExchangeRateOn=$Req->ExchangeRate;
$ExchangeRateOn=$Req->ExchangeRateCalculatedon;
$PaymentDays=$Req->PaymentDays;
$PaymentTerms=$Req->PaymentTerms;
$UpdatedOn=$Req->UpdatedOn;
$CapitalRange=$Req->CapitalRange;
}
}
@ -134,6 +139,38 @@ $('#Deliverydt').val('');
$('#Scheduleby').val(SchName);
}
});
var capitalType='';
window.onload = function()
{
var CapRan = '<?php echo $CapitalRange; ?>';
if(CapRan == '1')
{
document.getElementById('ExchangeRateOnDiv').style.display = 'none';
document.getElementById('ExchangeRateOnDiv').style.display = 'none';
document.getElementById('ExchangeRateDiv').style.display = 'none';
document.getElementById('currencyTypeDiv').style.display = 'none';
document.getElementById('ExchangeRateModalDiv').style.display = 'none';
document.getElementById('ExchangeRateModalEditDiv').style.display = 'none';
capitalType='Domestic';
}
else
{
document.getElementById('ExchangeRateOnDiv').style.display = 'block';
document.getElementById('ExchangeRateOnDiv').style.display = 'block';
document.getElementById('ExchangeRateDiv').style.display = 'block';
document.getElementById('currencyTypeDiv').style.display = 'block';
document.getElementById('ExchangeRateModalDiv').style.display = 'block';
document.getElementById('ExchangeRateModalEditDiv').style.display = 'block';
capitalType='International';
document.getElementById('currencyTypeDiv').style.display = 'block';
}
}
</script>
@ -173,6 +210,7 @@ $('#Scheduleby').val(SchName);
});
</script>
<div class="content-wrapper">
<div id="content"></div>
<?php
$attributes = array('class' => 'form-label-left CapitalPO ','name' => 'CapitalPO','id' => 'ImportPO');
@ -214,7 +252,7 @@ $('#Scheduleby').val(SchName);
?>
</div>
<div class="col-md-12">
<div class="col-md-12" id="currencyTypeDiv" style="display:none;">
<label>Currency Type</label>
<div class="form-group">
@ -222,7 +260,7 @@ $('#Scheduleby').val(SchName);
<?php
if(!empty($Currency))
{
@ -342,10 +380,10 @@ $('#Scheduleby').val(SchName);
</div>
<div class="col-md-12">
<div class="col-md-3">
<div class="col-md-3" id="FromOnline" style="display:none;">
<a href="http://www.xe.com/" target="_blank"><u>Click here to check Today's Foreign Exchange value</u></a>
</div>
<div class="col-md-3">
<div class="col-md-3" id="ExchangeRateOnDiv" style="display:none;">
<label>Exchange Rate On</label>
<div class="form-group">
<?php
@ -356,7 +394,7 @@ $('#Scheduleby').val(SchName);
</div>
<div class="col-md-3">
<div class="col-md-3" id="ExchangeRateDiv" style="display:none;">
<label id="CurrencySymbol">Exchange Rate </label>
<div class="form-group">
<?php
@ -514,6 +552,8 @@ $('#Scheduleby').val(SchName);
<input type="hidden" name="<?php echo 'itemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
<input type="hidden" name="<?php echo 'basicval'.$index ?>" id="<?php echo 'basicval'.$index ?>" value="<?php echo $record->BasicValue ; ?>" />
<input type="hidden" name="<?php echo 'basicvalInINR'.$index ?>" id="<?php echo 'basicvalInINR'.$index ?>" value="<?php echo $record->ProductPrice ; ?>" />
<input type="hidden" name="<?php echo 'AfterServiceTax'.$index ?>" id="<?php echo 'AfterServiceTax'.$index ?>" value="<?php echo $record->ServiceTax ; ?>" />
<input type="hidden" name="<?php echo 'AfterEduCess'.$index ?>" id="<?php echo 'AfterEduCess'.$index ?>" value="<?php echo $record->EducessTax ; ?>" />
@ -593,13 +633,13 @@ $('#Scheduleby').val(SchName);
$TotalLanding = $TotalLanding + $record->AfterLandingCharge;
$tothighseas = $tothighseas + $record->AfterHighSeasSalesCharge;
$totcustom = $totcustom + $record->AfterCustomDuty;
$totexciseduty = $totexciseduty + $record->ExciseDuty;
$totexcisedutyED = $totexcisedutyED + $record->ExciseDutyEdCess;
$totexciseduty = $totexciseduty + $record->AfterExciseDuty;
$totexcisedutyED = $totexcisedutyED + $record->AfterExciseDutyEdCess;
$totexciseSH = $totexciseSH + $record->AfterExciseDutySHCess;
$totcustomED = $totcustomED +$record->AfterCustomEdCess;
$totcustomSH = $totcustomSH + $record->CustomSHCess;
$totaddtnlexcise= $totaddtnlexcise + $record->AddlExciseDuty;
$totcustomSH = $totcustomSH + $record->AfterCustomSHCess;
$totaddtnlexcise= $totaddtnlexcise + $record->AfterAddlExciseDuty;
$totgrossduty = $totgrossduty + $record->Grossdutypayable;
$totavlmodvat = $totavlmodvat +$record->AvailableModvat;
@ -615,6 +655,9 @@ $('#Scheduleby').val(SchName);
?> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index;?>">
<input type="hidden" name="CapitalToatlOrder" id="CapitalToatlOrder" value="<?php echo $totalCapitalOrder;?>">
<input type="hidden" name="txtPONO" id="txtPONO" value="<?php echo $PONO; ?>"/>
<input type="hidden" name="capitalType" id="capitalType" value="<?php echo $CapitalRange; ?>"/>
<?php
}
@ -692,7 +735,7 @@ $('#Scheduleby').val(SchName);
</div>
</div>
</div>
<div class="col-md-2">
<div class="col-md-2" id="ExchangeRateModalDiv" style="display:none;">
<label> Exchange Rate</label>
<div class="form-group">
<?php
@ -742,7 +785,7 @@ $('#Scheduleby').val(SchName);
</div>
</div>
<div class="col-md-2">
<label id="RateIn">Rate(in US $ /Ton)</label>
<label id="RateIn">Rate(in INR /Ton)</label>
<div class="form-group">
<?php
$data = array('name' => 'CPRate','value' => set_value('CPRate'),'id'=>'CPRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Ratechange();' );
@ -751,7 +794,7 @@ $('#Scheduleby').val(SchName);
</div>
</div>
<div class="col-md-2">
<label>Basic value in INR</label>
<label id="TotalAmount">Basic value in INR</label>
<div class="form-group">
<?php
$data = array('name' => 'CPTotalAmount','value' => set_value('CPTotalAmount'),'id'=>'CPTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
@ -819,7 +862,7 @@ $('#Scheduleby').val(SchName);
<div class="col-md-6" style="padding:0px;">
<div class="col-md-12">
<div class="col-md-4" >
Basic Price:
Basic Price In INR:
</div>
<div class="col-md-4">
<div class="form-group">
@ -1230,7 +1273,7 @@ $('#Scheduleby').val(SchName);
</div>
</div>
</div>
<div class="col-md-2">
<div class="col-md-2" id="ExchangeRateModalEditDiv" style="display:none;">
<label> Exchange Rate</label>
<div class="form-group">
<?php
@ -1280,7 +1323,7 @@ $('#Scheduleby').val(SchName);
</div>
</div>
<div class="col-md-2">
<label id="EditRateIn">Rate(in US $ /Ton)</label>
<label id="EditRateIn">Rate(in INR /Ton)</label>
<div class="form-group">
<?php
$data = array('name' => 'EditCPRate','value' => set_value('EditCPRate'),'id'=>'EditCPRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'EditRatechange();' );
@ -1289,7 +1332,7 @@ $('#Scheduleby').val(SchName);
</div>
</div>
<div class="col-md-2">
<label>Basic value in INR</label>
<label id="EditTotalAmount">Basic value in INR</label>
<div class="form-group">
<?php
$data = array('name' => 'EditCPTotalAmount','value' => set_value('EditCPTotalAmount'),'id'=>'EditCPTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
@ -1357,7 +1400,7 @@ $('#Scheduleby').val(SchName);
<div class="col-md-6" style="padding:0px;">
<div class="col-md-12">
<div class="col-md-4" >
Basic Price:
Basic Price In INR:
</div>
<div class="col-md-4">
<div class="form-group">
@ -1922,8 +1965,9 @@ $('#Scheduleby').val(SchName);
<div class="col-md-4">
<span>Status</span>
<?php
$options = array("0"=>'Select Status');
echo form_dropdown('Status', $options,set_value('Status'),'id="Status"' ,'required="true"' ,'class="form-control select2')
$data = array('name' => 'Status','value' => set_value('Status',$PoStatusName),'id'=>'Status', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
@ -2181,7 +2225,16 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
$("#CapitalItemName").val(obj.MaterialName);
$("#CPUOM").val(obj.UOM);
$("#CPQuantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
RequistQuantity = obj.Quantity;
var CPUOMDisplay=obj.UOM;
$('#RateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+CPUOMDisplay+')');
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/Ton)');
}
});
}
@ -2218,7 +2271,11 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
$("#EditItemName").val(obj.MaterialName);
$("#EditUOM").val(obj.UOM);
$("#EditQuantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
RequistQuantity = obj.Quantity;
var CPUOMDisplay=obj.UOM;
$('#RateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+CPUOMDisplay+')');
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/Ton)');
}
});
}
@ -2281,6 +2338,7 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
*/
function Ratechange(){
if($('#Reqnumber').val() == "0")
{
alert('Please select the Requisition Number');
@ -2304,23 +2362,38 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
if(ExceedQuantityCheck()){
if($('#CPQuantity').val() != '' && $('#CPRate').val() != '' && $('#ExchangeRtModal').val() != '')
if($('#CPQuantity').val() != '' && $('#CPRate').val() != '')
{
var txtQuantity = parseFloat( $('#CPQuantity').val());
var txtExchangeRate = parseFloat( $('#ExchangeRtModal').val());
//var txtExchangeRate = parseFloat( $('#ExchangeRtModal').val());
var RatePerTon = parseFloat( $('#CPRate').val());
//var txtUnitPrice = parseFloat($('#Rate').val());
var Tot = txtQuantity * txtExchangeRate * RatePerTon
$('#CPTotalAmount').val(parseFloat(Tot).toFixed(2));
var txtExchangeRate='';
if(capitalType=='International'){
txtExchangeRate = parseFloat( $('#ExchangeRtModal').val());
var Tot = txtQuantity * RatePerTon;
}
else{
var Tot = txtQuantity * RatePerTon;
txtExchangeRate = 1;
}
var BasicInINR=Tot * txtExchangeRate;
$('#CPTotalAmount').val(parseFloat(Tot).toFixed(2));
$('#AfterBasicPriceTax').val(Math.round(BasicInINR));
//ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val());
if(ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val())){
//Service Tax calculation
$('#AfterServiceTax').val(calculateServiceTax($('#CPTotalAmount').val()));
$('#AfterServiceTax').val(calculateServiceTax($('#AfterBasicPriceTax').val()));
//Edu. cess @2% on service Tax
$('#AfterEduCess').val( calculateEduess($('#AfterServiceTax').val()));
@ -2330,14 +2403,14 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
$('#AfterSecHighTax').val(calculateHigherEdu($('#AfterServiceTax').val()));
//Krishi Kalyan tax
$('#AfterKrishiTax').val(calculateKrishiKalyantax($('#CPTotalAmount').val()));
$('#AfterKrishiTax').val(calculateKrishiKalyantax($('#AfterBasicPriceTax').val()));
//Swachh Bharat tax
$('#AfterSwachhTax').val(calculateSwachhBharattax($('#CPTotalAmount').val()));
$('#AfterSwachhTax').val(calculateSwachhBharattax($('#AfterBasicPriceTax').val()));
// This is for import basic price
$('#AfterBasicPriceTax').val(Math.round($('#CPTotalAmount').val()));
//$('#AfterBasicPriceTax').val(Math.round($('#CPTotalAmount').val()));
if($('#LandingCharge').val()!='' && $('#AfterBasicPriceTax').val()!=''){
$('#AfterLandingCharge').val(calculateLandingCharge($('#LandingCharge').val(),$('#AfterBasicPriceTax').val()));
@ -2820,7 +2893,7 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
var AfterKrishiTax = $("#AfterKrishiTax").val();
var AfterSwachhTax = $("#AfterSwachhTax").val();
var landingCharge = $('#AfterLandingCharge').val();
var HighSeasSalesCharge = $('#AfterHighseas').val();
@ -2838,7 +2911,7 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
var purchaseRate = $('#purchaserate').val();
var CustomDutyExpenses = $('#CustomDutyExpenses').val();
var RMCIncludingCustomers = $('#RMCIncludingCustomers').val();
var basicvalInINR=$('#AfterBasicPriceTax').val();
/*get % values */
var beforeLanding = $('#LandingCharge').val();
@ -2932,7 +3005,7 @@ var purchaseRate = $('#purchaserate').val();
addHidden(theForm,"PurQuantity"+temp,PurQuantity);
addHidden(theForm,"PerKgExpense"+temp,TotalOrderValuePerkg);
addHidden(theForm,"LineItemNo"+temp,"");
addHidden(theForm,"basicvalInINR"+temp,basicvalInINR);
$('#txtRowCount').val(temp);
@ -2950,7 +3023,7 @@ var purchaseRate = $('#purchaserate').val();
var basicAmountRate = parseFloat($('#CPTotalAmount').val());
var totalAmount = parseFloat($('#txtTotalOrderValue').val());
if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt)
if(basicAmountRate > avalbudAmt)
{
alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
$('#CPRate').focus();
@ -3518,6 +3591,7 @@ function DeleteRow(rowid)
$('#EditCapitalItemName').val($('#materialName'+userid).val());
$('#EditCPUOM').val($('#uom'+userid).val());
$('#EditCPQuantity').val($('#quantity'+userid).val());
$('#EditCPRate').val($('#rateInUs'+userid).val());
@ -3531,7 +3605,7 @@ function DeleteRow(rowid)
$('#EditAfterSwachhTax').val($('#AfterSwachhTax'+userid).val());
$('#EditAfterBasicPriceTax').val($('#basicval'+userid).val());
$('#EditAfterBasicPriceTax').val($('#basicvalInINR'+userid).val());
$('#EditAfterLandingCharge').val($('#landingCharge'+userid).val());
$('#EditAfterHighseas').val($('#HighSeasSalesCharge'+userid).val());
$('#EditAfterCustomduty').val($('#CustomDuty'+userid).val());
@ -3564,8 +3638,9 @@ function DeleteRow(rowid)
$('#EditAdditionalExciseduty').val($('#beforeAdditionalExciseDuty'+userid).val());
$('#EditPurQuantity').val($('#PurQuantity'+userid).val());
var EditUOM = $('#uom'+userid).val();
$('#RateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EditUOM+')');
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EditUOM+')');
@ -3717,7 +3792,7 @@ $('#txtStatus').val(stat);
$('#txtDeliveryAddress').val('');
clearAfterAddLineItemAdd();
window.location = "purchaseorderListing";
window.location ="purchaseorderListing";
}
else
@ -3792,15 +3867,29 @@ function clearAfterAddLineItemAdd(){
if(EditExceedQuantityCheck()){
if($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '' && $('#EditExchangeRtModal').val() != '')
if($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '')
{
var txtQuantity = parseFloat( $('#EditCPQuantity').val());
var txtExchangeRate = parseFloat( $('#EditExchangeRtModal').val());
//var txtExchangeRate = parseFloat( $('#EditExchangeRtModal').val());
var RatePerTon = parseFloat( $('#EditCPRate').val());
//var txtUnitPrice = parseFloat($('#Rate').val());
var Tot = txtQuantity * txtExchangeRate * RatePerTon
var txtExchangeRate='';
if(capitalType=='International'){
txtExchangeRate = parseFloat( $('#EditExchangeRtModal').val());
var Tot = txtQuantity * RatePerTon;
}
else{
var Tot = txtQuantity * RatePerTon;
txtExchangeRate = 1;
}
var BasicInINR=Tot * txtExchangeRate;
$('#EditCPTotalAmount').val(parseFloat(Tot).toFixed(2));
$('#EditAfterBasicPriceTax').val(Math.round(BasicInINR));
//ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val());
@ -3808,7 +3897,7 @@ function clearAfterAddLineItemAdd(){
//Service Tax calculation
$('#EditAfterServiceTax').val(calculateServiceTax($('#EditCPTotalAmount').val()));
$('#EditAfterServiceTax').val(calculateServiceTax($('#EditAfterBasicPriceTax').val()));
//Edu. cess @2% on service Tax
$('#EditAfterEduCess').val( calculateEduess($('#EditAfterServiceTax').val()));
@ -3818,14 +3907,14 @@ function clearAfterAddLineItemAdd(){
$('#EditAfterSecHighTax').val(calculateHigherEdu($('#EditAfterServiceTax').val()));
//Krishi Kalyan tax
$('#EditAfterKrishiTax').val(calculateKrishiKalyantax($('#EditCPTotalAmount').val()));
$('#EditAfterKrishiTax').val(calculateKrishiKalyantax($('#EditAfterBasicPriceTax').val()));
//Swachh Bharat tax
$('#EditAfterSwachhTax').val(calculateSwachhBharattax($('#EditCPTotalAmount').val()));
$('#EditAfterSwachhTax').val(calculateSwachhBharattax($('#EditAfterBasicPriceTax').val()));
// This is for import basic price
$('#EditAfterBasicPriceTax').val(Math.round($('#EditCPTotalAmount').val()));
// $('#EditAfterBasicPriceTax').val(Math.round($('#EditCPTotalAmount').val()));
if($('#EditLandingCharge').val()!='' && $('#EditAfterBasicPriceTax').val()!=''){
$('#EditAfterLandingCharge').val(calculateLandingCharge($('#EditLandingCharge').val(),$('#EditAfterBasicPriceTax').val()));
@ -4009,7 +4098,7 @@ function clearAfterAddLineItemAdd(){
var beforeCustomSHCess = $('#EditCustomSHcess').val();
var beforeAdditionalExciseDuty =$('#EditAdditionalExciseduty').val();
var PurQuantity = $('#EditPurQuantity').val();
var basicvalInINR=$('#EditAfterBasicPriceTax').val();
@ -4051,7 +4140,7 @@ function clearAfterAddLineItemAdd(){
$('#purchaseRate'+userid).val(purchaseRate);
$('#CustomDutyExpenses'+userid).val(CustomDutyExpenses);
$('#RMCIncludingCustomers'+userid).val(RMCIncludingCustomers);
$('#basicvalInINR'+userid).val(basicvalInINR);
@ -4193,7 +4282,7 @@ function validateEditCapitalTax()
var basicAmountRate = parseFloat($('#EditCPTotalAmount').val());
var totalAmount = parseFloat($('#EdittxtTotalOrderValue').val());
if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt)
if(basicAmountRate > avalbudAmt)
{
alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
$('#EditCPRate').focus();
@ -4314,16 +4403,20 @@ function validateEditCapitalTax()
$('#txtToatlOrder').val((parseFloat(TotalOrderValueSummary)).toFixed(2) );
}
var DisplayCurrencySymbol='';
var currency = <?php echo json_encode($Currency, JSON_PRETTY_PRINT) ?>;
$.each(currency, function(idx, obj) {
if(obj.Currency_Code === $("#currencytype").val())
{
$("#CurrencySymbol").val(obj.FontCode2000);
DisplayCurrencySymbol=obj.FontCode2000;
var DisplayUOM=$('#uom').val();
$('#CurrencySymbol').html('Exchange Rate In' + " "+obj.FontCode2000);
$('#RateIn').html('Rate(in' + " "+obj.FontCode2000 + '/Ton)');
$('#EditRateIn').html('Rate(in' + " "+obj.FontCode2000 + '/Ton)');
$('#RateIn').html('Rate(in' + " "+obj.FontCode2000 + '/'+DisplayUOM+')');
$('#EditRateIn').html('Rate(in' + " "+obj.FontCode2000 + '/'+DisplayUOM+')');
$('#TotalAmount').html('Basic Value in' + " "+DisplayCurrencySymbol);
$('#EditTotalAmount').html('Basic Value in' + " "+DisplayCurrencySymbol);
}
@ -4336,9 +4429,14 @@ var SelectCurrency = $('#currencytype').val();
if(obj.Currency_Code === SelectCurrency)
{
$("#CurrencySymbol").val(obj.FontCode2000);
DisplayCurrencySymbol=obj.FontCode2000;
$('#CurrencySymbol').html('Exchange Rate In' + " "+obj.FontCode2000);
$('#RateIn').html('Rate(in' + " "+obj.FontCode2000 + '/Ton)');
$('#EditRateIn').html('Rate(in' + " "+obj.FontCode2000 + '/Ton)');
$('#TotalAmount').html('Basic Value in' + " "+DisplayCurrencySymbol);
$('#EditTotalAmount').html('Basic Value in' + " "+DisplayCurrencySymbol);

File diff suppressed because it is too large Load Diff

0
application/views/editstorerequisition.php Normal file → Executable file
View File

0
application/views/storerequisition.php Normal file → Executable file
View File

0
application/views/storerequisitionlisting.php Normal file → Executable file
View File

View File

@ -54,7 +54,7 @@ function validate()
$('#Deliverydt').focus();
return false;
}
else if(PoType=='CAPITAL' ){
else if(PoType=='CAPITAL' && capitalType=='International'){
if(currencyType=='0'){
alert('Please Select the Currency Type');

View File

@ -54,7 +54,7 @@ function validate()
$('#Deliverydt').focus();
return false;
}
else if(PoType=='CAPITAL' ){
else if(PoType=='CAPITAL' && capitalType=='International'){
if(currencyType=='0'){
alert('Please Select the Currency Type');