diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 53adc2dd..15d3ac7d 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -164,6 +164,8 @@ $routes->post('getMaterialDetails', 'Requisitionform::getMaterialDetails'); $routes->post('DeleteRequistionForm', 'Requisitionform::DeleteRequistionForm'); // recheck it used or not. $routes->post('requisitionform/ApproveRequest', 'Requisitionform::ApproveRequest'); $routes->post('requisitionform/DeleteReqNo', 'Requisitionform::DeleteReqNo'); +$routes->post('requisitionform/ViewRequest', 'Requisitionform::ViewRequest'); + // Application PO Flow Routes $routes->match(['get', 'post', 'put', 'delete'],'addPO', 'Purchaseorder::addPO'); @@ -312,8 +314,4 @@ $routes->match(['get', 'post', 'put', 'delete'],'Empperform', 'Report::per'); $routes->get('qualityreportlist', 'Quality::reportList'); $routes->get('qualityreportlistinward', 'Quality::reportListInward'); -$routes->get('shortagematerialListing', 'Rawmaterialdetails::shortagematerialListing'); - -$routes->get('/pdf', 'PdfController::index'); -$routes->match(['get', 'post', 'put', 'delete'],'pdf/preview', 'PdfController::preview'); -$routes->match(['get', 'post', 'put', 'delete'],'pdf/download', 'PdfController::download'); +$routes->get('shortagematerialListing', 'Rawmaterialdetails::shortagematerialListing'); \ No newline at end of file diff --git a/app/Controllers/Emergencypurchaseorder.php b/app/Controllers/Emergencypurchaseorder.php index 484e3fa6..e1e7089c 100644 --- a/app/Controllers/Emergencypurchaseorder.php +++ b/app/Controllers/Emergencypurchaseorder.php @@ -202,11 +202,12 @@ class Emergencypurchaseorder extends BaseController if (count($Req) > 0) { $RegNo = $Req[0]['ReqNo']; } - $VaildUpto = ($this->request->getPost('VaildUpto') !== null && !empty($this->request->getPost('VaildUpto'))) ? $this->request->getPost('VaildUpto') : null; + $IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null; + $lastPONO = $this->purchaseorder_model->lastPONO(); $newPONO = generate_po_number($lastPONO); // PO Master - $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $ServiceWorkStatus, 'POType' => $POType, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => $DescriptionOfPo, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNo, 'POSubType' => $ServiceTypeOptions, 'BudgetType' => $BudgetType,'VaildUpto'=>$VaildUpto); + $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $ServiceWorkStatus, 'POType' => $POType, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => $DescriptionOfPo, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNo, 'POSubType' => $ServiceTypeOptions, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder); $POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $ServiceTypeOptions); @@ -457,10 +458,11 @@ class Emergencypurchaseorder extends BaseController $RegNo = $Req[0]['ReqNo']; } // PO Master - $VaildUpto = ($this->request->getPost('VaildUpto') !== null && !empty($this->request->getPost('VaildUpto'))) ? get_date_time_format($this->request->getPost('VaildUpto')) : null; + $IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null; + $lastPONO = $this->purchaseorder_model->lastPONO(); $newPONO = generate_po_number($lastPONO); - $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'PORange' => $Local_Interstate, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'CapitalRange' => $Local_Interstate, 'PaymentOtherDescription' => $OtherPayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Offer_No' => $supplieroffno, 'Supplier_Reference' => $supplierreference, 'Other_Reference' => $otherreference, 'InsuranceNumber' => $insuranceno, 'InsuranceStatus' => $insurancestatus, 'Fincap' => $fincap, 'POSubType' => $revenuetype, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'VaildUpto'=>$VaildUpto); + $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'PORange' => $Local_Interstate, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'CapitalRange' => $Local_Interstate, 'PaymentOtherDescription' => $OtherPayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Offer_No' => $supplieroffno, 'Supplier_Reference' => $supplierreference, 'Other_Reference' => $otherreference, 'InsuranceNumber' => $insuranceno, 'InsuranceStatus' => $insurancestatus, 'Fincap' => $fincap, 'POSubType' => $revenuetype, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder); //print_r($POList); $POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $revenuetype); $PONO = $POMaster ? $newPONO : ""; @@ -1181,14 +1183,14 @@ class Emergencypurchaseorder extends BaseController $createddt = get_current_date_time(); $Local_Interstate = $this->request->getPost('Range'); - $VaildUpto = ($this->request->getPost('VaildUpto') !== null && !empty($this->request->getPost('VaildUpto'))) ? $this->request->getPost('VaildUpto') : null; - + $IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null; + $lastPONO = $this->purchaseorder_model->lastPONO(); $newPONO = generate_po_number($lastPONO); // PO Master - $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'CapitalRange' => $Local_Interstate,'VaildUpto'=>$VaildUpto); + $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'CapitalRange' => $Local_Interstate,'IsOpenOrder'=>$IsOpenOrder); $POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,'advance'); diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php index 148a30e6..3d84dd55 100644 --- a/app/Controllers/Purchaseorder.php +++ b/app/Controllers/Purchaseorder.php @@ -286,42 +286,48 @@ class Purchaseorder extends BaseController return true; } - function CreatePOPrint() + function CreatePOPrint_old() { $PONO = $this->request->getVar('PONO'); $ReqType = $this->request->getVar('ReqType'); - - $this->poprint($PONO); - - // if ($ReqType == SERVICE) { - // $this->servicepoprint($PONO); - // } else if ($ReqType == REVENUE) { - // $this->revenuepoprint($PONO); - // } else if ($ReqType == IMPORT) { - // $this->importpoprint($PONO); - // } else if ($ReqType == CAPITAL) { - // $this->CapitalPoPrint($PONO); - // } + if ($ReqType == SERVICE) { + $this->servicepoprint($PONO); + } else if ($ReqType == REVENUE) { + $this->revenuepoprint($PONO); + } else if ($ReqType == IMPORT) { + $this->importpoprint($PONO); + } else if ($ReqType == CAPITAL) { + $this->CapitalPoPrint($PONO); + } } - public function poprint($PONO) + public function CreatePOPrint() { - // Load all views as normal + $PONO = $this->request->getVar('PONO'); + $ReqType = $this->request->getVar('ReqType'); - //$PONO = $this->request->getVar('PO'); $PoStatus = ''; $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO); $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF(); $data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO); - $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO); + if ($ReqType == SERVICE) { + $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetailsForpdf($PONO); + $data['serviceTaxList'] = $this->purchaseorder_model->GetServiceTaxDetails($PONO); + } else if ($ReqType == REVENUE) { + $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO); + $data['reveuetax'] = $this->purchaseorder_model->getRevenueTaxinforforpdf($PONO); + } else if ($ReqType == IMPORT) { + $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO); + } else if ($ReqType == CAPITAL) { + $data['POItem'] = $this->purchaseorder_model->GetCapitalPurchaseOrderDetailsForPDF($PONO); + } + // print_r($data['POItem']);die; $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); $data['CurrencySymbol'] = $this->purchaseorder_model->GerCurrencyCodeName('INR'); - $data['reveuetax'] = $this->purchaseorder_model->getRevenueTaxinforforpdf($PONO); - $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO); $Currencycode = ''; $TotalOrderValue = $data['POItem'][0]->TotalOrderValue; $AdvanceAmount = 0.00; @@ -342,6 +348,130 @@ class Purchaseorder extends BaseController $mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8', 'format' => 'A4', 'default_font' => 'sans-serif', + 'margin_header' => 0, + 'margin_top' => -30, + 'margin_right' => 14, + 'margin_left' => 5, + 'margin_footer' => -30, + 'orientation' => 'P']); + // Set PDF properties + $mpdf->SetTitle('Invoice'); + $mpdf->SetAuthor($data['CompanyDetails'][0]->CompanyName); + $mpdf->SetCreator('Venba'); + + + // Generate the PDF content (HTML) + // if ($PoStatus == PO_RELEASED || $PoStatus == PO_SERVICE_COMPLETED || $PoStatus == MRIR_APPROVED || $PoStatus == MRIR_REJECTED || $PoStatus == IGR_CREATED || $PoStatus == '' || $PoStatus == SPECIAL_PO) { + // $mpdf->SetWatermarkText(''); + // } else { + // $mpdf->SetWatermarkText('DRAFT'); + // } + + + // Set auto margins + $mpdf->setAutoTopMargin = 'stretch'; + $mpdf->setAutoBottomMargin = 'stretch'; +$mpdf->use_kwt = true; + // Set HTML header + // $HtmlHeading = view('includes/pdfheader', $data); + // $mpdf->SetHTMLHeader($HtmlHeading); + + // Set HTML body + // $html = view('pdf_view', $data); + // $mpdf->WriteHTML($html); // Use WriteHTML() method to add body content + $html = view('po_pdf', $data); + //echo $html;die; + $mpdf->WriteHTML($html); // Use WriteHTML() method to add body content + + // Set HTML footer + // $HTMLFooter = view('includes/pdffooter', $data); + // $mpdf->setFooter('' . "Page {PAGENO} of {nb}"); + + // Output PDF + $mpdf->Output('POReport' . $PONO . '.pdf', 'D'); + } + public function poprint2($PONO,$ReqType) + { + + // Load all views as normal + + + //$PONO = $this->request->getVar('PO'); + $Requester = ''; + $Depcode = ''; + $Currencycode = ''; + $PoStatus = ''; + $PaiseVal = ''; + $SymbolCurrency = ''; + $SymbolCurrencyName = ''; + $TotalOrderValue = 0.00; + $AdvanceAmount = 0.00; + $ProductPrice = ''; + $TotaltoPay = 0.00; + + + $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO); + + $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); + + $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF(); + + $data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO); + + $data['DEPCODE'] = $this->purchaseorder_model->GerRequesterDep($Depcode); + + + $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); + $data['CurrencySymbol'] = $this->purchaseorder_model->GerCurrencyCodeName($Currencycode); + $data['Requestername'] = $this->purchaseorder_model->GerRequesterName($Requester); + + + + +// print_r($data['POItem']);die; + $CapitalRange = 1; + + + if (!empty($data['CurrencySymbol']) > 0) { + $SymbolCurrency = $data['CurrencySymbol'][0]->FontCode2000; + $SymbolCurrencyName = $data['CurrencySymbol'][0]->Currency; + $PaiseVal = $data['CurrencySymbol'][0]->PaiseVal; + } + + if (!empty($data['POItem'])) { + foreach ($data['POItem'] as $POI) { + $Currencycode = $POI->CurrencyType; + $CapitalRange = $POI->CapitalRange; + $AdvanceAmount = $POI->AdvanceAmount; + $TotalOrderValue = $POI->TotalOrderValue; + $PoStatus = $POI->Status; + $Requester = isset($POI->Requestedby) ? $POI->Requestedby : ""; + + + } + } + + if ($CapitalRange != '') { + $data['TaxListDetails'] = $this->purchaseorder_model->GetCapitalTaxListDetails($PONO, $CapitalRange); + } + + foreach ($data['Requestername'] as $ReqDep) { + $Depcode = $ReqDep->Departmentcode; + } + + + + + + + $mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8', + 'format' => 'A4', + 'default_font' => 'sans-serif', + 'margin_header' => 0, + 'margin_top' => -30, + 'margin_right' => 14, + 'margin_left' => 5, + 'margin_footer' => -30, 'orientation' => 'P']); // Set PDF properties $mpdf->SetTitle('Invoice'); @@ -377,7 +507,7 @@ class Purchaseorder extends BaseController // $mpdf->setFooter('' . "Page {PAGENO} of {nb}"); // Output PDF - $mpdf->Output('POReport' . $PONO . '.pdf', 'D'); + $mpdf->Output($ReqType.'_' . $PONO . '.pdf', 'D'); } @@ -981,12 +1111,13 @@ class Purchaseorder extends BaseController $Qualitycheck = 1; - $VaildUpto = ($this->request->getPost('VaildUpto') !== null && !empty($this->request->getPost('VaildUpto'))) ? $this->request->getPost('VaildUpto') : null; + $IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null; + $lastPONO = $this->purchaseorder_model->lastPONO(); $newPONO = generate_po_number($lastPONO); // 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' => $insuranceno, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'VaildUpto'=>$VaildUpto); + $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' => $insuranceno, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder); $POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $revenuetype); // echo "@1100 i have pomaster = ".'
'.print_r($POMaster,true).'
'."
";die(); $PONO = $POMaster ? $newPONO : ""; @@ -1524,7 +1655,7 @@ class Purchaseorder extends BaseController $mpdf->WriteHTML($html); $mpdf->SetDisplayMode('fullpage'); // Output PDF - $mpdf->Output('ServicePOReport' . $PONO . '.pdf', 'I'); + $mpdf->Output('ServicePOReport' . $PONO . '.pdf', 'D'); } @@ -1791,11 +1922,12 @@ class Purchaseorder extends BaseController // $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType); $Qualitycheck = 1; - $VaildUpto = ($this->request->getPost('VaildUpto') !== null && !empty($this->request->getPost('VaildUpto'))) ? $this->request->getPost('VaildUpto') : null; + $IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null; + $lastPONO = $this->purchaseorder_model->lastPONO(); $newPONO = generate_po_number($lastPONO); - $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'Import_DispatchDetails' => $Dispatch, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ExchangeRate' => $Exchangerate, 'ExchangeRateCalculatedon' => $ExchangeRateCalculatedon, 'CurrencyType' => $CurrencyType, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'Import_PlaceofOrgin' => $Palaceoforigin, 'PaymentOtherDescription' => $OtherPayment, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'InsuranceStatus' => $Insurance, 'InsuranceNumber' => $Insurancenumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'VaildUpto'=>$VaildUpto); + $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'Import_DispatchDetails' => $Dispatch, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ExchangeRate' => $Exchangerate, 'ExchangeRateCalculatedon' => $ExchangeRateCalculatedon, 'CurrencyType' => $CurrencyType, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'Import_PlaceofOrgin' => $Palaceoforigin, 'PaymentOtherDescription' => $OtherPayment, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'InsuranceStatus' => $Insurance, 'InsuranceNumber' => $Insurancenumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder); //print_r($POList); //die(); @@ -2433,11 +2565,12 @@ class Purchaseorder extends BaseController $Qualitycheck = 1; - $VaildUpto = ($this->request->getPost('VaildUpto') !== null && !empty($this->request->getPost('VaildUpto'))) ? $this->request->getPost('VaildUpto') : null; + $IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null; + $lastPONO = $this->purchaseorder_model->lastPONO(); $newPONO = generate_po_number($lastPONO); - $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ExchangeRateCalculatedon' => $ExchangeRateOn, 'ExchangeRate' => $ExchangeRate, 'PaymentTerms' => $PaymentMethod, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'CapitalRange' => $CapitalRange, 'POType' => $POType, 'CurrencyType' => $currencytypeID, 'DeliverySchedule' => $DeliverySchedule, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Import_DispatchDetails' => $Dispatch, 'DeliveryDate' => $Deliverydt, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNo, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'VaildUpto'=>$VaildUpto); + $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ExchangeRateCalculatedon' => $ExchangeRateOn, 'ExchangeRate' => $ExchangeRate, 'PaymentTerms' => $PaymentMethod, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'CapitalRange' => $CapitalRange, 'POType' => $POType, 'CurrencyType' => $currencytypeID, 'DeliverySchedule' => $DeliverySchedule, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Import_DispatchDetails' => $Dispatch, 'DeliveryDate' => $Deliverydt, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNo, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder); // $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin); diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php index 3006ef53..a71c219b 100644 --- a/app/Models/Purchaseorder_model.php +++ b/app/Models/Purchaseorder_model.php @@ -1054,7 +1054,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath, ROUND(((AfterSGST + AfterCGST + AfterIGST)) ,2)as Taxamount,AdvanceAmount, TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,sup.SupplierID,sup.ContactNumber,sup.EmailAddress,sup.PAN,sup.GSTNO,sup.Cert_MSME, - LineItem.AmendedDetails as LineAmend,Payment.PaymentTerms + LineItem.AmendedDetails as LineAmend,LineItem.AmendedDetails as lineamenddetails,Payment.PaymentTerms FROM T_PurchaseOrder_LineItem LineItem left join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode left join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo @@ -1104,7 +1104,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath, $subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails,LineItem.Per,LineItem.ServiceMaterialDescription, Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount , -ProductPrice,Tax.*,LineItem.CostCenterCode ,Date(ReqMast.ReqDate) as ReqDate,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,AdvanceAmount, Pay.PaymentTerms as Pay,ROUND((Quantity *Rate),2 ) as BasicValue,HSNCODE,sup.EmailAddress,sup.SupplierID,sup.PAN,sup.ContactNumber,sup.GSTNO +ProductPrice,Tax.*,LineItem.CostCenterCode ,Date(ReqMast.ReqDate) as ReqDate,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,LineItem.AmendedDetails as lineamenddetails,AdvanceAmount, Pay.PaymentTerms as Pay,ROUND((Quantity *Rate),2 ) as BasicValue,HSNCODE,sup.EmailAddress,sup.SupplierID,sup.PAN,sup.ContactNumber,sup.GSTNO FROM T_PurchaseOrder_LineItem LineItem join T_Requestion_Master ReqMas on ReqMas.ReqNo=LineItem.ReqNo join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode @@ -1651,7 +1651,7 @@ left join T_Employee_Details emp on Req.Requestedby = emp.EmpID function GetCapitalPurchaseOrderDetailsForPDF($PONO = '') { - $subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.Per,LineItem.AmendedDetails as lineamd,ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription, + $subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.Per,LineItem.AmendedDetails as lineamd,LineItem.AmendedDetails as lineamenddetails,ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription, Mat.UOM,Mat.HSNCODE,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue , LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.SupplierID,sup.Address,sup.ContactNumber,sup.EmailAddress,sup.PAN,sup.GSTNO,Payment.PaymentID,Payment.PaymentTerms,AdvanceAmount,HSNCODE FROM T_PurchaseOrder_LineItem LineItem diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index f401c5cb..ee8ec107 100644 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -7,7 +7,6 @@ $SupId = ''; $SupName = ''; $Address = ''; $PODate = ''; -$VaildUpto = ''; $DeliveryAddress = ''; $PONOStatus = ''; $PONO = ''; @@ -83,13 +82,11 @@ if (!empty($POMaster)) { $DescriptionOfPo = $Req->Description_Of_Service; $BudgetType = $Req->BudgetType; - $Vdt = isset($Req->VaildUpto) ? $Req->VaildUpto : null; - if ($Vdt !== null && $Vdt !== "0000-00-00 00:00:00") { + $IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null; + if ($IsOpenOrder !== null && $IsOpenOrder !== "") { $isChecked = true; - $VaildUptodt = format_date($Req->VaildUpto,0,'d-m-Y'); } else { $isChecked = false; - $VaildUptodt = null; } } } @@ -139,16 +136,33 @@ if (!empty($getlogpodtl)) { \ No newline at end of file diff --git a/app/Views/alterpurchaseorder.php b/app/Views/alterpurchaseorder.php index 49903b42..9176f3fe 100644 --- a/app/Views/alterpurchaseorder.php +++ b/app/Views/alterpurchaseorder.php @@ -6,6 +6,8 @@ $ReqType = ''; $CompanyAddress = ''; $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $CurrentDate = $dt->format('d-m-Y'); +$CurrentDateNextYear = $dt->modify('+1 year')->format('d-m-Y'); + $MaxPoDate = ''; if (!empty($MaxPODate)) { foreach ($MaxPODate as $date) { @@ -205,26 +207,10 @@ if (!empty($INRSYMBOL)) { yearRange: '0:+10' }); - $("#VaildUpto").datepicker({ - dateFormat: 'dd-mm-yy', - changeMonth: true, - changeYear: true, - yearRange: '-1:+1', // Adjust as needed - minDate: 0 // Set minDate to today - }); - var SelectedMaterialList = { Mat: [] }; - // Set minDate of VaildUpto field based on dateofbirth field - $("#PODate").on("change", function() { - var minDate = $(this).datepicker("getDate"); - var maxDate = new Date(minDate.getFullYear() + 1, minDate.getMonth(), minDate.getDate()); - $("#VaildUpto").datepicker("option", "minDate", minDate); - $("#VaildUpto").datepicker("option", "maxDate", maxDate); - }); - /* $('#drpSupplier').change(function() { var id = $('#drpSupplier').val(); @@ -1832,8 +1818,9 @@ if (!empty($INRSYMBOL)) { function showsubmit() { + var isChecked = $('#IsOpenOrder').is(':checked'); + // alert("isChecked: " + isChecked); var PO = $('#POType').val(); - var isChecked = $('#openOrderFormat').is(':checked'); if (isChecked) { if (PO == 'REVENUE') { @@ -1858,7 +1845,7 @@ if (!empty($INRSYMBOL)) { var getLocal = document.getElementById('Local').value; StateTaxCheck = $("input:radio[name='Range']:checked").val(); var radioValue = $("input[name='DateRange']:checked").val(); - var isChecked = $('#openOrderFormat').is(':checked'); + var isChecked = $('#IsOpenOrder').is(':checked'); // $('#txtPoRange').val(StateTaxCheck) ; //alert('Radio clicke:'+StateTaxCheck); @@ -1888,11 +1875,7 @@ if (!empty($INRSYMBOL)) { $('#Scheduleby').focus(); return false; - } else if (isChecked && $('#VaildUpto').val() === '') { - alert('Please select the valid date'); - $('#VaildUpto').focus(); - return false; - } + } else { $("#" + input).modal('show'); $('#isEdit').val(0); @@ -2509,15 +2492,6 @@ if (!empty($INRSYMBOL)) { echo form_dropdown('BudgetType', $optionsnew, set_value('BudgetType'), 'id="BudgetType"', 'required="true"', 'class="form-control select2'); ?> - @@ -2528,7 +2502,7 @@ if (!empty($INRSYMBOL)) {
- IS THIS OPEN ORDER FORMAT + IS THIS OPEN ORDER FORMAT
Select Line Item @@ -5723,7 +5697,7 @@ if (!empty($INRSYMBOL)) { function clearRevenueModalFields() { // To reset the Modal controls - var isChecked = $('#openOrderFormat').is(':checked'); + var isChecked = $('#IsOpenOrder').is(':checked'); isChecked ? $('#Quantity').val(0).prop('readonly', true).prop('required', false) : $('#Quantity').val('').prop('readonly', false).prop('required', true); @@ -6524,7 +6498,7 @@ if (!empty($INRSYMBOL)) { * validate fields when clicking add service button */ function validateServiceTax() { - var isChecked = $('#openOrderFormat').is(':checked'); + var isChecked = $('#IsOpenOrder').is(':checked'); if ($('#ServiceMaterialCode').val() == "0") { alert('Please select the Material Code'); @@ -6550,10 +6524,6 @@ if (!empty($INRSYMBOL)) { alert('Please Enter the Service Description'); $('#txtSpcialInstructionSingle').focus(); return false; - } else if (isChecked && $('#VaildUpto').val() === '') { - alert('Please select the valid date'); - $('#VaildUpto').focus(); - return false; } else { return true; } @@ -6611,7 +6581,7 @@ if (!empty($INRSYMBOL)) { // To reset the Modal controls - var isChecked = $('#openOrderFormat').is(':checked'); + var isChecked = $('#IsOpenOrder').is(':checked'); isChecked ? $('#ServiceQuantity').val(0).prop('readonly', true).prop('required', false) : $('#ServiceQuantity').val('').prop('readonly', false).prop('required', true); $('#ServiceMaterialCode').val("0"); @@ -6874,7 +6844,7 @@ $('#content').loader('hide'); * This function is used for validate while update */ function validateEditServiceTax() { - var isChecked = $('#openOrderFormat').is(':checked'); + var isChecked = $('#IsOpenOrder').is(':checked'); if ($('#EditQuantity').val() == '') { alert('Please Enter the Quantity value'); @@ -6896,10 +6866,6 @@ $('#content').loader('hide'); alert('Please Enter the Service Description'); $('#EdittxtSpcialInstructionSingle').focus(); return false; - } else if (isChecked && $('#VaildUpto').val() === '') { - alert('Please select the valid date'); - $('#VaildUpto').focus(); - return false; } else { return true; } @@ -7549,13 +7515,7 @@ $('#content').loader('hide'); function validateAddRevenueTax() { - var isChecked = $('#openOrderFormat').is(':checked'); - if (isChecked && $('#VaildUpto').val() === '') { - alert('Please select the valid date'); - $('#VaildUpto').focus(); - return false; - } - + var isChecked = $('#IsOpenOrder').is(':checked'); if($('#ReqNo').val() == "0") { alert('Please select the Requisition Number'); @@ -7604,7 +7564,7 @@ $('#content').loader('hide'); } } function validateEditRevenueTax() { - var isChecked = $('#openOrderFormat').is(':checked'); + var isChecked = $('#IsOpenOrder').is(':checked'); if ($('#EditRevenueCostCenter').val() == "0") { alert('Please select the Cost center'); @@ -7626,11 +7586,7 @@ $('#content').loader('hide'); alert('Please Enter the Rate of the Item'); $('#EditRevenueRate').focus(); return false; - } else if (isChecked && $('#VaildUpto').val() === '') { - alert('Please select the valid date'); - $('#VaildUpto').focus(); - return false; - } + } // else if($('#EditRevenueRate').val() == 0) // { // alert('Please Enter the Valid Rate of the Item'); @@ -8606,11 +8562,11 @@ $('#content').loader('hide'); } \ No newline at end of file diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index ba8359fa..5b97f44c 100644 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -4711,8 +4711,8 @@ if(status == '0') } else { - // stat = ''; - stat = ''; + stat = ''; + // stat = ''; } tinyMCE.triggerSave(); var splinstr = $('#txtSpcialInstruction').val(); diff --git a/app/Views/editCapitalAmendPO.php b/app/Views/editCapitalAmendPO.php index a0656a2d..42088259 100644 --- a/app/Views/editCapitalAmendPO.php +++ b/app/Views/editCapitalAmendPO.php @@ -2308,8 +2308,8 @@ document.getElementById('dispatchinternational').style.display = 'block'; $UpdatedOn=$UpdatedOn->format('d-m-Y');?>

- - Status : +
diff --git a/app/Views/editCapitalPo.php b/app/Views/editCapitalPo.php index eb4f3bc6..721c9ba0 100644 --- a/app/Views/editCapitalPo.php +++ b/app/Views/editCapitalPo.php @@ -3912,6 +3912,7 @@ $("#PaymentMethod").select2(); }?>   Submit +   Cancel Request On :

- - Status : +
@@ -6302,11 +6303,12 @@ if(status == '0') else if(status == '2'){ stat = ''; } - +else if(status == '4'){ + stat = ''; +} else { - // stat = ''; - stat = ''; + stat = ''; } var AvlBudAmt = ''; tinyMCE.triggerSave(); diff --git a/app/Views/editImportAmendPO.php b/app/Views/editImportAmendPO.php index dfcb8055..072509a0 100644 --- a/app/Views/editImportAmendPO.php +++ b/app/Views/editImportAmendPO.php @@ -1940,8 +1940,8 @@ echo form_textarea($data);

- - Status : + diff --git a/app/Views/editRevenuepurchaseorder.php b/app/Views/editRevenuepurchaseorder.php index c25f80bb..ef4c5e02 100644 --- a/app/Views/editRevenuepurchaseorder.php +++ b/app/Views/editRevenuepurchaseorder.php @@ -78,13 +78,11 @@ if (!empty($POMaster)) { - $Vdt = isset($Req->VaildUpto) ? $Req->VaildUpto : null; - if ($Vdt !== null && $Vdt !== "0000-00-00 00:00:00") { + $IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null; + if ($IsOpenOrder !== null && $IsOpenOrder !== "0000-00-00 00:00:00") { $isChecked = true; - $VaildUptodt = format_date($Req->VaildUpto,0,'d-m-Y'); } else { $isChecked = false; - $VaildUptodt = null; } $DeliveryAddress = $Req->DeliveryAddress; @@ -202,27 +200,9 @@ if (!empty($getlogpodtl)) { \ No newline at end of file diff --git a/app/Views/editServiceAmendPO.php b/app/Views/editServiceAmendPO.php index 68fa8038..8e4622ff 100644 --- a/app/Views/editServiceAmendPO.php +++ b/app/Views/editServiceAmendPO.php @@ -1601,8 +1601,8 @@ foreach ($PaymentTerms as $TER) { $Reqon = $Reqon->format('d-m-Y'); ?>

- - Status : + @@ -2158,8 +2158,8 @@ foreach ($PaymentTerms as $TER) { + \ No newline at end of file diff --git a/app/Views/requisitionform.php b/app/Views/requisitionform.php index 03bba573..a6ec9bc9 100644 --- a/app/Views/requisitionform.php +++ b/app/Views/requisitionform.php @@ -239,7 +239,7 @@ if (!empty($Emp)) {
'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event)', 'maxlength' => '20'); + $data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event)', 'min' => '1','maxlength' => '20'); echo form_input($data); ?>
@@ -315,7 +315,7 @@ if (!empty($Emp)) {
'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event)', 'maxlength' => '20'); + $data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event)','min' => '1', 'maxlength' => '20'); echo form_input($data); ?>
@@ -358,7 +358,7 @@ if (!empty($Emp)) {
- +   Save @@ -696,11 +696,10 @@ if (!empty($Emp)) { alert('Please Select the MaterialCode '); return false; } - - if (document.getElementById('Quantity').value == '') { + var qty = parseInt(document.getElementById('Quantity').value); + if (isNaN(qty) || qty < 1) { alert('Please Enter the Quantity'); return false; - } if ($("#MaterialCode option:selected").val() != '-1' && $('#Quantity').val() != '') { @@ -794,10 +793,12 @@ if (!empty($Emp)) {