emergency po

This commit is contained in:
venbatechnologies@gmail.com 2017-11-20 16:21:07 +05:30
parent 392122fb64
commit 58ce7e23bb
10 changed files with 8729 additions and 7775 deletions

View File

@ -104,6 +104,8 @@ define('PO_AWAITING_RELEASE', 'ST025');
define('PO_APPROVED', 'ST025'); define('PO_APPROVED', 'ST025');
define('PO_APPROVER_ONHOLD', 'ST051'); define('PO_APPROVER_ONHOLD', 'ST051');
define('PO_RELEASER_ONHOLD', 'ST052'); define('PO_RELEASER_ONHOLD', 'ST052');
define('SPECIAL_PO', 'ST056');
/*store Status*/ /*store Status*/
define('STORE_DRAFT', 'ST043'); define('STORE_DRAFT', 'ST043');

266
application/controllers/emergencypurchaseorder.php Executable file → Normal file
View File

@ -22,6 +22,7 @@ class emergencypurchaseorder extends BaseController
$this->load->library('session'); $this->load->library('session');
$this->load->library('form_validation'); $this->load->library('form_validation');
$this->load->model('requistion_model'); $this->load->model('requistion_model');
$this->load->model('inwardgateregister_model');
$this->isLoggedIn(); $this->isLoggedIn();
} }
@ -91,6 +92,46 @@ class emergencypurchaseorder extends BaseController
} }
function addfile()
{
$file = '';
//Check whether user upload picture
if(!empty($_FILES['images']['name']))
{
//echo 'true';
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = 'docx|pdf|doc|png|jpg';
$config['file_name'] = $_FILES['images']['name'];
// print_r($config);die;
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload('images'))
{
$uploadData = $this->upload->data();
//print_r($uploadData);
$file = $uploadData['file_name'];
}
else
{
$error = array('error' => $this->upload->display_errors());
//print_r($error);
$file = '';
}
}
else
{
//echo 'false';
$file = '';
}
return $file ;
}
//This used to Create Service Purchase Order //This used to Create Service Purchase Order
function addNewServicePurchaseOrder() function addNewServicePurchaseOrder()
{ {
@ -133,7 +174,15 @@ class emergencypurchaseorder extends BaseController
$OtherPayment=$this->input->post('Otherpayment'); $OtherPayment=$this->input->post('Otherpayment');
if($POStatus==SPECIAL_PO)
{
$ServiceWorkStatus=SERVICE_COMPLETED;
}
else
{
$ServiceWorkStatus=$this->input->post('workStatus'); $ServiceWorkStatus=$this->input->post('workStatus');
}
$ServiceScheduleType = $this->input->post('ScheduleType'); $ServiceScheduleType = $this->input->post('ScheduleType');
$ServiceScheduleOptions = $this->input->post('ScheduleType'); $ServiceScheduleOptions = $this->input->post('ScheduleType');
//$ServiceServiceNo = $this->input->post('ServiceNo'); //$ServiceServiceNo = $this->input->post('ServiceNo');
@ -271,6 +320,9 @@ class emergencypurchaseorder extends BaseController
//This used to Create Revenue Emergency Purchase Order //This used to Create Revenue Emergency Purchase Order
function addNewRevenuePurchaseOrder() function addNewRevenuePurchaseOrder()
{ {
$txtspl=$this->input->post('txtSpecial');
//echo "Emergency Revenue PO"; //echo "Emergency Revenue PO";
$POdt =$this->input->post('PODate'); $POdt =$this->input->post('PODate');
@ -307,12 +359,33 @@ class emergencypurchaseorder extends BaseController
$SpcialInstruction = $this->input->post('txtSpcialInstruction'); $SpcialInstruction = $this->input->post('txtSpcialInstruction');
$RequistionComments = "Created Emergency Revenue PO"; $RequistionComments = "Created Emergency Revenue PO";
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary');
$POStatus = $this->input->post('TextStatus');
if($txtspl==0)
{
$POStatus=REQITEM_Emergency_PO_CREATED;
}
else
{
$POStatus=SPECIAL_PO;
}
//$POStatus = $this->input->post('TextStatus');
$RequestedBy = $this->input->post('drpDepartment'); $RequestedBy = $this->input->post('drpDepartment');
$CreateBy = $this->session->userdata ( 'userId' ); $CreateBy = $this->session->userdata ( 'userId' );
$RowCount = $this->input->post('TextRowCount'); // $RowCount = $this->input->post('TextRowCount');
$RowCount=$this->input->post('txtRowCount1');
//echo $RowCount; //echo $RowCount;
$DeletedRow = $this->input->post('TextDeletedRowCount'); // $DeletedRow = $this->input->post('TextDeletedRowCount');
$DeletedRow = $this->input->post('txtDeletedRow1');
$splRow = $this->input->post('splrow');
// echo $DeletedRow;
$ReqStatus = REQITEM_Emergency_PO_CREATED; $ReqStatus = REQITEM_Emergency_PO_CREATED;
$Local_Interstate=$this->input->post('Range'); $Local_Interstate=$this->input->post('Range');
@ -322,8 +395,19 @@ $RequestedBy = $this->input->post('drpDepartment');
$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');
$PaymentTerms=$this->input->post('PaymentMethod'); $PaymentTerms=$this->input->post('PaymentMethod');
$OtherPayment=$this->input->post('Otherpayment'); $OtherPayment=$this->input->post('Otherpayment');
if($POStatus==SPECIAL_PO)
{
$Qualitycheck=$this->input->post('txtQuality');
}
else
{
$Qualitycheck=1;
}
//add requistion //add requistion
$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);
@ -336,7 +420,7 @@ $RequestedBy = $this->input->post('drpDepartment');
$RegNo = $Req[0]['ReqNo']; $RegNo = $Req[0]['ReqNo'];
} }
// PO Master // PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Supplier_Reference'=>$supplierreference,'Other_Reference'=>$otherreference,'InsuranceNumber'=>$insuranceno,'InsuranceStatus'=>$insurancestatus,'Fincap'=>$fincap,'POSubType'=>$revenuetype); $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Supplier_Reference'=>$supplierreference,'Other_Reference'=>$otherreference,'InsuranceNumber'=>$insuranceno,'InsuranceStatus'=>$insurancestatus,'Fincap'=>$fincap,'POSubType'=>$revenuetype,'IsQualityChkReqired'=>$Qualitycheck);
//print_r($POList); //print_r($POList);
$POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$revenuetype); $POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$revenuetype);
@ -375,12 +459,12 @@ $RequestedBy = $this->input->post('drpDepartment');
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i); $TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
$revenuedescription = $this->input->post('service_description'.$i); $revenuedescription = $this->input->post('service_description'.$i);
$CostCenter = $this->input->post('costCode'.$i); $CostCenter = $this->input->post('costCode'.$i);
$Cgst = $this->input->post('RevenueCgst'.$i); $Cgst = $this->input->post('RevenueCgst'.$i);
$Sgst = $this->input->post('RevenueSgst'.$i); $Sgst = $this->input->post('RevenueSgst'.$i);
$Igst = $this->input->post('RevenueIgst'.$i); $Igst = $this->input->post('RevenueIgst'.$i);
$AfterCgst = $this->input->post('RevenueAfterCgst'.$i); $AfterCgst = $this->input->post('RevenueAfterCgst'.$i);
$AfterSgst = $this->input->post('RevenueAfterSgst'.$i); $AfterSgst = $this->input->post('RevenueAfterSgst'.$i);
$AfterIgst = $this->input->post('RevenueAfterIgst'.$i); $AfterIgst = $this->input->post('RevenueAfterIgst'.$i);
$SkipInsert = "False"; $SkipInsert = "False";
if( count($comma_separated) > 0) if( count($comma_separated) > 0)
{ {
@ -425,8 +509,162 @@ $RequestedBy = $this->input->post('drpDepartment');
} }
} }
} }
echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ;
if($txtspl==1 || $txtspl==2)
{
$PONOigr = $PONO;
//echo $PONOigr;
//die();
//IGR Data Entry
//$DeliveryChellanOrInvoiceNo = $this->input->post('ChallanInvNo');
$DeliveryChellanInvoiceNo=$this->input->post('ChallanInvNo');
$DeliveryChellan = $this->input->post('ChallanInvDate');
$DeliveryChellanDate = $this->getDateformat($DeliveryChellan);
$Vehicle = $this->input->post('VehicleNo');
$Courier = $this->input->post('CourierNo');
$CreatedBy = $this->session->userdata('userId');
//$Remarks = $this->input->post('Remarks');
//$RowCount = $this->input->post('TextRowCount');
//echo $RowCount;
$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,'CourierNo'=>$Courier,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt);
//print_r($igr);
$igrM = $this->inwardgateregister_model->addigrM($igr);
$IGRNO = '';
if(count($igrM)>0)
{
foreach ($igrM as $key )
{
$IGRNO=$key->IGRNO;
}
}
//echo $IGRNO;
$IGRItemStatus = REQITEM_NEW;
for ($i = 1; $i <= $RowCount; $i++)
{
$MaterialCode = trim($this->input->post('materialCode'.$i));
$QuantityAsPerInvoice = $this->input->post('quantity'.$i);
$OrderedQuantity = $this->input->post('quantity'.$i);
$ReceivedQty = $this->input->post('AQuantity'.$i);
$emergencyitemcode = $this->input->post('emergencyitemcode');
$PendingQty = 0;
//echo $QuantityAsPerInvoice;
//echo $PendingQty.'ReceivedQty'.$ReceivedQty;
//echo ' ';
if(strlen($QuantityAsPerInvoice)>0 && $QuantityAsPerInvoice != '0')
{
$Remarks = "Special PO Created";
$ItemStatus = '';
//if($QuantityAsPerInvoice == $OrderedQuantity)
if($PendingQty == 0.00 )
{
$ItemStatus = IGR_CREATED;
}
else
{
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
}
$CreatedBy = $this->session->userdata('userId');
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt);
//print_r($igrDetails);
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO,$MaterialCode);
$ReceivedQuantity = 0.00;
if(count($Recqty)>0)
{
foreach ($Recqty as $key ) {
$ReceivedQuantity=$key->ReceivedQuantity;
}
}
$totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
//echo '';
$POLineItem = array('ReceivedQuantity'=>$totalReceivedqty,'Status'=>$ItemStatus,'UpdateBY'=>$CreatedBy,'UpdatedOn'=>$createddt );
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
}
// $file =$this->addfile();
// $emergencyitemcode = $this->input->post('emergencyitemcode'.$i);
// ($this->input->post('materialCode'.$i));
// $myfile = array('FilePath'=>$file,'MaterialCode'=>$emergencyitemcode,'PONO'=>$PONO,'IGRNO'=>$IGRNO);
// // print_r($myfile);
// $result= $this->purchaseorder_model->fileupload($myfile);
}
for ($i = 1; $i <= $splRow; $i++)
{
$file =$this->addfile();
$emergencyitemcode = $this->input->post('materialCode'.$i);
$myfile = array('FilePath'=>$file,'MaterialCode'=>$emergencyitemcode,'PONO'=>$PONO,'IGRNO'=>$IGRNO);
$result= $this->purchaseorder_model->fileupload($myfile);
}
}
//if($result > 0)
// {
echo "<script>alert('You Have Successfully created the Purchase order! $PONO');</script>";
redirect('purchaseorder/PurchaseOrderList','refresh');
// }
} }

