CHANGE_TRACKER_ISSUE_5

This commit is contained in:
aadhavan valli 2024-09-17 18:29:16 +05:30
parent be86795246
commit 4fd1e396fc
21 changed files with 2951 additions and 2984 deletions

View File

@ -31,9 +31,8 @@ class Amendmentpurchaseorder extends BaseController
$this->costcenter_model = new Costcenter_model();
$this->session = session();
// $this->session = \CodeIgniter\Config\Factories::libraries('session');
helper(['form']);
helper(['form']);
$this->isLoggedIn();
}
/**
@ -210,7 +209,7 @@ class Amendmentpurchaseorder extends BaseController
*/
function EditRevenuePurchaseOrder()
{
// print_r($this->request->getPost());die;
$NewPO = '';
$MAD = '';
$PONO = $this->request->getPost('txtPONO');
@ -232,12 +231,11 @@ class Amendmentpurchaseorder extends BaseController
$Deliverydt = get_date_time_format($dt);
$DeliverySchedule = '';
}
$Modeofshipment = $this->request->getPost('addmodeofshipment');
$supplierreference = $this->request->getPost('amendsupplierreference');
$supplieroffno = $this->request->getPost('amendsupplierofferno');
$otherreference = $this->request->getPost('amendotherreference');
$fincap = "";//$this->request->getPost('amendfincap');
$fincap = ""; //$this->request->getPost('amendfincap');
$revenuetype = $this->request->getPost('PoTypeOptions');
$insurancestatus = $this->request->getPost('insurancestatus');
if ($insurancestatus == 1) {
@ -289,31 +287,39 @@ class Amendmentpurchaseorder extends BaseController
}
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
$POMaster = array('PONO' =>$AmendmentNewPoNo,'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'PORange' => $PoRange, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => PO_RELEASED, 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Reference' => $supplierreference, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $revenuetype, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpecialInstruction, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'IsQualityChkReqired' => $qtycheckresult);
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'PORange' => $PoRange, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => PO_RELEASED, 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Reference' => $supplierreference, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $revenuetype, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpecialInstruction, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'IsQualityChkReqired' => $qtycheckresult);
$file = $this->request->getFile('POFile');
$requestfilename = $file->getName();
$PrePOFile = $this->request->getPost('PrePOFile');
$PrePOFile = $this->request->getPost('PrePOFile');
if (!empty($requestfilename)) {
if ($file && $file->isValid() && !$file->hasMoved()) {
$path = ROOTPATH.'public/uploads/POfiles/';
if(!is_dir($path)) { mkdir($path, 0777, true); }
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
log_message('error', 'File already exists in the database'.$requestfilename);
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
else{
$file->move($path, $requestfilename);
$POMaster['POFile'] = $requestfilename;
}
}else{
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
$path = ROOTPATH . 'public/uploads/POfiles/';
if (!is_dir($path)) {
mkdir($path, 0777, true);
}
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
log_message('error', 'File already exists in the database' . $requestfilename);
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
} else {
$file->move($path, $requestfilename);
$POMaster['POFile'] = $requestfilename;
}
} else {
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
} else {
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
// print_r($POMaster);die;
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
// dd($LastPO);
if(!empty($LastPO)){
if (count($LastPO) > 0) {
$NewPO = $LastPO[0]['PONO'];
}
}else{
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
if (count($LastPO) > 0) {
$NewPO = $LastPO[0]['PONO'];
$NewPO = "";
}
$PODetail = array('Status' => PO_AMENDED); //TO SET PARENT PO AS AMENDMENT STATUS
@ -611,7 +617,7 @@ class Amendmentpurchaseorder extends BaseController
$SupplierReference = $this->request->getPost('amendsupplierreference');
$SuppliersOfferNo = $this->request->getPost('amendsupplierofferno');
$OtherReferences = $this->request->getPost('amendotherreference');
$Fincap = "";//$this->request->getPost('amendfincap');
$Fincap = ""; //$this->request->getPost('amendfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
$InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
@ -623,7 +629,7 @@ class Amendmentpurchaseorder extends BaseController
$updatedBy = $this->session->get('userId');
$RowCount = $this->request->getPost('txtRowCount');
$updateddt = get_current_date_time();
$WorkStatus = $this->request->getPost('workstatus');
@ -642,27 +648,28 @@ class Amendmentpurchaseorder extends BaseController
}
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
$POMaster = array('PONO' =>$AmendmentNewPoNo,'ParentPO' => $PONO, 'POType' => $POType, 'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => PO_RELEASED, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $scopeofwork, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $updateddt, 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'ServiceWorkStatus' => $WorkStatus, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => strip_tags((string)$DescriptionOfPo), 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult);
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'POType' => $POType, 'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => PO_RELEASED, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $scopeofwork, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $updateddt, 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'ServiceWorkStatus' => $WorkStatus, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => strip_tags((string)$DescriptionOfPo), 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult);
$file = $this->request->getFile('POFile');
$PrePOFile = $this->request->getPost('PrePOFile');
$requestfilename = $file->getName();
$requestfilename = $file->getName();
if (!empty($requestfilename)) {
if ($file && $file->isValid() && !$file->hasMoved()) {
$path = ROOTPATH.'public/uploads/POfiles/';
if(!is_dir($path)) { mkdir($path, 0777, true); }
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
log_message('error', 'File already exists in the database'.$requestfilename);
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
else{
$file->move($path, $requestfilename);
$POMaster['POFile'] = $requestfilename;
}
}else{
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
}else{
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
if ($file && $file->isValid() && !$file->hasMoved()) {
$path = ROOTPATH . 'public/uploads/POfiles/';
if (!is_dir($path)) {
mkdir($path, 0777, true);
}
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
log_message('error', 'File already exists in the database' . $requestfilename);
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
} else {
$file->move($path, $requestfilename);
$POMaster['POFile'] = $requestfilename;
}
} else {
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
} else {
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
@ -892,7 +899,7 @@ class Amendmentpurchaseorder extends BaseController
$SupplierReference = $this->request->getPost('amendsupplierreference');
$SuppliersOfferNo = $this->request->getPost('amendsupplierofferno');
$OtherReferences = $this->request->getPost('amendotherreference');
$Fincap = "";//$this->request->getPost('amendfincap');
$Fincap = ""; //$this->request->getPost('amendfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
$InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
@ -962,32 +969,33 @@ class Amendmentpurchaseorder extends BaseController
}
$updatedBy = $this->session->get('userId');
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
$POMaster = array('PONO' =>$AmendmentNewPoNo,'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'TotalOrderValue' => $FinalTotalOrder, 'POType' => $POType, 'PODate' => $PODate, 'Status' => PO_RELEASED, 'CapitalRange' => $PoRange, 'ExchangeRate' => $ExchangeRate, 'ExchangeRateCalculatedon' => $ExchangeRateOn, 'PaymentTerms' => $PaymentMethod, 'PaymentOtherDescription' => $Otherpayment, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'CurrencyType' => $currencytypeID, 'AmendedDetails' => $MAD, 'Import_DispatchDetails' => $curdispatch, 'Import_PlaceofOrgin' => $PlaceOforigin, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult);
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'TotalOrderValue' => $FinalTotalOrder, 'POType' => $POType, 'PODate' => $PODate, 'Status' => PO_RELEASED, 'CapitalRange' => $PoRange, 'ExchangeRate' => $ExchangeRate, 'ExchangeRateCalculatedon' => $ExchangeRateOn, 'PaymentTerms' => $PaymentMethod, 'PaymentOtherDescription' => $Otherpayment, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'CurrencyType' => $currencytypeID, 'AmendedDetails' => $MAD, 'Import_DispatchDetails' => $curdispatch, 'Import_PlaceofOrgin' => $PlaceOforigin, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult);
$file = $this->request->getFile('POFile');
$requestfilename = $file->getName();
$requestfilename = $file->getName();
$PrePOFile = $this->request->getPost('PrePOFile');
if (!empty($requestfilename)) {
if ($file && $file->isValid() && !$file->hasMoved()) {
$path = ROOTPATH.'public/uploads/POfiles/';
if(!is_dir($path)) { mkdir($path, 0777, true); }
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
log_message('error', 'File already exists in the database'.$requestfilename);
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
else{
$file->move($path, $requestfilename);
$POMaster['POFile'] = $requestfilename;
}
}else{
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
}else{
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
if ($file && $file->isValid() && !$file->hasMoved()) {
$path = ROOTPATH . 'public/uploads/POfiles/';
if (!is_dir($path)) {
mkdir($path, 0777, true);
}
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
log_message('error', 'File already exists in the database' . $requestfilename);
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
} else {
$file->move($path, $requestfilename);
$POMaster['POFile'] = $requestfilename;
}
} else {
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
} else {
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $CreateBy, $PONO);
if (count($LastPO) > 0) {
$NewPO = $LastPO[0]['PONO'];
}
@ -1309,11 +1317,11 @@ class Amendmentpurchaseorder extends BaseController
$CreateBy = $this->session->get('userId');
$RowCount = $this->request->getPost('txtRowCount');
$createddt = get_current_date_time();
$updateddt = get_current_date_time();
$PaymentTerms = $this->request->getPost('PaymentTerms');
$beforePaymentTerms = $this->request->getPost('beforePaymentterms');
@ -1322,7 +1330,7 @@ class Amendmentpurchaseorder extends BaseController
$SupplierRef = $this->request->getPost('amendsupplierreference');
$SupplierOffer = $this->request->getPost('amendsupplierofferno');
$otherRef = $this->request->getPost('amendotherreference');
$finCap = "";//$this->request->getPost('amendfincap');
$finCap = ""; //$this->request->getPost('amendfincap');
$OtherPayment = $this->request->getPost('Otherpayment');
@ -1358,36 +1366,37 @@ class Amendmentpurchaseorder extends BaseController
$MAD .= $MAD . "Current Place of Origin:&nbsp;&nbsp;" . $beforePalaceoforigin . "<br>";
}
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
$POMaster = array('PONO' =>$AmendmentNewPoNo,'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, '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, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'AmendedDetails' => $MAD, 'PaymentOtherDescription' => $OtherPayment, 'InsuranceStatus' => $insurestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $qtycheckresult);
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, '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, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'AmendedDetails' => $MAD, 'PaymentOtherDescription' => $OtherPayment, 'InsuranceStatus' => $insurestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $qtycheckresult);
$file = $this->request->getFile('POFile');
$requestfilename = $file->getName();
$requestfilename = $file->getName();
$PrePOFile = $this->request->getPost('PrePOFile');
if (!empty($requestfilename)) {
if ($file && $file->isValid() && !$file->hasMoved()) {
$path = ROOTPATH.'public/uploads/POfiles/';
if(!is_dir($path)) { mkdir($path, 0777, true); }
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
log_message('error', 'File already exists in the database'.$requestfilename);
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
else{
$file->move($path, $requestfilename);
$POMaster['POFile'] = $requestfilename;
}
}else{
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
}else{
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
if ($file && $file->isValid() && !$file->hasMoved()) {
$path = ROOTPATH . 'public/uploads/POfiles/';
if (!is_dir($path)) {
mkdir($path, 0777, true);
}
if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
log_message('error', 'File already exists in the database' . $requestfilename);
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
} else {
$file->move($path, $requestfilename);
$POMaster['POFile'] = $requestfilename;
}
} else {
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
} else {
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $CreateBy, $PONO);
$NewPO = '';
// if (count($LastPO) > 0) {
// $NewPO = $LastPO[0]['PONO'];
// }
foreach ($LastPO as $PO) :
$NewPO = $PO['PONO'];
endforeach;
foreach ($LastPO as $PO) :
$NewPO = $PO['PONO'];
endforeach;
$PODetail = array('Status' => PO_AMENDED); //TO SET PARENT PO AS AMENDMENT STATUS
$APO = $this->purchaseorder_model->updateAmendPOMaster($PONO, $PODetail);
@ -1635,5 +1644,4 @@ class Amendmentpurchaseorder extends BaseController
echo 'Purchase Order is' . $PONO . 'Amended Successfully! New PO Number is: ' . $NewPO;
}
}

View File

@ -321,9 +321,9 @@ class Inwardgateregister extends BaseController
$IsThisOpenOrderPO = $this->request->getPost('hiddenIsOpenOrder');
$DeliveryChellanOrInvoiceNo = $this->request->getPost('InvoiceNo');
$DeliveryChellan = (string)$this->request->getPost('InvoiceDate');
$DeliveryChellanDate = get_date_time_format($DeliveryChellan);
$DeliveryChellanDate = get_date_time_format_new($DeliveryChellan);
$Mat_Rcvd_Dt = (string)$this->request->getPost('MaterialRcvdDate');
$MaterialRcvdDt = get_date_time_format($Mat_Rcvd_Dt);
$MaterialRcvdDt = get_date_time_format_new($Mat_Rcvd_Dt);
$VehicleNo = $this->request->getPost('VehicleNo');
$TransporterId = $this->request->getPost('TransporterId');
$DriverName = $this->request->getPost('DriverName');

View File

@ -634,7 +634,8 @@ class Purchaseorder extends BaseController
//$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019');
$data['WorkStatus'] = $this->purchaseorder_model->getStatus(7);
//print_r($data);die;
// echo "<pre>";
// print_r($data);die;
$this->global['pageTitle'] = 'Edit Service Purchase order form';
$this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL);
} else if ($ReqType == REVENUE) {
@ -1212,6 +1213,8 @@ class Purchaseorder extends BaseController
//This used to Edit the Revenue Purchase Order
function EditRevenuePurchaseOrder()
{
$PONO = $this->request->getPost('txtPONO');
$POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt);

View File

@ -347,6 +347,7 @@ class Servicepurchaseorder extends BaseController
$newSupId = preg_split('[-]', (string)$newsup);
$POdt = $this->request->getPost('PODate');
// print_r($this->request->getPost());die;
$PODate = get_date_time_format($POdt);
/*-----------------------------------*/
$b4supplier = $this->request->getPost('b4supplier');

View File

@ -26,12 +26,20 @@ if (!function_exists('get_current_date')) {
if (!function_exists('get_date_time_format')) {
function get_date_time_format($val)
{
$date = new \DateTime($val, new \DateTimeZone('Asia/Kolkata'));
$date = new \DateTime($val, timezone: new \DateTimeZone('Asia/Kolkata'));
return $date->format('Y-m-d H:i:s');
}
}
if (!function_exists('get_date_time_format_new')) {
function get_date_time_format_new($val)
{
$date = \DateTime::createFromFormat('d/m/Y', $val, new \DateTimeZone('Asia/Kolkata'));
return $date->format('Y-m-d H:i:s');
}
}
if (!function_exists('get_date_format')) {
function get_date_format($DateValue)
{

View File

@ -39,7 +39,7 @@ class Monthlypay_model extends Model
// $this->db->where('t_employee_details.DateofJoining <=',$lastdate);
// $this->db->where('Month_Year',$current);
$sql = "select t_monthly_pay_inputs.*,t_employee_details.FirstName,t_employee_details.LastName,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_payroll.Key
$sql = "select t_monthly_pay_inputs.*,t_employee_details.FirstName,t_employee_details.LastName,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_payroll.Id
from t_monthly_pay_inputs
left join t_employee_details on t_monthly_pay_inputs.EmpID=t_employee_details.EmpID and t_employee_details.DateofJoining <= ?
left join t_payroll on t_monthly_pay_inputs.EmpID=t_payroll.EmpID
@ -100,7 +100,7 @@ class Monthlypay_model extends Model
//echo $lastdate;
//left join t_payroll on t_employee_details.EmpID = t_payroll.EmpID and month(t_payroll.PayOn) = month(?) and year(t_payroll.PayOn) = year(?)
$sql = "select t_emp_pay_data.EmpID,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.DateofJoining,t_employee_details.Designation,t_employee_details.esi_applicable,t_employee_details.pf_applicable,t_employee_details.is_management_team,t_attendance.Days_Worked as Days_worked,t_attendance.Absent as LOP_Days,t_attendance.Paid_Leave as Paid_leave,t_attendance.Total_OTHrs as OT_Hrs_Worked,t_attendance.NoofDays,t_attendance.sunday_count,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,t_loan_master.Loan_Amount,t_loan_master.Paid_Amount,t_payroll.Key,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount
$sql = "select t_emp_pay_data.EmpID,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.DateofJoining,t_employee_details.Designation,t_employee_details.esi_applicable,t_employee_details.pf_applicable,t_employee_details.is_management_team,t_attendance.Days_Worked as Days_worked,t_attendance.Absent as LOP_Days,t_attendance.Paid_Leave as Paid_leave,t_attendance.Total_OTHrs as OT_Hrs_Worked,t_attendance.NoofDays,t_attendance.sunday_count,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,t_loan_master.Loan_Amount,t_loan_master.Paid_Amount,t_payroll.Id,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount
from t_emp_pay_data
left join t_employee_details on t_employee_details.EmpID = t_emp_pay_data.EmpID
left join t_payroll on t_employee_details.EmpID = t_payroll.EmpID and t_payroll.PayOn = ?

View File

@ -829,13 +829,16 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
$insert_id = $this->db->affectedRows();
$this->db->transComplete();
// print_r($insert_id);die;
if ($insert_id > 0) {
$subQuery = 'select PONO from t_purchaseorder_master where CreatedBy=? and ParentPO=? order by CreatedDate desc limit 1';
$query = $this->db->query($subQuery, array($CreatedBy, $ParentPO));
return $query->getResultArray();
}else{
return false;
}
}

View File

@ -1,44 +1,52 @@
<!-- In this purchase order listing , datatable is used for sorting , pagination and etc.. , new design is used for table fro the theme-->
<style>
.pagination {
margin: 0px !important;
}
.pagination {
margin: 0px !important;
}
</style>
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px; /* Adjust the gap as needed */
}
.Date-filter-form input, .Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
th, td {
white-space: nowrap;
}
</style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
th,
td {
white-space: nowrap;
}
</style>
<div class="content-page">
@ -53,12 +61,12 @@
<h4 class="page-title">Amendment Purchase Order List</h4>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
<input type="hidden" name="table" value="requisition">
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
@ -66,9 +74,9 @@
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</form>
<div class="card-body">
<table id="amend_po_list" class="table dt-responsive nowrap w-100">
<table id="amend_po_list" class="table dt-responsive wrap w-100">
<thead>
<tr>
<!-- <th>#</th> -->
@ -85,76 +93,76 @@
</tr>
</thead>
<tbody>
<?php
if (!empty($POData)) {
$index = 0;
foreach ($POData as $record) {
$index = $index + 1;
?>
<tr id="<?php echo $index; ?>">
<!-- <td align="left"><?php echo $index; ?></td> -->
<td align="right"><?php $Pdt = new DateTime($record->PODate);
<?php
if (!empty($POData)) {
$index = 0;
foreach ($POData as $record) {
$index = $index + 1;
?>
<tr id="<?php echo $index; ?>">
<!-- <td align="left"><?php echo $index; ?></td> -->
<td><?php $Pdt = new DateTime($record->PODate);
$PODate = $Pdt->format('d-m-Y');
echo $PODate
?></td>
<td><?php echo $record->PONO ?></td>
<td><?php echo $record->ReqType ?></td>
<td><?php echo $record->SupplierName ?></td>
<td align="right"><?php echo $record->TotalOrderValue ?></td>
<td><?php echo $record->PONO ?></td>
<td><?php echo $record->ReqType ?></td>
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->TotalOrderValue ?></td>
<!-- <td><?php echo $record->StatusName ?></td> -->
<td><?php
$statusMappings = [
'PO APPROVED' => 'AWAITING APPROVE',
'AWAITING RELEASE' => 'AWAITING APPROVE',
'RELEASER ONHOLD' => 'APPROVER ONHOLD',
'PO RELEASED' => 'PO APPROVED',
];
if (isset($record->StatusName) && !empty($record->StatusName)) {
if (isset($statusMappings[$record->StatusName])) {
echo $statusMappings[$record->StatusName];
} else {
echo $record->StatusName;
}
} else {
echo "Status not provided";
<!-- <td><?php echo $record->StatusName ?></td> -->
<td><?php
$statusMappings = [
'PO APPROVED' => 'AWAITING APPROVE',
'AWAITING RELEASE' => 'AWAITING APPROVE',
'RELEASER ONHOLD' => 'APPROVER ONHOLD',
'PO RELEASED' => 'PO APPROVED',
];
if (isset($record->StatusName) && !empty($record->StatusName)) {
if (isset($statusMappings[$record->StatusName])) {
echo $statusMappings[$record->StatusName];
} else {
echo $record->StatusName;
}
} else {
echo "Status not provided";
}
?>
</td>
<td><?php $option = 'By Deliver Date';
if ($record->DeliveryOption == 1) {
$option = "By Schedule";
} else if ($record->DeliveryOption == 2) {
$option = "By Dispatch Instruction";
}
echo $option ?></td>
<td><?php
if ($record->DeliveryOption == 0) {
$Ddt = new DateTime($record->DeliveryDate);
$Deliverydt = $Ddt->format('d-m-Y');
echo $Deliverydt;
} else if ($record->DeliveryOption == 1) {
$Deliverydt = '';
echo $Deliverydt;
} ?></td>
<td><?php echo $record->DeliverySchedule ?></td>
<td> <a data-toggle="tooltip" href="<?php echo base_url() . 'EditAmendPO?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType . '&CapitalRange=' . $record->CapitalRange; ?>"><i class="fas fa-pencil-alt" data-toggle="tooltip" title="<?php echo $record->PONO; ?> - Click here to Edit Purchase Order details"></i>&nbsp;&nbsp;&nbsp;</a>
<a data-toggle="tooltip" href="<?php echo base_url() . 'EditAmendPO?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType . '&CapitalRange=' . $record->CapitalRange; ?>"> &nbsp;&nbsp;&nbsp; <a data-toggle="tooltip" href="<?php echo base_url() . 'purchaseorder/CreatePOPrint?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType; ?>"><i class="fa fa-print" data-toggle="tooltip" title="<?php echo $record->PONO; ?> - Click here to Print the Purchase Order details"></i>&nbsp;&nbsp;&nbsp;</a>
</td>
<?php
} ?>
</tr>
<?php
}
?>
</td>
<td><?php $option = 'By Deliver Date';
if ($record->DeliveryOption == 1) {
$option = "By Schedule";
} else if ($record->DeliveryOption == 2) {
$option = "By Dispatch Instruction";
}
echo $option ?></td>
<td align="right"><?php
if ($record->DeliveryOption == 0) {
$Ddt = new DateTime($record->DeliveryDate);
$Deliverydt = $Ddt->format('d-m-Y');
echo $Deliverydt;
} else if ($record->DeliveryOption == 1) {
$Deliverydt = '';
echo $Deliverydt;
} ?></td>
<td><?php echo $record->DeliverySchedule ?></td>
<td> <a data-toggle="tooltip" href="<?php echo base_url() . 'EditAmendPO?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType . '&CapitalRange=' . $record->CapitalRange; ?>"><i class="fas fa-pencil-alt" data-toggle="tooltip" title="<?php echo $record->PONO; ?> - Click here to Edit Purchase Order details"></i>&nbsp;&nbsp;&nbsp;</a>
<a data-toggle="tooltip" href="<?php echo base_url() . 'EditAmendPO?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType . '&CapitalRange=' . $record->CapitalRange; ?>"> &nbsp;&nbsp;&nbsp; <a data-toggle="tooltip" href="<?php echo base_url() . 'purchaseorder/CreatePOPrint?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType; ?>"><i class="fa fa-print" data-toggle="tooltip" title="<?php echo $record->PONO; ?> - Click here to Print the Purchase Order details"></i>&nbsp;&nbsp;&nbsp;</a>
</td>
<?php
} ?>
</tr>
<?php
}
?>
?>
</tbody>
</table>
</div> <!-- end card body-->
@ -187,85 +195,96 @@
</script> -->
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
});
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
});
$(document).ready(function() {
// Initialize the DataTable
var table = $('#amend_po_list').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
],
pageLength: 10, // Default rows per page
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
responsive: true, // Responsive table
order: [], // Default ordering (column index 0, descending)
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
$(document).ready(function() {
$(document).on('click', '.text-truncate', function() {
$(this).toggleClass('expanded');
});
// Initialize the DataTable
var table = $('#amend_po_list').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
],
pageLength: 10, // Default rows per page
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
], // Rows per page options
responsive: true, // Responsive table
order: [], // Default ordering (column index 0, descending)
columnDefs: [{
targets: '_all',
className: 'text-truncate'
}, // Apply truncation to all columns
],
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
}
});
});
// Date range filter function
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $('#fromDate').val();
var toDate = $('#toDate').val();
if (!fromDate || !toDate) {
return true; // If no dates selected, don't filter
// Date range filter function
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $('#fromDate').val();
var toDate = $('#toDate').val();
if (!fromDate || !toDate) {
return true; // If no dates selected, don't filter
}
var dateStr = data[0]; // Assuming the date is in the first column
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
var startDate = new Date(fromDate);
var endDate = new Date(toDate);
// Adjust startDate to include the day before the selected fromDate
startDate.setDate(startDate.getDate() - 1);
// Ensure endDate includes the entire end date by setting time to the end of the day
endDate.setHours(23, 59, 59, 999);
// Return true if the date is within the range
return date >= startDate && date <= endDate;
}
var dateStr = data[0]; // Assuming the date is in the first column
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
var startDate = new Date(fromDate);
var endDate = new Date(toDate);
// Adjust startDate to include the day before the selected fromDate
startDate.setDate(startDate.getDate() - 1);
// Ensure endDate includes the entire end date by setting time to the end of the day
endDate.setHours(23, 59, 59, 999);
);
// Return true if the date is within the range
return date >= startDate && date <= endDate;
}
);
// Handle form submission for the date range filter
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw(); // Redraw the table to apply the filter
});
// Handle form submission for the date range filter
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw(); // Redraw the table to apply the filter
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").val('');
$("#toDate").val('');
table.draw(); // Redraw the table to clear the filter
});
// Automatically focus and open the To Date picker when From Date is selected
document.getElementById('fromDate').addEventListener('change', function() {
var fromDate = this.value;
var toDateInput = document.getElementById('toDate');
// Set the min attribute of the To Date input to the selected From Date
toDateInput.min = fromDate;
// Optionally reset the To Date input if the current value is before the new min date
if (toDateInput.value < fromDate) {
toDateInput.value = fromDate;
}
});
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").val('');
$("#toDate").val('');
table.draw(); // Redraw the table to clear the filter
});
// Automatically focus and open the To Date picker when From Date is selected
document.getElementById('fromDate').addEventListener('change', function() {
var fromDate = this.value;
var toDateInput = document.getElementById('toDate');
// Set the min attribute of the To Date input to the selected From Date
toDateInput.min = fromDate;
// Optionally reset the To Date input if the current value is before the new min date
if (toDateInput.value < fromDate) {
toDateInput.value = fromDate;
}
});
});
</script>

