Emergency PO changes-1 vadivel J 03-12--2024

This commit is contained in:
vadivelJ96 2024-12-03 18:01:58 +05:30
parent 7ad0d2853c
commit bef33dc5cd
3 changed files with 988 additions and 1169 deletions

View File

@ -297,34 +297,22 @@ class Emergencypurchaseorder extends BaseController
}
if ($POStatus == SPECIAL_PO) {
$count = $this->request->getPost('hidecounters');
$constant = $this->request->getPost('hideconstants');
$serviceFilesLength = $this->request->getPost('serviceFilesLength');
$file = $this->request->getFiles();
if($serviceFilesLength > 0){ $listOfFiles = $serviceFilesLength ;}
$arr = [];
$prefile = array();
for ($i = 1; $i <= $constant; $i++) {
for ($i = 1; $i <= $listOfFiles; $i++) {
$file = $this->request->getFile('browseFiles' . $i);
$requestfilename = $file->getName();
if (!empty($requestfilename)) {
$files = str_replace(" ", "", $requestfilename);
$fcount = 0;
foreach ($prefile as $value) {
if ($value == $files) {
$fcount++;
}
}
if ($fcount == 0) {
if ($file->isValid() && !$file->hasMoved()) {
$path = ROOTPATH.'public/uploads/BillFiles/';
if(!is_dir($path)) { mkdir($path, 0777, true); }
@ -334,28 +322,14 @@ class Emergencypurchaseorder extends BaseController
//echo $Picture;
$arr[] = array($Picture);
}
$prefile[] = $files;
}
$prefile[] = trim($requestfilename);
}
//print_r($arr);
if (!empty($arr)) {
foreach ($arr as $ma) {
$index = 0;
foreach ($ma as $key => $value) {
$index++;
if ($index == 1) {
$filename = $value;
}
}
if (!empty($filename)) {
foreach ($arr as $filename) {
$myfile = array('FilePath' => $filename, 'PONO' => $PONO);
$this->purchaseorder_model->fileupload($myfile);
}
}
}
}
@ -723,7 +697,7 @@ class Emergencypurchaseorder extends BaseController
//echo $PendingQty.'ReceivedQty'.$ReceivedQty;
//echo ' ';
if (strlen((string)$QuantityAsPerInvoice) > 0 && $QuantityAsPerInvoice != '0') {
if (strlen((string)$QuantityAsPerInvoice) > 0 && $QuantityAsPerInvoice != '0') {
$Remarks = "Special PO Created";
$ItemStatus = '';
//if($QuantityAsPerInvoice == $OrderedQuantity)
@ -740,14 +714,9 @@ class Emergencypurchaseorder extends BaseController
$igrDetails = array('IGRNO' => $IGRNO, 'MaterialCode' => $MaterialCode, 'QuantityAsPerInvoice' => $QuantityAsPerInvoice, 'Remarks' => $Remarks, 'IGRItemStatus' => $IGRItemStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt);
//print_r($igrDetails);
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
$IGRItemNo = !empty($igrD) ? $igrD : '';
//echo $IGRItemNo;
$MaterialstockHistoryadd = array('Ref_No' => $IGRItemNo, 'MaterialCode' => $MaterialCode, 'Transaction_type' => 'Add', 'Ref_Type' => 'IGR', 'SupplierID' => $SupplierID, 'Quantity' => $QuantityAsPerInvoice, 'ItemValue' => $itemRate, 'CreatedBy' => $CreatedBy, 'CreatedOn' => $createddt);
@ -797,77 +766,52 @@ class Emergencypurchaseorder extends BaseController
}
//$myfile = array('FilePath'=>$filename);
// $emergencyitemcode = $this->request->getPost('emergencyitemcode'.$i);
// ($this->request->getPost('materialCode'.$i));
}
$counts = $this->request->getPost('hidecounter');
$constants = $this->request->getPost('hideconstant');
$revenueFilesLength = $this->request->getPost('revenueFilesLength');
$serviceFilesLength = $this->request->getPost('serviceFilesLength');
$file = $this->request->getFiles();
dd($file);
$arr = [];
$prefile = array();
for ($i = 1; $i <= $constants; $i++) {
$listOfFiles = 0 ;
if($revenueFilesLength > 0){ $listOfFiles = $revenueFilesLength ;}
if($serviceFilesLength > 0){ $listOfFiles = $serviceFilesLength ;}
for ($i = 1; $i <= $listOfFiles; $i++) {
$file = $this->request->getFile('browseFiles' . $i);
$requestfilename = $file->getName();
if (!empty($requestfilename)) {
$files = str_replace(" ", "", $requestfilename);
$fcount = 0;
foreach ($prefile as $value) {
if ($value == $files) {
$fcount++;
}
}
if ($fcount == 0) {
if ($file->isValid() && !$file->hasMoved()) {
if ($file->isValid() && !$file->hasMoved()){
$path = ROOTPATH.'public/uploads/BillFiles/';
if(!is_dir($path)) { mkdir($path, 0777, true); }
if(!is_dir($path)) { mkdir($path, 0777, true);}
$Picture = $file->getName();
$file->move($path,$Picture);
}
//echo $Picture;
$arr[] = array($Picture);
}
}
$prefile[] = $files;
$arr[] = array($Picture);
$prefile[] = trim($requestfilename);
}
}
if (!empty($arr)) {
foreach ($arr as $ma) {
$index = 0;
$filename = null;
foreach ($ma as $key => $value) {
$index++;
if ($index == 1) {
$filename = $value;
}
}
if (!empty($filename)) {
foreach ($arr as $filename) {
$myfile = array('FilePath' => $filename, 'PONO' => $PONO, 'IGRNO' => $IGRNO);
$this->purchaseorder_model->fileupload($myfile);
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -2633,7 +2633,7 @@ if (!empty($getlogpodtl)) {
<div class="form-row" style="padding-bottom: 10px;">
<div class=" col-md-8 px-2">
<label>Upload Purchase Order Bill </label>
<label>Upload IGR Bill </label>
<input type="button" class="btn btn-success" id="addmorebutton"
value=" ADD FILES "><br>