View File

@ -394,6 +394,8 @@ class purchaseorder extends BaseController
$PAYTERM=$TER->PaymentTerms; $PAYTERM=$TER->PaymentTerms;
} }
$data['getdata'] = $this->purchaseorder_model->getfunction($PONO);
$data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate(); $data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate();
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
@ -908,7 +910,7 @@ class purchaseorder extends BaseController
$DeliveryAddr = $this->input->post('DeliveryAddr'); $DeliveryAddr = $this->input->post('DeliveryAddr');
$dt = $this->input->post('Deliverydt'); $dt = $this->input->post('Deliverydt');
$POType = $this->input->post('POType'); $POType = $this->input->post('POType');
$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');
@ -950,8 +952,10 @@ class purchaseorder extends BaseController
$PaymentTerms=$this->input->post('PaymentTerms'); $PaymentTerms=$this->input->post('PaymentTerms');
$OtherPayment=$this->input->post('Otherpayment'); $OtherPayment=$this->input->post('Otherpayment');
$Local_Interstate=$this->input->post('Range'); $Local_Interstate=$this->input->post('Range');
$Qualitycheck=1;
// PO Master // PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$supplierreference,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'POSubType'=>$revenuetype,'InsuranceNumber'=>$insuranceno); $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$supplierreference,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'POSubType'=>$revenuetype,'InsuranceNumber'=>$insuranceno,'IsQualityChkReqired'=>$Qualitycheck);
// print_r($POList); // print_r($POList);
// die(); // die();
@ -1097,9 +1101,11 @@ class purchaseorder extends BaseController
$PaymentTerms=$this->input->post('PaymentTerms'); $PaymentTerms=$this->input->post('PaymentTerms');
$OtherPayment=$this->input->post('Otherpayment'); $OtherPayment=$this->input->post('Otherpayment');
$Local_Interstate=$this->input->post('Range'); $Local_Interstate=$this->input->post('Range');
$Qualitycheck=1;
// PO Master // PO Master
// PO Master // PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$supplierreference,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'POSubType'=>$revenuetype,'InsuranceNumber'=>$insuranceno); $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$supplierreference,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'POSubType'=>$revenuetype,'InsuranceNumber'=>$insuranceno,'IsQualityChkReqired'=>$Qualitycheck);
//print_r($POList); //print_r($POList);
//die(); //die();
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
@ -1719,8 +1725,9 @@ function addNewImportPurchaseOrder()
// $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'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,'CreatedDate'=>$createddt,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType);
$Qualitycheck=1;
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$Insurance,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption); $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$Insurance,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption,'IsQualityChkReqired'=>$Qualitycheck);
//print_r($POList); //print_r($POList);
//die(); //die();
@ -1940,10 +1947,10 @@ function addNewImportPurchaseOrder()
// 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);
$Qualitycheck=1;
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$insurestatus,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption,'IsQualityChkReqired'=>$Qualitycheck);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$insurestatus,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption);
//echo $PONO; //echo $PONO;
//echo $TotalOrder; //echo $TotalOrder;
//print_r($POList); //print_r($POList);
@ -2325,9 +2332,11 @@ function addNewImportPurchaseOrder()
$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');
$currencytypeID = $this->input->post('currencytype'); $currencytypeID = $this->input->post('currencytype');
$Qualitycheck=1;
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions); $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'IsQualityChkReqired'=>$Qualitycheck);
// $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin); // $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin);
@ -2578,9 +2587,10 @@ function addNewImportPurchaseOrder()
$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');
$Qualitycheck=1;
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions); $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'IsQualityChkReqired'=>$Qualitycheck);
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);

