code merged upload option in spl po
This commit is contained in:
parent
34cbd1536c
commit
291b612779
@ -42,24 +42,18 @@ class emergencypurchaseorder extends BaseController
|
|||||||
$data['DeptList'] = $this->purchaseorder_model->getDepartmentListForAllReq();
|
$data['DeptList'] = $this->purchaseorder_model->getDepartmentListForAllReq();
|
||||||
$data['stList'] = $this->purchaseorder_model->getStatusListforAllReq();
|
$data['stList'] = $this->purchaseorder_model->getStatusListforAllReq();
|
||||||
$data['ReqList'] = $this->purchaseorder_model->getRequistionListbySearch();
|
$data['ReqList'] = $this->purchaseorder_model->getRequistionListbySearch();
|
||||||
$this->global['pageTitle'] = $this->CompanyName.' : Create Purchase Order from Requistion';
|
$this->global['pageTitle'] = $this->CompanyName.' : Create PO from Requisition List';
|
||||||
$this->loadViews("createPOfromRequistion", $this->global, $data,Null);
|
$this->loadViews("createPOfromRequistion", $this->global, $data,Null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* To create new emergency po
|
|
||||||
*/
|
|
||||||
function CreateEmergencyPO()
|
function CreateEmergencyPO()
|
||||||
{
|
{
|
||||||
$RequestedBy = $this->session->userdata ('EmpID');
|
$RequestedBy = $this->session->userdata ('EmpID');
|
||||||
|
$this->global['pageTitle'] = $this->CompanyName.' : Create Emergency Purchase Order';
|
||||||
//$this->global['pageTitle'] = 'Resico : Create Emergency Purchase Order';
|
|
||||||
$this->global['pageTitle'] = $this->CompanyName.' : Emergency Purchase Order';
|
|
||||||
|
|
||||||
$data['RequestType'] = $this->requistion_model->getConfigValue('C004');
|
$data['RequestType'] = $this->requistion_model->getConfigValue('C004');
|
||||||
$data['Suplist'] = $this->purchaseorder_model->getSupplierName();
|
$data['Suplist'] = $this->purchaseorder_model->getSupplierName();
|
||||||
$data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR');
|
$data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR');
|
||||||
$data['DeptList'] = $this->purchaseorder_model->getDepartmentAllList();
|
$data['DeptList'] = $this->purchaseorder_model->getDepartmentAllList();
|
||||||
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
||||||
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
|
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
|
||||||
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
|
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
|
||||||
@ -69,24 +63,23 @@ class emergencypurchaseorder extends BaseController
|
|||||||
$data['ServiceOption'] = $this->requistion_model->getConfigValue('C022');
|
$data['ServiceOption'] = $this->requistion_model->getConfigValue('C022');
|
||||||
$data['PoTypeOptions'] = $this->purchaseorder_model->getConfigValue('C026');
|
$data['PoTypeOptions'] = $this->purchaseorder_model->getConfigValue('C026');
|
||||||
|
|
||||||
|
|
||||||
$this->loadViews("alterpurchaseorder", $this->global, $data, Null);
|
$this->loadViews("alterpurchaseorder", $this->global, $data, Null);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For get all material code using request type
|
* To used for get all material code using request type
|
||||||
*/
|
*/
|
||||||
function getMaterialCode(){
|
function getMaterialCode(){
|
||||||
$reqType = $this->input->post('input');
|
$reqType = $this->input->post('input');
|
||||||
$materialList = $this->requistion_model->GetMaterialCode($reqType);
|
$materialList = $this->requistion_model->GetMaterialCode($reqType);
|
||||||
echo json_encode($materialList);
|
echo json_encode($materialList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*This function is used for get cost center list using department code*/
|
||||||
* For get cost center list using department code
|
|
||||||
*/
|
|
||||||
function getCostCenterName(){
|
function getCostCenterName(){
|
||||||
$CostList='';
|
$CostList='';
|
||||||
$DeptCode = $this->input->post('id');
|
$DeptCode = $this->input->post('id');
|
||||||
@ -95,10 +88,7 @@ class emergencypurchaseorder extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function addfile($pathname)
|
||||||
* To add file for inward po
|
|
||||||
*/
|
|
||||||
function addfile($pathname)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
$picture = '';
|
$picture = '';
|
||||||
@ -113,7 +103,6 @@ class emergencypurchaseorder extends BaseController
|
|||||||
$this->upload->initialize($config);
|
$this->upload->initialize($config);
|
||||||
if($this->upload->do_upload($pathname))
|
if($this->upload->do_upload($pathname))
|
||||||
{
|
{
|
||||||
// echo "uploadif";
|
|
||||||
$uploadData = $this->upload->data();
|
$uploadData = $this->upload->data();
|
||||||
$picture = $uploadData['file_name'];
|
$picture = $uploadData['file_name'];
|
||||||
}
|
}
|
||||||
@ -132,41 +121,6 @@ class emergencypurchaseorder extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------special po file upload service----------------------------------*/
|
|
||||||
function add($pathname)
|
|
||||||
{
|
|
||||||
$picture = '';
|
|
||||||
if(!empty($_FILES[$pathname]['name']))
|
|
||||||
{
|
|
||||||
|
|
||||||
$config['upload_path'] = 'uploads/BillFiles/';
|
|
||||||
$config['allowed_types'] = '*';
|
|
||||||
$config['file_name'] = str_replace(" ","",$_FILES[$pathname]['name']);
|
|
||||||
|
|
||||||
$this->load->library('upload',$config);
|
|
||||||
$this->upload->initialize($config);
|
|
||||||
if($this->upload->do_upload($pathname))
|
|
||||||
{
|
|
||||||
$uploadData = $this->upload->data();
|
|
||||||
$picture = $uploadData['file_name'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$error = array('error' => $this->upload->display_errors());
|
|
||||||
$picture = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$picture = '';
|
|
||||||
}
|
|
||||||
return $picture ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* To Create Service Purchase Order
|
|
||||||
*/
|
|
||||||
function addNewServicePurchaseOrder()
|
function addNewServicePurchaseOrder()
|
||||||
{
|
{
|
||||||
$txtRowCount=$this->input->post('txtRowCount');
|
$txtRowCount=$this->input->post('txtRowCount');
|
||||||
@ -179,9 +133,9 @@ class emergencypurchaseorder extends BaseController
|
|||||||
$DeliverySchedule='';
|
$DeliverySchedule='';
|
||||||
$Deliverydt = $this->getDateformat($POdt);
|
$Deliverydt = $this->getDateformat($POdt);
|
||||||
|
|
||||||
$txtsplservice=$this->input->post('txtSpecialservice');
|
$txtsplservice=$this->input->post('txtSpecialservice');
|
||||||
|
|
||||||
if($txtsplservice=='1')
|
if($txtsplservice=='1')
|
||||||
{
|
{
|
||||||
$POStatus=SPECIAL_PO;
|
$POStatus=SPECIAL_PO;
|
||||||
}
|
}
|
||||||
@ -190,7 +144,7 @@ class emergencypurchaseorder extends BaseController
|
|||||||
$POStatus=REQITEM_Emergency_PO_CREATED;
|
$POStatus=REQITEM_Emergency_PO_CREATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
$POType = $this->input->post('POType');
|
$POType = $this->input->post('POType');
|
||||||
$SpcialInstruction = $this->input->post('ScopeOfWork');
|
$SpcialInstruction = $this->input->post('ScopeOfWork');
|
||||||
$RequistionComments = "Created Emergency Service PO";
|
$RequistionComments = "Created Emergency Service PO";
|
||||||
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummaryService');
|
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummaryService');
|
||||||
@ -209,10 +163,10 @@ class emergencypurchaseorder extends BaseController
|
|||||||
{
|
{
|
||||||
$ServiceWorkStatus=SERVICE_COMPLETED;
|
$ServiceWorkStatus=SERVICE_COMPLETED;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ServiceWorkStatus=$this->input->post('txtworkstatus');
|
$ServiceWorkStatus=$this->input->post('txtworkstatus');
|
||||||
}
|
}
|
||||||
$ServiceScheduleType = $this->input->post('ScheduleType');
|
$ServiceScheduleType = $this->input->post('ScheduleType');
|
||||||
$ServiceScheduleOptions = $this->input->post('ScheduleType');
|
$ServiceScheduleOptions = $this->input->post('ScheduleType');
|
||||||
$ServiceServiceNo = 1;
|
$ServiceServiceNo = 1;
|
||||||
@ -229,10 +183,10 @@ class emergencypurchaseorder extends BaseController
|
|||||||
//create T_Requestion_Master
|
//create T_Requestion_Master
|
||||||
$Request = array('ReqType'=>$POType, 'RequestedDept'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$RequistionComments,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy,'Schedule_Type'=>$ServiceScheduleType,'NumberOfService'=>$ServiceServiceNo,'Service_Period'=>$ServiceScheduleOptions);
|
$Request = array('ReqType'=>$POType, 'RequestedDept'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$RequistionComments,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy,'Schedule_Type'=>$ServiceScheduleType,'NumberOfService'=>$ServiceServiceNo,'Service_Period'=>$ServiceScheduleOptions);
|
||||||
|
|
||||||
$Req = $this->requistion_model->addRequistion($Request);
|
$Req = $this->requistion_model->addRequistion($Request);
|
||||||
|
|
||||||
$RegNo='';
|
$RegNo='';
|
||||||
if(count($Req)>0)
|
if(count($Req)>0)
|
||||||
{
|
{
|
||||||
$RegNo = $Req[0]['ReqNo'];
|
$RegNo = $Req[0]['ReqNo'];
|
||||||
}
|
}
|
||||||
@ -258,13 +212,13 @@ class emergencypurchaseorder extends BaseController
|
|||||||
$Quantity = $this->input->post('quantity'.$i);
|
$Quantity = $this->input->post('quantity'.$i);
|
||||||
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
||||||
$itemRate = $this->input->post('itemRate'.$i);
|
$itemRate = $this->input->post('itemRate'.$i);
|
||||||
$Cgst = $this->input->post('Cgst'.$i);
|
$Cgst = $this->input->post('Cgst'.$i);
|
||||||
$Sgst = $this->input->post('Sgst'.$i);
|
$Sgst = $this->input->post('Sgst'.$i);
|
||||||
$Igst = $this->input->post('Igst'.$i);
|
$Igst = $this->input->post('Igst'.$i);
|
||||||
$AfterCgst = $this->input->post('AfterCgst'.$i);
|
$AfterCgst = $this->input->post('AfterCgst'.$i);
|
||||||
$AfterSgst = $this->input->post('AfterSgst'.$i);
|
$AfterSgst = $this->input->post('AfterSgst'.$i);
|
||||||
$AfterIgst = $this->input->post('AfterIgst'.$i);
|
$AfterIgst = $this->input->post('AfterIgst'.$i);
|
||||||
$OtherAmt = $this->input->post('OtherAmt'.$i);
|
$OtherAmt = $this->input->post('OtherAmt'.$i);
|
||||||
$CostCenter = $this->input->post('costCode'.$i);
|
$CostCenter = $this->input->post('costCode'.$i);
|
||||||
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
|
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
|
||||||
$ServiceFrequency=$this->input->post('Frequency'.$i).' - '.$this->input->post('FrequencyValue'.$i);
|
$ServiceFrequency=$this->input->post('Frequency'.$i).' - '.$this->input->post('FrequencyValue'.$i);
|
||||||
@ -288,8 +242,8 @@ class emergencypurchaseorder extends BaseController
|
|||||||
|
|
||||||
//add requistion details
|
//add requistion details
|
||||||
$ReqDetails = array('ReqNo'=>$RegNo, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Status'=>$RegDetailsStatus,'UpdatedBy'=>$CreateBy,'UpdatedOn'=>$createddt);
|
$ReqDetails = array('ReqNo'=>$RegNo, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Status'=>$RegDetailsStatus,'UpdatedBy'=>$CreateBy,'UpdatedOn'=>$createddt);
|
||||||
$ReqDetQuery = $this->requistion_model->addRequistionDetails($ReqDetails,$RegNo);
|
$ReqDetQuery = $this->requistion_model->addRequistionDetails($ReqDetails,$RegNo);
|
||||||
$ItemNo = '';
|
$ItemNo = '';
|
||||||
if(count($ReqDetQuery)>0)
|
if(count($ReqDetQuery)>0)
|
||||||
{
|
{
|
||||||
$ItemNo = $ReqDetQuery[0]['ItemNo'];
|
$ItemNo = $ReqDetQuery[0]['ItemNo'];
|
||||||
@ -311,16 +265,16 @@ class emergencypurchaseorder extends BaseController
|
|||||||
}
|
}
|
||||||
if($POStatus==SPECIAL_PO){
|
if($POStatus==SPECIAL_PO){
|
||||||
$count = $this->input->post('hidecounters');
|
$count = $this->input->post('hidecounters');
|
||||||
$constant = $this->input->post('hideconstants');
|
$constant = $this->input->post('hideconstants');
|
||||||
$arr = [];
|
$arr = [];
|
||||||
$prefile =array();
|
$prefile =array();
|
||||||
|
|
||||||
for($i=1;$i<=$constant;$i++)
|
for($i=1;$i<=$constant;$i++)
|
||||||
{
|
{
|
||||||
$pathname = 'browseFiles'.$i;
|
$pathname = 'browseFiles'.$i;
|
||||||
|
|
||||||
if(!empty($_FILES[$pathname]['name']))
|
if(!empty($_FILES[$pathname]['name']))
|
||||||
{
|
{
|
||||||
|
|
||||||
$files = str_replace(" ","",$_FILES[$pathname]['name']);
|
$files = str_replace(" ","",$_FILES[$pathname]['name']);
|
||||||
|
|
||||||
@ -328,18 +282,16 @@ class emergencypurchaseorder extends BaseController
|
|||||||
|
|
||||||
foreach ($prefile as $value)
|
foreach ($prefile as $value)
|
||||||
{
|
{
|
||||||
if($value == $files)
|
if($value == $files)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$fcount++;
|
$fcount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($fcount == 0)
|
if($fcount == 0)
|
||||||
{
|
{
|
||||||
$Picture = $this->add($pathname);
|
$Picture = $this->addfile($pathname);
|
||||||
$arr[] = array($Picture);
|
$arr[] = array($Picture);
|
||||||
}
|
}
|
||||||
|
|
||||||
$prefile[] = $files;
|
$prefile[] = $files;
|
||||||
|
|
||||||
@ -357,108 +309,103 @@ class emergencypurchaseorder extends BaseController
|
|||||||
$filename = $value;
|
$filename = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!empty($filename))
|
if(!empty($filename))
|
||||||
{
|
{
|
||||||
$myfile = array('FilePath'=>$filename,'PONO'=>$PONO);
|
$myfile = array('FilePath'=>$filename,'PONO'=>$PONO);
|
||||||
$this->purchaseorder_model->fileupload($myfile);
|
$this->purchaseorder_model->fileupload($myfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($POStatus == REQ_DRAFT)
|
if($POStatus == REQ_DRAFT)
|
||||||
{
|
{
|
||||||
echo "<script>alert('You Have Successfully Saved the Purchase order! $PONO');</script>";
|
echo "<script>alert('You Have Successfully Saved the Purchase order! $PONO');</script>";
|
||||||
redirect('purchaseorder/PurchaseOrderList','refresh');
|
redirect('purchaseorder/PurchaseOrderList','refresh');
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "<script>alert('You Have Successfully created the Purchase order! $PONO');</script>";
|
echo "<script>alert('You Have Successfully created the Purchase order! $PONO');</script>";
|
||||||
redirect('purchaseorder/PurchaseOrderList','refresh');
|
redirect('purchaseorder/PurchaseOrderList','refresh');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* To Create Revenue Emergency Purchase Order
|
|
||||||
**/
|
|
||||||
function addNewRevenuePurchaseOrder()
|
function addNewRevenuePurchaseOrder()
|
||||||
{
|
{
|
||||||
$txtspl=$this->input->post('txtSpecial');
|
$txtspl=$this->input->post('txtSpecial');
|
||||||
$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('DeliveryAddr');
|
$DeliveryAddr = $this->input->post('DeliveryAddr');
|
||||||
$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{
|
|
||||||
$Deliverydt = $this->getDateformat($dt);
|
|
||||||
$DeliverySchedule = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$Modeofshipment=$this->input->post('emergmodeofshipment');
|
|
||||||
$supplierreference=$this->input->post('emergsupplierreference');
|
|
||||||
$supplieroffno=$this->input->post('emergsupplierofferno');
|
|
||||||
$otherreference=$this->input->post('emergotherreference');
|
|
||||||
$fincap=$this->input->post('emergfincap');
|
|
||||||
$revenuetype=$this->input->post('PoTypeOptions');
|
|
||||||
$insurancestatus=$this->input->post('insuranceStatus');
|
|
||||||
|
|
||||||
if($insurancestatus == 1){
|
|
||||||
$insuranceno=$this->input->post('insuranceNo');
|
|
||||||
}else{
|
|
||||||
$insuranceno="";
|
|
||||||
}
|
|
||||||
$CostCenterName = $this->input->post('CostCenterName');
|
|
||||||
$POType = $this->input->post('POType');
|
|
||||||
$PoRange = $this->input->post('txtPoRange');
|
|
||||||
|
|
||||||
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
|
||||||
$RequistionComments = "Created Emergency Revenue PO";
|
|
||||||
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary');
|
|
||||||
|
|
||||||
if($txtspl==0)
|
|
||||||
{
|
|
||||||
$POStatus=REQITEM_Emergency_PO_CREATED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$POStatus=SPECIAL_PO;
|
|
||||||
}
|
|
||||||
|
|
||||||
$RequestedBy = $this->input->post('drpDepartment');
|
|
||||||
$CreateBy = $this->session->userdata ( 'userId' );
|
|
||||||
$RowCount=$this->input->post('txtRowCount1');
|
|
||||||
$BudgetType = $this->input->post('Budget');
|
|
||||||
$DeletedRow = $this->input->post('txtDeletedRow1');
|
|
||||||
$splRow = $this->input->post('splrow');
|
|
||||||
$ReqStatus = REQITEM_Emergency_PO_CREATED;
|
|
||||||
$Local_Interstate=$this->input->post('Range');
|
|
||||||
|
|
||||||
$comma_separated = explode(':', $DeletedRow);
|
|
||||||
|
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
|
||||||
$createddt = $dt->format('Y-m-d H:i:s');
|
|
||||||
$PaymentTerms=$this->input->post('PaymentMethod');
|
|
||||||
$OtherPayment=$this->input->post('Otherpayment');
|
|
||||||
|
|
||||||
if($POStatus==SPECIAL_PO)
|
|
||||||
{
|
|
||||||
$Qualitycheck=$this->input->post('txtQuality');
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
$Qualitycheck=1;
|
|
||||||
}
|
}
|
||||||
//add requistion
|
else{
|
||||||
|
$Deliverydt = $this->getDateformat($dt);
|
||||||
|
$DeliverySchedule = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$Modeofshipment=$this->input->post('emergmodeofshipment');
|
||||||
|
$supplierreference=$this->input->post('emergsupplierreference');
|
||||||
|
$supplieroffno=$this->input->post('emergsupplierofferno');
|
||||||
|
$otherreference=$this->input->post('emergotherreference');
|
||||||
|
$fincap=$this->input->post('emergfincap');
|
||||||
|
$revenuetype=$this->input->post('PoTypeOptions');
|
||||||
|
$insurancestatus=$this->input->post('insuranceStatus');
|
||||||
|
if($insurancestatus == 1){
|
||||||
|
$insuranceno=$this->input->post('insuranceNo');
|
||||||
|
}else{
|
||||||
|
$insuranceno="";
|
||||||
|
}
|
||||||
|
$CostCenterName = $this->input->post('CostCenterName');
|
||||||
|
$POType = $this->input->post('POType');
|
||||||
|
$PoRange = $this->input->post('txtPoRange');
|
||||||
|
|
||||||
|
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
||||||
|
$RequistionComments = "Created Emergency Revenue PO";
|
||||||
|
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary');
|
||||||
|
|
||||||
|
if($txtspl==0)
|
||||||
|
{
|
||||||
|
$POStatus=REQITEM_Emergency_PO_CREATED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$POStatus=SPECIAL_PO;
|
||||||
|
}
|
||||||
|
|
||||||
|
$RequestedBy = $this->input->post('drpDepartment');
|
||||||
|
$CreateBy = $this->session->userdata ( 'userId' );
|
||||||
|
$RowCount=$this->input->post('txtRowCount1');
|
||||||
|
$BudgetType = $this->input->post('Budget');
|
||||||
|
$DeletedRow = $this->input->post('txtDeletedRow1');
|
||||||
|
$splRow = $this->input->post('splrow');
|
||||||
|
$ReqStatus = REQITEM_Emergency_PO_CREATED;
|
||||||
|
$Local_Interstate=$this->input->post('Range');
|
||||||
|
|
||||||
|
$comma_separated = explode(':', $DeletedRow);
|
||||||
|
|
||||||
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
|
$createddt = $dt->format('Y-m-d H:i:s');
|
||||||
|
$PaymentTerms=$this->input->post('PaymentMethod');
|
||||||
|
$OtherPayment=$this->input->post('Otherpayment');
|
||||||
|
|
||||||
|
if($POStatus==SPECIAL_PO)
|
||||||
|
{
|
||||||
|
$Qualitycheck=$this->input->post('txtQuality');
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
$Qualitycheck=1;
|
||||||
|
}
|
||||||
$Request = array('ReqType'=>$POType, 'RequestedDept'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$RequistionComments,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy);
|
$Request = array('ReqType'=>$POType, 'RequestedDept'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$RequistionComments,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy);
|
||||||
|
|
||||||
$Req = $this->requistion_model->addRequistion($Request);
|
$Req = $this->requistion_model->addRequistion($Request);
|
||||||
|
|
||||||
$RegNo='';
|
$RegNo='';
|
||||||
if(count($Req)>0)
|
if(count($Req)>0)
|
||||||
{
|
{
|
||||||
$RegNo = $Req[0]['ReqNo'];
|
$RegNo = $Req[0]['ReqNo'];
|
||||||
}
|
}
|
||||||
@ -517,80 +464,80 @@ class emergencypurchaseorder extends BaseController
|
|||||||
{
|
{
|
||||||
$SkipInsert = "True";
|
$SkipInsert = "True";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($SkipInsert == "False")
|
if($SkipInsert == "False")
|
||||||
{
|
{
|
||||||
//add requistion details
|
//add requistion details
|
||||||
$ReqDetails = array('ReqNo'=>$RegNo, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Status'=>$RegDetailsStatus,'UpdatedBy'=>$CreateBy,'UpdatedOn'=>$createddt);
|
$ReqDetails = array('ReqNo'=>$RegNo, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Status'=>$RegDetailsStatus,'UpdatedBy'=>$CreateBy,'UpdatedOn'=>$createddt);
|
||||||
|
|
||||||
$ReqDetQuery = $this->requistion_model->addRequistionDetails($ReqDetails);
|
$ReqDetQuery = $this->requistion_model->addRequistionDetails($ReqDetails);
|
||||||
|
|
||||||
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'Per'=>$per,'ServiceMaterialDescription'=>$revenuedescription);
|
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'Per'=>$per,'ServiceMaterialDescription'=>$revenuedescription);
|
||||||
//print_r($POLineItemList);
|
//print_r($POLineItemList);
|
||||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||||
|
|
||||||
$LineItemNo = '';
|
$LineItemNo = '';
|
||||||
if(count($POLineItem)>0)
|
if(count($POLineItem)>0)
|
||||||
{
|
{
|
||||||
$LineItemNo = $POLineItem[0]['LineItemNo'];
|
$LineItemNo = $POLineItem[0]['LineItemNo'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(trim($POType) == REVENUE )
|
if(trim($POType) == REVENUE )
|
||||||
{
|
{
|
||||||
// echo 'Success';
|
// echo 'Success';
|
||||||
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt, 'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip);
|
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt, 'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip);
|
||||||
//print_r($RevenueTaxList);
|
//print_r($RevenueTaxList);
|
||||||
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
|
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
|
||||||
//echo 'Revenue tax Success';
|
//echo 'Revenue tax Success';
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($txtspl==1 || $txtspl==2)
|
|
||||||
{
|
|
||||||
|
|
||||||
$PONOigr = $PONO;
|
|
||||||
$DeliveryChellanInvoiceNo=$this->input->post('ChallanInvNo');
|
|
||||||
|
|
||||||
$DeliveryChellan = $this->input->post('ChallanInvDate');
|
|
||||||
$DeliveryChellanDate = $this->getDateformat($DeliveryChellan);
|
|
||||||
|
|
||||||
$MaterialReceive = $this->input->post('MRC');
|
|
||||||
$MaterialReceivedate = $this->getDateformat($MaterialReceive);
|
|
||||||
|
|
||||||
$Vehicle = $this->input->post('VehicleNo');
|
|
||||||
$Courier = $this->input->post('CourierNo');
|
|
||||||
|
|
||||||
|
|
||||||
$CreatedBy = $this->session->userdata('userId');
|
|
||||||
|
|
||||||
$Remarksmrir='Emergency PO without Quality Check';
|
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
|
||||||
$createddt = $dt->format('Y-m-d H:i:s');
|
|
||||||
|
|
||||||
$IGRStatus = IGR_CREATED;
|
|
||||||
$igr = array();
|
|
||||||
|
|
||||||
$igr = array('PONO'=>$PONO,'VehicleNo'=>$Vehicle,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'MaterialRcvdDate'=>$DeliveryChellanDate,'CourierNo'=>$Courier,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt,'MaterialRcvdDate'=>$MaterialReceivedate);
|
|
||||||
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
|
||||||
$IGRNO = '';
|
|
||||||
if(count($igrM)>0)
|
|
||||||
{
|
|
||||||
foreach ($igrM as $key )
|
|
||||||
{
|
|
||||||
$IGRNO=$key->IGRNO;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($Qualitycheck==0)
|
}
|
||||||
{
|
if($txtspl==1 || $txtspl==2)
|
||||||
$mrirmastervalues = array('MRIRStatus'=>MRIR_APPROVED,'IGRNO'=>$IGRNO,'PONO'=>$PONO,'CreatedBy'=>$CreatedBy,'Createdon'=>$createddt,'Remarks'=>$Remarksmrir);
|
{
|
||||||
$mrirmaster = $this->mrir_model->master_mrir($mrirmastervalues);
|
|
||||||
|
$PONOigr = $PONO;
|
||||||
|
$DeliveryChellanInvoiceNo=$this->input->post('ChallanInvNo');
|
||||||
|
|
||||||
|
$DeliveryChellan = $this->input->post('ChallanInvDate');
|
||||||
|
$DeliveryChellanDate = $this->getDateformat($DeliveryChellan);
|
||||||
|
|
||||||
|
$MaterialReceive = $this->input->post('MRC');
|
||||||
|
$MaterialReceivedate = $this->getDateformat($MaterialReceive);
|
||||||
|
|
||||||
|
$Vehicle = $this->input->post('VehicleNo');
|
||||||
|
$Courier = $this->input->post('CourierNo');
|
||||||
|
|
||||||
|
|
||||||
|
$CreatedBy = $this->session->userdata('userId');
|
||||||
|
|
||||||
|
$Remarksmrir='Emergency PO without Quality Check';
|
||||||
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
|
$createddt = $dt->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
$IGRStatus = IGR_CREATED;
|
||||||
|
$igr = array();
|
||||||
|
|
||||||
|
$igr = array('PONO'=>$PONO,'VehicleNo'=>$Vehicle,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'MaterialRcvdDate'=>$DeliveryChellanDate,'CourierNo'=>$Courier,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt,'MaterialRcvdDate'=>$MaterialReceivedate);
|
||||||
|
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
||||||
|
$IGRNO = '';
|
||||||
|
if(count($igrM)>0)
|
||||||
|
{
|
||||||
|
foreach ($igrM as $key )
|
||||||
|
{
|
||||||
|
$IGRNO=$key->IGRNO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($Qualitycheck==0)
|
||||||
|
{
|
||||||
|
$mrirmastervalues = array('MRIRStatus'=>MRIR_APPROVED,'IGRNO'=>$IGRNO,'PONO'=>$PONO,'CreatedBy'=>$CreatedBy,'Createdon'=>$createddt,'Remarks'=>$Remarksmrir);
|
||||||
|
$mrirmaster = $this->mrir_model->master_mrir($mrirmastervalues);
|
||||||
$MRIRNO = '';
|
$MRIRNO = '';
|
||||||
if(count($mrirmaster)>0)
|
if(count($mrirmaster)>0)
|
||||||
{
|
{
|
||||||
foreach ($mrirmaster as $key ) {
|
foreach ($mrirmaster as $key ) {
|
||||||
|
|
||||||
$MRIRNO=$key->MRIRNo; }
|
$MRIRNO=$key->MRIRNo; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -602,11 +549,11 @@ class emergencypurchaseorder extends BaseController
|
|||||||
|
|
||||||
$Remarked = "Special PO Without Quality Check";
|
$Remarked = "Special PO Without Quality Check";
|
||||||
|
|
||||||
$MRIRStatus=MRIR_APPROVED;
|
$MRIRStatus=MRIR_APPROVED;
|
||||||
//this array to store the value in child table..
|
//this array to store the value in child table..
|
||||||
$mrirdetailvalues = array('MRIRNO'=>$MRIRNO,'MaterialCode'=>$MaterialCode,'ActualQuantityReceived'=>$Quantity,'Remarks'=>$Remarked,'MRIRStatus'=>$MRIRStatus);
|
$mrirdetailvalues = array('MRIRNO'=>$MRIRNO,'MaterialCode'=>$MaterialCode,'ActualQuantityReceived'=>$Quantity,'Remarks'=>$Remarked,'MRIRStatus'=>$MRIRStatus);
|
||||||
|
|
||||||
$mrirdetails = $this->mrir_model->detail_mrir($mrirdetailvalues);
|
$mrirdetails = $this->mrir_model->detail_mrir($mrirdetailvalues);
|
||||||
$getAvailableqty = $this->mrir_model->getItemQuantityFromStock(trim($MaterialCode));
|
$getAvailableqty = $this->mrir_model->getItemQuantityFromStock(trim($MaterialCode));
|
||||||
|
|
||||||
if(count($getAvailableqty)>0)
|
if(count($getAvailableqty)>0)
|
||||||
@ -620,7 +567,7 @@ class emergencypurchaseorder extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
$IGRItemStatus = REQITEM_NEW;
|
$IGRItemStatus = REQITEM_NEW;
|
||||||
for ($i = 1; $i <= $RowCount; $i++)
|
for ($i = 1; $i <= $RowCount; $i++)
|
||||||
{
|
{
|
||||||
@ -641,8 +588,8 @@ class emergencypurchaseorder extends BaseController
|
|||||||
{
|
{
|
||||||
$Remarks = "Special PO Created";
|
$Remarks = "Special PO Created";
|
||||||
$ItemStatus = '';
|
$ItemStatus = '';
|
||||||
|
|
||||||
if($PendingQty == 0.00 )
|
if($PendingQty == 0.00 )
|
||||||
{
|
{
|
||||||
$ItemStatus = IGR_CREATED;
|
$ItemStatus = IGR_CREATED;
|
||||||
}
|
}
|
||||||
@ -656,20 +603,13 @@ class emergencypurchaseorder extends BaseController
|
|||||||
|
|
||||||
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt);
|
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt);
|
||||||
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
|
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
|
||||||
|
|
||||||
|
|
||||||
$IGRItemNo = '';
|
$IGRItemNo = '';
|
||||||
foreach($igrD as $value)
|
foreach($igrD as $value)
|
||||||
{
|
{
|
||||||
|
|
||||||
$IGRItemNo = $value->IGRItemNo;
|
$IGRItemNo = $value->IGRItemNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$MaterialstockHistoryadd= array('Ref_No'=>$IGRItemNo,'MaterialCode'=>$MaterialCode,'Transaction_type'=>'Add','Ref_Type'=>'IGR','SupplierID'=>$SupplierID,'Quantity'=>$QuantityAsPerInvoice,'ItemValue'=>$itemRate,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
|
||||||
|
|
||||||
|
|
||||||
$this->inwardgateregister_model->addMaterialStockHistory($MaterialstockHistoryadd);
|
|
||||||
|
|
||||||
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO,$MaterialCode);
|
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO,$MaterialCode);
|
||||||
$ReceivedQuantity = 0.00;
|
$ReceivedQuantity = 0.00;
|
||||||
@ -680,7 +620,7 @@ class emergencypurchaseorder extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
|
$totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
|
||||||
|
|
||||||
$POLineItem = array('ReceivedQuantity'=>$totalReceivedqty,'Status'=>$ItemStatus,'UpdateBY'=>$CreatedBy,'UpdatedOn'=>$createddt );
|
$POLineItem = array('ReceivedQuantity'=>$totalReceivedqty,'Status'=>$ItemStatus,'UpdateBY'=>$CreatedBy,'UpdatedOn'=>$createddt );
|
||||||
|
|
||||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
|
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
|
||||||
@ -763,10 +703,10 @@ $prefile =array();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
echo "<script>alert('You Have Successfully created the Purchase order! $PONO');</script>";
|
echo "<script>alert('You Have Successfully created the Purchase order! $PONO');</script>";
|
||||||
redirect('purchaseorder/PurchaseOrderList','refresh');
|
redirect('purchaseorder/PurchaseOrderList','refresh');
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* To load the purchaseorder list
|
* To load the purchaseorder list
|
||||||
@ -779,20 +719,13 @@ $prefile =array();
|
|||||||
$returns = $this->paginationCompress ( "purchaseorderListing/", $count, 5 );
|
$returns = $this->paginationCompress ( "purchaseorderListing/", $count, 5 );
|
||||||
$this->purchaseorder_model->UpdateRequistionStatus();
|
$this->purchaseorder_model->UpdateRequistionStatus();
|
||||||
$data['POData'] = $this->purchaseorder_model->purchaseorderListing();
|
$data['POData'] = $this->purchaseorder_model->purchaseorderListing();
|
||||||
//$this->global['pageTitle'] = 'Resico : Purchase Orders';
|
$this->global['pageTitle'] = $this->CompanyName.' : Purchase Orders';
|
||||||
$this->global['pageTitle'] = $this->CompanyName.' : Purchase Orders Details';
|
$this->loadViews("POlist", $this->global, $data, NULL);
|
||||||
|
|
||||||
|
|
||||||
$this->loadViews("POlist", $this->global, $data, NULL);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*Validation for dropdown
|
|
||||||
*/
|
|
||||||
function Req_validate($selectValue)
|
function Req_validate($selectValue)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(strlen($selectValue) == 0)
|
if(strlen($selectValue) == 0)
|
||||||
{
|
{
|
||||||
$this->form_validation->set_message('Req_validate', 'Please Select Requisition Number to Create PO.');
|
$this->form_validation->set_message('Req_validate', 'Please Select Requisition Number to Create PO.');
|
||||||
@ -818,12 +751,11 @@ $prefile =array();
|
|||||||
if($this->form_validation->run() == FALSE)
|
if($this->form_validation->run() == FALSE)
|
||||||
{
|
{
|
||||||
$this->requisition();
|
$this->requisition();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
//$this->global['pageTitle'] = 'Resico : Purchase order form';
|
|
||||||
$this->global['pageTitle'] = $this->CompanyName.' : Purchase order form';
|
$this->global['pageTitle'] = $this->CompanyName.' : Purchase order form';
|
||||||
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
|
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
|
||||||
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
|
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
|
||||||
@ -836,22 +768,21 @@ $prefile =array();
|
|||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
foreach ($Req as $SID):
|
foreach ($Req as $SID):
|
||||||
$ReqArray[] = $SID->ReqNo ;
|
$ReqArray[] = $SID->ReqNo ;
|
||||||
$result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo);
|
$result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo);
|
||||||
$ReqType = $SID->ReqType;
|
$ReqType = $SID->ReqType;
|
||||||
|
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
$Year = $dt->format('Y');
|
$Year = $dt->format('Y');
|
||||||
$data['CostList'] = $this->purchaseorder_model->getCostCenterbyRequist('',$Year,$ReqType);
|
$data['CostList'] = $this->purchaseorder_model->getCostCenterbyRequist('',$Year,$ReqType);
|
||||||
$data['MaterialList'] = $result;
|
$data['MaterialList'] = $result; //$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray);
|
||||||
$data['RequistionDetails'] = $this->purchaseorder_model->getRequistDetails($ReqArray);
|
$data['RequistionDetails'] = $this->purchaseorder_model->getRequistDetails($ReqArray);
|
||||||
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
||||||
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
|
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
|
||||||
|
|
||||||
$ViewName = '';
|
$ViewName = '';
|
||||||
|
|
||||||
if($ReqType == REVENUE)
|
if($ReqType == REVENUE)
|
||||||
{
|
{
|
||||||
$ViewName = 'Purchaseorder';
|
$ViewName = 'Purchaseorder';
|
||||||
@ -860,7 +791,6 @@ $prefile =array();
|
|||||||
{
|
{
|
||||||
$ViewName = 'servicePurchaseorder';
|
$ViewName = 'servicePurchaseorder';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->loadViews($ViewName, $this->global,$data, NULL);
|
$this->loadViews($ViewName, $this->global,$data, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -881,9 +811,7 @@ $prefile =array();
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* To View/Update Emergency Purchase Order
|
|
||||||
**/
|
|
||||||
function EditPurchaseOrder()
|
function EditPurchaseOrder()
|
||||||
{
|
{
|
||||||
$PONO = $_GET['PONO'];
|
$PONO = $_GET['PONO'];
|
||||||
@ -920,9 +848,8 @@ $prefile =array();
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* To get the Material value based on the MaterialCode
|
// To get the Material value based on the MaterialCode
|
||||||
**/
|
|
||||||
function getDetailsforReq()
|
function getDetailsforReq()
|
||||||
{
|
{
|
||||||
$SearchFilter= $this->input->post('id');
|
$SearchFilter= $this->input->post('id');
|
||||||
@ -961,9 +888,7 @@ $prefile =array();
|
|||||||
|
|
||||||
die(json_encode(array('MatDetail' =>$HTML1,'Cost'=> $HTML)));
|
die(json_encode(array('MatDetail' =>$HTML1,'Cost'=> $HTML)));
|
||||||
}
|
}
|
||||||
|
/* This method to get the status based on the Department selection in th
|
||||||
/**
|
|
||||||
* This method to get the status based on the Department selection in th
|
|
||||||
*/
|
*/
|
||||||
function getStatusByDepartment()
|
function getStatusByDepartment()
|
||||||
{
|
{
|
||||||
@ -984,9 +909,7 @@ $prefile =array();
|
|||||||
die(json_encode(array('depStaus' => $HTML)));
|
die(json_encode(array('depStaus' => $HTML)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// To get the available Budget Amount
|
||||||
* To get the available Budget Amount
|
|
||||||
**/
|
|
||||||
function AvilBudgetAmount()
|
function AvilBudgetAmount()
|
||||||
{
|
{
|
||||||
$SearchFilter= $this->input->post('id');
|
$SearchFilter= $this->input->post('id');
|
||||||
@ -1005,33 +928,31 @@ $prefile =array();
|
|||||||
}
|
}
|
||||||
|
|
||||||
print_r($AvilBudAmt);
|
print_r($AvilBudAmt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* To Convert the dateformat (date with time) and stored into DB
|
|
||||||
*/
|
|
||||||
function getDateformat($Val)
|
function getDateformat($Val)
|
||||||
{
|
{
|
||||||
$date = new DateTime($Val,new DateTimeZone('Asia/Kolkata'));
|
$date = new DateTime($Val,new DateTimeZone('Asia/Kolkata'));
|
||||||
$retDate = $date->format('Y-m-d H:i:s');
|
$retDate = $date->format('Y-m-d H:i:s');
|
||||||
return $retDate;
|
return $retDate;
|
||||||
}
|
}
|
||||||
|
/* Method to get the Requistion list based on the search filter*/
|
||||||
/**
|
|
||||||
* Method to get the Requistion list based on the search filter
|
|
||||||
**/
|
|
||||||
function SearchListofRequistion()
|
function SearchListofRequistion()
|
||||||
{
|
{
|
||||||
$SearchFilter= $this->input->post('id');
|
$SearchFilter= $this->input->post('id');
|
||||||
|
|
||||||
$DEPCode = $SearchFilter[0];
|
$DEPCode = $SearchFilter[0];
|
||||||
$Status = $SearchFilter[1];
|
$Status = $SearchFilter[1];
|
||||||
$rng = $SearchFilter[2];
|
$rng = $SearchFilter[2];
|
||||||
|
|
||||||
$FromDate ='';
|
$FromDate ='';
|
||||||
$ToDate = '';
|
$ToDate = '';
|
||||||
|
|
||||||
$Dt = explode("-",$rng);
|
$Dt = explode("-",$rng);
|
||||||
|
|
||||||
if(count( $Dt)>1)
|
if(count( $Dt)>1)
|
||||||
{
|
{
|
||||||
$FDate = $Dt[0];
|
$FDate = $Dt[0];
|
||||||
@ -1039,8 +960,10 @@ $prefile =array();
|
|||||||
$FromDate = $this->getDateformat($FDate);
|
$FromDate = $this->getDateformat($FDate);
|
||||||
$ToDate = $this->getDateformat($TDate);
|
$ToDate = $this->getDateformat($TDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->purchaseorder_model->getRequistionListbySearch($DEPCode,$Status,$FromDate,$ToDate);
|
$result = $this->purchaseorder_model->getRequistionListbySearch($DEPCode,$Status,$FromDate,$ToDate);
|
||||||
|
|
||||||
|
|
||||||
$HTML="";
|
$HTML="";
|
||||||
for ($i = 0; $i < count($result); $i++)
|
for ($i = 0; $i < count($result); $i++)
|
||||||
{
|
{
|
||||||
@ -1056,7 +979,7 @@ $prefile =array();
|
|||||||
$HTML.="<tr id='".$i."'>
|
$HTML.="<tr id='".$i."'>
|
||||||
<td align='left'><input type='checkbox' name='chk'".$i." id='chk'".$i."/></td>
|
<td align='left'><input type='checkbox' name='chk'".$i." id='chk'".$i."/></td>
|
||||||
<td align='left'><a data-toggle='modal' data-target='#myModal'><u>". $ReqNo."</u></a></td>
|
<td align='left'><a data-toggle='modal' data-target='#myModal'><u>". $ReqNo."</u></a></td>
|
||||||
<td align='left'>".$ReqType."</td>
|
<td align='left'>".$ReqType."</td>
|
||||||
<td align='left'>".$Reqedby."</td>
|
<td align='left'>".$Reqedby."</td>
|
||||||
<td align='left'>".$ReqDate."</td>
|
<td align='left'>".$ReqDate."</td>
|
||||||
<td align='left'>".$Status."</td>
|
<td align='left'>".$Status."</td>
|
||||||
@ -1068,9 +991,6 @@ $prefile =array();
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* To View the request details
|
|
||||||
**/
|
|
||||||
function ListPORequistion()
|
function ListPORequistion()
|
||||||
{
|
{
|
||||||
$ReqNo= $this->input->post('id');
|
$ReqNo= $this->input->post('id');
|
||||||
@ -1095,7 +1015,7 @@ $prefile =array();
|
|||||||
<td align='left'>".$UOM."</td>
|
<td align='left'>".$UOM."</td>
|
||||||
<td align='left'>".$Quantity."</td>
|
<td align='left'>".$Quantity."</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$CostCenter = "<option value='-1'>Select Cost center</option>";
|
$CostCenter = "<option value='-1'>Select Cost center</option>";
|
||||||
if(count($CostList) > 0)
|
if(count($CostList) > 0)
|
||||||
@ -1110,9 +1030,7 @@ $prefile =array();
|
|||||||
die(json_encode(array('Items' =>$HTML,'Requist'=>$ReqList,'Cost'=>$CostCenter)));
|
die(json_encode(array('Items' =>$HTML,'Requist'=>$ReqList,'Cost'=>$CostCenter)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* To Create Revenue Purchase Order
|
|
||||||
**/
|
|
||||||
function addNewPurchaseOrder()
|
function addNewPurchaseOrder()
|
||||||
{
|
{
|
||||||
$POdt =$this->input->post('PODate');
|
$POdt =$this->input->post('PODate');
|
||||||
@ -1209,14 +1127,14 @@ $prefile =array();
|
|||||||
{
|
{
|
||||||
$LineItemNo = $POLineItem[0]['LineItemNo'];
|
$LineItemNo = $POLineItem[0]['LineItemNo'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(trim($POType) == REVENUE )
|
if(trim($POType) == REVENUE )
|
||||||
{
|
{
|
||||||
|
|
||||||
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
|
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
|
||||||
|
|
||||||
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
|
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1224,6 +1142,7 @@ $prefile =array();
|
|||||||
echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ;
|
echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This used to Edit the Revenue Purchase Order
|
* This used to Edit the Revenue Purchase Order
|
||||||
**/
|
**/
|
||||||
@ -1234,12 +1153,11 @@ $prefile =array();
|
|||||||
$PODate = $this->getDateformat($POdt);
|
$PODate = $this->getDateformat($POdt);
|
||||||
$SupplierID = $this->input->post('drpSupplier');
|
$SupplierID = $this->input->post('drpSupplier');
|
||||||
|
|
||||||
$newsup=$this->input->post('newsup');
|
$newsup=$this->input->post('newsup');
|
||||||
$newSupId = split("[ - ]+", $newsup);
|
$newSupId = split("[ - ]+", $newsup);
|
||||||
|
$b4supplier=$this->input->post('b4supplier');
|
||||||
$b4supplier=$this->input->post('b4supplier');
|
$b4date=$this->input->post('b4podate');
|
||||||
$b4date=$this->input->post('b4podate');
|
$b4podate = $this->getDateformat($b4date);
|
||||||
$b4podate = $this->getDateformat($b4date);
|
|
||||||
|
|
||||||
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
|
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
|
||||||
$dt = $this->input->post('Deliverydt');
|
$dt = $this->input->post('Deliverydt');
|
||||||
@ -1259,7 +1177,7 @@ $prefile =array();
|
|||||||
$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');
|
||||||
$Local_Interstate=$this->input->post('Range');
|
$Local_Interstate=$this->input->post('Range');
|
||||||
|
|
||||||
// PO Master
|
// PO Master
|
||||||
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'CapitalRange'=>$Local_Interstate );
|
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'CapitalRange'=>$Local_Interstate );
|
||||||
|
|
||||||
@ -1267,7 +1185,7 @@ $prefile =array();
|
|||||||
|
|
||||||
$LineItemStatus = REQITEM_NEW;
|
$LineItemStatus = REQITEM_NEW;
|
||||||
|
|
||||||
if($PODate != $b4podate )
|
if($PODate != $b4podate )
|
||||||
{
|
{
|
||||||
$logpo =array('PONO'=>$PONO,'LineItemNo'=>'-','UpdateBy'=>$updatedBy,'OldValue'=>$b4podate,'NewValue'=>$PODate,'Entity'=>'PO DateChanged');
|
$logpo =array('PONO'=>$PONO,'LineItemNo'=>'-','UpdateBy'=>$updatedBy,'OldValue'=>$b4podate,'NewValue'=>$PODate,'Entity'=>'PO DateChanged');
|
||||||
|
|
||||||
@ -1292,8 +1210,10 @@ $prefile =array();
|
|||||||
$Quantity = $this->input->post('quantity'.$i);
|
$Quantity = $this->input->post('quantity'.$i);
|
||||||
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
||||||
$itemRate = $this->input->post('itemRate'.$i);
|
$itemRate = $this->input->post('itemRate'.$i);
|
||||||
$b4qty=$this->input->post('b4qty'.$i);
|
|
||||||
$b4rate=$this->input->post('b4rate'.$i);
|
$b4qty=$this->input->post('b4qty'.$i);
|
||||||
|
$b4rate=$this->input->post('b4rate'.$i);
|
||||||
|
|
||||||
$DiscountType = $this->input->post('DisType'.$i);
|
$DiscountType = $this->input->post('DisType'.$i);
|
||||||
$DiscountValue = $this->input->post('DisVal'.$i);
|
$DiscountValue = $this->input->post('DisVal'.$i);
|
||||||
$AfterDiscount = $this->input->post('AfterDisVal'.$i);
|
$AfterDiscount = $this->input->post('AfterDisVal'.$i);
|
||||||
@ -1323,23 +1243,22 @@ $prefile =array();
|
|||||||
$CostCenter = $this->input->post('costCode'.$i);
|
$CostCenter = $this->input->post('costCode'.$i);
|
||||||
$LineItemNo = '';
|
$LineItemNo = '';
|
||||||
|
|
||||||
if($Quantity != $b4qty)
|
if($Quantity != $b4qty)
|
||||||
{
|
{
|
||||||
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4qty,'NewValue'=>$Quantity,'Entity'=>'Quantity Changed');
|
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4qty,'NewValue'=>$Quantity,'Entity'=>'Quantity Changed');
|
||||||
|
|
||||||
|
|
||||||
$this->purchaseorder_model->insertlogpo($logpo);
|
$this->purchaseorder_model->insertlogpo($logpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($itemRate != $b4rate)
|
if($itemRate != $b4rate)
|
||||||
{
|
{
|
||||||
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4rate,'NewValue'=>$itemRate,'Entity'=>'Rate Changed');
|
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4rate,'NewValue'=>$itemRate,'Entity'=>'Rate Changed');
|
||||||
|
|
||||||
|
|
||||||
$this->purchaseorder_model->insertlogpo($logpo);
|
$this->purchaseorder_model->insertlogpo($logpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
$SkipInsert = "False";
|
$SkipInsert = "False";
|
||||||
if( count($comma_separated) > 0)
|
if( count($comma_separated) > 0)
|
||||||
{
|
{
|
||||||
@ -1396,22 +1315,22 @@ $prefile =array();
|
|||||||
|
|
||||||
echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ;
|
echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To load pagenotfound view
|
* To load pagenotfound view
|
||||||
*/
|
*/
|
||||||
function pageNotFound()
|
function pageNotFound()
|
||||||
{
|
{
|
||||||
//$this->global['pageTitle'] = 'Resico : 404 - Page Not Found';
|
|
||||||
$this->global['pageTitle'] = $this->CompanyName.': 404 - Page Not Found';
|
$this->global['pageTitle'] = $this->CompanyName.': 404 - Page Not Found';
|
||||||
$this->loadViews("404", $this->global, NULL, NULL);
|
$this->loadViews("404", $this->global, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To load revenue PO for PDF
|
* To load revenue PO for PDF
|
||||||
*/
|
*/
|
||||||
public function revenuepoprint($PONO)
|
public function revenuepoprint($PONO)
|
||||||
{
|
{
|
||||||
|
|
||||||
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
||||||
$data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO);
|
$data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO);
|
||||||
|
|
||||||
@ -1444,6 +1363,7 @@ $prefile =array();
|
|||||||
public function servicepoprint($PONO)
|
public function servicepoprint($PONO)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// $this->load->view('includes/pdfheader');
|
||||||
|
|
||||||
// Load the pdf page with multiviews
|
// Load the pdf page with multiviews
|
||||||
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
||||||
@ -1500,4 +1420,4 @@ $prefile =array();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -5388,6 +5388,7 @@ var spclins=$.trim(tinymce.get('edittxtInstruction').getContent());
|
|||||||
function populateValueMainFormForEditImportTax()
|
function populateValueMainFormForEditImportTax()
|
||||||
{
|
{
|
||||||
var rows =document.getElementById('ImportTax').rows.length;
|
var rows =document.getElementById('ImportTax').rows.length;
|
||||||
|
var editrow = parseFloat(rows)-1;
|
||||||
var TotalLanding=0;
|
var TotalLanding=0;
|
||||||
|
|
||||||
var TotalCustom=0;
|
var TotalCustom=0;
|
||||||
@ -5460,7 +5461,7 @@ TotalIgst=parseFloat(TotalIgst)+parseFloat(Igst);
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}while (i < rows);
|
}while (i < editrow);
|
||||||
|
|
||||||
$('#txttotallanding').val(parseFloat(TotalLanding).toFixed(2));
|
$('#txttotallanding').val(parseFloat(TotalLanding).toFixed(2));
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user