Merge branch 'CI4-Application' of bitbucket.org:venbainformationtechnology/ria into CI4-Application

This commit is contained in:
bitbucket 2024-08-20 09:56:40 +05:30
commit f257210241
2 changed files with 89 additions and 73 deletions

View File

@ -371,11 +371,12 @@ class Inwardgateregister extends BaseController
foreach ($files['emp_file'] as $index => $file) {
if ($file->isValid() && !$file->hasMoved()) {
// Move the file to the desired directory
$finallyfilename = (!empty($fileNames[$index])) ? $fileNames[$index] : $file->getName();
$newName = $file->getRandomName();
$file->move($path, $newName);
// Store the file information in the database
$additionalFiles = array(
'Remarks' => $fileNames[$index],
'Remarks' => $finallyfilename,
'FilePath' => $newName,
'IGRNO' => $IGRNO,
'PONO' => $PONO
@ -383,7 +384,7 @@ class Inwardgateregister extends BaseController
$lastInsertFileId = $this->inwardgateregister_model->uploadAdditionalFile($additionalFiles);
if ($lastInsertFileId) {
$fileupdated_count++;
$fileupdated_name[] = $fileNames[$index];
$fileupdated_name[] = $finallyfilename;
}
}
}
@ -478,11 +479,17 @@ class Inwardgateregister extends BaseController
log_message('error', 'SaveIGR igrDetails result : ' . json_encode($igrDetails));
$igrlineno = "";
if (strlen($QuantityAsPerInvoice) > 0 && $QuantityAsPerInvoice != '0' && ((int)$IsThisOpenOrderPO != 1)){
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
$igrlineno = !empty($igrD) ? $igrD : '';
}else if((int)$IsThisOpenOrderPO == 1){
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
$igrlineno = !empty($igrD) ? $igrD : '';
}
if($igrlineno){
$itemvalue = '';
$SupplierId = '';
$polineitemvalue = $this->inwardgateregister_model->getitemvalue($PONO, $MaterialCode);
foreach ($polineitemvalue as $it) {
$itemvalue = $it->Rate;
@ -536,7 +543,7 @@ class Inwardgateregister extends BaseController
$av_qty = $gt->Current_stock;
}
}
$currentav_qty = $QuantityAsPerInvoice + $av_qty;
$currentav_qty = (int)$QuantityAsPerInvoice + (int)$av_qty;
$current_qty = array('Current_stock' => $currentav_qty);
$this->inwardgateregister_model->addmaterialmaster($current_qty, $MaterialCode);
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO, $MaterialCode);
@ -546,10 +553,16 @@ class Inwardgateregister extends BaseController
$ReceivedQuantity = $key->ReceivedQuantity;
}
}
$totalReceivedqty = (int)$IsThisOpenOrderPO == 1 ? 0 : $ReceivedQuantity + $QuantityAsPerInvoice ;
$totalReceivedqty = (int)$IsThisOpenOrderPO == 1 ? 0 : (int)$ReceivedQuantity + (int)$QuantityAsPerInvoice ;
// $totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
if(((int)$totalReceivedqty > 0) && ((int)$IsThisOpenOrderPO != 1)){
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
}else if((int)$IsThisOpenOrderPO == 1){
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
}
}
}
$this->inwardgateregister_model->UpdatePOMaster($PONO, $CreatedBy,$IGRStatus);
@ -710,11 +723,12 @@ function viewIGRDetails()
if ($file->isValid() && !$file->hasMoved()) {
// Move the file to the desired directory
$finallyfilename = (!empty($fileNames[$index])) ? $fileNames[$index] : $file->getName();
$newName = $file->getRandomName();
$file->move($path, $newName);
// Store the file information in the database
$additionalFiles = array(
'Remarks' => $fileNames[$index],
'Remarks' => $finallyfilename,
'FilePath' => $newName,
'IGRNO' => $IGRNo,
'PONO' => $PONo
@ -722,7 +736,7 @@ function viewIGRDetails()
$lastInsertFileId = $this->inwardgateregister_model->uploadAdditionalFile($additionalFiles);
if ($lastInsertFileId) {
$fileupdated_count++;
$fileupdated_name[] = $fileNames[$index];
$fileupdated_name[] = $finallyfilename;
}
}
}

View File

@ -700,6 +700,7 @@ console.log(parsedData);
if (item.MasterFile !== null && item.MasterFile !== undefined && item.MasterFile.trim() !== "") {
modal.find('#MasterFileLabel a').attr('href', '<?php echo base_url() ?>' + 'public/uploads/Igrfiles/' + item.MasterFile);
modal.find('#MasterFileLabel a').attr('title', 'previously uploaded IGR Master File');
modal.find('#MasterFileLabel a').attr('target', '_blank');
modal.find('#MasterFileLabel a span').text('previously uploaded - ');
modal.find('#MasterFileLabel a small').text(item.MasterFile);
modal.find('#MasterFileLabel').show();
@ -1283,6 +1284,7 @@ function deleteBill(Billno,i){
if (fileName !== 'null' && fileName !== undefined && fileName.trim() !== "") {
modal.find('#WeightFileLabel a').attr('title', 'previously uploaded IGR Weight File');
modal.find('#WeightFileLabel a').attr('href', '<?php echo base_url() ?>'+'public/uploads/Igrfiles/'+fileName);
modal.find('#WeightFileLabel a').attr('target', '_blank');
modal.find('#WeightFileLabel a span').text('previously uploaded - ');
modal.find('#WeightFileLabel a small').text(fileName);
modal.find('#WeightFileLabel').show();