View File

@ -29,7 +29,8 @@ class mrir_model extends CI_Model
$this->db->from('T_IGR_Master igr'); $this->db->from('T_IGR_Master igr');
$this->db->join('T_PurchaseOrder_Master PO','igr.PONO = PO.PONO'); $this->db->join('T_PurchaseOrder_Master PO','igr.PONO = PO.PONO');
$this->db->join('T_SupplierDetailsN` sup','PO.SupplierID = sup.SupplierID'); $this->db->join('T_SupplierDetailsN` sup','PO.SupplierID = sup.SupplierID');
$this->db->where('igr.IGRStatus !=',MRIR_CREATED); // $this->db->where('igr.IGRStatus !=',MRIR_CREATED);
$this->db->where('PO.IsQualityChkReqired',1);
$this->db->order_by("CreatedDate","desc"); $this->db->order_by("CreatedDate","desc");
$query = $this->db->get(); $query = $this->db->get();
$result = $query->result(); $result = $query->result();
@ -37,7 +38,7 @@ class mrir_model extends CI_Model
return $result; return $result;
} }
/* This function is used to get the igr value (button link)*/ /* This function is used to get the igr value (button link)*/
function get_IGR($IgrNo) function get_IGR($IgrNo)
{ {
$this->db->distinct(); $this->db->distinct();
$this->db->select('IGRM.DeliveryChellanDate,IGRM.CreatedDate,IGRM.IGRNO,IGRM.VehicleNo,IGRM.DeliveryChellanOrInvoiceNo,IGRM.CourierNo,IGRM.PONO,IGRD.MaterialCode,IGRD.QuantityAsPerInvoice,POMR.ServiceDescription,POMR.PODate,POMR.DeliveryDate,POMR.CreatedBy,SUPP.SupplierName,SUPP.Address,MM.UOM,MM.MaterialName,POLT.Quantity,POLT.ReceivedQuantity,ED.FirstName'); $this->db->select('IGRM.DeliveryChellanDate,IGRM.CreatedDate,IGRM.IGRNO,IGRM.VehicleNo,IGRM.DeliveryChellanOrInvoiceNo,IGRM.CourierNo,IGRM.PONO,IGRD.MaterialCode,IGRD.QuantityAsPerInvoice,POMR.ServiceDescription,POMR.PODate,POMR.DeliveryDate,POMR.CreatedBy,SUPP.SupplierName,SUPP.Address,MM.UOM,MM.MaterialName,POLT.Quantity,POLT.ReceivedQuantity,ED.FirstName');
@ -131,8 +132,8 @@ TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
$this->db->join('T_PurchaseOrder_AdvanceRequest PUADV','POM.PONO=PUADV.PONO','left'); $this->db->join('T_PurchaseOrder_AdvanceRequest PUADV','POM.PONO=PUADV.PONO','left');
$this->db->join ('tbl_users user','user.userid=TMD.UpdateBY'); $this->db->join ('tbl_users user','user.userid=TMD.UpdateBY');
$this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID'); $this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID');
$this->db->join ('tbl_users user1','user1.userid = POM.ReleasedBy'); $this->db->join ('tbl_users user1','user1.userid = POM.ReleasedBy','left');
$this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID'); $this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID','left');
$this->db->join ('tbl_users user2','user2.userid=TMD.StoreInchargeID'); $this->db->join ('tbl_users user2','user2.userid=TMD.StoreInchargeID');
$this->db->join ('T_Employee_Details ED2','ED2.EmpID = user2.EmpID'); $this->db->join ('T_Employee_Details ED2','ED2.EmpID = user2.EmpID');
$this->db->join ('T_MaterialMaster MM','MM.MaterialCode = IGRD.MaterialCode and POL.MaterialCode = MM.MaterialCode'); $this->db->join ('T_MaterialMaster MM','MM.MaterialCode = IGRD.MaterialCode and POL.MaterialCode = MM.MaterialCode');

