import po
This commit is contained in:
parent
a4691068ea
commit
b77f71ddbc
@ -157,7 +157,8 @@ class purchaseorder extends BaseController
|
||||
/* End Here */
|
||||
|
||||
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
||||
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
|
||||
// $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
|
||||
$data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate();
|
||||
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
|
||||
|
||||
$ViewName = '';
|
||||
@ -259,7 +260,15 @@ class purchaseorder extends BaseController
|
||||
/* End Here */
|
||||
|
||||
$data['POMaster'] = $this->purchaseorder_model->GetServicePurchaseOrder($PONO);
|
||||
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
|
||||
//print_r($data['POMaster']);
|
||||
foreach ($data['POMaster'] as $Exc)
|
||||
{
|
||||
$exRate=$Exc->ExchangeRate;
|
||||
}
|
||||
|
||||
//print_r($exRate);
|
||||
//$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
|
||||
$data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate();
|
||||
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
|
||||
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
|
||||
if($ReqType == SERVICE)
|
||||
@ -290,36 +299,20 @@ class purchaseorder extends BaseController
|
||||
}
|
||||
// print_r($data);
|
||||
$data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetails($PONO);
|
||||
//print_r($data);
|
||||
//$data['ExchangeRate']=$data['POItem']->ExchangeRate;
|
||||
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
|
||||
|
||||
// foreach($data['POMaster'] as $CUR)
|
||||
// {
|
||||
|
||||
//print_r($data['POItem']);
|
||||
|
||||
foreach($data['POItem'] as $Rate)
|
||||
{
|
||||
|
||||
// print_r($Rate->ExchangeRate);
|
||||
$exRate=$Rate->ExchangeRate;
|
||||
|
||||
// $data[$Rate->ExchangeRate]=$Rate->ExchangeRate;
|
||||
}
|
||||
|
||||
foreach($data['POItem'] as $CUR)
|
||||
{
|
||||
|
||||
//print_r($CUR->CurrencyType);
|
||||
$Currency=$CUR->CurrencyType;
|
||||
// //print_r($CUR->CurrencyType);
|
||||
// $Currency=$CUR->Currency_Code;
|
||||
|
||||
|
||||
// $data[$Rate->ExchangeRate]=$Rate->ExchangeRate;
|
||||
}
|
||||
//echo "$Currency";
|
||||
$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency);
|
||||
//print_r($data);
|
||||
$data['ExchangeRate']=$exRate;
|
||||
|
||||
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
|
||||
//print_r($data);
|
||||
// // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate;
|
||||
// }
|
||||
// $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency);
|
||||
// //print_r($data['CurrencyDetail']);
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form';
|
||||
$this->loadViews("editimportpo", $this->global, $data, NULL);
|
||||
}
|
||||
@ -965,11 +958,15 @@ public function importpoprint($PONO)
|
||||
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
$Exchangerate=$this->input->post('ExchangeRate');
|
||||
$ExchangeRateCalculatedon=$this->input->post('Exchangerateon');
|
||||
$CurrencyType=$this->input->post('currencytype');
|
||||
|
||||
|
||||
$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 );
|
||||
$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);
|
||||
|
||||
|
||||
//print_r($POList);
|
||||
//die();
|
||||
$POMaster = $this->purchaseorder_model->addPOMaster($POList);
|
||||
|
||||
$PONO = '';
|
||||
@ -991,7 +988,7 @@ public function importpoprint($PONO)
|
||||
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
||||
$itemRate = $this->input->post('itemRate'.$i);
|
||||
|
||||
$Exchangerate = $this->input->post('Exchangerate'.$i);
|
||||
//$Exchangerate = $this->input->post('Exchangerate'.$i);
|
||||
$BasicPriceinmton = $this->input->post('BasicPriceinUS'.$i);
|
||||
$Productprice = $this->input->post('BasicAmt'.$i);
|
||||
$LandingCharge = $this->input->post('LandingChargee'.$i);
|
||||
@ -1027,7 +1024,7 @@ public function importpoprint($PONO)
|
||||
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i);
|
||||
$QuantityKG = $this->input->post('PurQuantity'.$i);
|
||||
|
||||
$currencytypeID = $this->input->post('currencytype');
|
||||
//$currencytypeID = $this->input->post('currencytype');
|
||||
$Totalvalueitem=$this->input->post('TotalExp'.$i);
|
||||
|
||||
//echo $BasicPriceinmton;
|
||||
@ -1064,7 +1061,7 @@ public function importpoprint($PONO)
|
||||
if(trim($POType) == IMPORT )
|
||||
{
|
||||
// echo 'Success';
|
||||
$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();
|
||||
|
||||
@ -1093,6 +1090,12 @@ $createddt='';
|
||||
$POType = $this->input->post('POType');
|
||||
$PoRange = $this->input->post('txtPoRange');
|
||||
$DeliveryOption = $this->input->post('DateRange');
|
||||
|
||||
$Exchangerate=$this->input->post('ExchangeRate');
|
||||
$ExchangeRateCalculatedon=$this->input->post('Exchangerateon');
|
||||
$CurrencyType=$this->input->post('currencytype');
|
||||
|
||||
|
||||
if($DeliveryOption==1){
|
||||
$Deliverydt = '';
|
||||
$DeliverySchedule = $this->input->post('Scheduleby');
|
||||
@ -1116,7 +1119,7 @@ $createddt='';
|
||||
$updateddt = $dt->format('Y-m-d H:i:s');
|
||||
// PO Master
|
||||
// PO Master
|
||||
$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 );
|
||||
$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 );
|
||||
//echo $PONO;
|
||||
//echo $TotalOrder;
|
||||
//print_r($POList);
|
||||
@ -1137,7 +1140,7 @@ $createddt='';
|
||||
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
||||
$itemRate = $this->input->post('itemRate'.$i);
|
||||
|
||||
$Exchangerate = $this->input->post('Exchangerate'.$i);
|
||||
//$Exchangerate = $this->input->post('Exchangerate'.$i);
|
||||
$BasicPriceinmton = $this->input->post('BasicPriceinUS'.$i);
|
||||
$Productprice = $this->input->post('BasicAmt'.$i);
|
||||
$LandingCharge = $this->input->post('LandingChargee'.$i);
|
||||
@ -1179,7 +1182,7 @@ $createddt='';
|
||||
$Totalvalueitem=$this->input->post('TotalExp'.$i);
|
||||
$LineItemNo = '';
|
||||
|
||||
$currencytypeID = $this->input->post('currencytype');
|
||||
//$currencytypeID = $this->input->post('currencytype');
|
||||
$SkipInsert = "False";
|
||||
if( count($comma_separated) > 0)
|
||||
{
|
||||
@ -1217,7 +1220,7 @@ $createddt='';
|
||||
$isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo);
|
||||
if(count($isExists) == 0)
|
||||
{
|
||||
$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();
|
||||
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
|
||||
|
||||
@ -335,6 +335,16 @@ function purchaseorderListing()
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
function getLastReleasedPODate()
|
||||
{
|
||||
$this->db->select('max(ReleasedOn) as PODate');
|
||||
$this->db->from('T_PurchaseOrder_Master');
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -347,7 +357,7 @@ function purchaseorderListing()
|
||||
$this->db->insert('T_PurchaseOrder_Master', $POMaster);
|
||||
$insert_id = $this->db->affected_rows();
|
||||
$this->db->trans_complete();
|
||||
// print_r($this->db->last_query());
|
||||
//print_r($this->db->last_query());
|
||||
if($insert_id>0)
|
||||
{
|
||||
$subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master';
|
||||
@ -435,7 +445,7 @@ function purchaseorderListing()
|
||||
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,Stat.StatusCode');
|
||||
$this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,Stat.StatusCode,POMast.ExchangeRateCalculatedon,POMast.ExchangeRate,POMast.CurrencyType');
|
||||
$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');
|
||||
@ -555,7 +565,7 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
|
||||
function GetCurrencyDetail($Currency='')
|
||||
{
|
||||
|
||||
$subQuery='SELECT CurrencyCode,CurrencyName from T_Currency_Details where CurrencyCode=?';
|
||||
$subQuery='SELECT Currency_Code,Country_and_Currency from T_Currency_Details where Currency_Code=?';
|
||||
$query=$this->db->query($subQuery,array($Currency));
|
||||
return $query->result();
|
||||
|
||||
@ -592,7 +602,7 @@ Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,
|
||||
function GetCurrencytype()
|
||||
{
|
||||
|
||||
$subQuery = 'select CurrencyCode,CurrencyName from T_Currency_Details';
|
||||
$subQuery = 'select Currency_Code,Country_and_Currency from T_Currency_Details;';
|
||||
|
||||
$query = $this->db->query($subQuery);
|
||||
|
||||
|
||||
@ -1,11 +1,16 @@
|
||||
<?php
|
||||
$AvlAmount = 0;
|
||||
$ReqType ='';
|
||||
|
||||
$Value='';
|
||||
$EXCRATE=0;
|
||||
//echo $ExchangeRate;
|
||||
//echo $Currency;
|
||||
|
||||
|
||||
// foreach ($CurrencyDetail as $Detail)
|
||||
// {
|
||||
// $Cur=$Detail->Currency_Code.' '.' - '.' '.$Detail->Country_and_Currency;
|
||||
// }
|
||||
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$CurrentDate = $dt->format('Y-m-d');
|
||||
@ -36,7 +41,7 @@ if(!empty($CompanyDetails))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//echo "$CompanyAddress";
|
||||
//$Exchangerate=$ExchangeRate;
|
||||
|
||||
|
||||
@ -66,6 +71,7 @@ $totordervalue='';
|
||||
$ExchangeRate='';
|
||||
$totorder='';
|
||||
//$ExchangeRate
|
||||
$ExchangeRateCalculatedon='';
|
||||
|
||||
|
||||
if(!empty($POMaster))
|
||||
@ -86,7 +92,9 @@ if(!empty($POMaster))
|
||||
$POStatus = $Req->StatusCode;
|
||||
$PONO = $Req->PONO;
|
||||
$ServiceDescription = $Req->ServiceDescription;
|
||||
// $ExchangeRate=$Req->ExchangeRate;
|
||||
$ExchangeRate=$Req->ExchangeRate;
|
||||
$ExchangeRateCalculatedon=$Req->ExchangeRateCalculatedon;
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -117,16 +125,33 @@ if(!empty($POMaster))
|
||||
//$("#drpSupplier").select2();
|
||||
var POMaxDate = '<?php echo $MaxPoDate;?>';
|
||||
var d = new Date(POMaxDate);
|
||||
|
||||
var t='<?php echo $CurrentDate;?>';
|
||||
var m=new Date(t);
|
||||
|
||||
$("#PODate").datepicker({
|
||||
minDate : d,
|
||||
maxDate : 'now',
|
||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
|
||||
$("#PayableAT").datepicker({
|
||||
minDate : m,
|
||||
//maxDate : 'now',
|
||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
$("#Deliverydt").datepicker({
|
||||
minDate : 'now',
|
||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
|
||||
});
|
||||
|
||||
|
||||
$("#Exchangerateon").datepicker({
|
||||
minDate : m,
|
||||
//maxDate : 'now',
|
||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@ -181,6 +206,7 @@ if(!empty($POMaster))
|
||||
<label>Currency Type</label>
|
||||
|
||||
<?php
|
||||
//$options = array("0"=>$Cur);
|
||||
$options = array("0"=>'Select Currency');
|
||||
|
||||
//print_r( $options);
|
||||
@ -189,7 +215,7 @@ if(!empty($POMaster))
|
||||
foreach ($Currency as $CUR):
|
||||
|
||||
|
||||
$options[$CUR->CurrencyCode] = $CUR->CurrencyCode.' '.' - '.' '.$CUR->CurrencyName;
|
||||
$options[$CUR->Currency_Code] = $CUR->Currency_Code.' '.' - '.' '.$CUR->Country_and_Currency;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
@ -213,10 +239,12 @@ if(!empty($POMaster))
|
||||
?>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12"><br/>
|
||||
<a href="http://www.xe.com/" target="_blank"><u>Click here to check Today's Foreign Exchange value</u></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-4">
|
||||
@ -258,19 +286,17 @@ if(!empty($POMaster))
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
Exchange Rate :
|
||||
<div class="form-group">
|
||||
<?php
|
||||
<div class="col-md-12">
|
||||
<label>Exchange Rate On</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Exchangerateon','value' => set_value('Exchangerateon',$ExchangeRateCalculatedon),'id'=>'Exchangerateon', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
$data = array('name' => 'ExchangeRate','value' => set_value('ExchangeRate',$ExchangeRate),'id'=>'ExchangeRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'USRate()');
|
||||
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-12">
|
||||
@ -289,10 +315,21 @@ if(!empty($POMaster))
|
||||
<?php
|
||||
$data = array('name' => 'DeliveryAddr','value' => set_value('DeliveryAddr',$DeliveryAddress),'id'=>'DeliveryAddr', 'class' => 'form-control' ,'required' => 'true', 'rows' => '3', 'cols' => '40');
|
||||
echo Form_textarea($data);
|
||||
|
||||
?> <input type="hidden" name="txtDeliveryAddress" id="txtDeliveryAddress" value="<?php echo $DeliveryAddress;?>">
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<!--<label>Exchange Rate </label>-->
|
||||
<label><?php echo "Exchange Rate in $Value";?></label>
|
||||
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ExchangeRate','value' => set_value('ExchangeRate',$ExchangeRate),'id'=>'ExchangeRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'USRate()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-md-12">
|
||||
Basic value in INR :
|
||||
<div class="form-group">
|
||||
@ -304,28 +341,84 @@ if(!empty($POMaster))
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12">
|
||||
|
||||
<b><u>Select Delivery By</u></b><br/>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo form_label('Date', 'Date') ." ". form_radio(array("name"=>"DateRange", "id"=>"Date", "value"=>"0", 'checked'=>'checked')); ?> </td>
|
||||
<td>
|
||||
<?php echo form_label('Schedule', 'Schedule') ." ". form_radio(array("name"=>"DateRange", "id"=>"Schedule", "value"=>"1")); ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" id="Schedulediv" style="display:none;"><br/>
|
||||
<label >Schedule </label>
|
||||
|
||||
<?php
|
||||
$data = array('name' => 'Scheduleby','value' => set_value('Scheduleby'),'id'=>'Scheduleby', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40');
|
||||
echo Form_textarea($data);
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12" id="Deliverydtdiv"><br/>
|
||||
<label>Delivery Date</label>
|
||||
|
||||
<?php
|
||||
$data = array('name' => 'Deliverydt','value' => set_value('Deliverydt',$CurrentDate),'id'=>'Deliverydt', 'class' => 'form-control' ,'required' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12"><br/>
|
||||
<label>Purchase Order Date</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'PODate','value' => set_value('PODate',$PODate),'id'=>'PODate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
$data = array('name' => 'PODate','value' => set_value('PODate',$CurrentDate),'id'=>'PODate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>Delivery Date</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Deliverydt','value' => set_value('Deliverydt',$Deliverydt),'id'=>'Deliverydt', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
|
||||
<legend>Payment Details</legend>
|
||||
<!-- Text input-->
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="payablefrom">Payable Terms</span>
|
||||
<select class="form-control required" id="PaymentTerms" name="PaymentTerms">
|
||||
<option value="Date of invoice" >Select Payment method</option>
|
||||
<?php
|
||||
if(!empty($payment))
|
||||
{
|
||||
foreach ($payment as $rl)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="PayableAT">Payable AT</span>
|
||||
<input type="text" class="form-control required" id="PayableAT" name="PayableAT">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3"><span>Payment Date</span><br/>
|
||||
<label class="radio-inline"><input type="radio" name="Payment" value="Before">Before</label>
|
||||
<label class="radio-inline"><input type="radio" name="Payment" value="After">After</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -482,7 +575,8 @@ if(!empty($POMaster))
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>Basic Amount </label>
|
||||
<!-- <label>Basic Amount </label>-->
|
||||
<label><?php echo "Basic Value In $Value";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
//$data = array('name' => 'imTotalAmount','value' => set_value('imTotalAmount'),'id'=>'imTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
@ -1018,7 +1112,7 @@ if(!empty($POMaster))
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>Basic Amount </label>
|
||||
<label><?php echo "Basic Value In $Value";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
//$data = array('name' => 'imTotalAmount','value' => set_value('imTotalAmount'),'id'=>'imTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
@ -1395,7 +1489,7 @@ if(!empty($POMaster))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'EditTotalExp','value' => set_value('TotalExp'),'id'=>'TotalExp', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','readonly'=>'true');
|
||||
$data = array('name' => 'EditTotalExp','value' => set_value('EditTotalExp'),'id'=>'EditTotalExp', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','readonly'=>'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -1795,9 +1889,12 @@ var NilType = '<?php echo NILTYPE;?>';
|
||||
Mat: []
|
||||
};
|
||||
|
||||
$('#ExchangeRate').val(<?php echo $ExchangeRate;?>);
|
||||
//$('#ExchangeRate').val(<?php echo $ExchangeRate;?>);
|
||||
$('#EditAvlBudAmt').val(<?php echo $AvlAmount; ?>);
|
||||
|
||||
//var a=$('#ExchangeRate').val();
|
||||
//alert(a);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2,6 +2,13 @@
|
||||
$AvlAmount = 0;
|
||||
$ReqType ='';
|
||||
$CompanyAddress = '';
|
||||
$Value='';
|
||||
|
||||
|
||||
date_default_timezone_set('Australia/Melbourne');
|
||||
$date = date('m/d/Y h:i:s a', time());
|
||||
|
||||
|
||||
if(!empty($CompanyDetails))
|
||||
{
|
||||
foreach ($CompanyDetails as $Req)
|
||||
@ -9,10 +16,10 @@ if(!empty($CompanyDetails))
|
||||
$CompanyAddress = $Req->Address;
|
||||
}
|
||||
}
|
||||
|
||||
//echo "$CompanyAddress";
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$CurrentDate = $dt->format('Y-m-d');
|
||||
|
||||
//echo $CurrentDate;
|
||||
$MaxPoDate = '';
|
||||
if(!empty($MaxPODate))
|
||||
{
|
||||
@ -50,18 +57,33 @@ if(!empty($AvlBudAmt))
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function(){
|
||||
|
||||
//Initialize Select2 Elements for currency type
|
||||
$("#currencytype").select2();
|
||||
|
||||
var POMaxDate = '<?php echo $MaxPoDate;?>';
|
||||
var d = new Date(POMaxDate);
|
||||
var d = new Date(POMaxDate);
|
||||
var t='<?php echo $CurrentDate;?>';
|
||||
var m=new Date(t);
|
||||
|
||||
$("#PODate").datepicker({
|
||||
minDate : d,
|
||||
maxDate : 'now',
|
||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
|
||||
$("#PayableAT").datepicker({
|
||||
minDate : m,
|
||||
//maxDate : 'now',
|
||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
|
||||
$("#Exchangerateon").datepicker({
|
||||
minDate : m,
|
||||
//maxDate : 'now',
|
||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
$("#Deliverydt").datepicker({
|
||||
minDate : 'now',
|
||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
|
||||
@ -159,30 +181,32 @@ function vaildateBeforeOpenModal()
|
||||
echo form_multiselect('RequistionNo', $options,set_value('RequistionNo'),'id="RequistionNo"' , 'required="true"');
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>Currency Type</label>
|
||||
|
||||
<?php
|
||||
$options = array("0"=>'Select Currency Type');
|
||||
//print_r($Currency);
|
||||
if(!empty($Currency))
|
||||
{ //print_r($Currency);
|
||||
foreach ($Currency as $CUR):
|
||||
|
||||
|
||||
$options[$CUR->CurrencyCode] = $CUR->CurrencyCode.' '.' - '.' '.$CUR->CurrencyName;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
|
||||
echo form_dropdown('currencytype', $options,set_value('currencytype'),'id="currencytype"' ,'required="true"' ,'class="form-control select2');
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<label>Currency Type</label>
|
||||
|
||||
<?php
|
||||
$options = array("0"=>'Select Currency Type');
|
||||
//print_r($Currency);
|
||||
if(!empty($Currency))
|
||||
{ //print_r($Currency);
|
||||
foreach ($Currency as $CUR):
|
||||
|
||||
|
||||
$options[$CUR->Currency_Code] = $CUR->Currency_Code.' '.' - '.' '.$CUR->Country_and_Currency;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
|
||||
echo form_dropdown('currencytype', $options,set_value('currencytype'),'id="currencytype"' ,'required="true"' ,'class="form-control select2');
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12"><br/>
|
||||
<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">
|
||||
@ -217,15 +241,17 @@ function vaildateBeforeOpenModal()
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>Exchange Rate </label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ExchangeRate','value' => set_value('ExchangeRate'),'id'=>'ExchangeRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'USRate()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>Exchange Rate On</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Exchangerateon','value' => set_value('Exchangerateon',$CurrentDate),'id'=>'Exchangerateon', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-12">
|
||||
@ -247,15 +273,18 @@ function vaildateBeforeOpenModal()
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>Purchase Order Date</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'PODate','value' => set_value('PODate',$CurrentDate),'id'=>'PODate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<!--<label>Exchange Rate </label>-->
|
||||
<label><?php echo "Exchange Rate in $Value";?></label>
|
||||
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ExchangeRate','value' => set_value('ExchangeRate'),'id'=>'ExchangeRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'USRate()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-md-12">
|
||||
Basic value in INR :
|
||||
<div class="form-group">
|
||||
@ -281,7 +310,7 @@ function vaildateBeforeOpenModal()
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" id="Schedulediv" style="display:none;"><br/>
|
||||
<label >Schedule :</label>
|
||||
<label >Schedule </label>
|
||||
|
||||
<?php
|
||||
$data = array('name' => 'Scheduleby','value' => set_value('Scheduleby'),'id'=>'Scheduleby', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40');
|
||||
@ -289,19 +318,62 @@ function vaildateBeforeOpenModal()
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12" id="Deliverydtdiv">
|
||||
<div class="col-md-12" id="Deliverydtdiv"><br/>
|
||||
<label>Delivery Date</label>
|
||||
|
||||
<?php
|
||||
$data = array('name' => 'Deliverydt','value' => set_value('Deliverydt'),'id'=>'Deliverydt', 'class' => 'form-control' ,'required' => 'true');
|
||||
$data = array('name' => 'Deliverydt','value' => set_value('Deliverydt',$CurrentDate),'id'=>'Deliverydt', 'class' => 'form-control' ,'required' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12"><br/>
|
||||
<label>Purchase Order Date</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'PODate','value' => set_value('PODate',$CurrentDate),'id'=>'PODate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
|
||||
<legend>Payment Details</legend>
|
||||
<!-- Text input-->
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="payablefrom">Payable Terms</span>
|
||||
<select class="form-control required" id="PaymentTerms" name="PaymentTerms">
|
||||
<option value="Date of invoice" >Select Payment method</option>
|
||||
<?php
|
||||
if(!empty($payment))
|
||||
{
|
||||
foreach ($payment as $rl)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="PayableAT">Payable AT</span>
|
||||
<input type="text" class="form-control required" id="PayableAT" name="PayableAT">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3"><span>Payment Date</span><br/>
|
||||
<label class="radio-inline"><input type="radio" name="Payment" value="Before">Before</label>
|
||||
<label class="radio-inline"><input type="radio" name="Payment" value="After">After</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -443,7 +515,8 @@ function vaildateBeforeOpenModal()
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>Basic Amount </label>
|
||||
<!--<label>Basic Amount </label>-->
|
||||
<label><?php echo "Basic Value In $Value";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
//$data = array('name' => 'imTotalAmount','value' => set_value('imTotalAmount'),'id'=>'imTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
@ -979,7 +1052,7 @@ function vaildateBeforeOpenModal()
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>Basic Amount </label>
|
||||
<label><?php echo "Basic Value In $Value";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
//$data = array('name' => 'imTotalAmount','value' => set_value('imTotalAmount'),'id'=>'imTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
@ -1542,7 +1615,7 @@ function vaildateBeforeOpenModal()
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12">
|
||||
<label>Comments for Special Instructions :</label> <?php
|
||||
<label>Special Instructions :</label> <?php
|
||||
$data = array('name' => 'txtSpcialInstruction','value' => set_value('txtSpcialInstruction'),'id'=>'txtSpcialInstruction', 'class' => 'form-control','rows' => '3', 'cols' => '40' );
|
||||
echo form_textarea($data);
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user