View File

@ -759,7 +759,7 @@ if (!empty($getlogpodtl)) {
<?php } else { ?>
<h4><?= "Amended Service Purchase Order - $PONO "; ?></h4>
<?php } ?>
<a href="<?php echo base_url() ?>purchaseorderListing" class="btn btn-success" id="back" value="Back">Back</a>
<a href="<?php echo base_url() ?>purchaseorderListing" class="btn btn-secondary" id="back" value="Back">Back</a>
</div>
</div>
</div>
@ -1197,7 +1197,8 @@ if (!empty($getlogpodtl)) {
<?php
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == SPECIAL_PO) { ?>
<td> <a data-target='#EDITSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->ReqNo; ?> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
<td> <a data-target='#EDITSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" title="Click here to view/Edit the . <?php echo $record->ReqNo; ?> .Requisition details"></i></a>
<a href='#' onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
<?php
} else { ?>
<td> <a data-target='#VIEWSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWSERVICE"><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->ReqNo; ?> - Click here to view Requistion details"></i>&nbsp;&nbsp;&nbsp;</a> </td>
@ -1436,7 +1437,7 @@ if (!empty($getlogpodtl)) {
<input type="hidden" id="PrePOFile" name="PrePOFile" value="<?php echo $PrePOFile; ?>" /><br>
</div> <input type="hidden" name="txtPONO" id="txtPONO" value="<?php echo $PONO; ?>" />
<input type="hidden" name="txtStatus" id="txtStatus" />
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index; ?>">
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php if(isset($index)){ echo $index; }?>">
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
<input type="hidden" name="Budget" id="Budget" value="<?php echo $BudgetType; ?>" />
@ -1460,11 +1461,11 @@ if (!empty($getlogpodtl)) {
</div>
<label>Request On : </label><?php echo $Reqon; ?><br />
<?php if ($RequesterName != '' || $RequesterName != null) { ?>
<label>Request On : </label><?php if(isset($Reqon)){ echo $Reqon; } ?><br />
<?php if(isset($RequesterName)){ if ($RequesterName != '' || $RequesterName != null) { ?>
<label>Request By : </label><?php echo $RequesterName; ?><br />
<?php
} ?>
}} ?>
<!-- <label>Status : </label><?php echo $StatusName; ?> -->
<label>Status : </label><?php
$statusMappings = [
@ -2023,7 +2024,7 @@ if (!empty($getlogpodtl)) {
</div>
<div class="modal-footer">
<div class="form-row">
<a class="btn btn-success" data-dismiss="modal" value="Cancel">Cancel</a>
<a class="btn btn-success" data-dismiss="modal" value="Cancel" style="margin:10px;">Cancel</a>
<a class="btn btn-success font EditService" ID="Edit">&nbsp;&nbsp;<span class="bold">Update Service</span></a>
</div>
</div>
@ -2336,7 +2337,7 @@ if (!empty($getlogpodtl)) {
</tr>
</script> -->
<script>
var index = <?php echo $index; ?>;
var index = <?php if(isset($index)){ echo $index; } ?>;
var userid = '';
var SelectedMaterialCode = [];
var CollIndex = 0;
@ -2512,9 +2513,7 @@ $('#ServiceAppend').append(rowHtml);
}
$('.EditService').click(function() {
tinyMCE.triggerSave();
if (validateEditServiceTax()) {
var CostCode = $("#EditCostCenter").val();
var AvilBudget = $('#EditAvlBudAmt').val();
var editMaterialCode = $("#EditMaterialCode").val();
@ -2581,6 +2580,7 @@ $('#ServiceAppend').append(rowHtml);
$('#ItemDescription' + userid).val(ServiceDescription);
$('#OtherAmt' + userid).val(OtherAmt);
populateValueMainFormForEditServiceTax();
$('#EDITSERVICE').modal('hide');
}
});
@ -2805,7 +2805,7 @@ $('#ServiceAppend').append(rowHtml);
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function(data) {
if (data) {
$('#content').loader('hide');
// $('#content').loader('hide');
alert(data);
} else {
alert("Error");
@ -2999,7 +2999,7 @@ $('#ServiceAppend').append(rowHtml);
$('#editdescofpo').focus();
return false;
} else {
$('#content').loader('show');
// $('#content').loader('show');
var formData = new FormData($('.ServicePO')[0]);
$.ajax({
// data: $('.ServicePO').serialize(),
@ -3010,7 +3010,7 @@ $('#ServiceAppend').append(rowHtml);
contentType: false,
success: function(data) {
if (data) {
$('#content').loader('hide');
// $('#content').loader('hide');
alert(data);
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');
@ -3020,7 +3020,7 @@ $('#ServiceAppend').append(rowHtml);
window.location = "purchaseorderListing";
} else {
$('#content').loader('hide');
// $('#content').loader('hide');
alert("Error");
}
@ -3288,7 +3288,7 @@ $('#ServiceAppend').append(rowHtml);
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
// For Binding Material list center for the selected Requistion Number
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
// $("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
var isAdded = "0";
for (i = 0; i < Material.length; i++) {
@ -3467,7 +3467,7 @@ $('#ServiceAppend').append(rowHtml);
// formData.append('param5',param5);
// formData.append('param6',param6);
$('.content').loader('show');
// $('.content').loader('show');
$.ajax({
data: formData,
type: "POST",
@ -3479,7 +3479,7 @@ $('#ServiceAppend').append(rowHtml);
if (data) {
alert(data);
window.location.reload();
$('.content').loader('hide');
// $('.content').loader('hide');
//$('#spl').find('td').eq(1).text(filename[2]);
$('#EditServiceSplPOModel').modal('hide');
}
@ -3519,7 +3519,7 @@ $('#ServiceAppend').append(rowHtml);
formData.append('count', counter);
// formData.append('igr',igr);
$('.content').loader('show');
// $('.content').loader('show');
$.ajax({
data: formData,
type: "POST",
@ -3531,7 +3531,7 @@ $('#ServiceAppend').append(rowHtml);
if (data) {
alert(data);
window.location.reload();
$('.content').loader('hide');
// $('.content').loader('hide');
// $('#spl').find('td').eq(5).text(filename[2]);
$('#EditServiceSplPOModel').modal('hide');
}

View File

@ -1,60 +1,72 @@
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px; /* Adjust the gap as needed */
}
.Date-filter-form input, .Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
th, td {
white-space: nowrap;
}
</style>
<style>
.dataTables_wrapper .top {
display: flex;
justify-content: space-between;
align-items: center;
}
.dataTables_wrapper .dataTables_length {
/* float: left; */
}
.dataTables_wrapper .dt-buttons,
.dataTables_wrapper .dataTables_filter {
/* float: right; */
/* margin-left: 10px; */
}
.dataTables_wrapper .dt-buttons {
/* margin-top: 10px; */
/* margin-bottom: 10px; */
}
.dataTables_wrapper .dataTables_filter {
/* margin-top: 10px; */
/* margin-bottom: 10px; */
}
</style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
th,
td {
white-space: nowrap;
}
</style>
<style>
.dataTables_wrapper .top {
display: flex;
justify-content: space-between;
align-items: center;
}
.dataTables_wrapper .dataTables_length {
/* float: left; */
}
.dataTables_wrapper .dt-buttons,
.dataTables_wrapper .dataTables_filter {
/* float: right; */
/* margin-left: 10px; */
}
.dataTables_wrapper .dt-buttons {
/* margin-top: 10px; */
/* margin-bottom: 10px; */
}
.dataTables_wrapper .dataTables_filter {
/* margin-top: 10px; */
/* margin-bottom: 10px; */
}
</style>
<div class="content-page">
@ -69,35 +81,36 @@
<h4 class="page-title">Purchase Order List</h4>
</div>
</div>
</div> <?php
helper('form');
$error = session()->getFlashdata('error');
if($error){
$type = "error";
echo show_alert($type, $error);
}
$success = session()->getFlashdata('success');
if($success){
$type = "success";
echo show_alert($type, $success);
}
?>
</div> <?php
helper('form');
$error = session()->getFlashdata('error');
if ($error) {
$type = "error";
echo show_alert($type, $error);
}
$success = session()->getFlashdata('success');
if ($success) {
$type = "success";
echo show_alert($type, $success);
}
?>
<div class="row">
<div class="col-12">
<div class="card">
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i> <div class="error" id="error"></div>
</form>
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
<div class="card-body">
<table id="po_list" class="table dt-responsive nowrap w-100">
<table id="po_list" class="table dt-responsive wrap w-100">
<thead>
<tr>
<th>PO Date</th>
@ -117,99 +130,99 @@
if (!empty($POData)) {
$index = 0;
foreach ($POData as $record) {
$index = $index + 1;
$index = $index + 1;
?>
<tr id="<?php echo $index; ?>">
<td align="right"><?php $Pdt = new DateTime($record->PODate);
$PODate = $Pdt->format('d-m-Y');
echo $PODate
?></td>
<td><?php echo $record->PONO ?></td>
<td><?php echo $record->ReqType ?></td>
<td><?php echo $record->SupplierName ?></td>
<td align="right"><?php echo $record->TotalOrderValue ?></td>
<tr id="<?php echo $index; ?>">
<td><?php $Pdt = new DateTime($record->PODate);
$PODate = $Pdt->format('d-m-Y');
echo $PODate
?></td>
<td><?php echo $record->PONO ?></td>
<td><?php echo $record->ReqType ?></td>
<!-- <td><?php echo $record->StatusName ?></td> -->
<td><?php
$statusMappings = [
'PO APPROVED' => 'AWAITING APPROVE',
'AWAITING RELEASE' => 'AWAITING APPROVE',
'RELEASER ONHOLD' => 'APPROVER ONHOLD',
'PO RELEASED' => 'PO APPROVED',
];
if (isset($record->StatusName) && !empty($record->StatusName)) {
if (isset($statusMappings[$record->StatusName])) {
echo $statusMappings[$record->StatusName];
} else {
echo $record->StatusName;
}
} else {
echo "Status not provided";
}
?></td>
<td><?php $option = 'By Deliver Date';
if ($record->DeliveryOption == 1) {
$option = "By Schedule";
} else if ($record->DeliveryOption == 2) {
$option = "By Dispatch Instruction";
}
echo $option ?></td>
<td align="right"><?php
if ($record->DeliveryOption == 0) {
$Ddt = new DateTime($record->DeliveryDate);
$Deliverydt = $Ddt->format('d-m-Y');
echo $Deliverydt;
} else if ($record->DeliveryOption == 1) {
$Deliverydt = '';
echo $Deliverydt;
} ?></td>
<td><?php echo $record->DeliverySchedule ?></td>
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->TotalOrderValue ?></td>
<?php $statusCode = $record->StatusCode;
<!-- <td><?php echo $record->StatusName ?></td> -->
<td><?php
$statusMappings = [
'PO APPROVED' => 'AWAITING APPROVE',
'AWAITING RELEASE' => 'AWAITING APPROVE',
'RELEASER ONHOLD' => 'APPROVER ONHOLD',
'PO RELEASED' => 'PO APPROVED',
];
if ($statusCode == PO_DRAFT || $statusCode == PO_CREATED) {
?>
if (isset($record->StatusName) && !empty($record->StatusName)) {
if (isset($statusMappings[$record->StatusName])) {
echo $statusMappings[$record->StatusName];
} else {
echo $record->StatusName;
}
} else {
echo "Status not provided";
}
?></td>
<td><?php $option = 'By Deliver Date';
if ($record->DeliveryOption == 1) {
$option = "By Schedule";
} else if ($record->DeliveryOption == 2) {
$option = "By Dispatch Instruction";
}
echo $option ?></td>
<td><?php
if ($record->DeliveryOption == 0) {
$Ddt = new DateTime($record->DeliveryDate);
$Deliverydt = $Ddt->format('d-m-Y');
echo $Deliverydt;
} else if ($record->DeliveryOption == 1) {
$Deliverydt = '';
echo $Deliverydt;
} ?></td>
<td><?php echo $record->DeliverySchedule ?></td>
<td>
<?php $statusCode = $record->StatusCode;
<a data-toggle="tooltip" title="<?php echo $record->PONO; ?> - Click here to Edit Purchase Order details"
href="<?php echo base_url() . 'EditPO?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType
. '&CapitalRange=' . $record->CapitalRange; ?>">
<i class="fa fa-pencil-alt" data-toggle="tooltip" > </i>
&nbsp;&nbsp;&nbsp;</a>
if ($statusCode == PO_DRAFT || $statusCode == PO_CREATED) {
</td>
<?php
} else {
?>
<td>
<a data-toggle="tooltip" href="<?php echo base_url() . 'EditPO?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType
. '&CapitalRange=' . $record->CapitalRange; ?>"><i class="fa fa-eye" data-toggle="tooltip"
title="<?php echo $record->PONO; ?> - Click here to view Purchase Order details"></i>
&nbsp;&nbsp;&nbsp;</a> &nbsp;&nbsp;&nbsp;
?>
<a data-toggle="tooltip" href="<?php echo base_url() . 'purchaseorder/CreatePOPrint?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType; ?>"
target="new"><i class="fa fa-print" data-toggle="tooltip" title="<?php echo $record->PONO; ?>
<td>
<a data-toggle="tooltip" title="<?php echo $record->PONO; ?> - Click here to Edit Purchase Order details"
href="<?php echo base_url() . 'EditPO?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType
. '&CapitalRange=' . $record->CapitalRange; ?>">
<i class="fa fa-pencil-alt" data-toggle="tooltip"> </i>
&nbsp;&nbsp;&nbsp;</a>
</td>
<?php
} else {
?>
<td>
<a data-toggle="tooltip" href="<?php echo base_url() . 'EditPO?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType
. '&CapitalRange=' . $record->CapitalRange; ?>"><i class="fa fa-eye" data-toggle="tooltip"
title="<?php echo $record->PONO; ?> - Click here to view Purchase Order details"></i>
&nbsp;&nbsp;&nbsp;</a> &nbsp;&nbsp;&nbsp;
<a data-toggle="tooltip" href="<?php echo base_url() . 'purchaseorder/CreatePOPrint?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType; ?>"
target="new"><i class="fa fa-print" data-toggle="tooltip" title="<?php echo $record->PONO; ?>
- Click here to Print the Purchase Order details"></i>
&nbsp;&nbsp;&nbsp;
</a>
</td>
&nbsp;&nbsp;&nbsp;
</a>
</td>
<?php
} ?>
</tr>
<?php
} ?>
</tr>
<?php
}
}
?>
?>
</tbody>
</table>
</div> <!-- end card body-->
@ -229,87 +242,98 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.13.6/sorting/datetime-moment.js"></script>
<script>
$(document).ready(function() {
// Initialize the DataTable
var table = $('#po_list').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
],
pageLength: 10, // Default rows per page
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
responsive: true, // Responsive table
order: [], // Default ordering (column index 0, descending)
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
$(document).ready(function() {
$(document).on('click', '.text-truncate', function() {
$(this).toggleClass('expanded');
});
// Initialize the DataTable
var table = $('#po_list').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
],
pageLength: 10, // Default rows per page
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
], // Rows per page options
responsive: true, // Responsive table
order: [], // Default ordering (column index 0, descending)
columnDefs: [{
targets: '_all',
className: 'text-truncate'
}, // Apply truncation to all columns
],
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
}
});
});
// Date range filter function
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $('#fromDate').val();
var toDate = $('#toDate').val();
if (!fromDate || !toDate) {
return true; // If no dates selected, don't filter
// Date range filter function
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $('#fromDate').val();
var toDate = $('#toDate').val();
if (!fromDate || !toDate) {
return true; // If no dates selected, don't filter
}
var dateStr = data[0]; // Assuming the date is in the first column
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
var startDate = new Date(fromDate);
var endDate = new Date(toDate);
// Adjust startDate to include the day before the selected fromDate
startDate.setDate(startDate.getDate() - 1);
// Ensure endDate includes the entire end date by setting time to the end of the day
endDate.setHours(23, 59, 59, 999);
// Return true if the date is within the range
return date >= startDate && date <= endDate;
}
var dateStr = data[0]; // Assuming the date is in the first column
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
var startDate = new Date(fromDate);
var endDate = new Date(toDate);
// Adjust startDate to include the day before the selected fromDate
startDate.setDate(startDate.getDate() - 1);
// Ensure endDate includes the entire end date by setting time to the end of the day
endDate.setHours(23, 59, 59, 999);
);
// Return true if the date is within the range
return date >= startDate && date <= endDate;
}
);
// Handle form submission for the date range filter
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw(); // Redraw the table to apply the filter
});
// Handle form submission for the date range filter
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw(); // Redraw the table to apply the filter
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").val('');
$("#toDate").val('');
table.draw(); // Redraw the table to clear the filter
});
// Automatically focus and open the To Date picker when From Date is selected
document.getElementById('fromDate').addEventListener('change', function() {
var fromDate = this.value;
var toDateInput = document.getElementById('toDate');
// Set the min attribute of the To Date input to the selected From Date
toDateInput.min = fromDate;
// Optionally reset the To Date input if the current value is before the new min date
if (toDateInput.value < fromDate) {
toDateInput.value = fromDate;
}
});
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").val('');
$("#toDate").val('');
table.draw(); // Redraw the table to clear the filter
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
// Automatically focus and open the To Date picker when From Date is selected
document.getElementById('fromDate').addEventListener('change', function() {
var fromDate = this.value;
var toDateInput = document.getElementById('toDate');
// Set the min attribute of the To Date input to the selected From Date
toDateInput.min = fromDate;
// Optionally reset the To Date input if the current value is before the new min date
if (toDateInput.value < fromDate) {
toDateInput.value = fromDate;
}
});
});
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>

View File

@ -10,15 +10,19 @@
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
th{
width:auto !important;
th {
/* width: auto !important; */
}
table{
width:auto;
}
.dataTables_filter input {
padding: 4px;
}
.dataTables_filter {
width: 50%;
/* width: 50%; */
float: right;
text-align: right;
}
@ -57,106 +61,106 @@
<!-- <form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;"> -->
<div class="card-body">
<form method="post" action="<?php echo base_url("Report_pending_purchase"); ?>">
<div class="form-group">
<div class="row">
<div class="col-4">
<label for="client_name">
<?php echo 'Supplier'; ?>
</label>
<select class="form-control" id="client_name" name="client_name">
<option value="">Select Supplier</option>
<?php
foreach ($cust as $item): { ?>
<option value="<?php echo $item->SupplierName; ?>"><?php echo $item->SupplierName; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-4">
<label for="client_name">
<?php echo 'Material'; ?>
</label>
<select class="form-control" id="item_name" name="item_name">
<form method="post" action="<?php echo base_url("Report_pending_purchase"); ?>">
<div class="form-group">
<div class="row">
<div class="col-4">
<label for="client_name">
<?php echo 'Supplier'; ?>
</label>
<select class="form-control" id="client_name" name="client_name">
<option value="">Select Supplier</option>
<?php
foreach ($cust as $item): { ?>
<option value="<?php echo $item->SupplierName; ?>"><?php echo $item->SupplierName; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-4">
<label for="client_name">
<?php echo 'Material'; ?>
</label>
<select class="form-control" id="item_name" name="item_name">
<option value="">Select Material</option>
<?php
foreach ($material as $it): { ?>
<option value="<?php echo $it->MaterialName; ?>"><?php echo $it->MaterialName; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-2">
<label for="to_date">
<?php echo 'Year'; ?>
</label>
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach ($finyear as $item): { ?>
<option value="<?php echo $item->financial_year; ?>"><?php echo $item->financial_year; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-2">
<label for="to_date">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
<option value="<?php echo $it->MaterialName; ?>"><?php echo $it->MaterialName; ?></option>
<?php }
endforeach; ?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-4">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker">
<div class="col-2">
<label for="to_date">
<?php echo 'Year'; ?>
</label>
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach ($finyear as $item): { ?>
<option value="<?php echo $item->financial_year; ?>"><?php echo $item->financial_year; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-2">
<label for="to_date">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</div>
</div>
</div>
<div class="col-4">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker">
<div class="row">
<div class="col-4">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker">
</div>
</div>
<div class="col-4">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker">
</div>
</div>
<div class="col-md-2"></div>
<div class="col-md-2 text-right"><br>
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report">
</div>
</div>
<div class="col-md-2"></div>
<div class="col-md-2 text-right"><br>
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report">
</div>
</div>
<div class="form-group has-feedback">
</div>
</div>
<div class="form-group has-feedback">
</div>
<!-- </form> -->
<!-- </form> -->
<!-- <input type="hidden" name="table" value="requisition">
<!-- <input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
@ -166,20 +170,20 @@
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div> -->
</form>
<table id="cc" class="table table-bordered table-hover" style="background-color:#fff;">
</form>
<table id="cc" class="table table-bordered table-hover wrap" style="background-color:#fff;width: 100% !important;">
<!-- <table class="table table-bordered table-hover" id="asset_list_table" style="background-color:#fff;font-size:12px;"> -->
<thead >
<!-- <table class="table table-bordered table-hover" id="asset_list_table" style="background-color:#fff;font-size:12px;"> -->
<thead>
<tr>
<th style="text-align:center" >PO Date</th>
<th style="text-align:center">PO No</th>
<th style="text-align:center">Supplier Name</th>
<th style="text-align:center">Material Name</th>
<th style="text-align:center">Category</th>
<th style="text-align:center">Ordered Quantity</th>
<th style="text-align:center">Received Quantity</th>
<th style="text-align:center">Pending Quantity</th>
<th style="text-align:center, width:10%">PO Date</th>
<th style="text-align:center, width:14%">PO No</th>
<th style="text-align:center, width:15%">Supplier Name</th>
<th style="text-align:center, width:17%">Material Name</th>
<th style="text-align:center, width:10%">Category</th>
<th style="text-align:center, width:9%">Ordered Quantity</th>
<th style="text-align:center, width:9%">Received Quantity</th>
<th style="text-align:center, width:10%">Pending Quantity</th>
</tr>
</thead>
<tbody>
@ -419,9 +423,14 @@
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
],
pageLength: 10, // Default rows per page
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
], // Rows per page options
responsive: true, // Responsive table
order: [[0, 'desc']], // Default ordering (column index 0, descending)
order: [
[0, 'desc']
], // Default ordering (column index 0, descending)
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
@ -439,40 +448,30 @@
});
$(function() {
//var dateFormat = "mm/dd/yy",
from = $("#min-date")
.datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
var dateFormat = 'dd-mm-yyyy';
})
.on("change", function() {
to.datepicker("option", "minDate", getDate(this));
}),
to = $("#max-date").datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
// Initialize min-date (Start Date)
var from = $("#min-date").datepicker({
format: dateFormat,
autoclose: true,
todayHighlight: true,
clearBtn: true
}).on('changeDate', function(e) {
// When a date is selected in #min-date, update the minDate option for #max-date
// to.datepicker('setStartDate', e.date);
});
})
.on("change", function() {
from.datepicker("option", "maxDate", getDate(this));
});
// Initialize max-date (End Date)
var to = $("#max-date").datepicker({
format: dateFormat,
// startDate: new Date(), // Start date cannot be in the past
autoclose: true,
todayHighlight: true,
clearBtn: true
}).on('changeDate', function(e) {
// When a date is selected in #max-date, update the endDate option for #min-date
from.datepicker('setStartDate', e.date);
});
});
function getDate(element) {
var date;
try {
date = $.datepicker.parseDate(dateFormat, element.value);
} catch (error) {
date = null;
}
return date;
}
});
</script>

View File

@ -36,6 +36,9 @@ if (!empty($INRSYMBOL)) {
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/3.3.4/jquery.inputmask.bundle.min.js"></script>
<style>
.txtSpcialInstruction{
background-color: #f4f9fb;
}
#packagingcalmodel {
margin-top: 200px;
z-index: 1080 !important;

View File

@ -432,7 +432,7 @@
<?php } else { ?>
<h4><?= "Amended Capital Purchase Order - $PONO "; ?></h4>
<?php } ?>
<a href="<?php echo base_url() ?>purchaseorderListing" class="btn btn-success" id="back" value="Back">Back</a>
<a href="<?php echo base_url() ?>purchaseorderListing" class="btn btn-secondary" id="back" value="Back">Back</a>
</div>
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -2137,13 +2137,13 @@ if (!empty($getlogpodtl)) {
</div>
<div class="form-row">
<div align="form-group col-md-12" align="right">
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<?php if ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT
<?php } ?>
<!-- <a data-toggle="modal" onclick="showmodel();" class=" btn btn-success"> Select Line Item </a> -->
<a data-toggle="modal"><button type="submit" onclick="myFunction();" class="btn btn-primary" id="abcd">Select Line Item</button> </a>
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<?php if ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT
<?php } ?>
<!-- <a data-toggle="modal" onclick="showmodel();" class=" btn btn-success"> Select Line Item </a> -->
<a data-toggle="modal"><button type="submit" onclick="myFunction();" class="btn btn-primary" id="abcd">Select Line Item</button> </a>
<?php } ?>
</div>
</div>
@ -2152,117 +2152,118 @@ if (!empty($getlogpodtl)) {
<div class="table-responsive">
<table id="revenueTax" class="table table-striped table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Description</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate <?php echo "($INRSYM)" ?></th>
<th>Basic Amount <?php echo "($INRSYM)" ?></th>
<th>Tax Amount <?php echo "($INRSYM)" ?></th>
<th>Total Order Amount <?php echo "($INRSYM)" ?></th>
<!-- <th>Actual Quantity</th>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Description</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate <?php echo "($INRSYM)" ?></th>
<th>Basic Amount <?php echo "($INRSYM)" ?></th>
<th>Tax Amount <?php echo "($INRSYM)" ?></th>
<th>Total Order Amount <?php echo "($INRSYM)" ?></th>
<!-- <th>Actual Quantity</th>
<th>Received Quantity</th>
<th>Pending Quantity</th> -->
<th>Action</th>
</tr>
</thead>
<tbody id='RevenueAppend'>
<?php
if (!empty($POItem)) {
$index = 0;
<th>Action</th>
</tr>
</thead>
<tbody id='RevenueAppend'>
<?php
if (!empty($POItem)) {
$index = 0;
foreach ($POItem as $record) {
$index = $index + 1;
?>
<tr id="<?php echo $index; ?>">
<td align="left"><?php echo $index; ?></td>
<td><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php echo $record->MaterialName ?></td>
<td align="right"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td align="right"><?php echo $record->Rate ?></td>
foreach ($POItem as $record) {
$index = $index + 1;
?>
<tr id="<?php echo $index; ?>">
<td align="left"><?php echo $index; ?></td>
<td><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php echo $record->MaterialName ?></td>
<td align="left"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td align="left"><?php echo $record->Rate ?></td>
<td align="right"><?php echo number_format($record->BasicValue, 2, '.', ''); ?></td>
<td align="left"><?php echo number_format($record->BasicValue, 2, '.', ''); ?></td>
<td align="right"><?php echo $record->Taxamount ?></td>
<td align="right"><?php echo $record->TotalValue ?></td>
<!-- <td align="right"><?php echo $record->Quantity ?></td>
<td align="left"><?php echo $record->Taxamount ?></td>
<td align="left"><?php echo $record->TotalValue ?></td>
<!-- <td align="right"><?php echo $record->Quantity ?></td>
<td align="right"><?php echo $record->ReceivedQuantity ?></td>
<td align="right"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td> -->
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'departmentName' . $index ?>" id="<?php echo 'departmentName' . $index ?>" value="<?php echo $record->DepartmentName; ?>" />
<input type="hidden" name="<?php echo 'AvilBudget' . $index ?>" id="<?php echo 'AvilBudget' . $index ?>" value="<?php echo $AvlAmount; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo' . $index ?>" id="<?php echo 'LineItemNo' . $index ?>" value="<?php echo $record->LineItemNo; ?>" />
<input type="hidden" name="<?php echo 'costCode' . $index ?>" id="<?php echo 'costCode' . $index ?>" value="<?php echo $record->CostCenterCode; ?>" />
<input type="hidden" name="<?php echo 'materialCode' . $index ?>" id="<?php echo 'materialCode' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
<input type="hidden" name="<?php echo 'materialName' . $index ?>" id="<?php echo 'materialName' . $index ?>" value="<?php echo htmlentities($record->MaterialName); ?>" />
<input type="hidden" name="<?php echo 'uom' . $index ?>" id="<?php echo 'uom' . $index ?>" value="<?php echo $record->UOM; ?>" />
<input align="right" type="hidden" name="<?php echo 'quantity' . $index ?>" id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4qty' . $index ?>" id="<?php echo 'b4qty' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input align="right" type="hidden" name="<?php echo 'itemRate' . $index ?>" id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4rate' . $index ?>" id="<?php echo 'b4rate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input align="right" type="hidden" name="<?php echo 'per' . $index ?>" id="<?php echo 'per' . $index ?>" value="<?php echo $record->Per; ?>" />
<input align="right" type="hidden" name="<?php echo 'service_description' . $index ?>" id="<?php echo 'service_description' . $index ?>" value="<?php echo $record->ServiceMaterialDescription; ?>" />
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'departmentName' . $index ?>" id="<?php echo 'departmentName' . $index ?>" value="<?php echo $record->DepartmentName; ?>" />
<input type="hidden" name="<?php echo 'AvilBudget' . $index ?>" id="<?php echo 'AvilBudget' . $index ?>" value="<?php echo $AvlAmount; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo' . $index ?>" id="<?php echo 'LineItemNo' . $index ?>" value="<?php echo $record->LineItemNo; ?>" />
<input type="hidden" name="<?php echo 'costCode' . $index ?>" id="<?php echo 'costCode' . $index ?>" value="<?php echo $record->CostCenterCode; ?>" />
<input type="hidden" name="<?php echo 'materialCode' . $index ?>" id="<?php echo 'materialCode' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
<input type="hidden" name="<?php echo 'materialName' . $index ?>" id="<?php echo 'materialName' . $index ?>" value="<?php echo htmlentities($record->MaterialName); ?>" />
<input type="hidden" name="<?php echo 'uom' . $index ?>" id="<?php echo 'uom' . $index ?>" value="<?php echo $record->UOM; ?>" />
<input align="right" type="hidden" name="<?php echo 'quantity' . $index ?>" id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4qty' . $index ?>" id="<?php echo 'b4qty' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input align="right" type="hidden" name="<?php echo 'itemRate' . $index ?>" id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4rate' . $index ?>" id="<?php echo 'b4rate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input align="right" type="hidden" name="<?php echo 'per' . $index ?>" id="<?php echo 'per' . $index ?>" value="<?php echo $record->Per; ?>" />
<input align="right" type="hidden" name="<?php echo 'service_description' . $index ?>" id="<?php echo 'service_description' . $index ?>" value="<?php echo $record->ServiceMaterialDescription; ?>" />
<input align="right" type="hidden" name="<?php echo 'DisType' . $index ?>" id="<?php echo 'DisType' . $index ?>" value="<?php echo $record->DiscountType; ?>" />
<input align="right" type="hidden" name="<?php echo 'DisVal' . $index ?>" id="<?php echo 'DisVal' . $index ?>" value="<?php echo $record->DiscountValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'AfterDisVal' . $index ?>" id="<?php echo 'AfterDisVal' . $index ?>" value="<?php echo $record->AfterDiscount; ?>" />
<input align="right" type="hidden" name="<?php echo 'PackOption' . $index ?>" id="<?php echo 'PackOption' . $index ?>" value="<?php echo $record->PackagingCalulatedOn; ?>" />
<input align="right" type="hidden" name="<?php echo 'PackType' . $index ?>" id="<?php echo 'PackType' . $index ?>" value="<?php echo $record->PackagingType; ?>" />
<input align="right" type="hidden" name="<?php echo 'PackVal' . $index ?>" id="<?php echo 'PackVal' . $index ?>" value="<?php echo $record->PackagingValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'AfterPackVal' . $index ?>" id="<?php echo 'AfterPackVal' . $index ?>" value="<?php echo $record->AfterPackagingValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueCgst' . $index ?>" id="<?php echo 'RevenueCgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueAfterCgst' . $index ?>" id="<?php echo 'RevenueAfterCgst' . $index ?>" value="<?php echo $record->AfterCGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueSgst' . $index ?>" id="<?php echo 'RevenueSgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueAfterSgst' . $index ?>" id="<?php echo 'RevenueAfterSgst' . $index ?>" value="<?php echo $record->AfterSGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueIgst' . $index ?>" id="<?php echo 'RevenueIgst' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueAfterIgst' . $index ?>" id="<?php echo 'RevenueAfterIgst' . $index ?>" value="<?php echo $record->AfterIGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'FreightType' . $index ?>" id="<?php echo 'FreightType' . $index ?>" value="<?php echo $record->FreightType; ?>" />
<input align="right" type="hidden" name="<?php echo 'NoOfTrip' . $index ?>" id="<?php echo 'NoOfTrip' . $index ?>" value="<?php echo $record->NoOfTrip; ?>" />
<input align="right" type="hidden" name="<?php echo 'FreightVal' . $index ?>" id="<?php echo 'FreightVal' . $index ?>" value="<?php echo $record->FreightValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'AfterFreightVal' . $index ?>" id="<?php echo 'AfterFreightVal' . $index ?>" value="<?php echo $record->AfterFreightValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'basicval' . $index ?>" id="<?php echo 'basicval' . $index ?>" value="<?php echo $record->BasicValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'Insval' . $index ?>" id="<?php echo 'Insval' . $index ?>" value="<?php echo $record->Insurance; ?>" />
<input align="right" type="hidden" name="<?php echo 'TotalOrderValue' . $index ?>" id="<?php echo 'TotalOrderValue' . $index ?>" value="<?php echo $record->TotalValue; ?>" />
<?php
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == SPECIAL_PO) { ?>
<td> <a data-target='#EDITREVENUE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITREVENUE"><i class="ri-pencil-fill" ></i></a>
&nbsp;&nbsp;&nbsp;
<a href='#' onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
<input align="right" type="hidden" name="<?php echo 'DisType' . $index ?>" id="<?php echo 'DisType' . $index ?>" value="<?php echo $record->DiscountType; ?>" />
<input align="right" type="hidden" name="<?php echo 'DisVal' . $index ?>" id="<?php echo 'DisVal' . $index ?>" value="<?php echo $record->DiscountValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'AfterDisVal' . $index ?>" id="<?php echo 'AfterDisVal' . $index ?>" value="<?php echo $record->AfterDiscount; ?>" />
<input align="right" type="hidden" name="<?php echo 'PackOption' . $index ?>" id="<?php echo 'PackOption' . $index ?>" value="<?php echo $record->PackagingCalulatedOn; ?>" />
<input align="right" type="hidden" name="<?php echo 'PackType' . $index ?>" id="<?php echo 'PackType' . $index ?>" value="<?php echo $record->PackagingType; ?>" />
<input align="right" type="hidden" name="<?php echo 'PackVal' . $index ?>" id="<?php echo 'PackVal' . $index ?>" value="<?php echo $record->PackagingValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'AfterPackVal' . $index ?>" id="<?php echo 'AfterPackVal' . $index ?>" value="<?php echo $record->AfterPackagingValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueCgst' . $index ?>" id="<?php echo 'RevenueCgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueAfterCgst' . $index ?>" id="<?php echo 'RevenueAfterCgst' . $index ?>" value="<?php echo $record->AfterCGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueSgst' . $index ?>" id="<?php echo 'RevenueSgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueAfterSgst' . $index ?>" id="<?php echo 'RevenueAfterSgst' . $index ?>" value="<?php echo $record->AfterSGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueIgst' . $index ?>" id="<?php echo 'RevenueIgst' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueAfterIgst' . $index ?>" id="<?php echo 'RevenueAfterIgst' . $index ?>" value="<?php echo $record->AfterIGST; ?>" />
<input align="right" type="hidden" name="<?php echo 'FreightType' . $index ?>" id="<?php echo 'FreightType' . $index ?>" value="<?php echo $record->FreightType; ?>" />
<input align="right" type="hidden" name="<?php echo 'NoOfTrip' . $index ?>" id="<?php echo 'NoOfTrip' . $index ?>" value="<?php echo $record->NoOfTrip; ?>" />
<input align="right" type="hidden" name="<?php echo 'FreightVal' . $index ?>" id="<?php echo 'FreightVal' . $index ?>" value="<?php echo $record->FreightValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'AfterFreightVal' . $index ?>" id="<?php echo 'AfterFreightVal' . $index ?>" value="<?php echo $record->AfterFreightValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'basicval' . $index ?>" id="<?php echo 'basicval' . $index ?>" value="<?php echo $record->BasicValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'Insval' . $index ?>" id="<?php echo 'Insval' . $index ?>" value="<?php echo $record->Insurance; ?>" />
<input align="right" type="hidden" name="<?php echo 'TotalOrderValue' . $index ?>" id="<?php echo 'TotalOrderValue' . $index ?>" value="<?php echo $record->TotalValue; ?>" />
<?php
} else { ?>
<td> <a data-target='#VIEWREVENUE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWREVENUE"><i class="fa fa-eye" data-toggle="tooltip" title="Click here to view the <?php echo $record->ReqNo; ?> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> </td>
<?php
} ?>
</tr>
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == SPECIAL_PO) { ?>
<td> <a data-target='#EDITREVENUE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITREVENUE"><i class="ri-pencil-fill"></i></a>
&nbsp;&nbsp;&nbsp;
<a href='#' onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
<?php
} else { ?>
<td> <a data-target='#VIEWREVENUE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWREVENUE"><i class="fa fa-eye" data-toggle="tooltip" title="Click here to view the <?php echo $record->ReqNo; ?> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> </td>
<?php
} ?>
</tr>
<?php
$totBasicAmt = $totBasicAmt + $record->BasicValue;
$totDiscountAmt = $totDiscountAmt + $record->AfterDiscount;
$totPackagingAmt = $totPackagingAmt + $record->AfterPackagingValue;
$totCgst = $totCgst + $record->AfterCGST;
$totSgst = $totSgst + $record->AfterSGST;
$totIgst = $totIgst + $record->AfterIGST;
$totFreightAmt = $totFreightAmt + $record->AfterFreightValue;
$totInsuranceAmt = $totInsuranceAmt + $record->Insurance;
$totOrderSummaryAmt = $totOrderSummaryAmt + $record->TotalValue;
}
?>
<?php
$totBasicAmt = $totBasicAmt + $record->BasicValue;
$totDiscountAmt = $totDiscountAmt + $record->AfterDiscount;
$totPackagingAmt = $totPackagingAmt + $record->AfterPackagingValue;
$totCgst = $totCgst + $record->AfterCGST;
$totSgst = $totSgst + $record->AfterSGST;
$totIgst = $totIgst + $record->AfterIGST;
$totFreightAmt = $totFreightAmt + $record->AfterFreightValue;
$totInsuranceAmt = $totInsuranceAmt + $record->Insurance;
$totOrderSummaryAmt = $totOrderSummaryAmt + $record->TotalValue;
}
?>
<?php
}
?>
</tbody>
</table><br></div>
</tbody>
</table><br>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
@ -2401,7 +2402,7 @@ if (!empty($getlogpodtl)) {
<input type="hidden" id="courierno<?= $row ?>" value="<?= $gd->CourierNo ?>">
<input type="hidden" id="MaterialRcvdDate<?= $row ?>" value="<?= $gd->MaterialRcvdDate ?>">
<td><span onclick="openmodel(<?= $row ?>);"><i class="ri-pencil-fill" ></i></span>
<td><span onclick="openmodel(<?= $row ?>);"><i class="ri-pencil-fill"></i></span>
</td>
</tr>
@ -2463,7 +2464,7 @@ if (!empty($getlogpodtl)) {
<td><span onclick="openbillmodel(<?php echo $index ?>);"><i class="ri-pencil-fill" ></i></span>
<td><span onclick="openbillmodel(<?php echo $index ?>);"><i class="ri-pencil-fill"></i></span>
<?php if (!empty($gd->FilePath)) { ?>
<a target="_blank" href="<?php echo base_url() . 'public/uploads/BillFiles/' ?><?php echo $gd->FilePath ?>"><i class="fa fa-download"></i></a>
<?php } ?>
@ -2579,31 +2580,31 @@ if (!empty($getlogpodtl)) {
</div><br />
</div>
<div class="form-row">
<div class="form-group col-md-12">
<div class="form-group col-md-12">
<label>Request On : </label><?php echo $Reqon; ?><br />
<?php if ($RequesterName != '' || $RequesterName != null) { ?>
<label>Request By : </label><?php echo $RequesterName; ?><br />
<?php } ?>
<label>Status : </label><?php
$statusMappings = [
'PO APPROVED' => 'AWAITING APPROVE',
'AWAITING RELEASE' => 'AWAITING APPROVE',
'RELEASER ONHOLD' => 'APPROVER ONHOLD',
'PO RELEASED' => 'PO APPROVED',
];
<label>Request On : </label><?php echo $Reqon; ?><br />
<?php if ($RequesterName != '' || $RequesterName != null) { ?>
<label>Request By : </label><?php echo $RequesterName; ?><br />
<?php } ?>
<label>Status : </label><?php
$statusMappings = [
'PO APPROVED' => 'AWAITING APPROVE',
'AWAITING RELEASE' => 'AWAITING APPROVE',
'RELEASER ONHOLD' => 'APPROVER ONHOLD',
'PO RELEASED' => 'PO APPROVED',
];
if (isset($StatusName) && !empty($StatusName)) {
if (isset($statusMappings[$StatusName])) {
echo $statusMappings[$StatusName];
} else {
echo $StatusName;
}
if (isset($StatusName) && !empty($StatusName)) {
if (isset($statusMappings[$StatusName])) {
echo $statusMappings[$StatusName];
} else {
echo "Status not provided";
echo $StatusName;
}
?>
</div>
} else {
echo "Status not provided";
}
?>
</div>
</div>
</div>
</div> <!-- end card body-->
@ -2931,10 +2932,10 @@ if (!empty($getlogpodtl)) {
<div class="form-group col-md-8"></div>
<div class="form-group col-md-4">
<label><?php echo "Total Order Amt ($INRSYM)"; ?></label>
<?php
$data = array('name' => 'txtTotalOrderValue', 'value' => set_value('txtTotalOrderValue'), 'id' => 'txtTotalOrderValue', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
<?php
$data = array('name' => 'txtTotalOrderValue', 'value' => set_value('txtTotalOrderValue'), 'id' => 'txtTotalOrderValue', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
@ -3043,38 +3044,38 @@ if (!empty($getlogpodtl)) {
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Quantity<span class="text-danger">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-2">
<label>Quantity<span class="text-danger">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-2">
<label><?php echo "Rate ($INRSYM)"; ?><span class="text-danger">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'EditRate', 'value' => set_value('EditRate'), 'id' => 'EditRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2">
<label><?php echo "Rate ($INRSYM)"; ?><span class="text-danger">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'EditRate', 'value' => set_value('EditRate'), 'id' => 'EditRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-1">
<label>Per</label> <?php
$data = array('name' => 'EditPer', 'value' => set_value('EditPer'), 'id' => 'EditPer', 'class' => 'form-control');
echo form_input($data); ?>
</div>
<div class="form-group col-md-2">
<label><?php echo "Basic Amt ($INRSYM)"; ?></label>
<div class="form-group">
<?php
$data = array('name' => 'txtEditBasicValue', 'value' => set_value('txtEditBasicValue'), 'id' => 'txtEditBasicValue', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-1">
<label>Per</label> <?php
$data = array('name' => 'EditPer', 'value' => set_value('EditPer'), 'id' => 'EditPer', 'class' => 'form-control');
echo form_input($data); ?>
</div>
<div class="form-group col-md-2">
<label><?php echo "Basic Amt ($INRSYM)"; ?></label>
<div class="form-group">
<?php
$data = array('name' => 'txtEditBasicValue', 'value' => set_value('txtEditBasicValue'), 'id' => 'txtEditBasicValue', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
</div>
</div>
@ -3303,10 +3304,10 @@ if (!empty($getlogpodtl)) {
<div class="form-row">
<div class="form-group col-md-12">
<label><?php echo "Revenue Description"; ?></label>
<?php
$data = array('name' => 'Edit_Service_Description', 'value' => set_value('Edit_Service_Description'), 'id' => 'Edit_Service_Description', 'class' => 'form-control', 'rows' => '2', 'cols' => '100');
echo form_textarea($data);;
?>
<?php
$data = array('name' => 'Edit_Service_Description', 'value' => set_value('Edit_Service_Description'), 'id' => 'Edit_Service_Description', 'class' => 'form-control', 'rows' => '2', 'cols' => '100');
echo form_textarea($data);;
?>
</div>
</div>
@ -3869,9 +3870,9 @@ if (!empty($getlogpodtl)) {
</td>
</tr> -->
</div>
</section>
</div>
</div>
</section>
</div>
</script>
<script>
var index = <?php echo $index; ?>;
@ -4021,7 +4022,7 @@ if (!empty($getlogpodtl)) {
</td>
</tr>
`;
$('#RevenueAppend').append(rowHtml);
$('#RevenueAppend').append(rowHtml);
@ -4454,8 +4455,7 @@ $('#RevenueAppend').append(rowHtml);
$('#ViewAfterIGST').val(TAXval);
return TAXval; // $('#AfterServiceTax').val(TAXval);
}
</script>
<script>
function validateBudgetExceedLimit() {
var rows = document.getElementById('revenueTax').rows.length;
var ReqType = '<?php echo REVENUE ?>';
@ -4635,82 +4635,6 @@ $('#RevenueAppend').append(rowHtml);
}
function Save(status) {
if (status == '0') {
stat = '<?php echo PO_DRAFT; ?>';
} else if (status == '1') {
stat = '<?php echo PO_CREATED; ?>';
} else if (status == '4') {
stat = '<?php echo PO_RELEASED; ?>';
} else {
stat = '<?php echo $PONOStatus; ?>';
}
var deladd = $('#DeliveryAddr').val();
$('#txtStatus').val(stat);
tinyMCE.triggerSave();
var splinstr = $('#txtSpcialInstruction').val();
$('#SpcialInstruction').val(splinstr);
$('#txtDeliveryAddress').val(deladd);
var AvlBudAmt = '<?php echo number_format($AvlAmount + $totBasicAmt - $totDiscountAmt, 2, '.', '') ?>';
var txtTotalbasicamount = $('#txtTotBasicAmount').val();
var totaldiscount = $('#txtTotalDiscount').val();
//alert(txtTotalbasicamount+'-'+totaldiscount);
//alert(txtTotalbasicamount-totaldiscount);
if (validate()) {
if (document.getElementById('revenueTax').rows.length < 2) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
}
//else if(validateBudgetExceedLimit())
//{
// return false;
//}
// else if(parseInt(AvlBudAmt) < (parseInt(txtTotalbasicamount)- parseInt(totaldiscount))){
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#insurancestatus').val() == 1 && $('#InsuranceNumber').val() == '') {
alert('Please Enter Insurance No / Insurance Details..!');
$('#insurance').focus();
return false;
} else {
var formData = new FormData($('.CreatePO')[0]);
$.ajax({
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/EditRevenuePurchaseOrder",
data: formData,
processData: false,
contentType: false,
success: function(data) {
if (data) {
alert(data);
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');
$('#txtStatus').val('');
$('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('')
window.location = "purchaseorderListing";
} else {
alert("Error");
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus);
}
});
}
}
}
// this function is used to clear data changing schedule option
$('#Scheduleby').change(function() {
@ -4906,185 +4830,265 @@ $('#RevenueAppend').append(rowHtml);
id = '';
});
$(document).ready(function() {
$("#EDITREVENUE").on("shown.bs.modal", function(e) {
var AvlBudAmt = '<?php echo $AvlAmount ?>';
function Save(status) {
console.log("status");
console.log(status);
AvlBudAmt = '<?php echo number_format($AvlAmount + $totBasicAmt - $totDiscountAmt, 2, '.', '') ?>';
userid = $(e.relatedTarget).data('userid');
$('#isEdit').val(1);
//alert(userid);
var tr = document.getElementById(userid);
var cellval = tr.cells;
var id = $('#Reqnumber' + userid).val();
$('#EditReqNo').val($('#Reqnumber' + userid).val());
$('#EditdeptName').val($('#departmentName' + userid).val());
$("#EditCostCenter").val($('#costCode' + userid).val());
$('#EditAvlBudAmt').val(AvlBudAmt);
//
$('#EditItemName').val($('#materialName' + userid).val());
$('#EditUOM').val($('#uom' + userid).val());
$('#EditQuantity').val($('#quantity' + userid).val());
tinyMCE.get('Edit_Service_Description').setContent($('#service_description' + userid).val());
$('#EditRate').val($('#itemRate' + userid).val());
var per = $('#per' + userid).val()
if (per == '') {
$('#EditPer').val($('#uom' + userid).val());
if (status == '0') {
stat = '<?php echo PO_DRAFT; ?>';
} else if (status == '1') {
stat = '<?php echo PO_CREATED; ?>';
} else if (status == '4') {
stat = '<?php echo PO_RELEASED; ?>';
} else {
$('#EditPer').val($('#per' + userid).val());
stat = '<?php echo $PONOStatus; ?>';
}
$('#txtEditBasicValue').val(cellval[7].innerHTML);
RequistQuantity = $('#quantity' + userid).val();
$('#txtEditDiscount').val($('#DisVal' + userid).val());
$('#txtEditAfterDiscount').val($('#AfterDisVal' + userid).val());
var deladd = $('#DeliveryAddr').val();
$('#txtStatus').val(stat);
tinyMCE.triggerSave();
var splinstr = $('#txtSpcialInstruction').val();
$('#SpcialInstruction').val(splinstr);
$('#txtDeliveryAddress').val(deladd);
var AvlBudAmt = '<?php echo number_format($AvlAmount + $totBasicAmt - $totDiscountAmt, 2, '.', '') ?>';
var txtTotalbasicamount = $('#txtTotBasicAmount').val();
var totaldiscount = $('#txtTotalDiscount').val();
//alert(txtTotalbasicamount+'-'+totaldiscount);
//alert(txtTotalbasicamount-totaldiscount);
if (validate()) {
if (document.getElementById('revenueTax').rows.length < 2) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
}
//else if(validateBudgetExceedLimit())
//{
// return false;
//}
// else if(parseInt(AvlBudAmt) < (parseInt(txtTotalbasicamount)- parseInt(totaldiscount))){
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
$('#txtEditPackaging').val($('#PackVal' + userid).val());
$('#txtEditAfterPackaging').val($('#AfterPackVal' + userid).val());
// return false;
// }
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#insurancestatus').val() == 1 && $('#InsuranceNumber').val() == '') {
alert('Please Enter Insurance No / Insurance Details..!');
$('#insurance').focus();
return false;
} else {
var formData = new FormData($('.CreatePO')[0]);
$.ajax({
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/EditRevenuePurchaseOrder",
data: formData,
processData: false,
contentType: false,
success: function(data) {
console.log(data);
// if (data) {
// alert(data);
// $('#txtRowCount').val('');
// $('#txtDeletedRow').val('');
// $('#txtStatus').val('');
// $('#SpcialInstruction').val('');
// $('#txtDeliveryAddress').val('')
// window.location = "purchaseorderListing";
$('#txtEditFreight').val($('#FreightVal' + userid).val());
$('#txtEditAfterFreight').val($('#AfterFreightVal' + userid).val());
var FreightType = $('#FreightType' + userid).val();
$('#EditNOOfTrips').val($('#NoOfTrip' + userid).val());
if (FreightType == "PER TRIP") {
$('#EditTripsValue').show();
} else {
$('#EditTripsValue').hide();
}
$('#txtEditInsurance').val($('#Insval' + userid).val());
// } else {
// alert("Error");
// }
$('#txtEditTotalOrderValue').val($('#TotalOrderValue' + userid).val());
var x = $("input:radio[name='Range']:checked").val();
$('#EditAfterCgst').val($('#RevenueAfterCgst' + userid).val());
$('#EditAfterSgst').val($('#RevenueAfterSgst' + userid).val());
$('#EditAfterIgst').val($('#RevenueAfterIgst' + userid).val());
$('#EditCgst').val($('#RevenueCgst' + userid).val());
$('#EditSgst').val($('#RevenueSgst' + userid).val());
$('#EditIgst').val($('#RevenueIgst' + userid).val());
$("#EditMaterialCode").empty();
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
// For Binding Material list center for the selected Requistion Number
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
var isAdded = "0";
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function(idx, obj) {
if (obj.ReqNo === id) {
$.each(SelectedMaterialList.Mat, function(idx1, el) {
if (id == el.ReqNo) {
if (el.materialCode == obj.MaterialCode) {
isAdded = "1";
return false;
} else {
isAdded = "0";
}
}
});
if (isAdded == "0") {
$("#EditMaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
},
error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus);
}
}
});
});
}
}
}
$(document).ready(function() {
$("#EDITREVENUE").on("shown.bs.modal", function(e) {
var AvlBudAmt = '<?php echo $AvlAmount ?>';
$("#EditDiscountType").val($('#DisType' + userid).val());
$("#drpEditFreight").val($('#FreightType' + userid).val());
$("#EditPackagingType").val($('#PackType' + userid).val())
AvlBudAmt = '<?php echo number_format($AvlAmount + $totBasicAmt - $totDiscountAmt, 2, '.', '') ?>';
userid = $(e.relatedTarget).data('userid');
$('#isEdit').val(1);
//alert(userid);
var tr = document.getElementById(userid);
var cellval = tr.cells;
var id = $('#Reqnumber' + userid).val();
$("input:radio[name='optPackaging'][value='" + $('#PackOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optExcise'][value='" + $('#ExciseOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optVat'][value='" + $('#VatOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optCST'][value='" + $('#CSTOption' + userid).val() + "']").prop('checked', 'checked');
$('#EditReqNo').val($('#Reqnumber' + userid).val());
$('#EditdeptName').val($('#departmentName' + userid).val());
$("#EditCostCenter").val($('#costCode' + userid).val());
$('#EditAvlBudAmt').val(AvlBudAmt);
//
$('#EditItemName').val($('#materialName' + userid).val());
$('#EditUOM').val($('#uom' + userid).val());
$('#EditQuantity').val($('#quantity' + userid).val());
tinyMCE.get('Edit_Service_Description').setContent($('#service_description' + userid).val());
$('#EditRate').val($('#itemRate' + userid).val());
var per = $('#per' + userid).val()
if (per == '') {
$('#EditPer').val($('#uom' + userid).val());
} else {
$('#EditPer').val($('#per' + userid).val());
}
$('#txtEditBasicValue').val(cellval[7].innerHTML);
RequistQuantity = $('#quantity' + userid).val();
$('#txtEditDiscount').val($('#DisVal' + userid).val());
$('#txtEditAfterDiscount').val($('#AfterDisVal' + userid).val());
$('#txtEditPackaging').val($('#PackVal' + userid).val());
$('#txtEditAfterPackaging').val($('#AfterPackVal' + userid).val());
$('#txtEditFreight').val($('#FreightVal' + userid).val());
$('#txtEditAfterFreight').val($('#AfterFreightVal' + userid).val());
var FreightType = $('#FreightType' + userid).val();
$('#EditNOOfTrips').val($('#NoOfTrip' + userid).val());
if (FreightType == "PER TRIP") {
$('#EditTripsValue').show();
} else {
$('#EditTripsValue').hide();
}
$('#txtEditInsurance').val($('#Insval' + userid).val());
$('#txtEditTotalOrderValue').val($('#TotalOrderValue' + userid).val());
var x = $("input:radio[name='Range']:checked").val();
$('#EditAfterCgst').val($('#RevenueAfterCgst' + userid).val());
$('#EditAfterSgst').val($('#RevenueAfterSgst' + userid).val());
$('#EditAfterIgst').val($('#RevenueAfterIgst' + userid).val());
$('#EditCgst').val($('#RevenueCgst' + userid).val());
$('#EditSgst').val($('#RevenueSgst' + userid).val());
$('#EditIgst').val($('#RevenueIgst' + userid).val());
$("#EditMaterialCode").empty();
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
// For Binding Material list center for the selected Requistion Number
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
var isAdded = "0";
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function(idx, obj) {
if (obj.ReqNo === id) {
$.each(SelectedMaterialList.Mat, function(idx1, el) {
if (id == el.ReqNo) {
if (el.materialCode == obj.MaterialCode) {
isAdded = "1";
return false;
} else {
isAdded = "0";
}
}
});
if (isAdded == "0") {
$("#EditMaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
}
}
});
}
$("#EditDiscountType").val($('#DisType' + userid).val());
$("#drpEditFreight").val($('#FreightType' + userid).val());
$("#EditPackagingType").val($('#PackType' + userid).val())
$("input:radio[name='optPackaging'][value='" + $('#PackOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optExcise'][value='" + $('#ExciseOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optVat'][value='" + $('#VatOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optCST'][value='" + $('#CSTOption' + userid).val() + "']").prop('checked', 'checked');
});
$("#VIEWREVENUE").on("shown.bs.modal", function(e) {
var AvlBudAmt = '<?php echo $AvlAmount ?>';
AvlBudAmt = '<?php echo number_format($AvlAmount + $totBasicAmt - $totDiscountAmt, 2, '.', '') ?>';
userid = $(e.relatedTarget).data('userid');
$('#isEdit').val(1);
//alert(userid);
var tr = document.getElementById(userid);
var cellval = tr.cells;
var id = $('#Reqnumber' + userid).val();
$('#ViewReqNo').val($('#Reqnumber' + userid).val());
$('#ViewdeptName').val($('#departmentName' + userid).val());
$("#ViewCostCenter").val($('#costCode' + userid).val());
$('#ViewAvlBudAmt').val(AvlBudAmt);
//
$('#ViewItemName').val($('#materialName' + userid).val());
$('#ViewUOM').val($('#uom' + userid).val());
$('#ViewQuantity').val($('#quantity' + userid).val());
$('#ViewRate').val($('#itemRate' + userid).val());
$('#ViewPer').val($('#per' + userid).val());
$('#txtViewBasicValue').val(cellval[7].innerHTML);
RequistQuantity = $('#quantity' + userid).val();
$('#txtViewDiscount').val($('#DisVal' + userid).val());
$('#txtViewAfterDiscount').val($('#AfterDisVal' + userid).val());
tinyMCE.get('View_Service_Description').setContent($('#service_description' + userid).val());
$('#txtViewPackaging').val($('#PackVal' + userid).val());
$('#txtViewAfterPackaging').val($('#AfterPackVal' + userid).val());
$('#txtViewFreight').val($('#FreightVal' + userid).val());
$('#txtViewAfterFreight').val($('#AfterFreightVal' + userid).val());
$('#txtViewInsurance').val($('#Insval' + userid).val());
var FreightType = $('#FreightType' + userid).val();
$('#ViewNOOfTrips').val($('#NoOfTrip' + userid).val());
if (FreightType == "PER TRIP") {
$('#ViewTripsValue').show();
} else {
$('#ViewTripsValue').hide();
}
$('#txtViewTotalOrderValue').val($('#TotalOrderValue' + userid).val());
$('#ViewAfterCGST').val($('#RevenueAfterCgst' + userid).val());
$('#ViewAfterSGST').val($('#RevenueAfterSgst' + userid).val());
$('#ViewAfterIGST').val($('#RevenueAfterIgst' + userid).val());
$('#ViewCGST').val($('#RevenueCgst' + userid).val());
$('#ViewSGST').val($('#RevenueSgst' + userid).val());
$('#ViewIGST').val($('#RevenueIgst' + userid).val());
$("#ViewMaterialCode").empty();
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
// For Binding Material list center for the selected Requistion Number
$("#ViewMaterialCode").val($('#materialCode' + userid).val());
$("#ViewDiscountType").val($('#DisType' + userid).val());
$("#drpViewFreight").val($('#FreightType' + userid).val());
$("#ViewPackagingType").val($('#PackType' + userid).val())
$("input:radio[name='optPackaging'][value='" + $('#PackOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optExcise'][value='" + $('#ExciseOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optVat'][value='" + $('#VatOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optCST'][value='" + $('#CSTOption' + userid).val() + "']").prop('checked', 'checked');
});
});
$("#VIEWREVENUE").on("shown.bs.modal", function(e) {
var AvlBudAmt = '<?php echo $AvlAmount ?>';
AvlBudAmt = '<?php echo number_format($AvlAmount + $totBasicAmt - $totDiscountAmt, 2, '.', '') ?>';
userid = $(e.relatedTarget).data('userid');
$('#isEdit').val(1);
//alert(userid);
var tr = document.getElementById(userid);
var cellval = tr.cells;
var id = $('#Reqnumber' + userid).val();
$('#ViewReqNo').val($('#Reqnumber' + userid).val());
$('#ViewdeptName').val($('#departmentName' + userid).val());
$("#ViewCostCenter").val($('#costCode' + userid).val());
$('#ViewAvlBudAmt').val(AvlBudAmt);
//
$('#ViewItemName').val($('#materialName' + userid).val());
$('#ViewUOM').val($('#uom' + userid).val());
$('#ViewQuantity').val($('#quantity' + userid).val());
$('#ViewRate').val($('#itemRate' + userid).val());
$('#ViewPer').val($('#per' + userid).val());
$('#txtViewBasicValue').val(cellval[7].innerHTML);
RequistQuantity = $('#quantity' + userid).val();
$('#txtViewDiscount').val($('#DisVal' + userid).val());
$('#txtViewAfterDiscount').val($('#AfterDisVal' + userid).val());
tinyMCE.get('View_Service_Description').setContent($('#service_description' + userid).val());
$('#txtViewPackaging').val($('#PackVal' + userid).val());
$('#txtViewAfterPackaging').val($('#AfterPackVal' + userid).val());
$('#txtViewFreight').val($('#FreightVal' + userid).val());
$('#txtViewAfterFreight').val($('#AfterFreightVal' + userid).val());
$('#txtViewInsurance').val($('#Insval' + userid).val());
var FreightType = $('#FreightType' + userid).val();
$('#ViewNOOfTrips').val($('#NoOfTrip' + userid).val());
if (FreightType == "PER TRIP") {
$('#ViewTripsValue').show();
} else {
$('#ViewTripsValue').hide();
}
$('#txtViewTotalOrderValue').val($('#TotalOrderValue' + userid).val());
$('#ViewAfterCGST').val($('#RevenueAfterCgst' + userid).val());
$('#ViewAfterSGST').val($('#RevenueAfterSgst' + userid).val());
$('#ViewAfterIGST').val($('#RevenueAfterIgst' + userid).val());
$('#ViewCGST').val($('#RevenueCgst' + userid).val());
$('#ViewSGST').val($('#RevenueSgst' + userid).val());
$('#ViewIGST').val($('#RevenueIgst' + userid).val());
$("#ViewMaterialCode").empty();
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
// For Binding Material list center for the selected Requistion Number
$("#ViewMaterialCode").val($('#materialCode' + userid).val());
$("#ViewDiscountType").val($('#DisType' + userid).val());
$("#drpViewFreight").val($('#FreightType' + userid).val());
$("#ViewPackagingType").val($('#PackType' + userid).val())
$("input:radio[name='optPackaging'][value='" + $('#PackOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optExcise'][value='" + $('#ExciseOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optVat'][value='" + $('#VatOption' + userid).val() + "']").prop('checked', 'checked');
$("input:radio[name='optCST'][value='" + $('#CSTOption' + userid).val() + "']").prop('checked', 'checked');
});
});
</script>
<script>
$('#insurancestatus').change(function() {
@ -5123,6 +5127,7 @@ $('#RevenueAppend').append(rowHtml);
processData: false,
success: function(data) {
if (data) {
console.log(data);
alert(data);
window.location.reload();
// $('#spl').find('td').eq(5).text(filename[2]);
@ -5166,6 +5171,7 @@ $('#RevenueAppend').append(rowHtml);
processData: false,
success: function(data) {
if (data) {
console.log(data);
alert(data);
window.location.reload();
// $('#spl').find('td').eq(5).text(filename[2]);
@ -5199,6 +5205,7 @@ $('#RevenueAppend').append(rowHtml);
processData: false,
success: function(data) {
if (data) {
console.log(data);
alert(data);
window.location.reload();
// $('#spl').find('td').eq(5).text(filename[2]);
@ -5219,16 +5226,11 @@ $('#RevenueAppend').append(rowHtml);
$('#billimag').val('');
}
}
</script>
<script>
var counter = 0;
//var counterConstant = 0;
$("#addmorebutton").click(function() {
counter++;

View File

@ -370,7 +370,7 @@ if (!empty($getlogpodtl)) {
<?php } else { ?>
<h4><?= "Amended Import Purchase Order - $PONO "; ?></h4>
<?php } ?>
<a href="<?php echo base_url() ?>purchaseorderListing" class="btn btn-success" id="back" value="Back">Back</a>
<a href="<?php echo base_url() ?>purchaseorderListing" class="btn btn-secondary" id="back" value="Back">Back</a>
</div>
</div>
</div>
@ -5338,7 +5338,7 @@ if (!empty($getlogpodtl)) {
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function(data) {
if (data) {
$('#content').loader('hide');
// $('#content').loader('hide');
alert(data);
} else {
alert("Error");
@ -5512,7 +5512,7 @@ if (!empty($getlogpodtl)) {
return false;
} else {
//alert();
$('#content').loader('show');
// $('#content').loader('show');
var formData = new FormData($('.ImportPO')[0]);
formData.append('txtRowCount', Row);
formData.append('txtDeletedRow', txtDeletedRow);
@ -5527,7 +5527,7 @@ if (!empty($getlogpodtl)) {
url: "<?php echo base_url() ?>purchaseorder/EditImportPurchaseOrder",
success: function(data) {
if (data) {
$('#content').loader('hide');
// $('#content').loader('hide');
alert(data);
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');

File diff suppressed because it is too large Load Diff

View File

@ -120,6 +120,7 @@
margin-top: 55px;
}
}
@media (max-width: 992px) {
.synczohobooks_button {
margin-top: 55px;
@ -331,6 +332,26 @@
z-index: 1;
color: rgb(173, 3, 23);
}
/* This CSS is for Table Cell Expend*/
.text-truncate {
max-width: 120px;
/* Adjust width as needed */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-truncate:hover {
white-space: normal;
overflow: visible;
word-wrap: break-word;
max-width: none;
}
.text-truncate.expanded {
white-space: normal;
max-width: none;
}
/* This CSS is for Table Cell Expend*/
</style>
</head>
@ -346,11 +367,11 @@
<ul class="list-unstyled topnav-menu float-right mb-0">
<li class="dropdown d-none d-lg-inline-block">
<!-- <li class="dropdown d-none d-lg-inline-block">
<a class="nav-link dropdown-toggle arrow-none waves-effect waves-light" data-toggle="fullscreen" href="#">
<i class="fe-maximize noti-icon"></i>
</a>
</li>
</li> -->
<li class="dropdown notification-list topbar-dropdown">
<a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
@ -403,7 +424,7 @@
</span>
</a>
<a href="index.html" class="logo logo-light text-center">
<a href="<?php echo base_url(); ?>sales_dashboard" class="logo logo-light text-center">
<span class="logo-sm">
<img src="<?php echo base_url(); ?>public/new_assets/images/RI.png" alt="" height="30">
</span>
@ -603,4 +624,4 @@
<!-- ============================================================== -->
<!-- Start Page Content here -->
<!-- ============================================================== -->
<!-- ============================================================== -->

View File

@ -39,7 +39,7 @@ if (!empty($Emp)) {
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4><?= "Add Requisition"; ?></h4>
<a href="<?php echo base_url(); ?>Requisition"><button type="button" class="btn btn-dark waves-effect waves-light">Back</button></a>
<a href="<?php echo base_url(); ?>Requisition"><button type="button" class="btn btn-secondary">Back</button></a>
</div>
</div>
</div>

View File

@ -538,12 +538,12 @@ if (!empty($INRSYMBOL)) {
$(document).ready(function() {
$("#Deliverydt").datepicker({
format: 'dd-mm-yyyy',
startDate: new Date(),
startDate: new Date(),
clearBtn: true
});
$("#PODate").datepicker({
format: 'dd-mm-yyyy',
startDate: new Date(),
startDate: new Date(),
clearBtn: true
});
$("#PaymentTerms").select2();
@ -559,6 +559,89 @@ if (!empty($INRSYMBOL)) {
$('#Schedulediv').show();
});
clearTotalItemValues();
$('#Edit').click(function() {
console.log("1111111111111111111");
// tinyMCE.triggerSave();
console.log("2222222222222222");
if (validateEditServiceTax()) {
alert('inside Add');
var CostCode = $("#EditCostCenter").val();
var AvilBudget = $('#EditAvlBudAmt').val();
var editMaterialCode = $("#EditMaterialCode").val();
var editDescription = $("#EditItemName").val();
var editUOM = $('#EditUOM').val();
var editPer = '';
if ($("#EditPer").val().trim() == '') {
editPer = $("#EditUOM").val();
} else {
editPer = $("#EditPer").val();
}
var editQuantity = $('#EditQuantity').val();
var itemRate = $("#EditRate").val();
var Cgst = $("#EditCgst").val();
var AfterCgst = $("#EditAfterCgst").val();
var Sgst = $("#EditSgst").val();
var AfterSgst = $("#EditAfterSgst").val();
var Igst = $("#EditIgst").val();
var AfterIgst = $("#EditAfterIgst").val();
var Frequency = $("#EditFrequency").val();
var FrequencyValue = $("#EditFrequencyNo").val();
var ServiceDescription = $('#EdittxtSpcialInstruction').val();
var OtherAmt = $('#EditOtherAllowances').val();
var TotalOrderValue = $("#EditTotalOrderValue ").val();
var basicval = $("#txtEditBasicValue").val();
var TotalTaxValue = calculateEditTaxValue();
var tr = document.getElementById(userid);
var cellval = tr.cells;
cellval[2].innerHTML = editMaterialCode;
cellval[3].innerHTML = editDescription;
cellval[4].innerHTML = editQuantity;
cellval[5].innerHTML = editUOM;
cellval[6].innerHTML = parseFloat(itemRate).toFixed(2);
cellval[7].innerHTML = parseFloat(basicval).toFixed(2);
cellval[8].innerHTML = parseFloat(TotalTaxValue).toFixed(2);
cellval[9].innerHTML = parseFloat(TotalOrderValue).toFixed(2);
$('#materialCode' + userid).val(editMaterialCode);
$('#materialName' + userid).val(editDescription);
$('#uom' + userid).val(editUOM);
$('#per' + userid).val(editPer);
$('#quantity' + userid).val(editQuantity);
$('#itemRate' + userid).val(itemRate);
$('#Cgst' + userid).val(Cgst);
$('#AfterCgst' + userid).val(AfterCgst);
$('#Sgst' + userid).val(Sgst);
$('#AfterSgst' + userid).val(AfterSgst);
$('#Igst' + userid).val(Igst);
$('#AfterIgst' + userid).val(AfterIgst);
$('#ItemDescription' + userid).val(ServiceDescription);
$('#OtherAmt' + userid).val(OtherAmt);
$('#TotalOrderValue' + userid).val(TotalOrderValue);
populateValueMainFormForEditServiceTax();
}
});
});
</script>
<style>
@ -1753,28 +1836,28 @@ if (!empty($INRSYMBOL)) {
// }));
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>
<td align="left">${quantity}</td>
<td align="left">${uom}</td>
<td align="left">${itemRate}</td>
<td align="left">${basicval}</td>
<td align="left">${TotalTaxValue}</td>
<td align="left">${TotalOrderValue}</td>
<td>
<a data-target='#EDITSERVICE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITSERVICE">
<i class="ri-pencil-fill" data-toggle="tooltip"></i>
</a>
&nbsp;&nbsp;&nbsp;
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span>
</a>
</td>
</tr>
`;
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>
<td align="left">${quantity}</td>
<td align="left">${uom}</td>
<td align="left">${itemRate}</td>
<td align="left">${basicval}</td>
<td align="left">${TotalTaxValue}</td>
<td align="left">${TotalOrderValue}</td>
<td>
<a data-target='#EDITSERVICE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITSERVICE">
<i class="ri-pencil-fill" data-toggle="tooltip"></i>
</a>
&nbsp;&nbsp;&nbsp;
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span>
</a>
</td>
</tr>
`;
// Append the generated HTML to your table body
$('#ServiceAppend').append(rowHtml);
@ -1819,84 +1902,6 @@ if (!empty($INRSYMBOL)) {
});
$('.EditService').click(function() {
tinyMCE.triggerSave();
if (validateEditServiceTax()) {
//alert('inside Add');
var CostCode = $("#EditCostCenter").val();
var AvilBudget = $('#EditAvlBudAmt').val();
var editMaterialCode = $("#EditMaterialCode").val();
var editDescription = $("#EditItemName").val();
var editUOM = $('#EditUOM').val();
var editPer = '';
if ($("#EditPer").val().trim() == '') {
editPer = $("#EditUOM").val();
} else {
editPer = $("#EditPer").val();
}
var editQuantity = $('#EditQuantity').val();
var itemRate = $("#EditRate").val();
var Cgst = $("#EditCgst").val();
var AfterCgst = $("#EditAfterCgst").val();
var Sgst = $("#EditSgst").val();
var AfterSgst = $("#EditAfterSgst").val();
var Igst = $("#EditIgst").val();
var AfterIgst = $("#EditAfterIgst").val();
var Frequency = $("#EditFrequency").val();
var FrequencyValue = $("#EditFrequencyNo").val();
var ServiceDescription = $('#EdittxtSpcialInstruction').val();
var OtherAmt = $('#EditOtherAllowances').val();
var TotalOrderValue = $("#EditTotalOrderValue ").val();
var basicval = $("#txtEditBasicValue").val();
var TotalTaxValue = calculateEditTaxValue();
var tr = document.getElementById(userid);
var cellval = tr.cells;
cellval[2].innerHTML = editMaterialCode;
cellval[3].innerHTML = editDescription;
cellval[4].innerHTML = editQuantity;
cellval[5].innerHTML = editUOM;
cellval[6].innerHTML = parseFloat(itemRate).toFixed(2);
cellval[7].innerHTML = parseFloat(basicval).toFixed(2);
cellval[8].innerHTML = parseFloat(TotalTaxValue).toFixed(2);
cellval[9].innerHTML = parseFloat(TotalOrderValue).toFixed(2);
$('#materialCode' + userid).val(editMaterialCode);
$('#materialName' + userid).val(editDescription);
$('#uom' + userid).val(editUOM);
$('#per' + userid).val(editPer);
$('#quantity' + userid).val(editQuantity);
$('#itemRate' + userid).val(itemRate);
$('#Cgst' + userid).val(Cgst);
$('#AfterCgst' + userid).val(AfterCgst);
$('#Sgst' + userid).val(Sgst);
$('#AfterSgst' + userid).val(AfterSgst);
$('#Igst' + userid).val(Igst);
$('#AfterIgst' + userid).val(AfterIgst);
$('#ItemDescription' + userid).val(ServiceDescription);
$('#OtherAmt' + userid).val(OtherAmt);
$('#TotalOrderValue' + userid).val(TotalOrderValue);
populateValueMainFormForEditServiceTax();
}
});
function addHidden(theForm, key, value) {
// Create a hidden input element, and append it to the form:
@ -2189,7 +2194,7 @@ if (!empty($INRSYMBOL)) {
// });
$("#Deliverydt").datepicker({
format: 'dd-mm-yyyy',
startDate: new Date(),
startDate: new Date(),
yearRange: '0:+10',
changeMonth: true,
changeYear: true,

View File

@ -250,6 +250,9 @@ if (! function_exists('form_multiselect')) {
if (stripos($extra, 'multiple') === false) {
$extra .= ' multiple="multiple"';
}
if (stripos($extra, 'class=') === false) {
$extra .= ' class="form-control"'; // Add your desired default class here
}
return form_dropdown($name, $options, $selected, $extra);
}