Live service po issue related changes : GWM

This commit is contained in:
Smart 2024-09-26 11:34:26 +05:30
parent c4276fb215
commit a70c655ab1
2 changed files with 35 additions and 18 deletions

View File

@ -341,6 +341,7 @@ class Servicepurchaseorder extends BaseController
//update service po
function UpdateServicePurchaseOrder()
{
// print_r($this->request->getPost());die;
$PONO = $this->request->getPost('txtPONO');
$newsup = $this->request->getPost('newsup');
// $newSupId = split("[ - ]+", $newsup);
@ -408,23 +409,30 @@ class Servicepurchaseorder extends BaseController
$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;
if ($file !== null) {
$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);
} else {
$file->move($path, $requestfilename);
$POList['POFile'] = $requestfilename;
}
}
}
} else {
log_message('error', 'No file was uploaded');
}
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO, $POList);

View File

@ -2995,16 +2995,16 @@ if (!empty($getlogpodtl)) {
var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
if (validate()) {
if (document.getElementById('ServiceTable').rows.length < 2) {
if (document.getElementById('ServiceTable').rows.length < 2)
{
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
}
// else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
// }
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms');
$('#Otherpayment').focus();
@ -3025,7 +3025,16 @@ if (!empty($getlogpodtl)) {
processData: false,
contentType: false,
success: function(data) {
// console.log(data);
// var newWindow = window.open("", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,width=1024,height=768");
// newWindow.document.write("<html><head><title>Response</title></head><body>");
// newWindow.document.write("<pre>" + data + "</pre>"); // Using <pre> to preserve formatting
// newWindow.document.write("</body></html>");
// newWindow.document.close();
// newWindow.moveTo(0, 0);
// newWindow.resizeTo(screen.width, screen.height);
if (data) {
$('#loader').hide();
alert(data);