FIX_Normal Renenuepo File
This commit is contained in:
parent
d071665a2c
commit
af50cca1bc
@ -1096,14 +1096,34 @@ $mpdf->use_kwt = true;
|
|||||||
$Local_Interstate = $this->request->getPost('Range');
|
$Local_Interstate = $this->request->getPost('Range');
|
||||||
$Qualitycheck = 1;
|
$Qualitycheck = 1;
|
||||||
$IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null;
|
$IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null;
|
||||||
|
|
||||||
|
|
||||||
|
$file = $this->request->getFile('POFile');
|
||||||
|
$requestfilename = $file->getName();
|
||||||
|
if (!empty($requestfilename)) {
|
||||||
|
|
||||||
|
if ($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);
|
||||||
|
$requestfilename = "";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$file->move($path, $requestfilename);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$requestfilename = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Generate PO Number
|
// Generate PO Number
|
||||||
$lastPONO = $this->purchaseorder_model->lastPONO();
|
$lastPONO = $this->purchaseorder_model->lastPONO();
|
||||||
$newPONO = generate_po_number($lastPONO);
|
$newPONO = generate_po_number($lastPONO);
|
||||||
log_message('debug', 'newPONO returned: ' . $newPONO);
|
log_message('debug', 'newPONO returned: ' . $newPONO);
|
||||||
|
|
||||||
// PO Master
|
// PO Master
|
||||||
$POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'Status' => $POStatus, 'PORange' => $Local_Interstate, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'CapitalRange' => $Local_Interstate, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $supplierreference, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'POSubType' => $revenuetype, 'InsuranceNumber' => $InsuranceNumber, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
|
$POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'Status' => $POStatus, 'PORange' => $Local_Interstate, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'CapitalRange' => $Local_Interstate, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $supplierreference, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'POSubType' => $revenuetype, 'InsuranceNumber' => $InsuranceNumber, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder,'POFile'=>$requestfilename);
|
||||||
$POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $revenuetype);
|
$POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $revenuetype);
|
||||||
$PONO = '';
|
$PONO = '';
|
||||||
if (count($POMaster) > 0) {
|
if (count($POMaster) > 0) {
|
||||||
@ -1260,6 +1280,22 @@ $mpdf->use_kwt = true;
|
|||||||
$POList['ReleasedOn'] = get_current_date_time();
|
$POList['ReleasedOn'] = get_current_date_time();
|
||||||
$POList['ReleasedBy'] = $this->session->get('userId');
|
$POList['ReleasedBy'] = $this->session->get('userId');
|
||||||
}
|
}
|
||||||
|
$file = $this->request->getFile('POFile');
|
||||||
|
$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);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$file->move($path, $requestfilename);
|
||||||
|
$POList['POFile'] = $requestfilename;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO, $POList);
|
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO, $POList);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -140,7 +140,12 @@ Where IGRM.PONO = ? ';
|
|||||||
return $query->getResult();
|
return $query->getResult();
|
||||||
}
|
}
|
||||||
///////////////////end this function used to pono reset financeyear configuration
|
///////////////////end this function used to pono reset financeyear configuration
|
||||||
|
public function isFileExists($filename)
|
||||||
|
{
|
||||||
|
$result = $this->db->table('t_purchaseorder_master')->where('POFile', $filename);
|
||||||
|
$query = $result->get();
|
||||||
|
return $query->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,8 @@ $ServiceDescription = '';
|
|||||||
$CapitalRange = '';
|
$CapitalRange = '';
|
||||||
$otherPayment = '';
|
$otherPayment = '';
|
||||||
$BudgetType = '';
|
$BudgetType = '';
|
||||||
|
$PrePOFile = '';
|
||||||
|
|
||||||
if (!empty($POMaster)) {
|
if (!empty($POMaster)) {
|
||||||
//print_r($POMaster);
|
//print_r($POMaster);
|
||||||
//print_r($POItem);
|
//print_r($POItem);
|
||||||
@ -100,7 +102,7 @@ if (!empty($POMaster)) {
|
|||||||
$insurenceno = $Req->InsuranceNumber;
|
$insurenceno = $Req->InsuranceNumber;
|
||||||
$BudgetType = $Req->BudgetType;
|
$BudgetType = $Req->BudgetType;
|
||||||
$IGRNO = $Req->IGRNO;
|
$IGRNO = $Req->IGRNO;
|
||||||
|
$PrePOFile = $Req->POFile;
|
||||||
// echo $otherPayment;
|
// echo $otherPayment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3935,6 +3937,13 @@ if (!empty($getlogpodtl)) {
|
|||||||
<!-- Revenue Special PO Modal Ends Here -->
|
<!-- Revenue Special PO Modal Ends Here -->
|
||||||
<div class="row" style="padding: 2% 0%">
|
<div class="row" style="padding: 2% 0%">
|
||||||
<div class="col-md-5 col-md-offset-7" align="right"><br />
|
<div class="col-md-5 col-md-offset-7" align="right"><br />
|
||||||
|
<div>
|
||||||
|
<input type="file" name="POFile" id="POFile">
|
||||||
|
<?php if($PrePOFile){ ?>
|
||||||
|
<label><a title="previously uploaded PO File" href="<?php echo base_url().'public/uploads/POfiles/' . $PrePOFile ?>"><span>previously uploaded - </span><small><?= $PrePOFile; ?></small></a></label>
|
||||||
|
<?php } ?>
|
||||||
|
<input type="hidden" id="PrePOFile" name="PrePOFile" value="<?php echo $PrePOFile; ?>"/><br>
|
||||||
|
</div>
|
||||||
<input type="hidden" name="txtPoRange" id="txtPoRange" />
|
<input type="hidden" name="txtPoRange" id="txtPoRange" />
|
||||||
<input type="hidden" name="isEdit" id="isEdit" value="0" />
|
<input type="hidden" name="isEdit" id="isEdit" value="0" />
|
||||||
<input type="hidden" name="txtStatus" id="txtStatus" />
|
<input type="hidden" name="txtStatus" id="txtStatus" />
|
||||||
@ -4796,11 +4805,14 @@ if (!empty($getlogpodtl)) {
|
|||||||
$('#insurance').focus();
|
$('#insurance').focus();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
var formData = new FormData($('.CreatePO')[0]);
|
||||||
$('#content').loader('show');
|
$('#content').loader('show');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: $('.CreatePO').serialize(),
|
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url() ?>purchaseorder/EditRevenuePurchaseOrder",
|
url: "<?php echo base_url() ?>purchaseorder/EditRevenuePurchaseOrder",
|
||||||
|
data: formData,
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#content').loader('hide');
|
$('#content').loader('hide');
|
||||||
@ -4817,7 +4829,10 @@ if (!empty($getlogpodtl)) {
|
|||||||
alert("Error");
|
alert("Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
},error: function(jqXHR, textStatus, errorThrown) {
|
||||||
|
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
|
||||||
|
alert("Error: " + textStatus);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1821,10 +1821,9 @@ if (!empty($INRSYMBOL)) {
|
|||||||
</style>
|
</style>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<?php
|
<?php
|
||||||
$attributes = array('class' => 'form-label-left CreatePO ', 'name' => 'CreatePO', 'id' => 'CreatePO');
|
$attributes = array('class' => 'form-label-left CreatePO ', 'name' => 'CreatePO', 'id' => 'CreatePO','enctype' => 'multipart/form-data');
|
||||||
|
|
||||||
echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?>
|
echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?>
|
||||||
|
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div style="border:2px solid #333">
|
<div style="border:2px solid #333">
|
||||||
<div id="content"></div>
|
<div id="content"></div>
|
||||||
@ -2109,7 +2108,10 @@ if (!empty($INRSYMBOL)) {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
<div class="col-md-2" style="padding-right: 0px;">
|
<div class="col-md-2" style="padding-right: 0px;">
|
||||||
<label for="BudgetType">Budget Type</label>
|
<label for="BudgetType">Budget Type</label>
|
||||||
<?php
|
<?php
|
||||||
@ -2122,12 +2124,8 @@ if (!empty($INRSYMBOL)) {
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Modal for Packing Calculation -->
|
<!-- Modal for Packing Calculation -->
|
||||||
@ -2297,7 +2295,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
<div class="col-md-3 col-md-offset-7" align="right" style="padding:10px">
|
<div class="col-md-3 col-md-offset-7" align="right" style="padding:10px">
|
||||||
<!-- <input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1"> IS THIS OPEN ORDER FORMAT -->
|
<!-- <input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1"> IS THIS OPEN ORDER FORMAT -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1" align="right">
|
<div class="col-md-1" align="right" style="padding:10px">
|
||||||
<a data-toggle="modal"><button type="submit" onclick="openModal();" class="btn btn-success" id="abcd">Select Line Item</button> </a>
|
<a data-toggle="modal"><button type="submit" onclick="openModal();" class="btn btn-success" id="abcd">Select Line Item</button> </a>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
@ -3206,6 +3204,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="row" style="padding: 2% 0%">
|
<div class="row" style="padding: 2% 0%">
|
||||||
<div class="col-md-3 col-md-offset-9"><br />
|
<div class="col-md-3 col-md-offset-9"><br />
|
||||||
|
<input type="file" name="POFile" id="POFile"><br>
|
||||||
<input type="hidden" name="txtPoRange" id="txtPoRange" />
|
<input type="hidden" name="txtPoRange" id="txtPoRange" />
|
||||||
<input type="hidden" name="isEdit" id="isEdit" value="0" />
|
<input type="hidden" name="isEdit" id="isEdit" value="0" />
|
||||||
<input type="hidden" name="txtStatus" id="txtStatus" />
|
<input type="hidden" name="txtStatus" id="txtStatus" />
|
||||||
@ -3917,12 +3916,15 @@ if (!empty($INRSYMBOL)) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
var formData = new FormData($('.CreatePO')[0]);
|
||||||
|
|
||||||
$('#content').loader('show');
|
$('#content').loader('show');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: $('.CreatePO').serialize(),
|
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder",
|
url: "<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder",
|
||||||
|
data: formData,
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#content').loader('hide');
|
$('#content').loader('hide');
|
||||||
@ -3937,7 +3939,10 @@ if (!empty($INRSYMBOL)) {
|
|||||||
alert("Error");
|
alert("Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
},error: function(jqXHR, textStatus, errorThrown) {
|
||||||
|
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
|
||||||
|
alert("Error: " + textStatus);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user