Amendment issue
This commit is contained in:
parent
c995d1b8ba
commit
5d90214dfe
@ -5,9 +5,9 @@ require APPPATH . '/libraries/BaseController.php';
|
|||||||
/**
|
/**
|
||||||
* Class : Amendment Purchase Order controller
|
* Class : Amendment Purchase Order controller
|
||||||
* User Class to control all user related operations.
|
* User Class to control all user related operations.
|
||||||
* @author : Saravana kumar
|
* @author : Velmurugan
|
||||||
* @version : 1.1
|
* @version : 1.1
|
||||||
* @since : 19 June 2016
|
* @since : 10 Jul 2017
|
||||||
*/
|
*/
|
||||||
class amendmentpurchaseorder extends BaseController
|
class amendmentpurchaseorder extends BaseController
|
||||||
{
|
{
|
||||||
@ -32,14 +32,8 @@ class amendmentpurchaseorder extends BaseController
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$this->load->library('pagination');
|
$this->load->library('pagination');
|
||||||
|
|
||||||
// $count = $this->purchaseorder_model->purchaseorderListingCount('');
|
|
||||||
|
|
||||||
//$returns = $this->paginationCompress ( "purchaseorderListing/", $count, 10 );
|
|
||||||
|
|
||||||
//$this->purchaseorder_model->UpdateRequistionStatus(); CONFORM IT
|
|
||||||
|
|
||||||
$forwhat='amendment';
|
$forwhat='amendment';
|
||||||
$data['POData'] = $this->purchaseorder_model->purchaseorderListing($forwhat);
|
$data['POData'] = $this->purchaseorder_model->purchaseorderListing($forwhat);
|
||||||
$this->global['pageTitle'] = 'Siddharth : Amendment Purchase Order';
|
$this->global['pageTitle'] = 'Siddharth : Amendment Purchase Order';
|
||||||
@ -71,7 +65,7 @@ class amendmentpurchaseorder extends BaseController
|
|||||||
$data['RequistionDetails'] = $ReqDetails;
|
$data['RequistionDetails'] = $ReqDetails;
|
||||||
$CostCode = '';
|
$CostCode = '';
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
|
$currencycode = '';
|
||||||
$Year = $dt->format('Y');
|
$Year = $dt->format('Y');
|
||||||
|
|
||||||
foreach ($ReqDetails as $Rs):
|
foreach ($ReqDetails as $Rs):
|
||||||
@ -425,37 +419,27 @@ class amendmentpurchaseorder extends BaseController
|
|||||||
function UpdateAmendServicePurchaseOrder()
|
function UpdateAmendServicePurchaseOrder()
|
||||||
{
|
{
|
||||||
$PONO =$this->input->post('txtPONO');
|
$PONO =$this->input->post('txtPONO');
|
||||||
$NewPO='0';
|
|
||||||
//echo $PONO;
|
|
||||||
$POdt =$this->input->post('PODate');
|
$POdt =$this->input->post('PODate');
|
||||||
$PODate = $this->getDateformat($POdt);
|
$PODate = $this->getDateformat($POdt);
|
||||||
|
|
||||||
$SupplierID = $this->input->post('drpSupplier');
|
$SupplierID = $this->input->post('drpSupplier');
|
||||||
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
|
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
|
||||||
$dt = $this->input->post('Deliverydt');
|
$dt = $this->input->post('Deliverydt');
|
||||||
$DeliveryOption = $this->input->post('DateRange');
|
$DeliveryOption = $this->input->post('DateRange');
|
||||||
if($DeliveryOption==1){
|
if($DeliveryOption==1){
|
||||||
$Deliverydt = '';
|
$Deliverydt = '';
|
||||||
$DeliverySchedule = $this->input->post('Scheduleby');
|
$DeliverySchedule = $this->input->post('Scheduleby');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$Deliverydt = $this->getDateformat($dt);
|
$Deliverydt = $this->getDateformat($dt);
|
||||||
$DeliverySchedule = '';
|
$DeliverySchedule = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$PaymentDate=$this->input->post('Payment');
|
|
||||||
if($PaymentDate==1)
|
|
||||||
{
|
|
||||||
$PaymentDays='After';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$PaymentDays='Before';
|
|
||||||
}
|
|
||||||
|
|
||||||
$PaymentTerms=$this->input->post('PaymentTerms');
|
$PaymentTerms=$this->input->post('PaymentTerms');
|
||||||
$Payableat=$this->input->post('PayableAT');
|
|
||||||
|
|
||||||
$POType = $this->input->post('POType');
|
$POType = $this->input->post('POType');
|
||||||
|
|
||||||
@ -465,35 +449,31 @@ function UpdateAmendServicePurchaseOrder()
|
|||||||
|
|
||||||
$updatedBy = $this->session->userdata ( 'userId' );
|
$updatedBy = $this->session->userdata ( 'userId' );
|
||||||
$RowCount = $this->input->post('txtRowCount');
|
$RowCount = $this->input->post('txtRowCount');
|
||||||
//echo "ROw Count is" . $RowCount;
|
|
||||||
//die();
|
|
||||||
// $DeletedRow = $this->input->post('txtDeletedRow');
|
|
||||||
|
|
||||||
//$comma_separated = explode(':', $DeletedRow);
|
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
$updateddt = $dt->format('Y-m-d H:i:s');
|
$updateddt = $dt->format('Y-m-d H:i:s');
|
||||||
$WorkStatus=$this->input->post('workstatus');
|
$WorkStatus=$this->input->post('workstatus');
|
||||||
|
|
||||||
|
|
||||||
// PO Master
|
// PO Master
|
||||||
$POMaster = array('ParentPO'=>$PONO,'POType'=>$POType,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays,'ServiceWorkStatus'=>$WorkStatus );
|
$POMaster = array('ParentPO'=>$PONO,'POType'=>$POType,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt);
|
||||||
|
|
||||||
//print_r($POMaster);
|
//print_r($POMaster);
|
||||||
$LastPO = $this->purchaseorder_model->addPOMaster($POMaster);
|
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster,$updatedBy,$PONO);
|
||||||
//print_r($LastPO);
|
//print_r($LastPO);
|
||||||
foreach($LastPO as $PO):
|
$NewPO = '';
|
||||||
$NewPO=$PO['PONO'];
|
if(count($LastPO)>0)
|
||||||
endforeach;
|
{
|
||||||
//echo "NEW PO IS " . $NewPO;
|
$NewPO = $LastPO[0]['PONO'];
|
||||||
//echo "";
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$PODetail=array('Status'=>PO_AMENDED);//TO SET PARENT PO AS AMENDMENT STATUS
|
||||||
|
|
||||||
$PODetail=array('Status'=>"ST030");//TO SET PARENT PO AS AMENDMENT STATUS
|
|
||||||
//print_r($PODetail);
|
|
||||||
$APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail);
|
$APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail);
|
||||||
//echo $APO."Affected";
|
|
||||||
|
|
||||||
$LineItemStatus = REQITEM_NEW;
|
$LineItemStatus = REQITEM_NEW;
|
||||||
//echo "Before For Loop" ;
|
|
||||||
//echo $RowCount;
|
|
||||||
|
|
||||||
for ($i = 1; $i <= $RowCount; $i++)
|
for ($i = 1; $i <= $RowCount; $i++)
|
||||||
{
|
{
|
||||||
@ -513,84 +493,28 @@ function UpdateAmendServicePurchaseOrder()
|
|||||||
$POLineItemNo = $this->input->post('LineItemNo'.$i);
|
$POLineItemNo = $this->input->post('LineItemNo'.$i);
|
||||||
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
|
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
|
||||||
$ServiceFrequency=$this->input->post('Frequency'.$i);
|
$ServiceFrequency=$this->input->post('Frequency'.$i);
|
||||||
// echo $MaterialCode;
|
|
||||||
//$POLineItem = array();
|
|
||||||
$LineItemNo = '';
|
$LineItemNo = '';
|
||||||
//echo "LineItem is". $LineItemNo;
|
|
||||||
// $SkipInsert = "False";
|
|
||||||
// if( count($comma_separated) > 0)
|
|
||||||
// {
|
|
||||||
// for($j = 1; $j < count($comma_separated); $j++)
|
|
||||||
// {
|
|
||||||
// $deletedRow = $comma_separated[$j] ;
|
|
||||||
|
|
||||||
// if($deletedRow == $i )
|
|
||||||
// {
|
|
||||||
// $SkipInsert = "True";
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if($SkipInsert == "False")
|
|
||||||
// {
|
|
||||||
// if(strlen($POLineItemNo) == 0)
|
|
||||||
// {
|
|
||||||
|
|
||||||
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency);
|
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency);
|
||||||
//print_r($POLineItemList);
|
|
||||||
|
|
||||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||||
// if(count($POLineItem)>0)
|
|
||||||
// {
|
if(count($POLineItem)>0)
|
||||||
foreach($POLineItem as $line):
|
{
|
||||||
$LineItemNo = $line['LineItemNo'];
|
$LineItemNo = $POLineItem[0]['LineItemNo'];
|
||||||
endforeach;
|
}
|
||||||
//echo " Last Lineitem no is" . $LineItemNo;
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
// //}
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// $LineItemNo = $POLineItemNo;
|
|
||||||
|
|
||||||
// $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter);
|
|
||||||
// $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(trim($POType) == SERVICE )
|
|
||||||
// {
|
|
||||||
// $isExists = $this->purchaseorder_model->LineItemExists($LineItemNo);
|
|
||||||
|
|
||||||
// if(count($isExists) == 0)
|
|
||||||
// {
|
|
||||||
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt);
|
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt);
|
||||||
//echo "Service to be stored";
|
|
||||||
|
|
||||||
//print_r($ServiceTaxList);
|
|
||||||
$ServiceList =$this->purchaseorder_model->addServiceTax($ServiceTaxList);
|
$ServiceList =$this->purchaseorder_model->addServiceTax($ServiceTaxList);
|
||||||
//echo "final";
|
|
||||||
//print_r($ServiceList);
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// $ServiceTaxList1 = array('ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt);
|
|
||||||
|
|
||||||
// $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList1);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
echo 'PO Number'.$PONO . ' Amended Successfully! - New PO Number is'.$NewPO;
|
echo 'PO Number is'.$PONO . ' is Amended Successfully! - New Amended PO Number is '.$NewPO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -647,11 +571,7 @@ function UpdateAmendServicePurchaseOrder()
|
|||||||
|
|
||||||
$CreateBy = $this->session->userdata ( 'userId' );
|
$CreateBy = $this->session->userdata ( 'userId' );
|
||||||
$RowCount = $this->input->post('txtRowCount');
|
$RowCount = $this->input->post('txtRowCount');
|
||||||
//echo $RowCount;
|
|
||||||
//die();
|
|
||||||
//$DeletedRow = $this->input->post('txtDeletedRow');
|
|
||||||
|
|
||||||
//$comma_separated = explode(':', $DeletedRow);
|
|
||||||
|
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
$createddt = $dt->format('Y-m-d H:i:s');
|
$createddt = $dt->format('Y-m-d H:i:s');
|
||||||
@ -660,7 +580,7 @@ function UpdateAmendServicePurchaseOrder()
|
|||||||
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'POType'=>$POType,'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 = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'POType'=>$POType,'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);
|
||||||
//print_r($POMaster);
|
//print_r($POMaster);
|
||||||
|
|
||||||
$LastPO = $this->purchaseorder_model->addPOMaster($POMaster);
|
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster,$CreateBy,$PONO);
|
||||||
foreach($LastPO as $PO):
|
foreach($LastPO as $PO):
|
||||||
$NewPO=$PO['PONO'];
|
$NewPO=$PO['PONO'];
|
||||||
endforeach;
|
endforeach;
|
||||||
@ -680,7 +600,7 @@ function UpdateAmendServicePurchaseOrder()
|
|||||||
|
|
||||||
for ($i = 1; $i <= $RowCount; $i++)
|
for ($i = 1; $i <= $RowCount; $i++)
|
||||||
{
|
{
|
||||||
//echo "Inside Loopp";
|
|
||||||
$MaterialCode = $this->input->post('materialCode'.$i);
|
$MaterialCode = $this->input->post('materialCode'.$i);
|
||||||
$Quantity = $this->input->post('quantity'.$i);
|
$Quantity = $this->input->post('quantity'.$i);
|
||||||
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
||||||
@ -737,25 +657,8 @@ function UpdateAmendServicePurchaseOrder()
|
|||||||
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
|
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
|
||||||
$POLineItemNo = $this->input->post('LineItemNo'.$i);
|
$POLineItemNo = $this->input->post('LineItemNo'.$i);
|
||||||
|
|
||||||
// $SkipInsert = "False";
|
|
||||||
// if( count($comma_separated) > 0)
|
|
||||||
// {
|
|
||||||
// for($j = 1; $j < count($comma_separated); $j++)
|
|
||||||
// {
|
|
||||||
// $deletedRow = $comma_separated[$j] ;
|
|
||||||
|
|
||||||
// if($deletedRow == $i)
|
|
||||||
// {
|
|
||||||
// $SkipInsert = "True";
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if($SkipInsert == "False")
|
|
||||||
// {
|
|
||||||
// if(strlen($POLineItemNo) == 0)
|
|
||||||
// {
|
|
||||||
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
|
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
|
||||||
// print_r($POLineItemList);
|
// print_r($POLineItemList);
|
||||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||||
@ -783,31 +686,11 @@ function UpdateAmendServicePurchaseOrder()
|
|||||||
|
|
||||||
|
|
||||||
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
|
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
|
||||||
//echo "Import";
|
|
||||||
|
|
||||||
//print_r($ImportList);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// $LineItemNo = $POLineItemNo;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
|
|
||||||
// $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$LineItemNo,$POLineItemList);
|
|
||||||
|
|
||||||
// $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,'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);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -845,15 +728,7 @@ function UpdateAmendServicePurchaseOrder()
|
|||||||
$Deliverydt = $this->getDateformat($dt);
|
$Deliverydt = $this->getDateformat($dt);
|
||||||
$DeliverySchedule = '';
|
$DeliverySchedule = '';
|
||||||
}
|
}
|
||||||
$PaymentDate=$this->input->post('Payment');
|
|
||||||
if($PaymentDate==1)
|
|
||||||
{
|
|
||||||
$PaymentDays='After';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$PaymentDays='Before';
|
|
||||||
}
|
|
||||||
|
|
||||||
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
||||||
$TotalOrder = $this->input->post('txtTotalorderValue');
|
$TotalOrder = $this->input->post('txtTotalorderValue');
|
||||||
@ -865,33 +740,29 @@ function UpdateAmendServicePurchaseOrder()
|
|||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
$createddt = $dt->format('Y-m-d H:i:s');
|
$createddt = $dt->format('Y-m-d H:i:s');
|
||||||
$updateddt = $dt->format('Y-m-d H:i:s');
|
$updateddt = $dt->format('Y-m-d H:i:s');
|
||||||
//echo "Row Count is:";
|
|
||||||
//echo $RowCount;
|
|
||||||
|
|
||||||
//$DeletedRow = $this->input->post('txtDeletedRow');
|
|
||||||
|
|
||||||
//$comma_separated = explode(':', $DeletedRow);
|
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
$updateddt = $dt->format('Y-m-d H:i:s');
|
$updateddt = $dt->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
$PaymentTerms=$this->input->post('PaymentTerms');
|
$PaymentTerms=$this->input->post('PaymentTerms');
|
||||||
$Payableat=$this->input->post('PayableAT');
|
$Payableat=$this->input->post('PayableAT');
|
||||||
|
echo $RowCount;
|
||||||
// PO Master
|
// PO Master
|
||||||
// PO Master
|
// PO Master
|
||||||
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'POType'=>$POType,'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);
|
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'POType'=>$POType,'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,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt);
|
||||||
//echo $PONO;
|
|
||||||
//echo $TotalOrder;
|
|
||||||
//print_r($POMaster);
|
|
||||||
|
|
||||||
|
//print_r($POMaster);
|
||||||
|
|
||||||
$LastPO = $this->purchaseorder_model->addPOMaster($POMaster);
|
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster,$CreateBy,$PONO);
|
||||||
foreach($LastPO as $PO):
|
$NewPO = '';
|
||||||
$NewPO=$PO['PONO'];
|
if(count($LastPO)>0)
|
||||||
endforeach;
|
{
|
||||||
// echo "NEW PO IS " . $NewPO."</br>";
|
$NewPO = $LastPO[0]['PONO'];
|
||||||
//echo "";
|
}
|
||||||
|
|
||||||
$PODetail=array('Status'=>"ST030");//TO SET PARENT PO AS AMENDMENT STATUS
|
//echo $NewPO;
|
||||||
|
|
||||||
|
$PODetail=array('Status'=>PO_AMENDED);//TO SET PARENT PO AS AMENDMENT STATUS
|
||||||
// print_r($PODetail);
|
// print_r($PODetail);
|
||||||
$APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail);
|
$APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail);
|
||||||
// echo "Affected Rows:";
|
// echo "Affected Rows:";
|
||||||
@ -955,72 +826,30 @@ function UpdateAmendServicePurchaseOrder()
|
|||||||
$Totalvalueitem=$this->input->post('txtTotalorderValue');
|
$Totalvalueitem=$this->input->post('txtTotalorderValue');
|
||||||
$LineItemNo = '';
|
$LineItemNo = '';
|
||||||
|
|
||||||
//$currencytypeID = $this->input->post('currencytype');
|
|
||||||
// $SkipInsert = "False";
|
|
||||||
// if( count($comma_separated) > 0)
|
|
||||||
// {
|
|
||||||
// for($j = 1; $j < count($comma_separated); $j++)
|
|
||||||
// {
|
|
||||||
// $deletedRow = $comma_separated[$j] ;
|
|
||||||
|
|
||||||
// if($deletedRow == $i )
|
|
||||||
// {
|
|
||||||
// $SkipInsert = "True";
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
// // }
|
|
||||||
// if($SkipInsert == "False")
|
|
||||||
// {
|
|
||||||
// if(strlen($POLineItemNo) == 0)
|
|
||||||
// {
|
|
||||||
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
|
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
|
||||||
//print_r($POLineItemList);
|
//print_r($POLineItemList);
|
||||||
|
|
||||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||||
// // if(count($POLineItem)>0)
|
|
||||||
// // {
|
if(count($POLineItem)>0)
|
||||||
foreach($POLineItem as $line):
|
{
|
||||||
$LineItemNo = $line['LineItemNo'];
|
$LineItemNo = $POLineItem[0]['LineItemNo'];
|
||||||
endforeach;
|
}
|
||||||
// //}
|
// foreach($POLineItem as $line):
|
||||||
// echo "New Line Item is:".$LineItemNo;
|
// $LineItemNo = $line['LineItemNo'];
|
||||||
|
// endforeach;
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// $LineItemNo = $POLineItemNo;
|
|
||||||
|
|
||||||
// $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter);
|
|
||||||
// $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList);
|
|
||||||
|
|
||||||
// }
|
|
||||||
// $isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo);
|
|
||||||
// if(count($isExists) == 0)
|
|
||||||
// {
|
|
||||||
|
|
||||||
$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);
|
$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);
|
// print_r($ImportTaxList);
|
||||||
//die();
|
//die();
|
||||||
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
|
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
|
||||||
//echo "DONE ALL";
|
|
||||||
//}
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// $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);
|
|
||||||
|
|
||||||
// //print_r($ImportTaxList);
|
|
||||||
// //die();
|
|
||||||
// $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList);
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo 'Purchase Order'.$PONO.'Amended Successfully! New PO Number Is: '.$NewPO ;
|
echo 'Purchase Order is'.$PONO.'Amended Successfully! New PO Number is: '.$NewPO ; }
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function getDateformat($Val)
|
function getDateformat($Val)
|
||||||
|
|||||||
@ -370,6 +370,7 @@ class purchaseorder extends BaseController
|
|||||||
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
|
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
|
||||||
//print_r($data['PaymentTerms']);
|
//print_r($data['PaymentTerms']);
|
||||||
$unicode ='';
|
$unicode ='';
|
||||||
|
$currencycode = '';
|
||||||
foreach ($data['CurrencyDetail'] as $Detail)
|
foreach ($data['CurrencyDetail'] as $Detail)
|
||||||
{
|
{
|
||||||
$unicode=$Detail->FontCode2000;
|
$unicode=$Detail->FontCode2000;
|
||||||
@ -379,7 +380,6 @@ class purchaseorder extends BaseController
|
|||||||
$currencycode=$Detail->Currency_Code;
|
$currencycode=$Detail->Currency_Code;
|
||||||
}
|
}
|
||||||
//print_r($unicode);
|
//print_r($unicode);
|
||||||
$currencycode='';
|
|
||||||
$data['unicode']=$unicode;
|
$data['unicode']=$unicode;
|
||||||
$data['currencycode']=$currencycode;
|
$data['currencycode']=$currencycode;
|
||||||
$this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form';
|
$this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form';
|
||||||
@ -689,7 +689,7 @@ $DeliveryOption = $this->input->post('DateRange');
|
|||||||
$PONO = '';
|
$PONO = '';
|
||||||
if(count($POMaster)>0)
|
if(count($POMaster)>0)
|
||||||
{
|
{
|
||||||
$PONO = $POMaster[0]['PONO'];
|
$PONO = $POMaster[0]['PONO'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// PO Line Items
|
// PO Line Items
|
||||||
@ -1030,19 +1030,18 @@ $DeliveryOption = $this->input->post('DateRange');
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function importpoprint($PONO)
|
public function importpoprint($PONO)
|
||||||
{
|
{
|
||||||
|
|
||||||
//$this->load->view('includes/pdfheader');
|
//$this->load->view('includes/pdfheader');
|
||||||
|
|
||||||
// Load the pdf page with multiviews
|
// Load the pdf page with multiviews
|
||||||
$Requester='';
|
$Requester='';
|
||||||
$Depcode='';
|
$Depcode='';
|
||||||
$Currencycode='';
|
$Currencycode='';
|
||||||
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
||||||
$data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO);
|
$data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO);
|
||||||
|
// print_r( $data['POItem']);
|
||||||
foreach ($data['POItem'] as $Reqdby)
|
foreach ($data['POItem'] as $Reqdby)
|
||||||
{
|
{
|
||||||
$Requester=$Reqdby->Requestedby;
|
$Requester=$Reqdby->Requestedby;
|
||||||
@ -1065,6 +1064,7 @@ public function importpoprint($PONO)
|
|||||||
//print_r($data['Requestername']);
|
//print_r($data['Requestername']);
|
||||||
$data['Currencytype']=$this->purchaseorder_model->GerCurrencyCodeName($Currencycode);
|
$data['Currencytype']=$this->purchaseorder_model->GerCurrencyCodeName($Currencycode);
|
||||||
$ProductPrice='';
|
$ProductPrice='';
|
||||||
|
$TotalOrderValue = '';
|
||||||
foreach ($data['POItem'] as $PO )
|
foreach ($data['POItem'] as $PO )
|
||||||
{
|
{
|
||||||
$TotalOrderValue=$PO->TotalOrderValue;
|
$TotalOrderValue=$PO->TotalOrderValue;
|
||||||
@ -1081,46 +1081,51 @@ public function importpoprint($PONO)
|
|||||||
if(!empty($data['POItem'])){
|
if(!empty($data['POItem'])){
|
||||||
$CurrencyType=$data['POItem'][0]->CurrencyType;
|
$CurrencyType=$data['POItem'][0]->CurrencyType;
|
||||||
}
|
}
|
||||||
else{
|
//echo $CurrencyType;
|
||||||
}
|
|
||||||
|
|
||||||
if($CurrencyType==''){
|
if($CurrencyType=='')
|
||||||
|
{
|
||||||
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
|
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
|
||||||
|
}
|
||||||
|
else
|
||||||
$TotalOrderValue=$data['POItem'][0]->$TotalOrderValue;
|
{
|
||||||
|
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType);
|
||||||
|
}
|
||||||
|
|
||||||
|
// $TotalOrderValue=$data['POItem'][0]->$TotalOrderValue;
|
||||||
//print_r($data['POItem'][0]);
|
//print_r($data['POItem'][0]);
|
||||||
|
|
||||||
$totalAmt=sprintf("%.2f", $TotalOrderValue);
|
$totalAmt=sprintf("%.2f", $TotalOrderValue);
|
||||||
|
|
||||||
$data['TotalAmountInWords']= $this->convertNumber($totalAmt);
|
$data['TotalAmountInWords']= $this->convertNumber($totalAmt);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
else{
|
|
||||||
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType);
|
|
||||||
//print_r($data['CurrencySymbol']);
|
|
||||||
$SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000;
|
|
||||||
$SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency;
|
|
||||||
$PaiseVal=$data['CurrencySymbol'][0]->PaiseVal;
|
|
||||||
|
|
||||||
$TotalOrderValue=$data['POItem'][0]->TotalOrderValue;
|
$SymbolCurrency = '';
|
||||||
|
$SymbolCurrencyName ='';
|
||||||
|
$PaiseVal = '';
|
||||||
|
if(!empty($data['CurrencySymbol']) >0)
|
||||||
|
{
|
||||||
|
$SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000;
|
||||||
|
$SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency;
|
||||||
|
$PaiseVal=$data['CurrencySymbol'][0]->PaiseVal;
|
||||||
|
}
|
||||||
|
$TotalOrderValue=$data['POItem'][0]->TotalOrderValue;
|
||||||
|
|
||||||
$totalAmt=sprintf("%.2f", $TotalOrderValue);
|
$totalAmt=sprintf("%.2f", $TotalOrderValue);
|
||||||
|
|
||||||
$data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal);
|
$data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal);
|
||||||
}
|
|
||||||
|
|
||||||
|
$this->load->View("importpopdf", $data);
|
||||||
$this->load->View("importpopdf", $data);
|
|
||||||
|
|
||||||
|
|
||||||
// Add header to pdf
|
// Add header to pdf
|
||||||
//$this->load->view('includes/pdffooter');
|
$this->load->view('includes/pdffooter');
|
||||||
|
|
||||||
// Get output html
|
// Get output html
|
||||||
$php = $this->output->get_output();
|
$php = $this->output->get_output();
|
||||||
|
|
||||||
// Load library
|
// Load library
|
||||||
$this->load->library('dompdf_gen');
|
$this->load->library('dompdf_gen');
|
||||||
@ -1130,7 +1135,7 @@ public function importpoprint($PONO)
|
|||||||
$this->dompdf->load_html($php);
|
$this->dompdf->load_html($php);
|
||||||
$this->dompdf->render();
|
$this->dompdf->render();
|
||||||
$data['Attachment'] = FALSE;
|
$data['Attachment'] = FALSE;
|
||||||
//$this->dompdf->stream("ImportPOReport.pdf",$data,$php);
|
$this->dompdf->stream("ImportPOReport.pdf",$data,$php);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1182,7 +1187,7 @@ public function importpoprint($PONO)
|
|||||||
|
|
||||||
function addNewImportPurchaseOrder()
|
function addNewImportPurchaseOrder()
|
||||||
{//echo ("ggh");
|
{//echo ("ggh");
|
||||||
//die();
|
|
||||||
$POdt =$this->input->post('PODate');
|
$POdt =$this->input->post('PODate');
|
||||||
$PODate = $this->getDateformat($POdt);
|
$PODate = $this->getDateformat($POdt);
|
||||||
$SupplierID = $this->input->post('drpSupplier');
|
$SupplierID = $this->input->post('drpSupplier');
|
||||||
@ -1202,15 +1207,15 @@ function addNewImportPurchaseOrder()
|
|||||||
$DeliverySchedule = '';
|
$DeliverySchedule = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// $PaymentDate=$this->input->post('Payment');
|
$PaymentDate=$this->input->post('Payment');
|
||||||
// if($PaymentDate==1)
|
if($PaymentDate==1)
|
||||||
// {
|
{
|
||||||
// $PaymentDays='After';
|
$PaymentDays='After';
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// $PaymentDays='Before';
|
$PaymentDays='Before';
|
||||||
// }
|
}
|
||||||
|
|
||||||
//echo $PaymentDays;
|
//echo $PaymentDays;
|
||||||
//die();
|
//die();
|
||||||
@ -1233,12 +1238,13 @@ function addNewImportPurchaseOrder()
|
|||||||
$Exchangerate=$this->input->post('ExchangeRate');
|
$Exchangerate=$this->input->post('ExchangeRate');
|
||||||
$ExchangeRateCalculatedon=$this->input->post('Exchangerateon');
|
$ExchangeRateCalculatedon=$this->input->post('Exchangerateon');
|
||||||
$CurrencyType=$this->input->post('currencytype');
|
$CurrencyType=$this->input->post('currencytype');
|
||||||
|
|
||||||
$PaymentTerms=$this->input->post('PaymentTerms');
|
$PaymentTerms=$this->input->post('PaymentTerms');
|
||||||
//$Payableat=$this->input->post('PayableAT');
|
$Payableat=$this->input->post('PayableAT');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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,'POType'=>$POType);
|
$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);
|
//print_r($POList);
|
||||||
//die();
|
//die();
|
||||||
@ -1414,7 +1420,7 @@ $createddt='';
|
|||||||
$Payableat=$this->input->post('PayableAT');
|
$Payableat=$this->input->post('PayableAT');
|
||||||
// PO Master
|
// PO Master
|
||||||
// PO Master
|
// PO Master
|
||||||
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms);
|
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays);
|
||||||
//echo $PONO;
|
//echo $PONO;
|
||||||
//echo $TotalOrder;
|
//echo $TotalOrder;
|
||||||
//print_r($POList);
|
//print_r($POList);
|
||||||
@ -2066,8 +2072,7 @@ $createddt='';
|
|||||||
if(!empty($data['POItem'])){
|
if(!empty($data['POItem'])){
|
||||||
$CurrencyType=$data['POItem'][0]->CurrencyType;
|
$CurrencyType=$data['POItem'][0]->CurrencyType;
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
}
|
|
||||||
|
|
||||||
if($CurrencyType=='' OR $CurrencyType=='0'){
|
if($CurrencyType=='' OR $CurrencyType=='0'){
|
||||||
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
|
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user