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');
|
||||
$Qualitycheck = 1;
|
||||
$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
|
||||
$lastPONO = $this->purchaseorder_model->lastPONO();
|
||||
$newPONO = generate_po_number($lastPONO);
|
||||
log_message('debug', 'newPONO returned: ' . $newPONO);
|
||||
|
||||
// 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);
|
||||
$PONO = '';
|
||||
if (count($POMaster) > 0) {
|
||||
@ -1260,6 +1280,22 @@ $mpdf->use_kwt = true;
|
||||
$POList['ReleasedOn'] = get_current_date_time();
|
||||
$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);
|
||||
|
||||
|
||||
|
||||
@ -140,7 +140,12 @@ Where IGRM.PONO = ? ';
|
||||
return $query->getResult();
|
||||
}
|
||||
///////////////////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 = '';
|
||||
$otherPayment = '';
|
||||
$BudgetType = '';
|
||||
$PrePOFile = '';
|
||||
|
||||
if (!empty($POMaster)) {
|
||||
//print_r($POMaster);
|
||||
//print_r($POItem);
|
||||
@ -100,7 +102,7 @@ if (!empty($POMaster)) {
|
||||
$insurenceno = $Req->InsuranceNumber;
|
||||
$BudgetType = $Req->BudgetType;
|
||||
$IGRNO = $Req->IGRNO;
|
||||
|
||||
$PrePOFile = $Req->POFile;
|
||||
// echo $otherPayment;
|
||||
}
|
||||
}
|
||||
@ -3935,6 +3937,13 @@ if (!empty($getlogpodtl)) {
|
||||
<!-- Revenue Special PO Modal Ends Here -->
|
||||
<div class="row" style="padding: 2% 0%">
|
||||
<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="isEdit" id="isEdit" value="0" />
|
||||
<input type="hidden" name="txtStatus" id="txtStatus" />
|
||||
@ -4796,11 +4805,14 @@ if (!empty($getlogpodtl)) {
|
||||
$('#insurance').focus();
|
||||
return false;
|
||||
} else {
|
||||
var formData = new FormData($('.CreatePO')[0]);
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data: $('.CreatePO').serialize(),
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>purchaseorder/EditRevenuePurchaseOrder",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
$('#content').loader('hide');
|
||||
@ -4817,7 +4829,10 @@ if (!empty($getlogpodtl)) {
|
||||
alert("Error");
|
||||
}
|
||||
|
||||
}
|
||||
},error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
|
||||
alert("Error: " + textStatus);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@ -1821,10 +1821,9 @@ if (!empty($INRSYMBOL)) {
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<?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); ?>
|
||||
|
||||
<section class="content">
|
||||
<div style="border:2px solid #333">
|
||||
<div id="content"></div>
|
||||
@ -2109,7 +2108,10 @@ if (!empty($INRSYMBOL)) {
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-2" style="padding-right: 0px;">
|
||||
<label for="BudgetType">Budget Type</label>
|
||||
<?php
|
||||
@ -2122,12 +2124,8 @@ if (!empty($INRSYMBOL)) {
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- 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">
|
||||
<!-- <input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1"> IS THIS OPEN ORDER FORMAT -->
|
||||
</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>
|
||||
</div>
|
||||
<br>
|
||||
@ -3206,6 +3204,7 @@ if (!empty($INRSYMBOL)) {
|
||||
</div>
|
||||
<div class="row" style="padding: 2% 0%">
|
||||
<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="isEdit" id="isEdit" value="0" />
|
||||
<input type="hidden" name="txtStatus" id="txtStatus" />
|
||||
@ -3917,12 +3916,15 @@ if (!empty($INRSYMBOL)) {
|
||||
|
||||
} else {
|
||||
|
||||
var formData = new FormData($('.CreatePO')[0]);
|
||||
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data: $('.CreatePO').serialize(),
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
$('#content').loader('hide');
|
||||
@ -3937,7 +3939,10 @@ if (!empty($INRSYMBOL)) {
|
||||
alert("Error");
|
||||
}
|
||||
|
||||
}
|
||||
},error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
|
||||
alert("Error: " + textStatus);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user