Merge branch 'CI4-Application' of bitbucket.org:venbainformationtechnology/ria into CI4-Application
This commit is contained in:
commit
5238af125a
@ -246,7 +246,6 @@ $routes->get('AddIGR', 'Inwardgateregister::addIGR'); // ADD IGR page - working
|
||||
$routes->get('ViewIGR', 'Inwardgateregister::viewIGR'); // View IGR PAGE - Working
|
||||
$routes->post('ViewIGRDetails', 'Inwardgateregister::viewIGRDetails');
|
||||
$routes->post('GetIGRLineItemDetails', 'Inwardgateregister::getIGRLineItemDetails');
|
||||
$routes->post('deleteBillFile', 'Inwardgateregister::deleteBillFile');
|
||||
$routes->post('SaveIGR', 'Inwardgateregister::SaveIGR');// Save IGR PAGE - Working
|
||||
$routes->post('UpdateIGR', 'Inwardgateregister::UpdateIGR');
|
||||
$routes->post('updateIGRWeight', 'Inwardgateregister::updateIGRWeight');
|
||||
@ -254,7 +253,10 @@ $routes->post('UpdateIGRLineItem', 'Inwardgateregister::updateIGRLineItem');
|
||||
$routes->post('ViewIGRHistory', 'Inwardgateregister::ViewIGRHistory');
|
||||
$routes->post('getCostCenterData', 'Inwardgateregister::getCostCenterData');
|
||||
$routes->post('ViewIGRfile', 'Inwardgateregister::ViewIGRfile');
|
||||
$routes->post('inwardgateregister/addloadfile', 'Inwardgateregister::addloadfile');
|
||||
$routes->post('getAdditionalIGRFile', 'Inwardgateregister::getAdditionalIGRFile');
|
||||
$routes->post('deleteAdditionalIGRFile', 'Inwardgateregister::deleteAdditionalIGRFile');
|
||||
$routes->get('download-files/(:segment)', 'Inwardgateregister::downloadFilesAsZip/$1');
|
||||
|
||||
$routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituploadfile');
|
||||
|
||||
// Application OGR Page
|
||||
|
||||
@ -1325,7 +1325,9 @@ class Emergencypurchaseorder extends BaseController
|
||||
$SupplierID = $this->request->getPost('drpSupplier');
|
||||
|
||||
$newsup = (string)$this->request->getPost('newsup');
|
||||
$newSupId = split("[ - ]+", $newsup);
|
||||
// echo $newsup;die;
|
||||
// $newSupId = split("[ - ]+", $newsup);
|
||||
$newSupId = preg_split('/[ - ]+/', $newsup);
|
||||
/*-----------------------------------*/
|
||||
$b4supplier = $this->request->getPost('b4supplier');
|
||||
$b4date = $this->request->getPost('b4podate');
|
||||
|
||||
@ -8,6 +8,8 @@ use CodeIgniter\Validation\Exceptions\ValidationException;
|
||||
|
||||
use App\Models\Inwardgateregister_model;
|
||||
|
||||
use ZipArchive;
|
||||
|
||||
/**
|
||||
* Module : IGR (security)
|
||||
* Inwardgateregister Class to control all igr related operations.
|
||||
@ -71,6 +73,9 @@ class Inwardgateregister extends BaseController
|
||||
$data['PO_NO'] = array_filter($result, function($item) {
|
||||
return !($item->status === 'ST027');
|
||||
});
|
||||
$data['emp_data'] = [];
|
||||
// $data['emp_data'] = $this->inwardgateregister_model->getAdditionalIGRFile();
|
||||
// print_r($data['PO_NO']);die;
|
||||
|
||||
$this->loadViews("inwardgateregister", $this->global, $data, NULL);
|
||||
}
|
||||
@ -201,7 +206,7 @@ class Inwardgateregister extends BaseController
|
||||
|
||||
$PO = $this->request->getPost('id');
|
||||
$CreatedBy = $this->session->get('userId');
|
||||
$this->inwardgateregister_model->UpdatePOMaster($PO, $CreatedBy);
|
||||
$this->inwardgateregister_model->UpdatePOMaster($PO, $CreatedBy,IGR_CREATED);
|
||||
$data = $this->inwardgateregister_model->viewpurchaseorder($PO);
|
||||
|
||||
echo json_encode($data);
|
||||
@ -209,7 +214,7 @@ class Inwardgateregister extends BaseController
|
||||
|
||||
|
||||
|
||||
function addloadfile()
|
||||
function getAdditionalIGRFile()
|
||||
{
|
||||
|
||||
$lastinsertbillid = 0;
|
||||
@ -221,7 +226,7 @@ class Inwardgateregister extends BaseController
|
||||
$file = $this->request->getFile('file');
|
||||
$requestfilename = $file->getName();
|
||||
|
||||
$files = $this->inwardgateregister_model->getfies($igr);
|
||||
$files = $this->inwardgateregister_model->getAdditionalIGRFile($igr);
|
||||
|
||||
$fcount = 0;
|
||||
foreach ($files as $value) {
|
||||
@ -247,7 +252,7 @@ class Inwardgateregister extends BaseController
|
||||
|
||||
$myfiles = array('PONO' => $pono, 'IGRNO' => $igr, 'FilePath' => $Picture);
|
||||
|
||||
$lastinsertbillid = $this->inwardgateregister_model->fileupload($myfiles);
|
||||
$lastinsertbillid = $this->inwardgateregister_model->uploadAdditionalFile($myfiles);
|
||||
}
|
||||
}
|
||||
|
||||
@ -258,18 +263,17 @@ class Inwardgateregister extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
function deleteBillFile(){
|
||||
function deleteAdditionalIGRFile(){
|
||||
|
||||
$deleteBillFile = '';
|
||||
|
||||
$Billno = $this->request->getPost('Billno');
|
||||
$deleteBillFile = $this->inwardgateregister_model->deleteBillFile($Billno);
|
||||
|
||||
if ($deleteBillFile) {
|
||||
echo "file deleted successfully!";
|
||||
} else {
|
||||
echo "file details not exist to delete";
|
||||
}
|
||||
$deleteAdditionalFile = false;
|
||||
$fileid = $this->request->getPost('id');
|
||||
$deleteAdditionalFile = $this->inwardgateregister_model->deleteAdditionalFile($fileid);
|
||||
return $deleteAdditionalFile;
|
||||
// if ($deleteAdditionalFile) {
|
||||
// echo "file deleted successfully!";
|
||||
// } else {
|
||||
// echo "file details not exist to delete";
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -307,8 +311,10 @@ class Inwardgateregister extends BaseController
|
||||
|
||||
function SaveIGR()
|
||||
{
|
||||
//print_r($this->request->getPost());die;
|
||||
#Step 1 IGR Details
|
||||
$PONO = $this->request->getPost('PONO');
|
||||
$IsThisOpenOrderPO = $this->request->getPost('hiddenIsOpenOrder');
|
||||
$DeliveryChellanOrInvoiceNo = $this->request->getPost('InvoiceNo');
|
||||
$DeliveryChellan = (string)$this->request->getPost('InvoiceDate');
|
||||
$DeliveryChellanDate = get_date_time_format($DeliveryChellan);
|
||||
@ -321,8 +327,8 @@ class Inwardgateregister extends BaseController
|
||||
$RowCount = $this->request->getPost('txtRowCount');
|
||||
$createddt = get_current_date_time();
|
||||
//$IGRStatus = IGR_CREATED;//old
|
||||
$IGRStatus = (int)$this->request->getPost('hideIGRStatus') == 1 ? IGR_CREATED : IGR_DRAFT;
|
||||
|
||||
$PreIGRStatus = (int)$this->request->getPost('hideIGRStatus') == 1 ? IGR_CREATED : IGR_DRAFT;
|
||||
$IGRStatus = ((int)$IsThisOpenOrderPO == 1) ? IGR_DRAFT : $PreIGRStatus;
|
||||
$igr = array(); // For IGR Master
|
||||
$paymentstatus = NO_PAIDIGR;
|
||||
|
||||
@ -353,10 +359,38 @@ class Inwardgateregister extends BaseController
|
||||
#Step 3 Master Details Gathering to Save In DB
|
||||
$igr = array('PONO' => $PONO, 'VehicleNo' => $VehicleNo, 'DeliveryChellanOrInvoiceNo' => $DeliveryChellanOrInvoiceNo, 'DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $MaterialRcvdDt, 'DriverName' => $DriverName, 'DriverMobileNumber' => $DriverMobileNumber,'IGRStatus' => $IGRStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt, 'PaymentStatus' => $paymentstatus);
|
||||
$igr['MasterFile'] = $requestMasterFileName;
|
||||
// print_r( $igr );die;
|
||||
#Step 4 Calling DB to Save IGR Master
|
||||
$IGRNO = $this->inwardgateregister_model->addigrM($igr);
|
||||
// Get the uploaded files
|
||||
// $IGRNO = "IGRNO02750";
|
||||
// $IGRNO = "IGRNO02734";
|
||||
if($IGRNO){
|
||||
$files = $this->request->getFiles();
|
||||
$fileNames = $this->request->getPost('file_name'); // Get user-entered file names
|
||||
if(isset($files['emp_file']))
|
||||
{
|
||||
foreach ($files['emp_file'] as $index => $file) {
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
// Move the file to the desired directory
|
||||
$newName = $file->getRandomName();
|
||||
$file->move($path, $newName);
|
||||
// Store the file information in the database
|
||||
$additionalFiles = array(
|
||||
'Remarks' => $fileNames[$index],
|
||||
'FilePath' => $newName,
|
||||
'IGRNO' => $IGRNO,
|
||||
'PONO' => $PONO
|
||||
);
|
||||
$lastInsertFileId = $this->inwardgateregister_model->uploadAdditionalFile($additionalFiles);
|
||||
if ($lastInsertFileId) {
|
||||
$fileupdated_count++;
|
||||
$fileupdated_name[] = $fileNames[$index];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Step 5 Save Master Detail On History Table
|
||||
if($VehicleNo){
|
||||
$igr_history = array('field' => 'VehicleNo','is_add' => 1,'new_data' => $VehicleNo,'old_data' => NULL,'history_dated' => get_current_date_time(),'by' => $this->session->get('userId'),'IGR_No' => $IGRNO);
|
||||
@ -427,7 +461,6 @@ class Inwardgateregister extends BaseController
|
||||
$GrossWeightDate = !empty($grossWeightDate) && is_string($grossWeightDate) ? date('Y-m-d H:i:s', strtotime($grossWeightDate)) : null;
|
||||
$TareWeightDate = !empty($tareWeightDate) && is_string($tareWeightDate) ? date('Y-m-d H:i:s', strtotime($tareWeightDate)) : null;
|
||||
log_message('error', "TareWeightDate" . $TareWeightDate);
|
||||
|
||||
if (strlen($QuantityAsPerInvoice) > 0 && $QuantityAsPerInvoice != '0') {
|
||||
$Remarks = $this->request->getPost('txtRemarks' . $i);
|
||||
$ItemStatus = '';
|
||||
@ -514,18 +547,56 @@ class Inwardgateregister extends BaseController
|
||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
|
||||
}
|
||||
else if ((int)$IsThisOpenOrderPO == 1) {
|
||||
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
|
||||
|
||||
# Is this open order po means i have to save IGR DETAILS
|
||||
$Remarks = $this->request->getPost('txtRemarks' . $i);
|
||||
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
|
||||
$CreatedBy = $this->session->get('userId');
|
||||
$igrDetails = array('IGRNO' => $IGRNO, 'MaterialCode' => $MaterialCode, 'QuantityAsPerInvoice' => $QuantityAsPerInvoice, 'Remarks' => $Remarks, 'IGRItemStatus' => $IGRItemStatus,'GrossWeight' => (float)$GrossWeight ,'GrossWeightDate'=> $GrossWeightDate,'TareWeight' => (float)$TareWeight ,'TareWeightDate' => $TareWeightDate ,'NetWeight' => (float)$NetWeight, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt);
|
||||
$igrDetails['WeightFile'] = $requestWeightFileName;
|
||||
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
|
||||
$igrD ='';
|
||||
$igrlineno = !empty($igrD) ? $igrD : '';
|
||||
log_message('error', 'SaveIGR igrDetails result : ' . json_encode($igrDetails)." IgrLineNo : ".$igrlineno);
|
||||
$itemvalue = '';
|
||||
$SupplierId = '';
|
||||
$polineitemvalue = $this->inwardgateregister_model->getitemvalue($PONO, $MaterialCode);
|
||||
foreach ($polineitemvalue as $it) {
|
||||
$itemvalue = $it->Rate;
|
||||
$SupplierId = $it->SupplierID;
|
||||
}
|
||||
# Is this open order po means i have to save add material history
|
||||
$historydetails = array('MaterialCode' => $MaterialCode, 'Transaction_type' => "Add", 'Ref_Type' => "IGR", 'Ref_No' => $igrlineno, 'Quantity' => $QuantityAsPerInvoice, 'CreatedBy' => $CreatedBy, 'CreatedOn' => $createddt, 'SupplierID' => $SupplierId, 'ItemValue' => $itemvalue);
|
||||
$this->inwardgateregister_model->addmaterialhistory($historydetails);
|
||||
|
||||
# Is this open order po means i have to save the get received qty in PO lineitem table
|
||||
$get_pre_qty = $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
||||
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO, $MaterialCode);
|
||||
$ReceivedQuantity = 0.00;
|
||||
if (count($Recqty) > 0) {
|
||||
foreach ($Recqty as $key) {
|
||||
$ReceivedQuantity = $key->ReceivedQuantity;
|
||||
}
|
||||
}
|
||||
$totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
|
||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
|
||||
}
|
||||
}
|
||||
|
||||
$this->inwardgateregister_model->UpdatePOMaster($PONO, $CreatedBy);
|
||||
$this->inwardgateregister_model->UpdatePOMaster($PONO, $CreatedBy,$IGRStatus);
|
||||
|
||||
#Step 9 Updating Pending Quantity IN PO Master amd Line Item Details.
|
||||
if ((int)$IsThisOpenOrderPO != 1) {
|
||||
if ($TotalPendingQty == 0.00) {
|
||||
$Newstatus = array('Status' => $IGRStatus);
|
||||
$this->inwardgateregister_model->POLineItemsupdatestatus($PONO, $Newstatus);
|
||||
$this->inwardgateregister_model->pomasterupdatestatus($PONO, $Newstatus);
|
||||
} else {
|
||||
/*echo 'error' ;*/
|
||||
}
|
||||
}}
|
||||
#finally
|
||||
$finalstatement = "Successfully Created IGR Number: $IGRNO \n";
|
||||
if ($fileupdated_count > 0) {
|
||||
@ -555,7 +626,9 @@ function viewIGRDetails()
|
||||
|
||||
$IGRNO = $this->request->getPost('id');
|
||||
|
||||
$data = $this->inwardgateregister_model->viewigr($IGRNO);
|
||||
$data['details'] = $this->inwardgateregister_model->viewigr($IGRNO);
|
||||
$data['files'] = $this->inwardgateregister_model->viewIGRFile($IGRNO);
|
||||
|
||||
// echo $IGRNO;
|
||||
// print_r($data);die;
|
||||
|
||||
@ -588,6 +661,7 @@ function viewIGRDetails()
|
||||
{
|
||||
|
||||
$IGRNo = $this->request->getPost('igr');
|
||||
$PONo = $this->request->getPost('po');
|
||||
|
||||
$DeliveryChellan = $this->request->getPost('invdate');
|
||||
$DeliveryChellanDate = !$DeliveryChellan || $DeliveryChellan === null ? NULL : get_date_time_format($DeliveryChellan);
|
||||
@ -627,7 +701,37 @@ function viewIGRDetails()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$fileupdated_count = 0;
|
||||
$fileupdated_name = [];
|
||||
|
||||
$fileNames = $this->request->getPost('file_name');
|
||||
$files = $this->request->getFiles();
|
||||
|
||||
if(isset($files['emp_file']))
|
||||
{
|
||||
foreach ($files['emp_file'] as $index => $file) {
|
||||
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
|
||||
// Move the file to the desired directory
|
||||
$newName = $file->getRandomName();
|
||||
$file->move($path, $newName);
|
||||
// Store the file information in the database
|
||||
$additionalFiles = array(
|
||||
'Remarks' => $fileNames[$index],
|
||||
'FilePath' => $newName,
|
||||
'IGRNO' => $IGRNo,
|
||||
'PONO' => $PONo
|
||||
);
|
||||
$lastInsertFileId = $this->inwardgateregister_model->uploadAdditionalFile($additionalFiles);
|
||||
if ($lastInsertFileId) {
|
||||
$fileupdated_count++;
|
||||
$fileupdated_name[] = $fileNames[$index];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log_message('error', 'UpdateIGR igrarr: ' . json_encode($igrarr));
|
||||
$updateigrmaster = $this->inwardgateregister_model->updateigr($igrarr, $IGRNo);
|
||||
if(!empty($tableData )){
|
||||
@ -877,12 +981,21 @@ function viewIGRDetails()
|
||||
}
|
||||
}
|
||||
if ($updateigrmaster > 0) {
|
||||
echo "Updated Succefully!";
|
||||
$finalstatement = "Successfully Updated IGR Number: $IGRNo \n";
|
||||
} else if($updateigrlineitem >0){
|
||||
echo "Updated Succefully!";
|
||||
$finalstatement = "Successfully Updated IGR Number: $IGRNo \n";
|
||||
}else{
|
||||
echo "Not Updated!";
|
||||
$finalstatement = "IGR Number: $IGRNo \n";
|
||||
}
|
||||
|
||||
if ($fileupdated_count > 0) {
|
||||
$finalstatement .= "Number of files updated: $fileupdated_count \n";
|
||||
$finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name);
|
||||
} else {
|
||||
$finalstatement .= "No files to update";
|
||||
}
|
||||
|
||||
echo $finalstatement;
|
||||
}
|
||||
function updateIGRLineItem() {
|
||||
|
||||
@ -1156,6 +1269,7 @@ function viewIGRDetails()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function updateIGRWeight(){
|
||||
$GrossWeight = $this->request->getPost('GrossWeight');
|
||||
$GrossWeightDate = $this->request->getPost('GrossWeightDate');
|
||||
@ -1166,8 +1280,8 @@ function updateIGRWeight(){
|
||||
$IGRItemNo = $this->request->getPost('IGRlineitem');
|
||||
$updateby = $this->session->get('userId');
|
||||
$WeightFile = $this->request->getfile('WeightFile');
|
||||
$GrossWtDt = !empty($GrossWeightDate) ? get_date_time_format($GrossWeightDate) : null;
|
||||
$TareWtDt = !empty($TareWeightDate) ? get_date_time_format($TareWeightDate) : null;
|
||||
$GrossWtDt = (!empty($GrossWeightDate) && (string)$GrossWeightDate != 'null' ) ? get_date_time_format($GrossWeightDate) : null;
|
||||
$TareWtDt =(!empty($TareWeightDate) && (string)$TareWeightDate != 'null') ? get_date_time_format($TareWeightDate) : null;
|
||||
|
||||
|
||||
$path = ROOTPATH.'public/uploads/Igrfiles/';
|
||||
@ -1521,4 +1635,66 @@ function updateIGRWeight(){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function downloadFilesAsZip($igrno)
|
||||
{
|
||||
// Get all file details for the given IGR number
|
||||
$fileDetails = $this->inwardgateregister_model->getAllIgrFileDetails($igrno);
|
||||
if (empty($fileDetails)) {
|
||||
// Display an alert message
|
||||
echo '<script>alert("There are no files.");</script>';
|
||||
redirect('ViewIGR', 'refresh');
|
||||
return;
|
||||
}
|
||||
|
||||
// Define the root path for files
|
||||
$rootPath = ROOTPATH . 'public/uploads/Igrfiles/';
|
||||
|
||||
// Create a new ZIP archive
|
||||
$zip = new ZipArchive();
|
||||
|
||||
// Define the name of the ZIP file
|
||||
$zipFileName = $igrno . '.zip';
|
||||
$zipFilePath = $rootPath . $zipFileName;
|
||||
|
||||
if ($zip->open($zipFilePath, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE) {
|
||||
$filesAdded = false;
|
||||
|
||||
// Add each file to the ZIP archive
|
||||
foreach ($fileDetails as $file) {
|
||||
$filePath = $rootPath . $file->file;
|
||||
if (file_exists($filePath)) {
|
||||
if (!$zip->addFile($filePath, $file->filename)) {
|
||||
// Handle error when adding file to ZIP
|
||||
echo '<script>alert("Failed to add file: ' . $file->filename . '");</script>';
|
||||
$zip->close();
|
||||
redirect('ViewIGR', 'refresh');
|
||||
return;
|
||||
}
|
||||
$filesAdded = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Close the ZIP archive
|
||||
$zip->close();
|
||||
|
||||
if ($filesAdded) {
|
||||
// Return the ZIP file as a download
|
||||
return $this->response->download($zipFilePath, null)->setFileName($zipFileName);
|
||||
} else {
|
||||
// Delete the empty ZIP file
|
||||
if (file_exists($zipFilePath)) {
|
||||
unlink($zipFilePath);
|
||||
}
|
||||
echo '<script>alert("There are no files.");</script>';
|
||||
redirect('ViewIGR', 'refresh');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
echo '<script>alert("Failed to create ZIP file");</script>';
|
||||
redirect('ViewIGR', 'refresh');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -40,21 +40,14 @@ class Inwardgateregister_model extends Model
|
||||
$afftectedRows = $this->db->affectedRows();
|
||||
return $afftectedRows;
|
||||
}
|
||||
|
||||
|
||||
function getfies($igr)
|
||||
{
|
||||
|
||||
function getAdditionalIGRFile($igr){
|
||||
$builder = $this->db->table('t_inwardgateregister_fileupload')->select('*')
|
||||
|
||||
->where('IGRNO', $igr);
|
||||
|
||||
->where('IGRNO', $igr);
|
||||
$query = $builder->get();
|
||||
|
||||
return $query->getResult();
|
||||
}
|
||||
|
||||
function fileupload($myfiles)
|
||||
function uploadAdditionalFile($myfiles)
|
||||
{
|
||||
$builder = $this->db->table('t_inwardgateregister_fileupload');
|
||||
$builder->insert($myfiles);
|
||||
@ -62,13 +55,14 @@ class Inwardgateregister_model extends Model
|
||||
return $aff > 0 ? $this->db->insertID() : 0;
|
||||
}
|
||||
|
||||
function deleteBillFile($billno)
|
||||
function deleteAdditionalFile($fileid)
|
||||
{
|
||||
$deleteBillFile = array('Isactive' => 0);
|
||||
$arr = array('Isactive' => 0);
|
||||
$this->db->table('t_inwardgateregister_fileupload')
|
||||
->where('BillNo', $billno)
|
||||
->update($deleteBillFile);
|
||||
return TRUE;
|
||||
->where('BillNo', $fileid)
|
||||
->update($arr);
|
||||
$aff = $this->db->affectedRows();
|
||||
return $aff > 0 ? true : false;
|
||||
}
|
||||
|
||||
|
||||
@ -266,9 +260,7 @@ class Inwardgateregister_model extends Model
|
||||
$builder = $this->db->table('t_igr_details');
|
||||
$builder->insert($igrD);
|
||||
$aff_row = $this->db->affectedRows();
|
||||
log_message('error', 'addigrD Query: ' . $this->db->getLastQuery()->getQuery());
|
||||
|
||||
|
||||
log_message('error', 'addigrD Query: ' . $this->db->getLastQuery()->getQuery());
|
||||
$this->db->transComplete();
|
||||
|
||||
$result = $this->db->table('t_igr_details')
|
||||
@ -277,7 +269,7 @@ class Inwardgateregister_model extends Model
|
||||
->get()
|
||||
->getRow();
|
||||
|
||||
$res = ($aff_row && $result !== null) ? $result->IGRItemNo : 0;
|
||||
$res = ($aff_row > 0) ? $result->IGRItemNo : 0;
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -414,7 +406,7 @@ class Inwardgateregister_model extends Model
|
||||
}
|
||||
}
|
||||
|
||||
function UpdatePOMaster($PONO, $updatedBy)
|
||||
function UpdatePOMaster($PONO, $updatedBy,$IGRStatus)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_purchaseorder_lineitem')->select('*')
|
||||
@ -425,7 +417,7 @@ class Inwardgateregister_model extends Model
|
||||
|
||||
|
||||
if ($query->getNumRows() == 0) {
|
||||
$POStatus = array('status' => IGR_CREATED, 'UpdateBY' => $updatedBy);
|
||||
$POStatus = array('status' => $IGRStatus, 'UpdateBY' => $updatedBy);
|
||||
$this->db->table('t_purchaseorder_master')
|
||||
->where('PONO', $PONO)
|
||||
->update($POStatus);
|
||||
@ -933,5 +925,38 @@ class Inwardgateregister_model extends Model
|
||||
|
||||
}
|
||||
|
||||
public function getAllIgrFileDetails($igrno)
|
||||
{
|
||||
|
||||
// Query 1: Get FilePath and Remarks from t_inwardgateregister_fileupload
|
||||
$builder1 = $this->db->table('t_inwardgateregister_fileupload IFU');
|
||||
$query1 = $builder1->select('IFU.FilePath as file, IFU.Remarks as filename')
|
||||
->where('IFU.IGRNO', $igrno)
|
||||
->where('IFU.Isactive', 1)
|
||||
->get();
|
||||
$result1 = $query1->getResult();
|
||||
|
||||
// Query 2: Get MasterFile from t_igr_master
|
||||
$builder2 = $this->db->table('t_igr_master IM');
|
||||
$query2 = $builder2->select('IM.MasterFile as file, IM.MasterFile as filename')
|
||||
->where('IM.IGRNO', $igrno)
|
||||
->where('IM.MasterFile IS NOT NULL')
|
||||
->get();
|
||||
$result2 = $query2->getResult();
|
||||
|
||||
// Query 3: Get WeightFile from t_igr_details
|
||||
$builder3 = $this->db->table('t_igr_details ID');
|
||||
$query3 = $builder3->select('ID.WeightFile as file, ID.WeightFile as filename')
|
||||
->where('ID.IGRNO', $igrno)
|
||||
->where('ID.WeightFile IS NOT NULL')
|
||||
->get();
|
||||
$result3 = $query3->getResult();
|
||||
|
||||
// Merging results into a single array
|
||||
$results = array_merge($result1, $result2, $result3);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -124,8 +124,9 @@ class Requistion_model extends Model
|
||||
{
|
||||
$builder = $this->db->table('t_costcenter_master Mast ')
|
||||
->select('Mast.CostCenterCode,Mast.CostCenterName')
|
||||
->join('t_costcenter_departments COST', 'COST.CostCenterCode = Mast.CostCenterCode')
|
||||
->where('COST.DEPCode ',$DeptId );
|
||||
->where('Mast.IsActive ',1 );
|
||||
// ->join('t_costcenter_departments COST', 'COST.CostCenterCode = Mast.CostCenterCode','left')
|
||||
// ->where('COST.DEPCode ',$DeptId );
|
||||
$query = $builder->get();
|
||||
|
||||
return $query->getResultArray();
|
||||
|
||||
@ -3224,7 +3224,7 @@ if (!empty($INRSYMBOL)) {
|
||||
</div>
|
||||
<div align="left">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
<label>Req No<span class="badge mandatory">*</span></label>
|
||||
<div>
|
||||
<?php
|
||||
@ -3235,8 +3235,7 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
<label>Department Name</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
@ -3245,7 +3244,7 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
<label>Cost Center Code</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
@ -3278,7 +3277,6 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Item Name</label>
|
||||
<div class="form-group">
|
||||
@ -3333,6 +3331,7 @@ if (!empty($INRSYMBOL)) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<label>Discount Type </label>
|
||||
<div>
|
||||
@ -3372,29 +3371,9 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>CGST in %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditCgst', 'value' => set_value('RevenueEditCgst', 0), 'id' => 'RevenueEditCgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>CGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditAfterCgst', 'value' => set_value('RevenueEditAfterCgst', 0), 'id' => 'RevenueEditAfterCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12" style="text-align:left;">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<label>Packaging Type </label>
|
||||
<div>
|
||||
@ -3434,49 +3413,10 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="SGSTEditModel">
|
||||
<div class="col-md-2">
|
||||
<label>SGST in %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditSgst', 'value' => set_value('RevenueEditSgst', 0), 'id' => 'RevenueEditSgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditAfterSgst', 'value' => set_value('RevenueEditAfterSgst', 0), 'id' => 'RevenueEditAfterSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="IGSTEditModel">
|
||||
<div class="col-md-2">
|
||||
<label>IGST in %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditIgst', 'value' => set_value('RevenueEditIgst', 0), 'id' => 'RevenueEditIgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditAfterIgst', 'value' => set_value('RevenueEditAfterIgst', 0), 'id' => 'RevenueEditAfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<label>Freight Type </label>
|
||||
<div>
|
||||
<?php
|
||||
@ -3526,6 +3466,80 @@ if (!empty($INRSYMBOL)) {
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>CGST in %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditCgst', 'value' => set_value('RevenueEditCgst', 0), 'id' => 'RevenueEditCgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>CGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditAfterCgst', 'value' => set_value('RevenueEditAfterCgst', 0), 'id' => 'RevenueEditAfterCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" id="SGSTEditModel">
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>SGST in %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditSgst', 'value' => set_value('RevenueEditSgst', 0), 'id' => 'RevenueEditSgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditAfterSgst', 'value' => set_value('RevenueEditAfterSgst', 0), 'id' => 'RevenueEditAfterSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" id="IGSTEditModel">
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>IGST in %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditIgst', 'value' => set_value('RevenueEditIgst', 0), 'id' => 'RevenueEditIgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueEditAfterIgst', 'value' => set_value('RevenueEditAfterIgst', 0), 'id' => 'RevenueEditAfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label> Insurance Amt <?php echo "($INRSYM)" ?> (if Any)</label>
|
||||
<div class="form-group">
|
||||
@ -3535,11 +3549,11 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><?php echo "Total Order Amt ($INRSYM)"; ?></label>
|
||||
@ -3663,9 +3677,10 @@ if (!empty($INRSYMBOL)) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="padding:0px;">
|
||||
<div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<label>Discount Type <span class="badge mandatory"></span></label>
|
||||
<div>
|
||||
@ -3705,29 +3720,9 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>CGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueCgst', 'value' => set_value('RevenueCgst', 0), 'id' => 'RevenueCgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();RevenueChangeSgst();');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>CGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueAfterCgst', 'value' => set_value('RevenueAfterCgst', 0), 'id' => 'RevenueAfterCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="text-align:left;">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<label>Packaging Type <span class="badge mandatory"></span></label>
|
||||
<div>
|
||||
@ -3767,50 +3762,10 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="SGSTAddModel">
|
||||
<div class="col-md-2">
|
||||
<label>SGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueSgst', 'value' => set_value('RevenueSgst', 0), 'id' => 'RevenueSgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueAfterSgst', 'value' => set_value('RevenueAfterSgst', 0), 'id' => 'RevenueAfterSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="IGSTAddModel" style="display:none;">
|
||||
<div class="col-md-2">
|
||||
<label>IGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueIgst', 'value' => set_value('RevenueIgst', 0), 'id' => 'RevenueIgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueAfterIgst', 'value' => set_value('RevenueAfterIgst', 0), 'id' => 'RevenueAfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<label>Freight Type <span class="badge mandatory"></label>
|
||||
<div>
|
||||
<?php
|
||||
@ -3849,7 +3804,6 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Freight Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
@ -3859,6 +3813,79 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-8"></div>
|
||||
<div class="col-md-2">
|
||||
<label>CGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueCgst', 'value' => set_value('RevenueCgst', 0), 'id' => 'RevenueCgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();RevenueChangeSgst();');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>CGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueAfterCgst', 'value' => set_value('RevenueAfterCgst', 0), 'id' => 'RevenueAfterCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" style="text-align:left;">
|
||||
<div id="SGSTAddModel">
|
||||
<div class="col-md-8"></div>
|
||||
<div class="col-md-2">
|
||||
<label>SGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueSgst', 'value' => set_value('RevenueSgst', 0), 'id' => 'RevenueSgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueAfterSgst', 'value' => set_value('RevenueAfterSgst', 0), 'id' => 'RevenueAfterSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" style="text-align:left;">
|
||||
<div id="IGSTAddModel" style="display:none;">
|
||||
<div class="col-md-8"></div>
|
||||
<div class="col-md-2">
|
||||
<label>IGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueIgst', 'value' => set_value('RevenueIgst', 0), 'id' => 'RevenueIgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RevenueAfterIgst', 'value' => set_value('RevenueAfterIgst', 0), 'id' => 'RevenueAfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label> Insurance <?php echo "($INRSYM)" ?> (if Any)</label>
|
||||
<div class="form-group">
|
||||
@ -3868,13 +3895,11 @@ if (!empty($INRSYMBOL)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
<div class="col-md-4 ">
|
||||
<label><?php echo "Total Order Amt ($INRSYM)"; ?></label>
|
||||
<div class="form-group">
|
||||
|
||||
@ -2477,7 +2477,7 @@
|
||||
<td align="left"><%=TotalValue%></td>
|
||||
|
||||
<td>
|
||||
<a data-target='#EDITCAPITAL' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick="DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
<a data-target='#EDITCAPITAL' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick="DeleteRow('<%=index%>')" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
@ -2243,7 +2243,7 @@
|
||||
<td align="left"><%=TotalValue%></td>
|
||||
|
||||
<td>
|
||||
<a data-target='#EDITCAPITAL' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick="DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
<a data-target='#EDITCAPITAL' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick="DeleteRow('<%=index%>')" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
@ -576,7 +576,7 @@ if (!empty($RequistionDetails)) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="payablefrom">Import Options</label>
|
||||
<label for="payablefrom">Import Type Options<span class="badge mandatory">*</span></label>
|
||||
|
||||
<?php
|
||||
//$options1 = array("0"=>'Select Import Option');
|
||||
@ -602,7 +602,7 @@ if (!empty($RequistionDetails)) {
|
||||
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="payablefrom">Payable Terms</label>
|
||||
<label for="payablefrom">Payable Terms<span class="badge mandatory">*</span></label>
|
||||
<input type="hidden" name="beforePaymentTerms" value="<?php echo $Terms; ?>">
|
||||
|
||||
|
||||
@ -651,7 +651,7 @@ if (!empty($RequistionDetails)) {
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<label for="payablefrom">Insurance</label>
|
||||
<label for="payablefrom">Insurance<span class="badge mandatory">*</span></label>
|
||||
|
||||
|
||||
|
||||
@ -695,7 +695,7 @@ if (!empty($RequistionDetails)) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="BudgetType">Budget Type</label>
|
||||
<label for="BudgetType">Budget Type<span class="badge mandatory">*</span></label>
|
||||
<select id='BudgetType' name='BudgetType'>
|
||||
<?php if ($BudgetType == 'CAPITAL') {
|
||||
$opt1 = 'CAPITAL';
|
||||
|
||||
@ -2081,7 +2081,7 @@ if (!empty($INRSYMBOL)) {
|
||||
<td align="left"><%=TotalValue%></td>
|
||||
|
||||
<td>
|
||||
<a data-target='#EDITREVENUE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick="DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
<a data-target='#EDITREVENUE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick="DeleteRow('<%=index%>')" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
@ -127,21 +127,21 @@
|
||||
<div class="col-md-4">
|
||||
<label>Invoice Number <span style="color:red; font-size: 15px;">*</span><!-- Delivery Challan/Inv No --></label>
|
||||
<?php
|
||||
$data = array('name' => 'InvoiceNo', 'value' => set_value('InvoiceNo'), 'id' => 'InvoiceNo', 'class' => 'form-control', 'required=>"true"'); // ,'onkeypress'=>'return isNumberKey(event);' );
|
||||
$data = array('name' => 'InvoiceNo', 'value' => set_value('InvoiceNo'), 'id' => 'InvoiceNo', 'class' => 'form-control', 'required=>"true"', 'autocomplete'=>'off'); // ,'onkeypress'=>'return isNumberKey(event);' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Invoice Date <span style="color:red; font-size: 15px;">*</span><!-- Delivery Challan/Inv Date --></label>
|
||||
<?php
|
||||
$data = array('name' => 'InvoiceDate', 'value' => set_value('InvoiceDate'), 'id' => 'InvoiceDate', 'class' => 'form-control num', 'required' => 'true');
|
||||
$data = array('name' => 'InvoiceDate', 'value' => set_value('InvoiceDate'), 'id' => 'InvoiceDate', 'class' => 'form-control num', 'required' => 'true', 'autocomplete'=>'off');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Material Received Date <span style="color:red; font-size: 15px;">*</span></label>
|
||||
<?php
|
||||
$data = array('name' => 'MaterialRcvdDate', 'value' => set_value('MaterialRcvdDate'), 'id' => 'MaterialRcvdDate', 'class' => 'form-control num', 'required' => 'true');
|
||||
$data = array('name' => 'MaterialRcvdDate', 'value' => set_value('MaterialRcvdDate'), 'id' => 'MaterialRcvdDate', 'class' => 'form-control num', 'required' => 'true', 'autocomplete'=>'off');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -150,7 +150,7 @@
|
||||
<div class="col-md-4">
|
||||
<label>Vechicle Number</label>
|
||||
<?php
|
||||
$data = array('name' => 'VehicleNo', 'value' => set_value('VehicleNo'), 'id' => 'VehicleNo', 'class' => 'form-control', 'maxlength' => '20');
|
||||
$data = array('name' => 'VehicleNo', 'value' => set_value('VehicleNo'), 'id' => 'VehicleNo', 'class' => 'form-control', 'maxlength' => '20', 'autocomplete'=>'off');
|
||||
echo form_input($data);
|
||||
?>
|
||||
<!-- <span pattern="" required="true"></span> -->
|
||||
@ -158,14 +158,14 @@
|
||||
<div class="col-md-4">
|
||||
<label>Driver Name</label>
|
||||
<?php
|
||||
$data = array('name' => 'DriverName', 'value' => set_value('DriverName'), 'id' => 'DriverName', 'class' => 'form-control', 'maxlength' => '50');
|
||||
$data = array('name' => 'DriverName', 'value' => set_value('DriverName'), 'id' => 'DriverName', 'class' => 'form-control', 'maxlength' => '50', 'autocomplete'=>'off');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Driver Mobile Number</label>
|
||||
<?php
|
||||
$data = array('name' => 'DriverMobileNumber', 'value' => set_value('DriverMobileNumber'), 'id' => 'DriverMobileNumber', 'class' => 'form-control', 'maxlength' => '50');
|
||||
$data = array('name' => 'DriverMobileNumber', 'value' => set_value('DriverMobileNumber'), 'id' => 'DriverMobileNumber', 'class' => 'form-control', 'maxlength' => '50', 'autocomplete'=>'off');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -206,7 +206,43 @@
|
||||
|
||||
<div class="col-md-4 col-md-offset-8">
|
||||
<input type="file" name="MasterFile" id="images1" onchange="Copyfilenames(this.name); "><br>
|
||||
<button class="btn btn-success" id='IGRDraftLink' type="submit" name='IGRDraftLink' onclick="filecheck(0);">Draft IGR</button>
|
||||
</div>
|
||||
<div class="files">
|
||||
<div class="col-md-4 col-md-offset-8" style="padding-bottom: 15px;">
|
||||
<button type="button" class="btn btn-primary btn-sm a1"
|
||||
onclick="appendFilesFileds()" id="day">
|
||||
Add Additional File
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<?php if(!empty($emp_data)){ foreach ($emp_data as $key => $value) { ?>
|
||||
|
||||
<div class="col-md-12 pad ">
|
||||
<div class="col-md-4">
|
||||
<span>File Name</span>
|
||||
<input type="text" maxlength="255" class="form-control"
|
||||
value="<?php echo $value['file_name']; ?>" readonly>
|
||||
</div>
|
||||
<div class="col-md-1" style="margin-top: 25px;">
|
||||
<a href="<?php echo base_url() . 'public/uploads/images/emp_files/' . $value['emp_file']; ?>"
|
||||
download>
|
||||
<i class="fa fa-download" aria-hidden="true"
|
||||
style="font-size: 25px;"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-5" style="margin-top: 23px;">
|
||||
<button type="button" class="btn btn-danger btn-sm"
|
||||
id="<?= $value['id']; ?>"
|
||||
onclick="removeContact(this)">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }} ?>
|
||||
|
||||
<div id="filesContainer"></div>
|
||||
</div><br>
|
||||
<div class="col-md-4 col-md-offset-8">
|
||||
<button class="btn btn-success" id='IGRDraftLink' type="submit" name='IGRDraftLink' onclick="filecheck(0);">Save as Draft IGR</button>
|
||||
<button class="btn btn-success" id='IGRLink' type="submit" name='IGRLink' onclick="filecheck(1);">Generate IGR</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -267,7 +303,7 @@
|
||||
<label for="GrossWeight" class="col-md-2 col-form-label">Gross Weight</label>
|
||||
<div class="col-md-5">
|
||||
<?php
|
||||
$data = array('name' => 'GrossWeight', 'value' => set_value('GrossWeight'), 'id' => 'GrossWeight', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'maxlength' => '50', 'onchange' => 'WeightDiffer(this);', 'placeholder' => 'Gross Weight Value (A)');
|
||||
$data = array('name' => 'GrossWeight', 'value' => set_value('GrossWeight'), 'id' => 'GrossWeight', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'maxlength' => '50', 'onchange' => 'WeightDiffer(this);', 'placeholder' => 'Gross Weight Value (A)', 'autocomplete'=>"off");
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -283,7 +319,7 @@
|
||||
<label for="TareWeight" class="col-md-2 col-form-label">Tare Weight</label>
|
||||
<div class="col-md-5">
|
||||
<?php
|
||||
$data = array('name' => 'TareWeight', 'value' => set_value('TareWeight'), 'id' => 'TareWeight', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'maxlength' => '50', 'onchange' => 'validateTareWeight(this);', 'placeholder' => 'Enter your username', 'placeholder' => 'Tare Weight Value (B)');
|
||||
$data = array('name' => 'TareWeight', 'value' => set_value('TareWeight'), 'id' => 'TareWeight', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'maxlength' => '50', 'onchange' => 'validateTareWeight(this);', 'autocomplete' => 'off', 'placeholder' => 'Tare Weight Value (B)', 'autocomplete'=>"off");
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -325,15 +361,8 @@
|
||||
</div><!-- modal content div closed-->
|
||||
</div><!-- modal content closed-->
|
||||
</div><!-- modal fade closed-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- WeightCalculator modal ended-->
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@ -348,7 +377,8 @@
|
||||
<script>
|
||||
function validate() {
|
||||
var rowcount = $("#txtRowCount").val();
|
||||
|
||||
var isOpenOrder = parseInt($("#hiddenIsOpenOrder").val(), 2);
|
||||
var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? 0 : 1;
|
||||
var Noval = 0;
|
||||
var isExceed = 0;
|
||||
for (k = 1; k <= rowcount; k++) {
|
||||
@ -383,7 +413,7 @@
|
||||
} else if (Noval == 0) {
|
||||
alert('Invoice Quantity is Empty.Please Enter the value');
|
||||
return false;
|
||||
} else if (isExceed == 1) {
|
||||
} else if (isExceed == 1 && formatted_IsOpenOrder == 0) {
|
||||
alert("Invoice Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
|
||||
return false;
|
||||
} else {
|
||||
@ -446,6 +476,8 @@
|
||||
var isOpenOrder = parseInt(obj.IsOpenOrder, 2);
|
||||
var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "" : "Open";
|
||||
$('.help-block').text(formatted_IsOpenOrder);
|
||||
var button_text_for_IGRDraftLink = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "Save as Draft IGR" : "Save as Open IGR";
|
||||
$('#IGRDraftLink').text(button_text_for_IGRDraftLink);
|
||||
//$("#Add").val(obj.Address);
|
||||
$("#del").val(obj.DeliveryDate);
|
||||
//$("#ser").val(obj.ServiceDescription);
|
||||
@ -476,11 +508,11 @@
|
||||
'<td name="MaterialName" id="MaterialCode" >' + item.MaterialCode + '</td>' +
|
||||
'<td>' + item.MaterialName + '</td>' +
|
||||
'<td name="UOM">' + item.UOM + '</td>' +
|
||||
'<td name="Quantity1' + i + '" id="Quantity_1' + i + '">' + item.Quantity + '</td>' +
|
||||
'<td name="Quantity1' + i + '" id="Quantity_1' + i + '">' + item.Quantity + '</td>' +
|
||||
'<td name="ReceivedQuantity' + i + '" id="ReceivedQuantity' + i + '">' + item.ReceivedQuantity + '</td>' +
|
||||
'<td name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + item.PendingQty + '</td>' +
|
||||
'<td data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="" onkeypress="return isNumberKey(event);"></td>' +
|
||||
'<td><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')"> </td>' +
|
||||
'<td data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="" onkeypress="return isNumberKey(event);" autocomplete="off"></td>' +
|
||||
'<td><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" autocomplete="off"> </td>' +
|
||||
'<td><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
||||
'</tr>';
|
||||
$('#txtRowCount').val(i);
|
||||
@ -619,7 +651,9 @@
|
||||
var RecQty = parseFloat($('#txtReceivedQuantity' + Rowid).val() == '' ? '0.00' : $('#txtReceivedQuantity' + Rowid).val());
|
||||
var OrderedQty = parseFloat($("#Quantity_1" + Rowid).text());
|
||||
var r = $("#Remark" + Rowid).val();
|
||||
|
||||
var isOpenOrder = parseInt($("#hiddenIsOpenOrder").val(), 2);
|
||||
var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? 0 : 1;
|
||||
if(formatted_IsOpenOrder == 0){
|
||||
if ((InvoiceQty + RecQty) > OrderedQty) {
|
||||
alert("Invoice Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
|
||||
$("#QuantityAsPerInvoice" + Rowid).focus();
|
||||
@ -638,6 +672,11 @@
|
||||
$("#txtQuantityAsPerInvoice" + Rowid).val(InvoiceQty);
|
||||
// InvoiceQty
|
||||
return true;
|
||||
}}else{
|
||||
$('#txtPendingQty' + Rowid).val(0.00);
|
||||
$("#txtQuantityAsPerInvoice" + Rowid).val(0.00);
|
||||
// InvoiceQty
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -818,4 +857,42 @@
|
||||
console.log("Saving values for index: " + inx + " undefined");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function appendFilesFileds(data) {
|
||||
var newRowHtml = `
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-4">
|
||||
<span for="file_name">File name</span>
|
||||
<input type="text" id="file_name" name="file_name[]" maxlength="255" class="form-control" value="${data != null && data != '' ? data.file_name : ''}">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<span for="emp_file">File</span>
|
||||
<input type="file" name="emp_file[]" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-4" style="margin-top: 23px;">
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)">Remove</button>
|
||||
<button type="button" class="btn btn-primary btn-sm a1" onclick="appendFilesFileds()">Add</button>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
$('#filesContainer').append(newRowHtml);
|
||||
$('.a1').hide();
|
||||
$('#filesContainer .pad:last .a1').show();
|
||||
}
|
||||
|
||||
function removeContact(button) {
|
||||
$(button).closest('.pad').remove();
|
||||
$('#filesContainer .a1').hide();
|
||||
$('#filesContainer .pad:last .a1').show();
|
||||
var len = $('#filesContainer .pad:last .a1')
|
||||
var length = len.length;
|
||||
if (length == 0) {
|
||||
$('#day').show()
|
||||
} else {
|
||||
$('#day').hide()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@ -88,12 +88,17 @@
|
||||
echo $date->format('d-m-Y'); ?></td>
|
||||
<td><?php echo $record->VehicleNo ?></td>
|
||||
<td><?php echo $record->IGRStatus == 'ST074' ? 'Draft' : 'Completed'; ?></td>
|
||||
<td><?php if (!empty($record->FilePath)) { ?>
|
||||
<a target="_blank" data-toggle="modal" data-target="#Fileshow" data-id="<%=index%>" title="Files" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><i class="fa fa-clone" style="text-align: center;"></i></a>
|
||||
<td>
|
||||
<a target="_blank" href="<?php echo base_url('download-files/' . $record->IGRNO); ?>">
|
||||
<i class="fa fa-download" style="text-align: center;"></i>
|
||||
</a>
|
||||
|
||||
<?php if (!empty($record->FilePath)) { ?>
|
||||
<!-- <a target="_blank" data-toggle="modal" data-target="#Fileshow" data-id="<%=index%>" title="Files" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><i class="fa fa-clone" style="text-align: center;"></i></a> -->
|
||||
<?php } else if (!empty($record->file)) { ?>
|
||||
<a target="_blank" data-toggle="modal" data-target="#Fileshow" data-id="<%=index%>" title="Files" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><i class="fa fa-clone" style="text-align: center;"></i></a>
|
||||
<!-- <a target="_blank" data-toggle="modal" data-target="#Fileshow" data-id="<%=index%>" title="Files" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><i class="fa fa-clone" style="text-align: center;"></i></a> -->
|
||||
<?php } else { ?>
|
||||
<a target="_blank" data-toggle="modal" data-target="#Fileshow" data-id="<%=index%>" title="Files" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><i class="fa fa-clone" style="text-align: center;"></i></a>
|
||||
<!-- <a target="_blank" data-toggle="modal" data-target="#Fileshow" data-id="<%=index%>" title="Files" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><i class="fa fa-clone" style="text-align: center;"></i></a> -->
|
||||
<?php } ?>
|
||||
|
||||
<a target="_blank" data-toggle="modal" data-target="#Historyshow" data-id="<%=index%>" title="IGR History" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>">
|
||||
@ -147,6 +152,8 @@
|
||||
?>
|
||||
</div>
|
||||
<input type="hidden" id="IGRNO1" name="IGRNumber" readonly>
|
||||
<input type="hidden" id="PONO1" name="PONumber" readonly>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12" style="margin: 10px 0;">
|
||||
<div class="col-md-4">
|
||||
@ -198,15 +205,15 @@
|
||||
<table class="table table-bordered" id="Inwardgateregistertable1 table-hover" style="background-color:#fff; font-size:12px;">
|
||||
<thead style="background-color:#ddd !important">
|
||||
<tr>
|
||||
<th>SNo</th>
|
||||
<th>Item Code</th>
|
||||
<th>Item Description</th>
|
||||
<th>UOM</th>
|
||||
<th>Ordred Qty</th>
|
||||
<th>Received Qty</th>
|
||||
<th id="pendingQuantityHeader" style="display:none;">Pending Qty</th>
|
||||
<th>Remarks</th>
|
||||
<th></th>
|
||||
<th style="width: 50px;">SNo</th>
|
||||
<th style="width: 100px;">Item Code</th>
|
||||
<th style="width: 200px; word-wrap: break-word; word-break: break-all; white-space: normal;">Item Description</th>
|
||||
<th style="width: 50px;">UOM</th>
|
||||
<th style="width: 100px;">Ordered Qty</th>
|
||||
<th style="width: 100px;">Received Qty</th>
|
||||
<th id="pendingQuantityHeader" style="display:none; width: 100px;">Pending Qty</th>
|
||||
<th style="width: 150px;">Remarks</th>
|
||||
<th style="width: 50px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbleIGRAppend">
|
||||
@ -222,7 +229,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
<!-- <a class="btn btn-primary" id="update" value="Update">Update</a> -->
|
||||
<div class="col-md-4 col-md-offset-8">
|
||||
<input type="file" name="MasterFile" id="MasterFile" onchange="Copyfilenames(this.name); ">
|
||||
@ -230,14 +237,25 @@
|
||||
<a><span></span><small></small></a>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="buttonContainer">
|
||||
<a class="btn btn-cancel" data-dismiss="modal" value="Close">Close</a>
|
||||
<a class="btn btn-primary" id="draftIGR" value="draftIGR">Draft IGR</a>
|
||||
<a class="btn btn-primary" id="generateIGR" value="generateIGR">Generate IGR</a>
|
||||
|
||||
<div class="files">
|
||||
<div class="col-md-4 col-md-offset-8" style="padding: 15px 0px;">
|
||||
<button type="button" class="btn btn-primary btn-sm a1"
|
||||
onclick="appendFilesFileds()" id="day">
|
||||
Add Additional File
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="existingContainer"></div>
|
||||
<div id="filesContainer"></div>
|
||||
</div><br>
|
||||
<div class="modal-footer">
|
||||
<div class="buttonContainer">
|
||||
<a class="btn btn-cancel" data-dismiss="modal" value="Close">Close</a>
|
||||
<a class="btn btn-primary" id="draftIGR" value="draftIGR">Save as Draft IGR</a>
|
||||
<a class="btn btn-primary" id="generateIGR" value="generateIGR">Generate IGR</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -423,8 +441,6 @@
|
||||
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data">
|
||||
<div class="modal-body" style="padding:0px;">
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-5">
|
||||
|
||||
@ -512,11 +528,13 @@
|
||||
// success:function(data) {
|
||||
$('#content').loader('hide');
|
||||
var parsedData = JSON.parse(data);
|
||||
if (parsedData.length === 0) {
|
||||
console.log(parsedData);
|
||||
if (parsedData['details'].length === 0) {
|
||||
console.log("No data available");
|
||||
// Reset all relevant fields and table
|
||||
$('#IgrshowTitle').text('');
|
||||
$("#IGRNO1").val('');
|
||||
$("#PONO1").val('');
|
||||
$("#txtIGRLineItem").val('');
|
||||
$('#printLink').attr('href', '#');
|
||||
$('.help-block').text('');
|
||||
@ -540,11 +558,12 @@
|
||||
|
||||
var trIGRHTML = '';
|
||||
|
||||
$.each(parsedData, function(i, item) {
|
||||
$.each(parsedData['details'], function(i, item) {
|
||||
if (igr == item.IGRNO) {
|
||||
console.log(item);
|
||||
$('#IgrshowTitle').text(" ( " + item.IGRNO + " ) ");
|
||||
$("#IGRNO1").val(item.IGRNO);
|
||||
$("#PONO1").val(item.PONO);
|
||||
$("#txtIGRLineItem").val(item.IGRItemNo);
|
||||
var baseUrl = '<?php echo base_url(); ?>purchaseorder/CreatePOPrint';
|
||||
var newUrl = baseUrl + '?PONO=' + item.PONO + '&ReqType=' + item.POType;
|
||||
@ -591,15 +610,15 @@
|
||||
$("#pendingQuantityHeader").css("display", "table-cell");
|
||||
|
||||
trIGRHTML += '<tr>' +
|
||||
'<td align="right">' + i + '</td>' +
|
||||
'<td name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
||||
'<td>' + item.MaterialName + '</td>' +
|
||||
'<td name="UOM">' + item.UOM + '</td>' +
|
||||
'<td align="right" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>' +
|
||||
'<td align="right" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>' +
|
||||
'<td name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + parseInt(item.Quantity - item.QuantityAsPerInvoice) + '</td>' +
|
||||
'<td><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;"> </td>' +
|
||||
'<td><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="'+i+'" data-material="'+item.MaterialName+'" data-igrstatus = "'+igrstatus+'"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
||||
'<td style="width: 50px;" align="right">' + i + '</td>' +
|
||||
'<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
||||
'<td style="width: 200px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
|
||||
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
|
||||
'<td style="width: 100px;" align="right" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>' +
|
||||
'<td style="width: 100px;" align="right" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>' +
|
||||
'<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + parseInt(item.Quantity - item.QuantityAsPerInvoice) + '</td>' +
|
||||
'<td style="width: 150px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;"> </td>' +
|
||||
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="'+i+'" data-material="'+item.MaterialName+'" data-igrstatus = "'+igrstatus+'"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
||||
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
|
||||
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
|
||||
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
|
||||
@ -622,14 +641,14 @@
|
||||
} else {
|
||||
$("#pendingQuantityHeader").css("display", "none");
|
||||
trIGRHTML += '<tr>' +
|
||||
'<td align="right">' + i + '</td>' +
|
||||
'<td name="MaterialName" id="MaterialCode" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
||||
'<td>' + item.MaterialName + '</td>' +
|
||||
'<td name="UOM">' + item.UOM + '</td>' +
|
||||
'<td align="right" name="Quantity">' + item.Quantity + '</td>' +
|
||||
'<td align="right" data-name="sel" >' + item.QuantityAsPerInvoice + '</td>' +
|
||||
'<td>' + item.Remarks + '</td>' +
|
||||
'<td><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="'+i+'" data-material="'+item.MaterialName+'" data-igrstatus = "'+igrstatus+'"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
||||
'<td style="width: 50px;" align="right">' + i + '</td>' +
|
||||
'<td style="width: 100px;" name="MaterialName" id="MaterialCode" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
||||
'<td style="width: 200px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
|
||||
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
|
||||
'<td style="width: 100px;" align="right" name="Quantity">' + item.Quantity + '</td>' +
|
||||
'<td style="width: 100px;" align="right" data-name="sel" >' + item.QuantityAsPerInvoice + '</td>' +
|
||||
'<td style="width: 150px;">' + item.Remarks + '</td>' +
|
||||
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="'+i+'" data-material="'+item.MaterialName+'" data-igrstatus = "'+igrstatus+'"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
||||
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
|
||||
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
|
||||
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
|
||||
@ -650,6 +669,11 @@
|
||||
|
||||
$("#tbleIGRAppend").empty();
|
||||
$("#tbleIGRAppend").append(trIGRHTML);
|
||||
if (parsedData['files'].length !== 0) {
|
||||
$.each(parsedData['files'], function(i, item) {
|
||||
appendExistingFilesFileds(item)
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -675,6 +699,7 @@
|
||||
$('#draftIGR').click(function(){
|
||||
$('#content').loader('show');
|
||||
var igrno = $("#IGRNO1").val();
|
||||
var pono = $("#PONO1").val();
|
||||
var status = 0;
|
||||
var tableData = [];
|
||||
$('#tbleIGRAppend tr').each(function(index) {
|
||||
@ -694,8 +719,12 @@
|
||||
};
|
||||
tableData.push(rowData);
|
||||
});
|
||||
|
||||
var formData = new FormData();
|
||||
// file_name[]
|
||||
// emp_file[]
|
||||
formData.append('igr', igrno);
|
||||
formData.append('po', pono);
|
||||
formData.append('mrc', $("#MaterialRcvdDate").val());
|
||||
formData.append('invdate', $("#Invoice_Date").val());
|
||||
formData.append('vehicle_no', $('#Vehicle_No').val());
|
||||
@ -704,6 +733,16 @@
|
||||
formData.append('status', status);
|
||||
formData.append('tableData', JSON.stringify(tableData));
|
||||
formData.append('MasterFile', $('#MasterFile')[0].files[0]);
|
||||
formData.append('file_name[]', $('#file_name').val());
|
||||
var empFiles = $('#emp_file')[0] ? $('#emp_file')[0].files : null;
|
||||
if (empFiles) {
|
||||
for (var i = 0; i < empFiles.length; i++) {
|
||||
formData.append('emp_file[]', empFiles[i]);
|
||||
console.log(empFiles[i]);
|
||||
}
|
||||
}else{
|
||||
console.log("ajax call");
|
||||
}
|
||||
$.ajax({
|
||||
data: formData,
|
||||
type: "POST",
|
||||
@ -720,6 +759,7 @@
|
||||
$('#generateIGR').click(function(){
|
||||
$('#content').loader('show');
|
||||
var igrno = $("#IGRNO1").val();
|
||||
var pono = $("#PONO1").val();
|
||||
var status = 1;
|
||||
var tableData = [];
|
||||
$('#tbleIGRAppend tr').each(function(index) {
|
||||
@ -741,6 +781,7 @@
|
||||
});
|
||||
var formData = new FormData();
|
||||
formData.append('igr', igrno);
|
||||
formData.append('po', pono);
|
||||
formData.append('mrc', $("#MaterialRcvdDate").val());
|
||||
formData.append('invdate', $("#Invoice_Date").val());
|
||||
formData.append('vehicle_no', $('#Vehicle_No').val());
|
||||
@ -749,7 +790,16 @@
|
||||
formData.append('status', status);
|
||||
formData.append('tableData', JSON.stringify(tableData));
|
||||
formData.append('MasterFile', $('#MasterFile')[0].files[0]);
|
||||
|
||||
formData.append('file_name[]', $('#file_name').val());
|
||||
var empFiles = $('#emp_file')[0] ? $('#emp_file')[0].files : null;
|
||||
if (empFiles) {
|
||||
for (var i = 0; i < empFiles.length; i++) {
|
||||
formData.append('emp_file[]', empFiles[i]);
|
||||
console.log(empFiles[i]);
|
||||
}
|
||||
}else{
|
||||
console.log("ajax call");
|
||||
}
|
||||
$.ajax({
|
||||
data: formData,
|
||||
type:"POST",
|
||||
@ -1023,10 +1073,10 @@ $("#hidebillno").val(Billno);
|
||||
function deleteBill(Billno,i){
|
||||
$.ajax({
|
||||
data: {
|
||||
Billno: Billno,
|
||||
id: Billno,
|
||||
},
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>deleteBillFile",
|
||||
url: "<?php echo base_url() ?>deleteAdditionalFile",
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
alert(data);
|
||||
@ -1498,4 +1548,100 @@ $(document).ready(function() {
|
||||
.dataTables_wrapper .col-sm-3 .dt-buttons {
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
<script>
|
||||
function appendExistingFilesFileds(data){
|
||||
const base_url = '<?php echo base_url(); ?>';
|
||||
var filePath = data != null && data != '' ? data.FilePath : '';
|
||||
var fileName = data != null && data != '' ? data.Remarks : '';
|
||||
var billNo = data != null && data != '' ? data.BillNo : '';
|
||||
var downloadUrl = `${base_url}public/uploads/Igrfiles/${filePath}`;
|
||||
|
||||
var newRowHtml = `<div class="col-md-12 pad ">
|
||||
<div class="col-md-4">
|
||||
<span>File Name</span>
|
||||
<input type="text" maxlength="255" class="form-control"
|
||||
value="${fileName}" readonly>
|
||||
</div>
|
||||
<div class="col-md-1" style="margin-top: 25px;">
|
||||
|
||||
<a href="${downloadUrl}" download>
|
||||
|
||||
<i class="fa fa-download" aria-hidden="true"
|
||||
style="font-size: 25px;"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-5" style="margin-top: 23px;">
|
||||
<button type="button" class="btn btn-danger btn-sm"
|
||||
value="${billNo}" onclick="removeContact(this)">Delete</button>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
$('#existingContainer').append(newRowHtml);
|
||||
}
|
||||
function appendFilesFileds(data) {
|
||||
var newRowHtml = `
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-4">
|
||||
<span for="file_name">File name</span>
|
||||
<input type="text" id="file_name" name="file_name[]" maxlength="255" class="form-control" value="${data != null && data != '' ? data.file_name : ''}">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<span for="emp_file">File</span>
|
||||
<input type="file" id="emp_file" name="emp_file[]" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-4" style="margin-top: 23px;">
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)">Remove</button>
|
||||
<button type="button" class="btn btn-primary btn-sm a1" onclick="appendFilesFileds()">Add</button>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
$('#filesContainer').append(newRowHtml);
|
||||
$('.a1').hide();
|
||||
$('#filesContainer .pad:last .a1').show();
|
||||
}
|
||||
|
||||
// function removeContact(button) {
|
||||
// $(button).closest('.pad').remove();
|
||||
// $('#filesContainer .a1').hide();
|
||||
// $('#filesContainer .pad:last .a1').show();
|
||||
// var len = $('#filesContainer .pad:last .a1')
|
||||
// var length = len.length;
|
||||
// if (length == 0) {
|
||||
// $('#day').show()
|
||||
// } else {
|
||||
// $('#day').hide()
|
||||
// }
|
||||
// }
|
||||
function removeContact(button) {
|
||||
if (button.id != '') {
|
||||
$.ajax({
|
||||
data: {
|
||||
id: button.id
|
||||
},
|
||||
type: "POST",
|
||||
url: "<?php echo base_url();?>deleteAdditionalIGRFile",
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
alert("File removed");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
$(button).closest('.pad').remove();
|
||||
$('#filesContainer .a1').hide();
|
||||
$('#filesContainer .pad:last .a1').show();
|
||||
var len = $('#filesContainer .pad:last .a1')
|
||||
var length = len.length;
|
||||
if (length == 0) {
|
||||
$('#day').show()
|
||||
} else {
|
||||
$('#day').hide()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
BIN
public/uploads/POfiles/SECLIENT.jpg
Normal file
BIN
public/uploads/POfiles/SECLIENT.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
public/uploads/POfiles/SupplierBills.png
Normal file
BIN
public/uploads/POfiles/SupplierBills.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
public/uploads/POfiles/WorkPlace2.jpeg
Normal file
BIN
public/uploads/POfiles/WorkPlace2.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
BIN
public/uploads/POfiles/WorkPlace2_1.jpeg
Normal file
BIN
public/uploads/POfiles/WorkPlace2_1.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
BIN
public/uploads/POfiles/WorkPlace2_2.jpeg
Normal file
BIN
public/uploads/POfiles/WorkPlace2_2.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
BIN
public/uploads/POfiles/WorkPlace3.jpeg
Normal file
BIN
public/uploads/POfiles/WorkPlace3.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
1171
public/uploads/POfiles/ria_test.sql
Normal file
1171
public/uploads/POfiles/ria_test.sql
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user