View File

@ -20,6 +20,38 @@ class purchaseorder_model extends CI_Model
return $query->result(); return $query->result();
} }
function fileupload($myfile)
{
$this->db->insert('T_PurchaseOrder_BillUpload',$myfile);
$myfile=$this->db->affected_rows();
return $myfile;
}
function getfunction($pono)
{
$this->db->distinct();
$this->db->select('bill.PONO,mstr.IGRNO,bill.BillNo,bill.MaterialCode,bill.FilePath,mstr.DeliveryChellanOrInvoiceNo,mstr.DeliveryChellanDate,mstr.VehicleNo,mstr.CourierNo,dtl.QuantityAsPerInvoice,pom.POType,mm.MaterialName');
$this->db->from('T_PurchaseOrder_BillUpload bill');
$this->db->join('T_IGR_Master mstr','bill.IGRNO = mstr.IGRNO');
$this->db->join('T_IGR_Details dtl','mstr.IGRNO = dtl.IGRNO');
$this->db->join('T_MaterialMaster mm','mm.MaterialCode = bill.MaterialCode');
$this->db->join('T_PurchaseOrder_Master pom','pom.PONO = bill.PONO');
$this->db->where('bill.PONO',$pono);
//$this->db->or_where('pom.status',SPECIAL_PO);
//$this->db->group_by('bill.BillNo');
$query = $this->db->get();
return $query->result();
}
function GetPODetailforBillingServicePO($PONO) function GetPODetailforBillingServicePO($PONO)
{ {

16094
application/views/alterpurchaseorder.php Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@ -205,7 +205,23 @@ if(!empty($RequistionDetails))
var DelDt = '<?php echo $Deliverydt; ?>'; var DelDt = '<?php echo $Deliverydt; ?>';
var insurancestatus = '<?php echo $insurencestatus;?>'; var insurancestatus = '<?php echo $insurencestatus;?>';
var insuranceno = '<?php echo $insurenceno;?>'; var insuranceno = '<?php echo $insurenceno;?>';
var statuscheck='<?php echo $PONOStatus;?>';
$(document).ready(function () { $(document).ready(function () {
if(statuscheck=="<?php echo SPECIAL_PO;?>")
{
$('#splpodiv').show();
}
else
{
$('#splpodiv').hide();
}
$('#PoTypeOptions').attr("style", "pointer-events: none;"); $('#PoTypeOptions').attr("style", "pointer-events: none;");
if(DelOpt=="0"){ if(DelOpt=="0"){
@ -4044,8 +4060,61 @@ function calculateEditTaxValue()
echo form_textarea($data); echo form_textarea($data);
?> ?>
<input type="hidden" name="SpcialInstruction" id="SpcialInstruction" value=""> <input type="hidden" name="SpcialInstruction" id="SpcialInstruction" value="">
</div> </div>
</div> </div>
<div class="col-md-12" id="splpodiv">
<div class="col-md-12"><label>Special po Table List</label>
<table id="table2" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
<thead style="background-color:#ddf">
<tr>
<th>Bill No </th>
<th>Materials</th>
<th>Delivery Challan No</th>
<th>Delivery Challan Date</th>
<th>Vehicle No</th>
<th>Courier No</th>
<th>Quantity</th>
<th>File</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($getdata))
{
foreach($getdata as $gd)
{
?>
<tr>
<td><?php echo $gd->BillNo ?></td>
<td><?php echo $gd->MaterialCode ?> - <?php echo $gd->MaterialName ?></td>
<td><?php echo $gd->DeliveryChellanOrInvoiceNo?></td>
<td><?php $date = new DateTime($gd->DeliveryChellanDate);
echo $date->format('d-m-Y'); ?></td>
<td><?php echo $gd->VehicleNo?></td>
<td><?php echo $gd->CourierNo?></td>
<td><?php echo $gd->QuantityAsPerInvoice?></td>
<td><?php echo $gd->FilePath?></td>
<td><a href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $gd->FilePath ?>"><i class="fa fa-download" ></i></a></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
<div class="row" style="padding: 2% 0%"> <div class="row" style="padding: 2% 0%">
<div class="col-md-3 col-md-offset-9"><br/> <div class="col-md-3 col-md-offset-9"><br/>
<input type="hidden" name="txtPoRange" id="txtPoRange" /> <input type="hidden" name="txtPoRange" id="txtPoRange" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB