Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
4ec0e24c61
@ -230,6 +230,7 @@ $routes->post('emergencypurchaseorder/addNewRevenuePurchaseOrder','Emergencypurc
|
|||||||
|
|
||||||
|
|
||||||
$routes->post('purchaseorder/addNewPurchaseOrder', 'Purchaseorder::addNewPurchaseOrder');
|
$routes->post('purchaseorder/addNewPurchaseOrder', 'Purchaseorder::addNewPurchaseOrder');
|
||||||
|
$routes->post('purchaseorder/DeletePODetails', 'Purchaseorder::DeletePODetails');
|
||||||
$routes->post('purchaseorder/addNewCapitalPurchaseOrder', 'Purchaseorder::addNewCapitalPurchaseOrder');
|
$routes->post('purchaseorder/addNewCapitalPurchaseOrder', 'Purchaseorder::addNewCapitalPurchaseOrder');
|
||||||
$routes->post('purchaseorder/addNewImportPurchaseOrder', 'Purchaseorder::addNewImportPurchaseOrder');
|
$routes->post('purchaseorder/addNewImportPurchaseOrder', 'Purchaseorder::addNewImportPurchaseOrder');
|
||||||
$routes->post('servicepurchaseorder/addNewServicePurchaseOrder', 'Servicepurchaseorder::addNewServicePurchaseOrder');
|
$routes->post('servicepurchaseorder/addNewServicePurchaseOrder', 'Servicepurchaseorder::addNewServicePurchaseOrder');
|
||||||
|
|||||||
@ -545,7 +545,7 @@ class Purchaseorder extends BaseController
|
|||||||
$ReqType = $this->request->getVar('ReqType');
|
$ReqType = $this->request->getVar('ReqType');
|
||||||
|
|
||||||
$Req = $this->purchaseorder_model->getRequistionNoFromPO($PONO);
|
$Req = $this->purchaseorder_model->getRequistionNoFromPO($PONO);
|
||||||
|
|
||||||
$data['ReqList'] = $Req;
|
$data['ReqList'] = $Req;
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
@ -554,8 +554,8 @@ class Purchaseorder extends BaseController
|
|||||||
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);
|
||||||
// echo "<pre>";
|
// echo "<pre>";
|
||||||
// print_r($result);die;
|
// print_r($result);die;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$data['MaterialList'] = $result; //$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray);
|
$data['MaterialList'] = $result; //$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray);
|
||||||
@ -1215,8 +1215,6 @@ class Purchaseorder extends BaseController
|
|||||||
//This used to Edit the Revenue Purchase Order
|
//This used to Edit the Revenue Purchase Order
|
||||||
function EditRevenuePurchaseOrder()
|
function EditRevenuePurchaseOrder()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$PONO = $this->request->getPost('txtPONO');
|
$PONO = $this->request->getPost('txtPONO');
|
||||||
$POdt = $this->request->getPost('PODate');
|
$POdt = $this->request->getPost('PODate');
|
||||||
$PODate = get_date_time_format($POdt);
|
$PODate = get_date_time_format($POdt);
|
||||||
@ -1446,6 +1444,7 @@ class Purchaseorder extends BaseController
|
|||||||
if ($SkipInsert == "False") {
|
if ($SkipInsert == "False") {
|
||||||
|
|
||||||
if (strlen((string)$POLineItemNo) == 0) {
|
if (strlen((string)$POLineItemNo) == 0) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$LineItemNo = $POLineItemNo;
|
$LineItemNo = $POLineItemNo;
|
||||||
@ -1454,10 +1453,12 @@ class Purchaseorder extends BaseController
|
|||||||
|
|
||||||
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO, $POLineItemNo, $POLineItemList);
|
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO, $POLineItemNo, $POLineItemList);
|
||||||
}
|
}
|
||||||
|
|
||||||
$isExists = $this->purchaseorder_model->LineItemExistsinRevenueTax($LineItemNo);
|
$isExists = $this->purchaseorder_model->LineItemExistsinRevenueTax($LineItemNo);
|
||||||
if (count($isExists) == 0) {
|
|
||||||
} else {
|
if (is_array($isExists) && count($isExists) == 0) {
|
||||||
|
|
||||||
|
} else {
|
||||||
$RevenueTaxList = array('DiscountType' => $DiscountType, 'DiscountValue' => $DiscountValue, 'AfterDiscount' => $AfterDiscount, 'PackagingType' => $PackagingType, 'PackagingValue' => $PackagingValue, 'PackagingCalulatedOn' => $PackagingOption, 'AfterPackagingValue' => $AfterPackagingValue, 'FreightType' => $FreightType, 'FreightValue' => $FreightValue, 'AfterFreightValue' => $AfterFreightValue, 'Insurance' => $InsuranceValue, 'TotalValue' => $TotalOrderValue, 'UpdateBY' => $updatedBy, 'UpdatedOn' => $updateddt, 'CGST' => $Cgst, 'AfterCGST' => $AfterCgst, 'SGST' => $Sgst, 'AfterSGST' => $AfterSgst, 'IGST' => $Igst, 'AfterIGST' => $AfterIgst, 'CreatedBy' => $updatedBy, 'NoOfTrip' => $NOOfTrip);
|
$RevenueTaxList = array('DiscountType' => $DiscountType, 'DiscountValue' => $DiscountValue, 'AfterDiscount' => $AfterDiscount, 'PackagingType' => $PackagingType, 'PackagingValue' => $PackagingValue, 'PackagingCalulatedOn' => $PackagingOption, 'AfterPackagingValue' => $AfterPackagingValue, 'FreightType' => $FreightType, 'FreightValue' => $FreightValue, 'AfterFreightValue' => $AfterFreightValue, 'Insurance' => $InsuranceValue, 'TotalValue' => $TotalOrderValue, 'UpdateBY' => $updatedBy, 'UpdatedOn' => $updateddt, 'CGST' => $Cgst, 'AfterCGST' => $AfterCgst, 'SGST' => $Sgst, 'AfterSGST' => $AfterSgst, 'IGST' => $Igst, 'AfterIGST' => $AfterIgst, 'CreatedBy' => $updatedBy, 'NoOfTrip' => $NOOfTrip);
|
||||||
$this->purchaseorder_model->updateRevenueTax($LineItemNo, $RevenueTaxList);
|
$this->purchaseorder_model->updateRevenueTax($LineItemNo, $RevenueTaxList);
|
||||||
}
|
}
|
||||||
@ -2156,7 +2157,7 @@ class Purchaseorder extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// echo $PONO;
|
// echo $PONO;
|
||||||
// echo $TotalOrder;
|
// echo $TotalOrder;
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ use App\Models\Requistion_model;
|
|||||||
class Servicepurchaseorder extends BaseController
|
class Servicepurchaseorder extends BaseController
|
||||||
{
|
{
|
||||||
protected $session;
|
protected $session;
|
||||||
protected $purchaseorder_model;
|
protected $purchaseorder_model;
|
||||||
protected $requistion_model;
|
protected $requistion_model;
|
||||||
protected $costcenter_model;
|
protected $costcenter_model;
|
||||||
/**
|
/**
|
||||||
@ -36,8 +36,8 @@ class Servicepurchaseorder extends BaseController
|
|||||||
$this->costcenter_model = new Costcenter_model();
|
$this->costcenter_model = new Costcenter_model();
|
||||||
$this->session = session();
|
$this->session = session();
|
||||||
helper('form'); //$this->load->library('form_validation');
|
helper('form'); //$this->load->library('form_validation');
|
||||||
|
|
||||||
|
|
||||||
$this->isLoggedIn();
|
$this->isLoggedIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ class Servicepurchaseorder extends BaseController
|
|||||||
$UOM = $result[$i]['UOM'];
|
$UOM = $result[$i]['UOM'];
|
||||||
$Quantity = $result[$i]['Quantity'];
|
$Quantity = $result[$i]['Quantity'];
|
||||||
$Rate = $result[$i]['Rate'];
|
$Rate = $result[$i]['Rate'];
|
||||||
$ReqDate = format_date($result[$i]['ReqDate'], 0,'d-m-Y');
|
$ReqDate = format_date($result[$i]['ReqDate'], 0, 'd-m-Y');
|
||||||
|
|
||||||
|
|
||||||
$HTML .= "<tr id='" . $SNo . "'>
|
$HTML .= "<tr id='" . $SNo . "'>
|
||||||
@ -113,7 +113,7 @@ class Servicepurchaseorder extends BaseController
|
|||||||
$Remarks = $this->request->getPost('Remarks');
|
$Remarks = $this->request->getPost('Remarks');
|
||||||
|
|
||||||
$updatedBy = $this->session->get('userId');
|
$updatedBy = $this->session->get('userId');
|
||||||
|
|
||||||
$updateddt = get_current_date_time();
|
$updateddt = get_current_date_time();
|
||||||
if ($WorkStatus == SERVICE_COMPLETED) {
|
if ($WorkStatus == SERVICE_COMPLETED) {
|
||||||
$POStatus = PO_SERVICE_COMPLETED;
|
$POStatus = PO_SERVICE_COMPLETED;
|
||||||
@ -150,7 +150,7 @@ class Servicepurchaseorder extends BaseController
|
|||||||
// To get the available Budget Amount
|
// To get the available Budget Amount
|
||||||
function AvilBudgetAmount()
|
function AvilBudgetAmount()
|
||||||
{
|
{
|
||||||
|
|
||||||
$CostCode = $this->request->getPost('id');
|
$CostCode = $this->request->getPost('id');
|
||||||
$ReqType = $this->request->getPost('type');
|
$ReqType = $this->request->getPost('type');
|
||||||
$FYStart = '';
|
$FYStart = '';
|
||||||
@ -164,7 +164,7 @@ class Servicepurchaseorder extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$FYdt = $FYStart . " - " . $FYEnd;
|
$FYdt = $FYStart . " - " . $FYEnd;
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
if ($ReqType == CAPITAL) {
|
if ($ReqType == CAPITAL) {
|
||||||
@ -206,7 +206,7 @@ class Servicepurchaseorder extends BaseController
|
|||||||
$SupplierReference = $this->request->getPost('addsupplierreference');
|
$SupplierReference = $this->request->getPost('addsupplierreference');
|
||||||
$SuppliersOfferNo = $this->request->getPost('addsupplierofferno');
|
$SuppliersOfferNo = $this->request->getPost('addsupplierofferno');
|
||||||
$OtherReferences = $this->request->getPost('addotherreference');
|
$OtherReferences = $this->request->getPost('addotherreference');
|
||||||
$Fincap = "";//$this->request->getPost('addfincap');
|
$Fincap = ""; //$this->request->getPost('addfincap');
|
||||||
$InsuranceOptions = $this->request->getPost('insuranceStatus');
|
$InsuranceOptions = $this->request->getPost('insuranceStatus');
|
||||||
$InsuranceNumber = $this->request->getPost('InsuranceNumber');
|
$InsuranceNumber = $this->request->getPost('InsuranceNumber');
|
||||||
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
|
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
|
||||||
@ -228,35 +228,35 @@ class Servicepurchaseorder extends BaseController
|
|||||||
|
|
||||||
$comma_separated = explode(':', (string)$DeletedRow);
|
$comma_separated = explode(':', (string)$DeletedRow);
|
||||||
|
|
||||||
|
|
||||||
$createddt = get_current_date_time();
|
$createddt = get_current_date_time();
|
||||||
|
|
||||||
$WorkStatus = $this->request->getPost('workstatus');
|
$WorkStatus = $this->request->getPost('workstatus');
|
||||||
$lastPONO = $this->purchaseorder_model->lastPONO();
|
$lastPONO = $this->purchaseorder_model->lastPONO();
|
||||||
$newPONO = generate_po_number($lastPONO);
|
$newPONO = generate_po_number($lastPONO);
|
||||||
$IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null;
|
$IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null;
|
||||||
$file = $this->request->getFile('POFile');
|
$file = $this->request->getFile('POFile');
|
||||||
$requestfilename = $file->getName();
|
$requestfilename = $file->getName();
|
||||||
if (!empty($requestfilename)) {
|
if (!empty($requestfilename)) {
|
||||||
|
|
||||||
if ($file->isValid() && !$file->hasMoved()) {
|
if ($file->isValid() && !$file->hasMoved()) {
|
||||||
$path = ROOTPATH.'public/uploads/POfiles/';
|
$path = ROOTPATH . 'public/uploads/POfiles/';
|
||||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
if (!is_dir($path)) {
|
||||||
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
|
mkdir($path, 0777, true);
|
||||||
log_message('error', 'File already exists in the database'.$requestfilename);
|
}
|
||||||
|
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
|
||||||
|
log_message('error', 'File already exists in the database' . $requestfilename);
|
||||||
|
$requestfilename = "";
|
||||||
|
} else {
|
||||||
|
$file->move($path, $requestfilename);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$requestfilename = "";
|
$requestfilename = "";
|
||||||
}
|
|
||||||
else{
|
|
||||||
$file->move($path, $requestfilename);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$requestfilename = "";
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// PO Master
|
// PO Master
|
||||||
$POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $WorkStatus, 'POType' => $POType, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => $DescriptionOfPo, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
|
$POList = array('PONO' => $newPONO, 'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $WorkStatus, 'POType' => $POType, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => $DescriptionOfPo, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'BudgetType' => $BudgetType, 'IsOpenOrder' => $IsOpenOrder);
|
||||||
$POList['POFile'] = $requestfilename;
|
$POList['POFile'] = $requestfilename;
|
||||||
$POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $ServiceTypeOptions);
|
$POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $ServiceTypeOptions);
|
||||||
$PONO = $POMaster ? $newPONO : "";
|
$PONO = $POMaster ? $newPONO : "";
|
||||||
@ -370,7 +370,7 @@ class Servicepurchaseorder extends BaseController
|
|||||||
$SupplierReference = $this->request->getPost('editsupplierreference');
|
$SupplierReference = $this->request->getPost('editsupplierreference');
|
||||||
$SuppliersOfferNo = $this->request->getPost('editsupplierofferno');
|
$SuppliersOfferNo = $this->request->getPost('editsupplierofferno');
|
||||||
$OtherReferences = $this->request->getPost('editotherreference');
|
$OtherReferences = $this->request->getPost('editotherreference');
|
||||||
$Fincap = "";//$this->request->getPost('editfincap');
|
$Fincap = ""; //$this->request->getPost('editfincap');
|
||||||
$InsuranceOptions = $this->request->getPost('insuranceStatus');
|
$InsuranceOptions = $this->request->getPost('insuranceStatus');
|
||||||
$InsuranceNumber = $this->request->getPost('InsuranceNumber');
|
$InsuranceNumber = $this->request->getPost('InsuranceNumber');
|
||||||
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
|
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
|
||||||
@ -391,9 +391,8 @@ class Servicepurchaseorder extends BaseController
|
|||||||
$updatedBy = $this->session->get('userId');
|
$updatedBy = $this->session->get('userId');
|
||||||
$RowCount = $this->request->getPost('txtRowCount');
|
$RowCount = $this->request->getPost('txtRowCount');
|
||||||
$DeletedRow = $this->request->getPost('txtDeletedRow');
|
$DeletedRow = $this->request->getPost('txtDeletedRow');
|
||||||
|
|
||||||
$comma_separated = explode(':', (string)$DeletedRow);
|
$comma_separated = explode(':', (string)$DeletedRow);
|
||||||
|
|
||||||
$updateddt = get_current_date_time();
|
$updateddt = get_current_date_time();
|
||||||
$WorkStatus = $this->request->getPost('workstatus');
|
$WorkStatus = $this->request->getPost('workstatus');
|
||||||
|
|
||||||
@ -402,31 +401,32 @@ class Servicepurchaseorder extends BaseController
|
|||||||
// $lastPONO = $this->purchaseorder_model->lastPONO();
|
// $lastPONO = $this->purchaseorder_model->lastPONO();
|
||||||
// $newPONO = generate_po_number($lastPONO);
|
// $newPONO = generate_po_number($lastPONO);
|
||||||
// PO Master
|
// PO Master
|
||||||
$POList = array('SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'UpdateBY' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $WorkStatus, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => $DescriptionOfPo, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
|
$POList = array('SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'UpdateBY' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $WorkStatus, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => $DescriptionOfPo, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'BudgetType' => $BudgetType, 'IsOpenOrder' => $IsOpenOrder);
|
||||||
if ($POStatus == 'ST026') {
|
if ($POStatus == 'ST026') {
|
||||||
$POList['ApprovedOn'] = get_current_date_time();
|
$POList['ApprovedOn'] = get_current_date_time();
|
||||||
$POList['ApprovedBy'] = $this->session->get('userId');
|
$POList['ApprovedBy'] = $this->session->get('userId');
|
||||||
$POList['ReleasedOn'] = get_current_date_time();
|
$POList['ReleasedOn'] = get_current_date_time();
|
||||||
$POList['ReleasedBy'] = $this->session->get('userId');
|
$POList['ReleasedBy'] = $this->session->get('userId');
|
||||||
}
|
}
|
||||||
$file = $this->request->getFile('POFile');
|
$file = $this->request->getFile('POFile');
|
||||||
$requestfilename = $file->getName();
|
$requestfilename = $file->getName();
|
||||||
if (!empty($requestfilename)) {
|
if (!empty($requestfilename)) {
|
||||||
if ($file && $file->isValid() && !$file->hasMoved()) {
|
if ($file && $file->isValid() && !$file->hasMoved()) {
|
||||||
$path = ROOTPATH.'public/uploads/POfiles/';
|
$path = ROOTPATH . 'public/uploads/POfiles/';
|
||||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
if (!is_dir($path)) {
|
||||||
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
|
mkdir($path, 0777, true);
|
||||||
log_message('error', 'File already exists in the database'.$requestfilename);
|
}
|
||||||
}
|
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
|
||||||
else{
|
log_message('error', 'File already exists in the database' . $requestfilename);
|
||||||
$file->move($path, $requestfilename);
|
} else {
|
||||||
$POList['POFile'] = $requestfilename;
|
$file->move($path, $requestfilename);
|
||||||
}
|
$POList['POFile'] = $requestfilename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO, $POList);
|
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO, $POList);
|
||||||
|
|
||||||
|
|
||||||
$LineItemStatus = REQITEM_NEW;
|
$LineItemStatus = REQITEM_NEW;
|
||||||
|
|
||||||
@ -559,13 +559,45 @@ class Servicepurchaseorder extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
if (trim((string)$POType) == SERVICE) {
|
if (trim((string)$POType) == SERVICE) {
|
||||||
|
// Check if LineItemExists() returns a valid array
|
||||||
$isExists = $this->purchaseorder_model->LineItemExists($LineItemNo);
|
$isExists = $this->purchaseorder_model->LineItemExists($LineItemNo);
|
||||||
if (is_array($isExists) && count($isExists) == 0) {
|
|
||||||
$ServiceTaxList = array('LineItemNo' => $LineItemNo, 'CGST' => $Cgst, 'After_CGST' => $AfterCgst, 'SGST' => $Sgst, 'After_SGST' => $AfterSgst, 'IGST' => $Igst, 'After_IGST' => $AfterIgst, 'TotalValue' => $TotalOrderValue, 'CreatedBy' => $updatedBy, 'CreatedDate' => $updateddt, 'otherallowance' => $OtherAmt);
|
// Ensure $isExists is an array, or initialize it as an empty array
|
||||||
|
if (!is_array($isExists)) {
|
||||||
|
$isExists = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($isExists) == 0) {
|
||||||
|
// Insert new service tax record
|
||||||
|
$ServiceTaxList = array(
|
||||||
|
'LineItemNo' => $LineItemNo,
|
||||||
|
'CGST' => $Cgst,
|
||||||
|
'After_CGST' => $AfterCgst,
|
||||||
|
'SGST' => $Sgst,
|
||||||
|
'After_SGST' => $AfterSgst,
|
||||||
|
'IGST' => $Igst,
|
||||||
|
'After_IGST' => $AfterIgst,
|
||||||
|
'TotalValue' => $TotalOrderValue,
|
||||||
|
'CreatedBy' => $updatedBy,
|
||||||
|
'CreatedDate' => $updateddt,
|
||||||
|
'otherallowance' => $OtherAmt
|
||||||
|
);
|
||||||
|
|
||||||
$this->purchaseorder_model->addServiceTax($ServiceTaxList);
|
$this->purchaseorder_model->addServiceTax($ServiceTaxList);
|
||||||
} else {
|
} else {
|
||||||
$ServiceTaxList1 = array('CGST' => $Cgst, 'After_CGST' => $AfterCgst, 'SGST' => $Sgst, 'After_SGST' => $AfterSgst, 'IGST' => $Igst, 'After_IGST' => $AfterIgst, 'TotalValue' => $TotalOrderValue, 'UpdateBY' => $updatedBy, 'UpdatedOn' => $updateddt, 'otherallowance' => $OtherAmt);
|
// Update existing service tax record
|
||||||
|
$ServiceTaxList1 = array(
|
||||||
|
'CGST' => $Cgst,
|
||||||
|
'After_CGST' => $AfterCgst,
|
||||||
|
'SGST' => $Sgst,
|
||||||
|
'After_SGST' => $AfterSgst,
|
||||||
|
'IGST' => $Igst,
|
||||||
|
'After_IGST' => $AfterIgst,
|
||||||
|
'TotalValue' => $TotalOrderValue,
|
||||||
|
'UpdateBY' => $updatedBy,
|
||||||
|
'UpdatedOn' => $updateddt,
|
||||||
|
'otherallowance' => $OtherAmt
|
||||||
|
);
|
||||||
|
|
||||||
$this->purchaseorder_model->updateServiceTax($LineItemNo, $ServiceTaxList1);
|
$this->purchaseorder_model->updateServiceTax($LineItemNo, $ServiceTaxList1);
|
||||||
}
|
}
|
||||||
@ -595,7 +627,7 @@ class Servicepurchaseorder extends BaseController
|
|||||||
$new_file_name = str_replace(" ", "", $new_file_name);
|
$new_file_name = str_replace(" ", "", $new_file_name);
|
||||||
|
|
||||||
if (!empty($new_file_name)) {
|
if (!empty($new_file_name)) {
|
||||||
|
|
||||||
$file = $this->request->getFile('file');
|
$file = $this->request->getFile('file');
|
||||||
if ($file && $file->isValid()) {
|
if ($file && $file->isValid()) {
|
||||||
$uploadPath = base_url() . 'public/uploads/BillFiles/';
|
$uploadPath = base_url() . 'public/uploads/BillFiles/';
|
||||||
@ -617,7 +649,7 @@ class Servicepurchaseorder extends BaseController
|
|||||||
|
|
||||||
/*-----------------------------------*/
|
/*-----------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -665,9 +697,9 @@ class Servicepurchaseorder extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function adfile()
|
public function adfile()
|
||||||
{
|
{
|
||||||
$picture = '';
|
$picture = '';
|
||||||
$file = $this->request->getFile('file');
|
$file = $this->request->getFile('file');
|
||||||
|
|
||||||
if ($file && $file->isValid()) {
|
if ($file && $file->isValid()) {
|
||||||
$uploadPath = base_url() . 'public/uploads/BillFiles/';
|
$uploadPath = base_url() . 'public/uploads/BillFiles/';
|
||||||
@ -678,6 +710,6 @@ class Servicepurchaseorder extends BaseController
|
|||||||
$picture = '';
|
$picture = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $picture;
|
return $picture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1012,12 +1012,12 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
|||||||
$subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.Per,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,LineItem.Quantity,ReceivedQuantity,Rate,LineItem.Status,(LineItem.Quantity *Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount,Dept.DepartmentName
|
$subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.Per,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,LineItem.Quantity,ReceivedQuantity,Rate,LineItem.Status,(LineItem.Quantity *Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount,Dept.DepartmentName
|
||||||
,TotalValue,CGST,After_CGST,SGST,After_SGST,IGST,After_IGST,otherallowance,LineItem.CostCenterCode,LineItem.ServiceFrequency,LineItem.ServiceMaterialDescription,Req.Schedule_Type,Req.NumberOfService,Req.Service_Period,ReqDet.MaterialDescription
|
,TotalValue,CGST,After_CGST,SGST,After_SGST,IGST,After_IGST,otherallowance,LineItem.CostCenterCode,LineItem.ServiceFrequency,LineItem.ServiceMaterialDescription,Req.Schedule_Type,Req.NumberOfService,Req.Service_Period,ReqDet.MaterialDescription
|
||||||
FROM t_purchaseorder_lineitem LineItem
|
FROM t_purchaseorder_lineitem LineItem
|
||||||
join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
left join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
||||||
join t_service_tax Tax on Tax.LineItemNo = LineItem.LineItemNo
|
left join t_service_tax Tax on Tax.LineItemNo = LineItem.LineItemNo
|
||||||
join t_requestion_master Req on Req.ReqNo = LineItem.ReqNo
|
left join t_requestion_master Req on Req.ReqNo = LineItem.ReqNo
|
||||||
join t_requestion_details ReqDet on ReqDet.ReqNo = LineItem.ReqNo and LineItem.MaterialCode = ReqDet.MaterialCode
|
left join t_requestion_details ReqDet on ReqDet.ReqNo = LineItem.ReqNo and LineItem.MaterialCode = ReqDet.MaterialCode
|
||||||
left join t_employee_details emp on Req.Requestedby = emp.EmpID
|
left join t_employee_details emp on Req.Requestedby = emp.EmpID
|
||||||
join t_departmentdetails Dept on Req.RequestedDept = Dept.DEPCode
|
left join t_departmentdetails Dept on Req.RequestedDept = Dept.DEPCode
|
||||||
where LineItem.PONO =?';
|
where LineItem.PONO =?';
|
||||||
|
|
||||||
$query = $this->db->query($subQuery, array($PONO));
|
$query = $this->db->query($subQuery, array($PONO));
|
||||||
|
|||||||
@ -3019,21 +3019,21 @@ if (!empty($getlogpodtl)) {
|
|||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
console.log(data);
|
// console.log(data);
|
||||||
// if (data) {
|
if (data) {
|
||||||
// // $('#content').loader('hide');
|
// $('#content').loader('hide');
|
||||||
// alert(data);
|
alert(data);
|
||||||
// $('#txtRowCount').val('');
|
$('#txtRowCount').val('');
|
||||||
// $('#txtDeletedRow').val('');
|
$('#txtDeletedRow').val('');
|
||||||
// $('#txtStatus').val('');
|
$('#txtStatus').val('');
|
||||||
// $('#SpcialInstruction').val('');
|
$('#SpcialInstruction').val('');
|
||||||
// $('#txtDeliveryAddress').val('')
|
$('#txtDeliveryAddress').val('')
|
||||||
// window.location = "purchaseorderListing";
|
window.location = "purchaseorderListing";
|
||||||
|
|
||||||
// } else {
|
} else {
|
||||||
// // $('#content').loader('hide');
|
// $('#content').loader('hide');
|
||||||
// alert("Error");
|
alert("Error");
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4000,18 +4000,12 @@ if (!empty($getlogpodtl)) {
|
|||||||
<td align="left">${Reqnumber}</td>
|
<td align="left">${Reqnumber}</td>
|
||||||
<td align="left">${materialCode}</td>
|
<td align="left">${materialCode}</td>
|
||||||
<td align="left">${materialName}</td>
|
<td align="left">${materialName}</td>
|
||||||
<td align="right">${quantity}</td>
|
<td align="left">${quantity}</td>
|
||||||
<td align="left">${uom}</td>
|
<td align="left">${uom}</td>
|
||||||
<td align="right">${itemRate}</td>
|
<td align="left">${itemRate}</td>
|
||||||
<td align="right">${PER}</td>
|
<td align="left">${basicval}</td>
|
||||||
<td align="right">${service_description}</td>
|
<td align="left">${TotalTaxValue}</td>
|
||||||
<td align="right">${basicval}</td>
|
<td align="left">${TotalOrderValue}</td>
|
||||||
<td align="right">${TotalTaxValue}</td>
|
|
||||||
<td align="right">${TotalOrderValue}</td>
|
|
||||||
<td align="right">${quantity}</td>
|
|
||||||
<td align="right">0</td>
|
|
||||||
<td align="right">${quantity}</td>
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<a data-target='#EDITREVENUE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
|
<a data-target='#EDITREVENUE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
|
||||||
<i class="ri-pencil-fill"></i>
|
<i class="ri-pencil-fill"></i>
|
||||||
@ -4891,18 +4885,18 @@ if (!empty($getlogpodtl)) {
|
|||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
// console.log(data);
|
console.log(data);
|
||||||
if (data) {
|
if (data) {
|
||||||
alert(data);
|
// alert(data);
|
||||||
$('#txtRowCount').val('');
|
// $('#txtRowCount').val('');
|
||||||
$('#txtDeletedRow').val('');
|
// $('#txtDeletedRow').val('');
|
||||||
$('#txtStatus').val('');
|
// $('#txtStatus').val('');
|
||||||
$('#SpcialInstruction').val('');
|
// $('#SpcialInstruction').val('');
|
||||||
$('#txtDeliveryAddress').val('')
|
// $('#txtDeliveryAddress').val('')
|
||||||
window.location = "purchaseorderListing";
|
// window.location = "purchaseorderListing";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
alert("Error");
|
alert("Something went wrong");
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1166,13 +1166,13 @@ if (!empty($getlogpodtl)) {
|
|||||||
|
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
|
|
||||||
<div align="right"><br>
|
<div align="right">
|
||||||
<div>
|
<div class="form-group col-md-3">
|
||||||
<input type="file" class="form-control" name="POFile" id="POFile">
|
<input type="file" class="form-control" name="POFile" id="POFile">
|
||||||
<?php if ($PrePOFile) { ?>
|
<?php if ($PrePOFile) { ?>
|
||||||
<label><a title="previously uploaded PO File" href="<?php echo base_url() . 'public/uploads/POfiles/' . $PrePOFile ?>"><span>previously uploaded - </span><small><?= $PrePOFile; ?></small></a></label>
|
<label><a title="previously uploaded PO File" href="<?php echo base_url() . 'public/uploads/POfiles/' . $PrePOFile ?>"><span>previously uploaded - </span><small><?= $PrePOFile; ?></small></a></label>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<input type="hidden" id="PrePOFile" name="PrePOFile" value="<?php echo $PrePOFile; ?>" /><br><br>
|
<input type="hidden" id="PrePOFile" name="PrePOFile" value="<?php echo $PrePOFile; ?>" />
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="txtPoRange" id="txtPoRange" />
|
<input type="hidden" name="txtPoRange" id="txtPoRange" />
|
||||||
<input type="hidden" name="isEdit" id="isEdit" value="0" />
|
<input type="hidden" name="isEdit" id="isEdit" value="0" />
|
||||||
@ -1211,10 +1211,8 @@ if (!empty($getlogpodtl)) {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row p-3" align="left" style="padding-right:10px">
|
<div class="form-group col-md-12" align="left" style="padding-right:10px">
|
||||||
|
<div class="col-md-5 col-md-offset-7" align="left"><br />
|
||||||
<div class="col-md-5 col-md-offset-7" align="right"><br />
|
|
||||||
<br><br>
|
|
||||||
<label>Request On :</label><?php echo $Reqon; ?><br />
|
<label>Request On :</label><?php echo $Reqon; ?><br />
|
||||||
<label>Request By :</label><?php echo $RequesterName; ?><br />
|
<label>Request By :</label><?php echo $RequesterName; ?><br />
|
||||||
<label>Status : </label><?php
|
<label>Status : </label><?php
|
||||||
|
|||||||
@ -315,7 +315,7 @@ if (empty($Status)) {
|
|||||||
/* MSG*/
|
/* MSG*/
|
||||||
var answer = confirm(strMsg);
|
var answer = confirm(strMsg);
|
||||||
if (answer) {
|
if (answer) {
|
||||||
$('#content').loader('show');
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {
|
data: {
|
||||||
PONO: PO,
|
PONO: PO,
|
||||||
@ -326,7 +326,7 @@ if (empty($Status)) {
|
|||||||
url: "<?php echo base_url() ?>purchaseorder/ReleasePO",
|
url: "<?php echo base_url() ?>purchaseorder/ReleasePO",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#content').loader('hide');
|
$('#loader').hide();
|
||||||
alert(data);
|
alert(data);
|
||||||
location.reload();
|
location.reload();
|
||||||
} else {
|
} else {
|
||||||
@ -388,7 +388,7 @@ if (empty($Status)) {
|
|||||||
$("#txtSpcialInstruction").val('');
|
$("#txtSpcialInstruction").val('');
|
||||||
$('#AlertImg').attr("style", "display:none;");
|
$('#AlertImg').attr("style", "display:none;");
|
||||||
|
|
||||||
$('#content').loader('show');
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {
|
data: {
|
||||||
id: ReqId
|
id: ReqId
|
||||||
@ -397,8 +397,8 @@ if (empty($Status)) {
|
|||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
url: "<?php echo base_url() ?>requisitionform/ViewRequest",
|
url: "<?php echo base_url() ?>requisitionform/ViewRequest",
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
// success:function(data) {
|
|
||||||
$('#content').loader('hide');
|
$('#loader').hide();
|
||||||
//alert(data);
|
//alert(data);
|
||||||
$("#ReqType").val(json.Requist[0]['ReqType']);
|
$("#ReqType").val(json.Requist[0]['ReqType']);
|
||||||
$("#ReqBy").val(json.Requist[0]['Requestedby']);
|
$("#ReqBy").val(json.Requist[0]['Requestedby']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user