From a3a3df8c0012869dffbdf159882440cce8b40421 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 20 Nov 2017 13:16:44 +0530 Subject: [PATCH] resico name changed in controller --- application/config/constants.php~ | 237 - application/config/routes.php | 18 +- application/controllers/CostCenter.php | 22 +- application/controllers/MRIRcontroller.php | 26 +- .../controllers/amendmentpurchaseorder.php | 14 +- application/controllers/assetdetails.php | 20 +- application/controllers/companycontroller.php | 6 +- application/controllers/configurationctrl.php | 8 +- application/controllers/department.php | 6 +- .../controllers/emergencypurchaseorder.php | 22 +- .../controllers/emergencypurchaseorder.php~ | 1110 ---- application/controllers/employeedetails.php | 8 +- application/controllers/emppaydate.php | 16 +- .../controllers/inwardgateregister.php | 12 +- application/controllers/login.php | 6 +- application/controllers/monthlypay.php | 20 +- application/controllers/payslip.php | 24 +- application/controllers/purchaseorder.php | 34 +- application/controllers/purchaseorder.php~ | 2805 ---------- .../controllers/rawmaterialdetails.php | 8 +- application/controllers/report.php | 6 +- application/controllers/requisitionform.php | 16 +- application/controllers/requisitionform.php~ | 542 -- .../controllers/servicepurchaseorder.php | 12 +- .../controllers/servicepurchaseorder.php~ | 325 -- application/controllers/storerequisition.php | 18 +- .../controllers/storerequisitionlist.php | 20 +- application/controllers/storestatus.php | 12 +- application/controllers/supplier.php | 8 +- application/controllers/supplier.php~ | 513 -- application/controllers/user.php | 8 +- application/models/purchaseorder_model.php~ | 1545 ------ application/models/requistion_model.php~ | 500 -- .../views/Editmaterialinspectionreport.php~ | 507 -- .../views/EditservicePurchaseorder.php~ | 2803 ---------- application/views/addCostCenter.php | 2 +- application/views/addasset.php | 2 +- application/views/addcost.php | 99 - application/views/assetListing.php | 2 +- application/views/costListing.php | 2 +- .../{editOldcost.php => editCostCenter.php} | 2 +- ...OldRawmaterial.php => editRawmaterial.php} | 0 .../views/editRevenuepurchaseorder.php~ | 4571 ----------------- application/views/editServiceAmendPO.php~ | 2013 -------- .../views/{editOldasset.php => editasset.php} | 2 +- application/views/editrequisitionform.php~ | 1047 ---- application/views/inwardgateregister.php~ | 576 --- .../views/materialinspectionreport.php~ | 394 -- application/views/requisitionform.php~ | 901 ---- application/views/revenuepopdf.php~ | 326 -- application/views/servicePurchaseorder.php~ | 2136 -------- application/views/servicepopdf.php~ | 431 -- .../views/statusofservicepurchaseorder.php~ | 189 - 53 files changed, 191 insertions(+), 23761 deletions(-) delete mode 100644 application/config/constants.php~ delete mode 100644 application/controllers/emergencypurchaseorder.php~ delete mode 100644 application/controllers/purchaseorder.php~ delete mode 100644 application/controllers/requisitionform.php~ delete mode 100644 application/controllers/servicepurchaseorder.php~ delete mode 100644 application/controllers/supplier.php~ delete mode 100644 application/models/purchaseorder_model.php~ delete mode 100644 application/models/requistion_model.php~ delete mode 100644 application/views/Editmaterialinspectionreport.php~ delete mode 100644 application/views/EditservicePurchaseorder.php~ delete mode 100644 application/views/addcost.php rename application/views/{editOldcost.php => editCostCenter.php} (99%) rename application/views/{editOldRawmaterial.php => editRawmaterial.php} (100%) delete mode 100644 application/views/editRevenuepurchaseorder.php~ delete mode 100644 application/views/editServiceAmendPO.php~ rename application/views/{editOldasset.php => editasset.php} (99%) delete mode 100644 application/views/editrequisitionform.php~ delete mode 100644 application/views/inwardgateregister.php~ delete mode 100644 application/views/materialinspectionreport.php~ delete mode 100644 application/views/requisitionform.php~ delete mode 100644 application/views/revenuepopdf.php~ delete mode 100644 application/views/servicePurchaseorder.php~ delete mode 100644 application/views/servicepopdf.php~ delete mode 100644 application/views/statusofservicepurchaseorder.php~ diff --git a/application/config/constants.php~ b/application/config/constants.php~ deleted file mode 100644 index fdc6b80b..00000000 --- a/application/config/constants.php~ +++ /dev/null @@ -1,237 +0,0 @@ - diff --git a/application/controllers/CostCenter.php b/application/controllers/CostCenter.php index 5343dbde..b8488036 100644 --- a/application/controllers/CostCenter.php +++ b/application/controllers/CostCenter.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Cost Center (Cost Center Controller) + * Class : CostCenter (Cost Center Details - Controller) * User Class to control all user related operations. - * @author : VenbaMail Mali + * @author : Venba Info Tech - * @version : 1.1 - * @since : 15 Feb 2016 + * @since : 18 November 2017 */ class CostCenter extends BaseController { @@ -29,7 +29,7 @@ class CostCenter extends BaseController */ public function index() { - $this->global['pageTitle'] = 'Siddharth : Cost'; + $this->global['pageTitle'] = 'Resico : Cost Details'; $this->loadViews("costListing", $this->global, NULL , NULL); } @@ -44,7 +44,7 @@ class CostCenter extends BaseController $data['userRecords'] = $this->costcenter_model->CostListing(); - $this->global['pageTitle'] = 'Siddharth : Cost List'; + $this->global['pageTitle'] = 'Resico : Cost List'; $this->loadViews("costListing", $this->global, $data, NULL); @@ -63,7 +63,7 @@ class CostCenter extends BaseController $data['FiscalYear'] = $this->costcenter_model->getFiscalYear(); - $this->global['pageTitle'] = 'siddharth : Add Cost Center'; + $this->global['pageTitle'] = 'Resico : Add Cost Center'; $this->loadViews("addCostCenter", $this->global,$data, NULL); @@ -175,9 +175,9 @@ class CostCenter extends BaseController $data['FiscalYear'] = $this->costcenter_model->getFiscalYear(); //print_r(count($data['BudType'])); - $this->global['pageTitle'] = 'Siddharth : Edit Cost'; + $this->global['pageTitle'] = 'Resico : Edit Cost'; - $this->loadViews("editOldcost", $this->global, $data,NULL); + $this->loadViews("editCostCenter", $this->global, $data,NULL); } @@ -417,7 +417,7 @@ class CostCenter extends BaseController $data['Cost'] = $this->costcenter_model->getuserinfo($CostCenterID); //$data['users'] = $this->purchaseorder_model->getusers(); - $this->global['pageTitle'] = 'Siddharth : View Cost'; + $this->global['pageTitle'] = 'Resico : View Cost Details'; $this->loadViews("viewcost", $this->global, $data,NULL); @@ -457,7 +457,7 @@ class CostCenter extends BaseController $this->excel->getActiveSheet()->setTitle('Cost Master'); - $this->excel->getActiveSheet()->setCellValue('G3', 'SIDDHARTH INDUSTRIES Cost Master'); + $this->excel->getActiveSheet()->setCellValue('G3', 'RESICO INDUSTRIES Cost Master'); $this->excel->getActiveSheet()->setCellValue('B5', 'S.No'); $this->excel->getActiveSheet()->setCellValue('C5', 'CostCenterCode'); $this->excel->getActiveSheet()->setCellValue('D5', 'CostCenterName'); @@ -561,7 +561,7 @@ class CostCenter extends BaseController function pageNotFound() { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/MRIRcontroller.php b/application/controllers/MRIRcontroller.php index 3bf6a016..f13386b9 100644 --- a/application/controllers/MRIRcontroller.php +++ b/application/controllers/MRIRcontroller.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Inward Gate Register Controller (security) + * Class : MRIRcontroller (Material Inspection Report - Controller) * User Class to control all user related operations. - * @author : Saravana kumar + * @author : Venba Info Tech - Saravana kumar * @version : 1.1 - * @since : 10 Jun 2017 + * @since : 18 Novmeber 2017 */ class MRIRcontroller extends BaseController { @@ -29,14 +29,14 @@ class MRIRcontroller extends BaseController */ public function index() { - $this->global['pageTitle'] = 'Siddharth : View material inspection report'; + $this->global['pageTitle'] = 'Resico : View material inspection report'; $this->loadViews("viewmaterialinspectionreport", $this->global,NULL , NULL); } /* For Entry MRIR Screen*/ function materialinspectionreport($mrir='',$IGRNO='') { - $this->global['pageTitle'] = 'Siddharth : Material Inspection Report'; + $this->global['pageTitle'] = 'Resico : Material Inspection Report'; $this->load->model('mrir_model'); @@ -50,7 +50,7 @@ class MRIRcontroller extends BaseController $MrirNo = $_GET['MRIRNO']; // echo $MrirNo; - $this->global['pageTitle'] = 'Siddharth : MRIR Pdf '; + $this->global['pageTitle'] = 'Resico : MRIR Pdf '; $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); //print_r($data['CompanyDetails']); $data['MRIRDetails'] = $this->mrir_model->edit_mrir($MrirNo); @@ -77,7 +77,7 @@ class MRIRcontroller extends BaseController public function viewmrirforbilling() { - $this->global['pageTitle'] = 'Siddharth : Billing '; + $this->global['pageTitle'] = 'Resico : Billing '; $data['Billing'] = $this->mrir_model->view_mrir_Billing(); @@ -85,7 +85,7 @@ class MRIRcontroller extends BaseController } public function viewmMaterialDistributionList() { - $this->global['pageTitle'] = 'Siddharth : Distribution list '; + $this->global['pageTitle'] = 'Resico : Distribution list '; $data['Distribution'] = $this->mrir_model->ViewDistributionList(); $data['status'] = $this->mrir_model->getStatus(); @@ -102,7 +102,7 @@ public function viewmMaterialDistributionList() $data['IGRDetails'] = $this->mrir_model->get_IGR($IgrNo); - $this->global['pageTitle'] = 'Siddharth : IGR Details '; + $this->global['pageTitle'] = 'Resico: IGR Details '; $this->loadViews("materialinspectionreport", $this->global, $data,NULL); @@ -110,7 +110,7 @@ public function viewmMaterialDistributionList() function viewinwardgateregister() { - $this->global['pageTitle'] = 'Siddharth : View Inward Gate Register'; + $this->global['pageTitle'] = 'Resico : View Inward Gate Register'; $data['IGR']= $this->mrir_model->ViewigrListing(); @@ -126,7 +126,7 @@ public function viewmMaterialDistributionList() $data['viewmrirdatas'] = $this->mrir_model-> view_mrir(); //old name:mrirdatas2 - $this->global['pageTitle'] = 'Siddharth : View Material Inspection Report'; + $this->global['pageTitle'] = 'Resico : View Material Inspection Report'; //print_r( $data); $this->loadViews("viewmaterialinspectionreport", $this->global,$data,NULL); @@ -143,7 +143,7 @@ public function viewmMaterialDistributionList() $data['MRIRDetails'] = $this->mrir_model->edit_mrir($MrirNo);//get_MRIR_Values($MrirNo); //print_r($data['MRIRDetails']); - $this->global['pageTitle'] = 'Siddharth : Edit Material Inspection Report'; + $this->global['pageTitle'] = 'Resico : Edit Material Inspection Report'; $this->loadViews("Editmaterialinspectionreport", $this->global,$data,NULL); @@ -375,7 +375,7 @@ public function viewmMaterialDistributionList() function pageNotFound() { - $this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } } diff --git a/application/controllers/amendmentpurchaseorder.php b/application/controllers/amendmentpurchaseorder.php index 6871213b..e365d280 100644 --- a/application/controllers/amendmentpurchaseorder.php +++ b/application/controllers/amendmentpurchaseorder.php @@ -5,9 +5,9 @@ require APPPATH . '/libraries/BaseController.php'; /** * Class : Amendment Purchase Order controller * User Class to control all user related operations. - * @author : Velmurugan + * @author : Venba Info Tech - Velmurugan * @version : 1.1 - * @since : 10 Jul 2017 + * @since : 18 November 2017 */ class amendmentpurchaseorder extends BaseController { @@ -36,7 +36,7 @@ class amendmentpurchaseorder extends BaseController $forwhat='amendment'; $data['POData'] = $this->purchaseorder_model->purchaseorderListing($forwhat); - $this->global['pageTitle'] = 'Siddharth : Amendment Purchase Order'; + $this->global['pageTitle'] = 'Resico : Amendment Purchase Order'; $this->loadviews('AmendPOlist',$this->global,$data,NULL); } @@ -115,7 +115,7 @@ class amendmentpurchaseorder extends BaseController $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO); $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); - $this->global['pageTitle'] = 'Siddharth : Edit Service Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Service Purchase order form'; $this->loadViews("editServiceAmendPO", $this->global, $data, NULL); } else if($ReqType == REVENUE) @@ -126,7 +126,7 @@ class amendmentpurchaseorder extends BaseController $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); //echo "FROM CON"; //print_r($data['Payment']); - $this->global['pageTitle'] = 'Siddharth : Edit Revenue Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Revenue Purchase order form'; $this->loadViews("editRevenueAmendPO", $this->global, $data, NULL); } @@ -173,7 +173,7 @@ class amendmentpurchaseorder extends BaseController //print_r($unicode); $data['unicode']=$unicode; $data['currencycode']=$currencycode; - $this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Import Purchase order form'; $this->loadViews("editImportAmendPO", $this->global, $data, NULL); } else if($ReqType == CAPITAL) @@ -246,7 +246,7 @@ class amendmentpurchaseorder extends BaseController } - $this->global['pageTitle'] = 'Siddharth : Edit Capital Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Capital Purchase order form'; $this->loadViews("editCapitalAmendPO", $this->global, $data, NULL); } diff --git a/application/controllers/assetdetails.php b/application/controllers/assetdetails.php index d0efb6f2..e39cddae 100644 --- a/application/controllers/assetdetails.php +++ b/application/controllers/assetdetails.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : purchaseorder (PurchaseorderController) + * Class : assetdetails (Asset Details - Controller) * User Class to control all user related operations. - * @author : VenbaMail Mali + * @author : Venba Info Tech * @version : 1.1 - * @since : 15 Feb 2016 + * @since : 18 November 2017 */ class assetdetails extends BaseController { @@ -26,7 +26,7 @@ class assetdetails extends BaseController */ public function index() { - $this->global['pageTitle'] = 'Siddharth : Asset Details'; + $this->global['pageTitle'] = 'Resico : Asset Details'; $this->loadViews("assetListing", $this->global, NULL , NULL); } @@ -41,7 +41,7 @@ class assetdetails extends BaseController $data['userRecords'] = $this->assetdetails_model->assetListing(); - $this->global['pageTitle'] = 'Siddharth : Asset List'; + $this->global['pageTitle'] = 'Resico : Asset List'; //print_r($data);die(); $this->loadViews("assetListing", $this->global, $data, NULL); @@ -56,7 +56,7 @@ class assetdetails extends BaseController $data['po'] = $this->assetdetails_model->getPO(); //print_r($data);die(); - $this->global['pageTitle'] = 'siddharth : Add Asset'; + $this->global['pageTitle'] = 'Resico : Add Asset'; $this->loadViews("addasset", $this->global, $data, NULL); @@ -301,9 +301,9 @@ class assetdetails extends BaseController $data['AssetStatusList'] = $this->assetdetails_model->getConfigValue('C015'); $data['PO'] = $this->assetdetails_model->getPO($PO); //print_r($data);die(); - $this->global['pageTitle'] = 'Siddharth : Edit Asset'; + $this->global['pageTitle'] = 'Resico : Edit Asset'; - $this->loadViews("editOldasset", $this->global, $data,NULL); + $this->loadViews("editasset", $this->global, $data,NULL); } @@ -435,7 +435,7 @@ class assetdetails extends BaseController $this->excel->getActiveSheet()->setTitle('Asset Details'); - $this->excel->getActiveSheet()->setCellValue('G3', 'SIDDHARTH INDUSTRIES Asset Details'); + $this->excel->getActiveSheet()->setCellValue('G3', 'RESICO INDUSTRIES Asset Details'); $this->excel->getActiveSheet()->setCellValue('C5', 'AssetCode'); $this->excel->getActiveSheet()->setCellValue('D5', 'AssetName'); $this->excel->getActiveSheet()->setCellValue('E5', 'AssetDescription'); @@ -552,7 +552,7 @@ class assetdetails extends BaseController function pageNotFound() { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/companycontroller.php b/application/controllers/companycontroller.php index d8d33452..e2d0e793 100644 --- a/application/controllers/companycontroller.php +++ b/application/controllers/companycontroller.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Employee (Employee Controller) + * Class : companycontroller (Company Details - Controller) * User Class to control all user related operations. - * @author : Gandhimathi + * @author :Venba Info Tech - Gandhimathi * @version : 1.1 - * @since : 07 Apr 2017 + * @since : 18 November 2017 */ class companycontroller extends BaseController { diff --git a/application/controllers/configurationctrl.php b/application/controllers/configurationctrl.php index f683bac6..cca4b419 100644 --- a/application/controllers/configurationctrl.php +++ b/application/controllers/configurationctrl.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Supplier Controller (supplier) + * Class : configurationctrl (Configuration Details - Controller) * User Class to control all user related operations. - * @author : Surendar + * @author :Venba Info Tech - Surendar * @version : 1.1 - * @since : 26 July 2017 + * @since : 18 November 2017 */ class configurationctrl extends BaseController { @@ -27,7 +27,7 @@ class configurationctrl extends BaseController public function index() { - $this->global['pageTitle'] = 'Resico : Supplier'; + $this->global['pageTitle'] = 'Resico : Config Details'; $this->loadViews("configlisting", $this->global, NULL , NULL); } diff --git a/application/controllers/department.php b/application/controllers/department.php index b56e7ba0..137da1d8 100644 --- a/application/controllers/department.php +++ b/application/controllers/department.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Supplier Controller (supplier) + * Class : department (Department Details - Controller) * User Class to control all user related operations. - * @author : Gandhimathi + * @author : Venba Info Tech - Gandhimathi * @version : 1.1 - * @since : 12 Apr 2017 + * @since : 18 November 2017 */ class department extends BaseController { diff --git a/application/controllers/emergencypurchaseorder.php b/application/controllers/emergencypurchaseorder.php index 334a5a14..b9129210 100644 --- a/application/controllers/emergencypurchaseorder.php +++ b/application/controllers/emergencypurchaseorder.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : purchaseorder (PurchaseorderController) + * Class : emergencypurchaseorder (Emergency Purchase Order - Controller) * User Class to control all user related operations. - * @author : VenbaMail Mali + * @author : Venba Info Tech - * @version : 1.1 - * @since : 15 Feb 2016 + * @since : 18 November 2017 */ class emergencypurchaseorder extends BaseController { @@ -30,7 +30,7 @@ class emergencypurchaseorder extends BaseController */ public function index() { - $this->global['pageTitle'] = 'Siddharth : AddPO'; + $this->global['pageTitle'] = 'Resico : AddPO'; $this->loadViews("addPO", $this->global, NULL , NULL); } @@ -42,7 +42,7 @@ class emergencypurchaseorder extends BaseController $data['stList'] = $this->purchaseorder_model->getStatusListforAllReq(); $data['ReqList'] = $this->purchaseorder_model->getRequistionListbySearch(); - $this->global['pageTitle'] = 'Siddharth : Create PO from Requisition List'; + $this->global['pageTitle'] = 'Resico : Create PO from Requisition List'; $this->loadViews("createPOfromRequistion", $this->global, $data,Null); } @@ -50,7 +50,7 @@ class emergencypurchaseorder extends BaseController function CreateEmergencyPO() { $RequestedBy = $this->session->userdata ('EmpID'); - $this->global['pageTitle'] = 'Siddharth : Create Emergency Purchase Order'; + $this->global['pageTitle'] = 'Resico : Create Emergency Purchase Order'; $data['RequestType'] = $this->requistion_model->getConfigValue('C004'); $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); @@ -447,7 +447,7 @@ $RequestedBy = $this->input->post('drpDepartment'); $this->purchaseorder_model->UpdateRequistionStatus(); $data['POData'] = $this->purchaseorder_model->purchaseorderListing(); - $this->global['pageTitle'] = 'Siddharth : Purchase Orders'; + $this->global['pageTitle'] = 'Resico : Purchase Orders'; $this->loadViews("POlist", $this->global, $data, NULL); @@ -487,7 +487,7 @@ $RequestedBy = $this->input->post('drpDepartment'); else { - $this->global['pageTitle'] = 'Siddharth : Purchase order form'; + $this->global['pageTitle'] = 'Resico : Purchase order form'; $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); @@ -571,14 +571,14 @@ $RequestedBy = $this->input->post('drpDepartment'); { $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO); - $this->global['pageTitle'] = 'Siddharth : Edit Service Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Service Purchase order form'; $this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL); } else if($ReqType == REVENUE) { $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($PONO); - $this->global['pageTitle'] = 'Siddharth : Edit Revenue Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Revenue Purchase order form'; $this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL); } @@ -1036,7 +1036,7 @@ $RequestedBy = $this->input->post('drpDepartment'); } function pageNotFound() { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/emergencypurchaseorder.php~ b/application/controllers/emergencypurchaseorder.php~ deleted file mode 100644 index 1f17f873..00000000 --- a/application/controllers/emergencypurchaseorder.php~ +++ /dev/null @@ -1,1110 +0,0 @@ -load->model('purchaseorder_model'); - - $this->load->library('session'); - $this->load->library('form_validation'); - $this->load->model('requistion_model'); - $this->isLoggedIn(); - } - - /** - * This function used to load the first screen of the user - */ - public function index() - { - $this->global['pageTitle'] = 'Siddharth : AddPO'; - - $this->loadViews("addPO", $this->global, NULL , NULL); - } - - function requisition() - { - $data['DeptList'] = $this->purchaseorder_model->getDepartmentListForAllReq(); - - $data['stList'] = $this->purchaseorder_model->getStatusListforAllReq(); - - $data['ReqList'] = $this->purchaseorder_model->getRequistionListbySearch(); - $this->global['pageTitle'] = 'Siddharth : Create PO from Requisition List'; - - $this->loadViews("createPOfromRequistion", $this->global, $data,Null); - } - - function CreateEmergencyPO() - { - $RequestedBy = $this->session->userdata ('EmpID'); - $this->global['pageTitle'] = 'Siddharth : Create Emergency Purchase Order'; - $data['RequestType'] = $this->requistion_model->getConfigValue('C004'); - $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); - $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); - /*$data['DeptList'] = $this->purchaseorder_model->getDepartmentAllList();*/ - $empDetails = $this->requistion_model->GetEmployeeDetails($RequestedBy); - - $DeptCode = $empDetails[0]['DEPCode']; - $data['DeptList'] = $empDetails; - $data['CostList'] = $this->requistion_model->GetCostCenterByDept( $DeptCode); - - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); - $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); - $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); - $data['Payment']=$this->purchaseorder_model->getSupplierPayment('C009'); - $data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); - - $this->loadViews("alterpurchaseorder", $this->global, $data, Null); - - } - /** - * this function used for get all material code using request type - */ - function getMaterialCode(){ - $reqType = $this->input->post('input'); - $materialList = $this->requistion_model->GetMaterialCode($reqType); - echo json_encode($materialList); - - } - - /*This function is used for get cost center list using department code*/ - function getCostCenterName(){ - $CostList=''; - $DeptCode = $this->input->post('id'); - $CostList = $this->requistion_model->GetCostCenterByDept($DeptCode); - // print_r($CostList); - echo json_encode($CostList); - - } - - //This used to Create Service Purchase Order - function addNewServicePurchaseOrder() - { - - - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('DeliveryAddr'); - $dt = $this->input->post('Deliverydt'); - $CostCenterName = $this->input->post('CostCenterName'); - $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } - - - $POType = $this->input->post('POType'); - - $SpcialInstruction = $this->input->post('TextSpcialInstruction'); - $TotalOrderValueSummary = $this->input->post('TextTotalOrderValueSummaryService'); - - $POStatus = $this->input->post('TextStatus'); - $CreateBy = $this->session->userdata ('userId'); - $RequestedBy = $this->session->userdata ('EmpID'); - - $ReqStatus = REQITEM_Emergency_PO_CREATED; - - $RowCount = $this->input->post('TextRowCount'); - - $DeletedRow = $this->input->post('TextDeletedRowCount'); - - $comma_separated = explode(':', $DeletedRow); - - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - $createddt = $dt->format('Y-m-d H:i:s'); - $PaymentTerms=$this->input->post('PaymentMethod'); - $PayableAT=$this->input->post('PayableAT'); - - $PaymentDays=$this->input->post('paymentDateOptions'); - $ServiceWorkStatus=$this->input->post('workStatus'); - - - - //create T_Requestion_Master - $Request = array('ReqType'=>$POType, 'Requestedby'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$SpcialInstruction,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy); - - $Req = $this->requistion_model->addRequistion($Request); - - $RegNo=''; - if(count($Req)>0) - { - $RegNo = $Req[0]['ReqNo']; - } - - - // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'ServiceWorkStatus'=>$ServiceWorkStatus,'POType'=>$POType); - - $POMaster = $this->purchaseorder_model->addPOMaster($POList); - $PONO = ''; - if(count($POMaster)>0) - { - $PONO = $POMaster[0]['PONO']; - } - - $RegDetailsStatus=REQITEM_POCREATED; - - // PO Line Items - $LineItemStatus = REQITEM_NEW; - - for ($i = 1; $i <= $RowCount; $i++) - { - - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - $ServiceTax = $this->input->post('ServiceTax'.$i); - $EduCess = $this->input->post('EduCess'.$i); - $SecHighTax = $this->input->post('SecHighTax'.$i); - $KrishiTax = $this->input->post('KrishiTax'.$i); - $SwachhTax = $this->input->post('SwachhTax'.$i); - $CostCenter = $this->input->post('costCode'.$i); - - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - $ServiceFrequency=$this->input->post('Frequency'.$i); - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j]; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - - //add requistion details - $ReqDetails = array('ReqNo'=>$RegNo, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Status'=>$RegDetailsStatus,'UpdatedBy'=>$CreateBy,'UpdatedOn'=>$createddt); - - - $ReqDetQuery = $this->requistion_model->addRequistionDetails($ReqDetails); - - - - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency); - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - $LineItemNo = ''; - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - - - if(trim($POType) == SERVICE ) - { - // echo 'Success'; - - $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); - - $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); - - } - } - else { - - } - - } - - if($POStatus == REQ_DRAFT) - { - echo 'Emergency Service Purchase Order Saved Successfully!The PO NO Is: '.$PONO; - - } - else - { - echo 'Emergency Service Purchase Order Created Successfully!The PO NO Is: '.$PONO; - - } - - - } - - - - //This used to Create Revenue Emergency Purchase Order - function addNewRevenuePurchaseOrder() - { - - - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('DeliveryAddr'); - $dt = $this->input->post('Deliverydt'); - $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } - $CostCenterName = $this->input->post('CostCenterName'); - $POType = $this->input->post('POType'); - $PoRange = $this->input->post('txtPoRange'); - - $SpcialInstruction = $this->input->post('TextSpcialInstruction'); - $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); - $POStatus = $this->input->post('TextStatus'); - - $CreateBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('TextRowCount'); - $DeletedRow = $this->input->post('TextDeletedRowCount'); - $RequestedBy = $this->session->userdata ('EmpID'); - $ReqStatus = REQITEM_Emergency_PO_CREATED; - - - $comma_separated = explode(':', $DeletedRow); - - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $createddt = $dt->format('Y-m-d H:i:s'); - $PaymentTerms=$this->input->post('PaymentMethod'); - $PayableAT=$this->input->post('PayableAT'); - - $PaymentDays=$this->input->post('paymentDateOptions'); - //add requistion - $Request = array('ReqType'=>$POType, 'Requestedby'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$SpcialInstruction,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy); - - $Req = $this->requistion_model->addRequistion($Request); - - $RegNo=''; - if(count($Req)>0) - { - $RegNo = $Req[0]['ReqNo']; - } - // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'POType'=>$POType ); - - $POMaster = $this->purchaseorder_model->addPOMaster($POList); - - $PONO = ''; - if(count($POMaster)>0) - { - $PONO = $POMaster[0]['PONO']; - } - - // PO Line Items - $RegDetailsStatus=REQITEM_POCREATED; - $LineItemStatus = REQITEM_NEW; - - for ($i = 1; $i <= $RowCount; $i++) - { - - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - - $DiscountType = $this->input->post('DisType'.$i); - $DiscountValue = $this->input->post('DisVal'.$i); - $AfterDiscount = $this->input->post('AfterDisVal'.$i); - $PackagingOption = $this->input->post('PackOption'.$i); - $PackagingType = $this->input->post('PackType'.$i); - $PackagingValue = $this->input->post('PackVal'.$i); - $AfterPackagingValue = $this->input->post('AfterPackVal'.$i); - $ExciseOption = $this->input->post('ExciseOption'.$i); - $ExciseValue = $this->input->post('ExciseVal'.$i); - $AfterExciseValue = $this->input->post('AfterExciseVal'.$i); - $VatOption = $this->input->post('VatOption'.$i); - $VatValue = $this->input->post('VatVal'.$i); - $AfterVatValue = $this->input->post('AfterVatVal'.$i); - $CSTOption = $this->input->post('CSTOption'.$i); - $CSTValue = $this->input->post('CSTVal'.$i); - $AfterCSTValue = $this->input->post('AfterCSTVal'.$i); - $GSTValue = $this->input->post('GSTVal'.$i); - $AfterGSTValue = $this->input->post('AfterGSTVal'.$i); - $OtherTaxValue = $this->input->post('OtherTaxVal'.$i); - $AfterOtherTaxValue = $this->input->post('AfterOtherTaxVal'.$i); - $FreightType = $this->input->post('FreightType'.$i); - $FreightValue = $this->input->post('FreightVal'.$i); - $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); - $InsuranceValue = $this->input->post('Insval'.$i); - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - $CostCenter = $this->input->post('costCode'.$i); - - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - //add requistion details - $ReqDetails = array('ReqNo'=>$RegNo, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Status'=>$RegDetailsStatus,'UpdatedBy'=>$CreateBy,'UpdatedOn'=>$createddt); - - - $ReqDetQuery = $this->requistion_model->addRequistionDetails($ReqDetails); - - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); - - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - - $LineItemNo = ''; - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - //echo $LineItemNo; - - if(trim($POType) == REVENUE ) - { - // echo 'Success'; - $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); - - $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); - //echo 'Revenue tax Success'; - } - } - - } - echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ; - - } - - - /** - * This function is used to load the purchaseorder list - */ - function PurchaseOrderList() - { - - $this->load->library('pagination'); - - $count = $this->purchaseorder_model->purchaseorderListingCount(''); - - $returns = $this->paginationCompress ( "purchaseorderListing/", $count, 5 ); - - //$this->purchaseorder_model->UpdateRequistItemStatus(); - $this->purchaseorder_model->UpdateRequistionStatus(); - $data['POData'] = $this->purchaseorder_model->purchaseorderListing(); - - $this->global['pageTitle'] = 'Siddharth : Purchase Orders'; - - $this->loadViews("POlist", $this->global, $data, NULL); - - } - function Req_validate($selectValue) - { - //echo 'select_validate method called'; - // 'none' is the first option and the text says something like "-Choose one-" - if(strlen($selectValue) == 0) - { - $this->form_validation->set_message('Req_validate', 'Please Select Requisition Number to Create PO.'); - return false; - } - else // user picked something - { - return true; - } - } - - /** - * This function used to show the Purchase Order Screen - */ - - function CreatePurchaseOrder() - { - - - $this->load->library('form_validation'); - - $this->form_validation->set_rules('txtReqNo', 'txtReqNo', 'callback_Req_validate'); - - if($this->form_validation->run() == FALSE) - { - $this->requisition(); - //echo 'Validate method called'; - } - else - { - - $this->global['pageTitle'] = 'Siddharth : Purchase order form'; - $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); - $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); - $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); - $SelectedReq = json_decode($this->input->post('txtReqNo')); - $Req = $SelectedReq->Req; - $data['ReqList'] = $Req ; - $ReqArray = array(); - $ReqType = ''; - $result = array(); - - foreach ($Req as $SID): - $ReqArray[] = $SID->ReqNo ; - $result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo); - $ReqType = $SID->ReqType; - //echo $SID->ReqNo; - - endforeach; - //print_r ($result); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $Year = $dt->format('Y'); - $data['CostList'] = $this->purchaseorder_model->getCostCenterbyRequist('',$Year,$ReqType); - $data['MaterialList'] = $result; //$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray); - //print_r ($data['MaterialList']); - $data['RequistionDetails'] = $this->purchaseorder_model->getRequistDetails($ReqArray); - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); - - $ViewName = ''; - if($ReqType == REVENUE) - { - $ViewName = 'Purchaseorder'; - } - else if($ReqType == SERVICE) - { - $ViewName = 'servicePurchaseorder'; - } - $this->loadViews($ViewName, $this->global,$data, NULL); - } - } - - function CreatePOPrint() - { - $PONO = $_GET['PONO']; - $ReqType = $_GET['ReqType']; - - if($ReqType == SERVICE) - { - $this ->servicepoprint($PONO); - - } - else if($ReqType == REVENUE) - { - $this ->revenuepoprint($PONO); - - } - } - //To View/Update Purchase Order - function EditPurchaseOrder() - { - $PONO = $_GET['PONO']; - $ReqType = $_GET['ReqType']; - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $Year = $dt->format('Y'); - $data['CostList'] = $this->purchaseorder_model->getCostCenterbyRequist('',$Year,$ReqType); - $Req = $this->purchaseorder_model->getRequistionNoFromPO($PONO); - $data['ReqList'] = $Req ; - $result = array(); - $ReqArray = array(); - foreach ($Req as $SID): - $ReqArray[] = $SID->ReqNo ; - $result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo); - endforeach; - $data['MaterialList'] = $result;//$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray); - $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); - $data['RequistionDetails'] = $this->purchaseorder_model->getRequistDetails($ReqArray); - $data['POMaster'] = $this->purchaseorder_model->GetServicePurchaseOrder($PONO); - $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); - $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); - $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); - if($ReqType == SERVICE) - { - - $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO); - $this->global['pageTitle'] = 'Siddharth : Edit Service Purchase order form'; - $this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL); - } - else if($ReqType == REVENUE) - { - - $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($PONO); - $this->global['pageTitle'] = 'Siddharth : Edit Revenue Purchase order form'; - $this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL); - } - - } - - // To get the Material value based on the MaterialCode - function getDetailsforReq() - { - - - $SearchFilter= $this->input->post('id'); - // $reqDate= $this->input->post('ReqDate'); - $DeptCode = $SearchFilter[0]; - $MatType = $SearchFilter[1]; - $ReqNo = $SearchFilter[2]; - // $ReqDetai = $this->purchaseorder_model->getRequistDetails( $EmpID ); - - $CostList = $this->requistion_model->GetCostCenterByDept( $DeptCode); - - $HTML = ""; - $BudAmount = ""; - if(count($CostList) > 0) - { - for ($j = 0; $j < count($CostList); $j++) - { - $Code = $CostList[$j]['CostCenterCode']; - $Name = $CostList[$j]['CostCenterName']; - $HTML .=""; - } - } - $MaterialDetails = $this->purchaseorder_model->getRawMaterialListForPO($MatType,$ReqNo); - - $HTML1 = ""; - - if(count($MaterialDetails) > 0) - { - for ($j = 0; $j < count($MaterialDetails); $j++) - { - $Code = $MaterialDetails[$j]['MaterialCode']; - $Name = $MaterialDetails[$j]['MaterialName']; - $HTML1 .=""; - - } - - } - // print_r($HTML1); - - die(json_encode(array('MatDetail' =>$HTML1,'Cost'=> $HTML))); - } - /* This method to get the status based on the Department selection in th - */ - function getStatusByDepartment() - { - $DepId = $this->input->post('id'); - - $data = $this->purchaseorder_model->getStatusByDepartment($DepId); - - $HTML = ""; - if(count($data) > 0) - { - for ($j = 0; $j < count($data); $j++) - { - $Code = $data[$j]['StatusCode']; - $Name = $data[$j]['StatusName']; - $HTML .=""; - } - } - //echo $HTML; - die(json_encode(array('depStaus' => $HTML))); - } - - // To get the available Budget Amount - function AvilBudgetAmount() - { - $SearchFilter= $this->input->post('id'); - // $reqDate= $this->input->post('ReqDate'); - $CostCode = $SearchFilter[0]; - $ReqType = $SearchFilter[1]; - print_r($SearchFilter); - $CostCode= $this->input->post('id'); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - $Year = $dt->format('Y'); - $this->load->model('purchaseorder_model'); - $result = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); - //print_r($result); - $AvilBudAmt = ''; - if(count($result)>0) - { - $AvilBudAmt = $result[0]['BudgetAmount'] - $result[0]['Totalvalue']; - } - - // echo 'Test'; - print_r($AvilBudAmt); - //die(json_encode(array('Cost' => $AvilBudAmt))); - } - - - function getDateformat($Val) - { - $date = new DateTime($Val,new DateTimeZone('Asia/Kolkata')); - // print_r($date); - $retDate = $date->format('Y-m-d H:i:s'); - return $retDate; - } - /* Method to get the Requistion list based on the search filter*/ - - function SearchListofRequistion() - { - $SearchFilter= $this->input->post('id'); - // $reqDate= $this->input->post('ReqDate'); - $DEPCode = $SearchFilter[0]; - $Status = $SearchFilter[1]; - $rng = $SearchFilter[2]; - // $ToDate = $SearchFilter[3]; - $FromDate =''; - $ToDate = ''; - // echo $rng; - $Dt = explode("-",$rng); - // print_r( $Dt); - if(count( $Dt)>1) - { - $FDate = $Dt[0]; - $TDate = $Dt[1]; - $FromDate = $this->getDateformat($FDate); - $ToDate = $this->getDateformat($TDate); - } - //echo $FromDate; - // print_r($Dt); - $result = $this->purchaseorder_model->getRequistionListbySearch($DEPCode,$Status,$FromDate,$ToDate); - - - $HTML=""; - for ($i = 0; $i < count($result); $i++) - { - $SNo = $i + 1; - $ReqNo = $result[$i]['ReqNo']; - $ReqType = $result[$i]['ReqType']; - $Reqedby = $result[$i]['FirstName']; - $ReqDate = $result[$i]['ReqDate']; - $Status = $result[$i]['StatusName']; - $Department = $result[$i]['DepartmentName']; - $Designation = $result[$i]['Designation']; - - $HTML.=" - - ". $ReqNo." - - ".$ReqType." - - ".$Reqedby." - ".$ReqDate." - ".$Status." - ".$Department." - ".$Designation." - "; - } - //print_r( $HTML); - die(json_encode(array('ReqList' =>$HTML))); - } - - - /* To View the request details*/ - function ListPORequistion() - { - $ReqNo= $this->input->post('id'); - $result = $this->requistion_model->getRequistItemList($ReqNo); - $ReqList = $this->requistion_model->getRequistDetails($ReqNo); - $DepNo = $ReqList[0]['DEPCode']; - $CostList = $this->requistion_model->GetCostCenterByDept($DepNo); - $HTML=""; - for ($i = 0; $i < count($result); $i++) - { - $SNo = $i + 1; - $MaterialCode = $result[$i]['MaterialCode']; - $MaterialName = $result[$i]['MaterialName']; - $UOM = $result[$i]['UOM']; - $Quantity = $result[$i]['Quantity']; - $HTML.=" - ".$SNo." - ". $MaterialCode." - - ".$MaterialName." - - ".$UOM." - ".$Quantity." - "; - - //$index = $index + 1; - - } - - $CostCenter = ""; - if(count($CostList) > 0) - { - for ($j = 0; $j < count($CostList); $j++) - { - $Code = $CostList[$j]['CostCenterCode']; - $Name = $CostList[$j]['CostCenterName']; - $CostCenter .=""; - } - } - //echo $HTML; - //echo $CostCenter; - die(json_encode(array('Items' =>$HTML,'Requist'=>$ReqList,'Cost'=>$CostCenter))); - } - - //This used to Create Revenue Purchase Order - function addNewPurchaseOrder() - { - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('DeliveryAddr'); - $dt = $this->input->post('Deliverydt'); - $Deliverydt = $this->getDateformat($dt); - $POType = $this->input->post('POType'); - $PoRange = $this->input->post('txtPoRange'); - - $SpcialInstruction = $this->input->post('txtSpcialInstruction'); - $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); - $POStatus = $this->input->post('txtStatus'); - - $CreateBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $createddt = $dt->format('Y-m-d H:i:s'); - // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt ); - - $POMaster = $this->purchaseorder_model->addPOMaster($POList); - - $PONO = ''; - if(count($POMaster)>0) - { - $PONO = $POMaster[0]['PONO']; - } - //echo $PONO; - //echo $POType; - // PO Line Items - $LineItemStatus = REQITEM_NEW; - //echo ' test:'.REVENUE; - //echo $RowCount; - for ($i = 1; $i <= $RowCount; $i++) - { - - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - - $DiscountType = $this->input->post('DisType'.$i); - $DiscountValue = $this->input->post('DisVal'.$i); - $AfterDiscount = $this->input->post('AfterDisVal'.$i); - $PackagingOption = $this->input->post('PackOption'.$i); - $PackagingType = $this->input->post('PackType'.$i); - $PackagingValue = $this->input->post('PackVal'.$i); - $AfterPackagingValue = $this->input->post('AfterPackVal'.$i); - $ExciseOption = $this->input->post('ExciseOption'.$i); - $ExciseValue = $this->input->post('ExciseVal'.$i); - $AfterExciseValue = $this->input->post('AfterExciseVal'.$i); - $VatOption = $this->input->post('VatOption'.$i); - $VatValue = $this->input->post('VatVal'.$i); - $AfterVatValue = $this->input->post('AfterVatVal'.$i); - $CSTOption = $this->input->post('CSTOption'.$i); - $CSTValue = $this->input->post('CSTVal'.$i); - $AfterCSTValue = $this->input->post('AfterCSTVal'.$i); - $GSTValue = $this->input->post('GSTVal'.$i); - $AfterGSTValue = $this->input->post('AfterGSTVal'.$i); - $OtherTaxValue = $this->input->post('OtherTaxVal'.$i); - $AfterOtherTaxValue = $this->input->post('AfterOtherTaxVal'.$i); - $FreightType = $this->input->post('FreightType'.$i); - $FreightValue = $this->input->post('FreightVal'.$i); - $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); - $InsuranceValue = $this->input->post('Insval'.$i); - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - $CostCenter = $this->input->post('costCode'.$i); - - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); - - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - - $LineItemNo = ''; - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - //echo $LineItemNo; - - if(trim($POType) == REVENUE ) - { - // echo 'Success'; - $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); - - $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); - //echo 'Revenue tax Success'; - } - } - - } - echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ; - - } - //This used to Edit the Revenue Purchase Order - function EditRevenuePurchaseOrder() - { - $PONO =$this->input->post('txtPONO'); - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('txtDeliveryAddress'); - $dt = $this->input->post('Deliverydt'); - $Deliverydt = $this->getDateformat($dt); - $POType = $this->input->post('POType'); - $PoRange = $this->input->post('txtPoRange'); - - $SpcialInstruction = $this->input->post('SpcialInstruction'); - $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); - $POStatus = $this->input->post('txtStatus'); - - $updatedBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $updateddt = $dt->format('Y-m-d H:i:s'); - // PO Master - // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt ); - - $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); - - $LineItemStatus = REQITEM_NEW; - - - - //echo $RowCount; - for ($i = 1; $i <= $RowCount; $i++) - { - - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - - $DiscountType = $this->input->post('DisType'.$i); - $DiscountValue = $this->input->post('DisVal'.$i); - $AfterDiscount = $this->input->post('AfterDisVal'.$i); - $PackagingOption = $this->input->post('PackOption'.$i); - $PackagingType = $this->input->post('PackType'.$i); - $PackagingValue = $this->input->post('PackVal'.$i); - $AfterPackagingValue = $this->input->post('AfterPackVal'.$i); - $ExciseOption = $this->input->post('ExciseOption'.$i); - $ExciseValue = $this->input->post('ExciseVal'.$i); - $AfterExciseValue = $this->input->post('AfterExciseVal'.$i); - $VatOption = $this->input->post('VatOption'.$i); - $VatValue = $this->input->post('VatVal'.$i); - $AfterVatValue = $this->input->post('AfterVatVal'.$i); - $CSTOption = $this->input->post('CSTOption'.$i); - $CSTValue = $this->input->post('CSTVal'.$i); - $AfterCSTValue = $this->input->post('AfterCSTVal'.$i); - $GSTValue = $this->input->post('GSTVal'.$i); - $AfterGSTValue = $this->input->post('AfterGSTVal'.$i); - $OtherTaxValue = $this->input->post('OtherTaxVal'.$i); - $AfterOtherTaxValue = $this->input->post('AfterOtherTaxVal'.$i); - $FreightType = $this->input->post('FreightType'.$i); - $FreightValue = $this->input->post('FreightVal'.$i); - $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); - $InsuranceValue = $this->input->post('Insval'.$i); - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - $POLineItemNo = $this->input->post('LineItemNo'.$i); - $CostCenter = $this->input->post('costCode'.$i); - $LineItemNo = ''; - - - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - if(strlen($POLineItemNo) == 0) - { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter); - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - - } - else - { - $LineItemNo = $POLineItemNo; - - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter); - $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList); - - } - $isExists = $this->purchaseorder_model->LineItemExistsinRevenueTax($LineItemNo); - if(count($isExists) == 0) - { - $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt); - - $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); - - } - else - { - $RevenueTaxList = array('DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt); - - $this->purchaseorder_model->updateRevenueTax($LineItemNo,$RevenueTaxList); - - } - } - - } - - echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ; - } - function pageNotFound() - { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; - - $this->loadViews("404", $this->global, NULL, NULL); - } - - public function revenuepoprint($PONO) - { - // Load all views as normal - - - //$PONO = $_GET['PO']; - - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO); - - - // Add header to pdf - //$this->load->view('includes/pdfheader'); - - // Load the pdf page with multiviews - $this->load->View("revenuepopdf", $data); - - // Add header to pdf - //$this->load->view('includes/pdffooter'); - - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("RevenuePOReport.pdf",$data,$php); - - } - public function servicepoprint($PONO) - { - - // $this->load->view('includes/pdfheader'); - - // Load the pdf page with multiviews - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetailsForPrint($PONO); - - $this->load->View("servicepopdf", $data); - - // Add header to pdf - //$this->load->view('includes/pdffooter'); - - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("ServicePOReport.pdf",$data,$php); - - } - /** - * This function used to load the Delete the Requistion Items - */ - function DeletePODetails() - { - - $ReqList= $this->input->post('id'); - $LineItemNo = ''; - $ReqNo =''; - $MaterialCode = ''; - $POType = ''; - if(count($ReqList) > 0) - { - $LineItemNo = $ReqList[0]; - $ReqNo = $ReqList[1]; - $MaterialCode = $ReqList[2]; - $POType = $ReqList[3]; - } - // print_r($ReqList); - - - If($POType == REVENUE) - { - $this->purchaseorder_model->DeletePORevenueTax($LineItemNo); - } - else If($POType == SERVICE) - { - $this->purchaseorder_model->DeletePOServiceTax($LineItemNo); - } - $this->purchaseorder_model->DeletePOLineItem($LineItemNo , $ReqNo,$MaterialCode); - echo "Successfully Deleted the Line item".$LineItemNo; - - } -} - -?> - diff --git a/application/controllers/employeedetails.php b/application/controllers/employeedetails.php index 81d7b6b5..b848c9a8 100644 --- a/application/controllers/employeedetails.php +++ b/application/controllers/employeedetails.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Employee (Employee Controller) + * Class : employeedetails (Employee Details - Controller) * User Class to control all user related operations. - * @author : Gandhimathi + * @author :Venba Info Tech - Gandhimathi * @version : 1.1 - * @since : 07 Apr 2017 + * @since : 18 November 2017 */ class employeedetails extends BaseController { @@ -19,7 +19,7 @@ class employeedetails extends BaseController parent::__construct(); $this->load->model('employeedetails_model'); $this->isLoggedIn(); - } + } /** * This function used to load the first screen of the user */ diff --git a/application/controllers/emppaydate.php b/application/controllers/emppaydate.php index 3f30cdd0..cb1484f0 100644 --- a/application/controllers/emppaydate.php +++ b/application/controllers/emppaydate.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Cost Center (Cost Center Controller) + * Class : emppaydate (Employee Payment details - Controller) * User Class to control all user related operations. - * @author : VenbaMail Mali + * @author : Venba Info Tech - * @version : 1.1 - * @since : 15 Feb 2016 + * @since : 18 November 2017 */ class emppaydate extends BaseController { @@ -30,7 +30,7 @@ class emppaydate extends BaseController */ public function index() { - $this->global['pageTitle'] = 'Siddharth : Employee Pay Details'; + $this->global['pageTitle'] = 'Resico : Employee Pay Details'; $this->loadViews("emppayListing", $this->global); } @@ -46,7 +46,7 @@ class emppaydate extends BaseController $data['userRecords'] = $this->emppaydate_model->emppayListing(); - $this->global['pageTitle'] = 'Siddharth : Employee Pay List'; + $this->global['pageTitle'] = 'Resico : Employee Pay List'; $this->loadViews("emppayListing", $this->global, $data, NULL); } @@ -63,7 +63,7 @@ class emppaydate extends BaseController - $this->global['pageTitle'] = 'Siddharth : Add Employee Pay'; + $this->global['pageTitle'] = 'Resico : Add Employee Pay'; $this->loadViews("addemppaydate", $this->global,$result); @@ -173,7 +173,7 @@ class emppaydate extends BaseController $data['emppay'] = $this->emppaydate_model->getUserInfo($paydataid); - $this->global['pageTitle'] = 'Siddharth : Edit Employee Pay Monthly Details '; + $this->global['pageTitle'] = 'Resico : Edit Employee Pay Monthly Details '; $this->loadViews("editOldemppay", $this->global, $data,NULL); @@ -328,7 +328,7 @@ class emppaydate extends BaseController function pageNotFound() { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php index 02d7126b..2c5e947e 100644 --- a/application/controllers/inwardgateregister.php +++ b/application/controllers/inwardgateregister.php @@ -5,9 +5,9 @@ require APPPATH . '/libraries/BaseController.php'; /** * Class : Inward Gate Register Controller (security) * User Class to control all user related operations. - * @author : Saravana kumar + * @author :Venba Info Tech - Saravana kumar * @version : 1.1 - * @since : 8 Jun 2017 + * @since :18 November 2017 */ class inwardgateregister extends BaseController { @@ -29,7 +29,7 @@ class inwardgateregister extends BaseController */ public function index() { - $this->global['pageTitle'] = 'Siddharth : Inward Gate Register'; + $this->global['pageTitle'] = 'Resico : Inward Gate Register'; $this->loadViews("viewinwardgateregister", $this->global,NULL , NULL); } @@ -38,7 +38,7 @@ class inwardgateregister extends BaseController function viewIGRDetails() { $this->load->model('inwardgateregister_model'); - $this->global['pageTitle'] = 'Siddharth : Inward Gate Register Details'; + $this->global['pageTitle'] = 'Resico : Inward Gate Register Details'; $data['IGR']= $this->inwardgateregister_model->igrListing(); $this->loadViews("viewIGRDetails",$this->global,$data,NULL); @@ -48,7 +48,7 @@ class inwardgateregister extends BaseController { $this->load->model('inwardgateregister_model'); - $this->global['pageTitle'] = 'Siddharth : Add Inward Gate Register'; + $this->global['pageTitle'] = 'Resico : Add Inward Gate Register'; $data['PO_NO'] = $this->inwardgateregister_model->getpurchaseorder(); @@ -202,7 +202,7 @@ class inwardgateregister extends BaseController } function pageNotFound() { - $this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/login.php b/application/controllers/login.php index 853d20af..df031ffa 100644 --- a/application/controllers/login.php +++ b/application/controllers/login.php @@ -1,11 +1,11 @@ global['pageTitle'] = 'Siddharth : Monthly Pay Details'; + $this->global['pageTitle'] = 'Resico: Monthly Pay Details'; $this->loadviews('monthlyListing',$this->global); } @@ -39,7 +39,7 @@ class monthlypay extends BaseController $data['days'] = $this-> monthlypay_model->getPublicHoldays(); - $this->global['pageTitle'] = 'Siddharth : Public Holidays'; + $this->global['pageTitle'] = 'Resico : Public Holidays'; $this->loadviews('publicholidays',$this->global,$data,NULL); @@ -138,7 +138,7 @@ class monthlypay extends BaseController $data['datefordropdown'] = $current; $data['attendance'] = $this-> monthlypay_model->monthlyAttendance($current); $data['emppay'] = $this-> monthlypay_model->getEmpPayDetails($current,$string); - $this->global['pageTitle'] = 'Siddharth : Monthly Attendance'; + $this->global['pageTitle'] = 'Resico : Monthly Attendance'; $this->loadViews("attendance", $this->global, $data, NULL); } @@ -202,7 +202,7 @@ class monthlypay extends BaseController $data['userRecords'] = $this->monthlypay_model->monthlyListing(); - $this->global['pageTitle'] = 'Siddharth : Monthly Pay List'; + $this->global['pageTitle'] = 'Resico : Monthly Pay List'; $this->loadViews("monthlyListing", $this->global, $data, NULL); } @@ -223,7 +223,7 @@ class monthlypay extends BaseController //$data['emp_id'] = $this->monthlypay_model->getmonthlypay(); - $this->global['pageTitle'] = 'siddharth : Add Monthly Pay'; + $this->global['pageTitle'] = 'Resico : Add Monthly Pay'; $this->loadviews('addMontly',$this->global, NULL); @@ -296,7 +296,7 @@ class monthlypay extends BaseController $data['monthly'] = $this->monthlypay_model->getUserInfo($EmpID,$month_year); //$data['monthly_pay_inputs'] = $this->monthlylisting_model->getUserInfo($employeeid); - $this->global['pageTitle'] = 'Siddharth : Edit Monthly Listing'; + $this->global['pageTitle'] = 'Resico : Edit Monthly Listing'; $this->loadViews("editOldmonthly", $this->global, $data,NULL); @@ -379,7 +379,7 @@ class monthlypay extends BaseController function pageNotFound() { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/payslip.php b/application/controllers/payslip.php index 7c27b038..2a7a35fa 100644 --- a/application/controllers/payslip.php +++ b/application/controllers/payslip.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Employee (Employee Controller) + * Class : payslip (Pay Slip - Controller) * User Class to control all user related operations. - * @author : Gandhimathi + * @author : Venba Info Tech - Gandhimathi * @version : 1.1 - * @since : 07 Apr 2017 + * @since : 18 November 2017 */ class payslip extends BaseController { @@ -47,7 +47,7 @@ function phpAlert($msg) { $Data['Payon'] = $this->payroll_model->getPayOn(); $Data['Bank'] = $this->payroll_model->getBankInfo(); - $this->global['pageTitle'] = 'Siddharth : Bank Report Screen'; + $this->global['pageTitle'] = 'Resico : Bank Report Screen'; $this->loadViews("bankreport", $this->global,$Data,NULL); } @@ -128,7 +128,7 @@ function phpAlert($msg) { else{ $this->load->library('excel'); - // $this->global['pageTitle'] = 'Siddharth : PF Excel Report'; + // $this->global['pageTitle'] = 'Resico : PF Excel Report'; // $this->loadViews('pfexcel',$this->global,$data,NULL); $this->excel->setActiveSheetIndex(0); $this->excel->getActiveSheet()->setTitle('Employee PF Report ' . $data['PayMonth']); @@ -467,7 +467,7 @@ function phpAlert($msg) { } $data['loanemployees'] = $this->payroll_model->getEmpDetailsforLoan(); - $this->global['pageTitle'] = 'Siddharth : Loan Reports'; + $this->global['pageTitle'] = 'Resico : Loan Reports'; $this->loadViews("loanreports", $this->global,$data, NULL); } @@ -478,7 +478,7 @@ function phpAlert($msg) { public function viewUpload2() { - $this->global['pageTitle'] = 'Siddharth : Payroll Data Upload2'; + $this->global['pageTitle'] = 'Resico : Payroll Data Upload2'; $this->loadViews("payslipupload2", $this->global, NULL); @@ -491,7 +491,7 @@ function phpAlert($msg) { // $data['fresh'] = $this-> monthlypay_model->getEmpPayDetails($current); $data['fresh'] = $this-> monthlypay_model->getEmpPayDetailsforMonthInputs($current); - $this->global['pageTitle'] = 'Siddharth : Payroll Monthly Inputs'; + $this->global['pageTitle'] = 'Resico : Payroll Monthly Inputs'; $this->loadViews("monthlypayinputs", $this->global,$data,NULL); @@ -676,7 +676,7 @@ function phpAlert($msg) { function payslipLisiting() { - $this->global['pageTitle'] = 'Siddharth : Payslip Listing'; + $this->global['pageTitle'] = 'Resico : Payslip Listing'; $data['PayInfo'] = $this->payroll_model->GetPayslipdata(); $this->loadViews("paysliplist", $this->global, $data , NULL); } @@ -685,7 +685,7 @@ function phpAlert($msg) { { - $this->global['pageTitle'] = 'Siddharth : Edit Employee Payslip'; + $this->global['pageTitle'] = 'Resico : Edit Employee Payslip'; $data['PayInfo'] = $this->payroll_model->GetPayslipdata($PayOn,$EmpID); $this->loadViews("editPayslip", $this->global, $data , NULL); } @@ -696,7 +696,7 @@ function phpAlert($msg) { - $this->global['pageTitle'] = 'Siddharth : Payroll Generater'; + $this->global['pageTitle'] = 'Resico : Payroll Generater'; $this->loadViews("payslipgenerate", $this->global, $Data , NULL); } @@ -1108,7 +1108,7 @@ function getEmployee() function pageNotFound() { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 80f56945..e31aba40 100644 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -5,11 +5,11 @@ require APPPATH . '/libraries/BaseController.php'; require APPPATH . '/third_party/mpdf/mpdf.php'; /** - * Class : purchaseorder (PurchaseorderController) + * Class : purchaseorder (Purchase order - Controller) * User Class to control all user related operations. * @author : Venba InfoTech * @version : 1.1 - * @since : 09/06 Feb 2017 + * @since : 18 November 2017 */ class purchaseorder extends BaseController { @@ -32,20 +32,20 @@ class purchaseorder extends BaseController */ public function index() { - $this->global['pageTitle'] = 'Siddharth : AddPO'; + $this->global['pageTitle'] = 'Resico : AddPO'; $this->loadViews("addPO", $this->global, NULL , NULL); } function viewfullpurchaseorder() { - $this->global['pageTitle'] = 'Siddharth : View Purchase Order'; + $this->global['pageTitle'] = 'Resico : View Purchase Order'; $this->loadViews("viewfullpurchaseorder", $this->global,Null); } function advancerequest() { - $this->global['pageTitle'] = 'Siddharth : Advance Request'; + $this->global['pageTitle'] = 'Resico : Advance Request'; $data['PONO']=$this->purchaseorder_model->getadvancePONO('ST026'); //print_r($data['PONO']); @@ -63,7 +63,7 @@ class purchaseorder extends BaseController $data['ReqList'] = $this->purchaseorder_model->getAllRequistionListToCreatePO(); /* End Here */ - $this->global['pageTitle'] = 'Siddharth : Create PO from Requisition List'; + $this->global['pageTitle'] = 'Resico : Create PO from Requisition List'; $this->loadViews("createPOfromRequistion", $this->global, $data,Null); } @@ -85,7 +85,7 @@ class purchaseorder extends BaseController $data['POData'] = $this->purchaseorder_model->purchaseorderListing(); - $this->global['pageTitle'] = 'Siddharth : Purchase Orders'; + $this->global['pageTitle'] = 'Resico : Purchase Orders'; $this->loadViews("POlist", $this->global, $data, NULL); @@ -121,7 +121,7 @@ class purchaseorder extends BaseController else { - $this->global['pageTitle'] = 'Siddharth : Purchase order' ; + $this->global['pageTitle'] = 'Resico : Purchase order' ; $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); @@ -407,7 +407,7 @@ class purchaseorder extends BaseController //$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); - $this->global['pageTitle'] = 'Siddharth : Edit Service Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Service Purchase order form'; $this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL); } else if($ReqType == REVENUE) @@ -416,7 +416,7 @@ class purchaseorder extends BaseController $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($PONO); $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); - $this->global['pageTitle'] = 'Siddharth : Edit Revenue Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Revenue Purchase order form'; $this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL); } else if($ReqType == IMPORT) @@ -454,7 +454,7 @@ class purchaseorder extends BaseController //print_r($unicode); $data['unicode']=$unicode; $data['currencycode']=$currencycode; - $this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Import Purchase order form'; $this->loadViews("editimportpo", $this->global, $data, NULL); } else if($ReqType == CAPITAL) @@ -504,7 +504,7 @@ class purchaseorder extends BaseController } - $this->global['pageTitle'] = 'Siddharth : Edit Capital Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Capital Purchase order form'; $this->loadViews("editCapitalPo", $this->global, $data, NULL); } @@ -636,7 +636,7 @@ class purchaseorder extends BaseController //print_r($unicode); $data['unicode']=$unicode; $data['currencycode']=$currencycode; - $this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Import Purchase order form'; $this->loadViews("editimportpo", $this->global, $data, NULL); } @@ -691,7 +691,7 @@ class purchaseorder extends BaseController } - $this->global['pageTitle'] = 'Siddharth : Edit Capital Purchase order form'; + $this->global['pageTitle'] = 'Resico : Edit Capital Purchase order form'; $this->loadViews("editCapitalPo", $this->global, $data, NULL); } @@ -1203,7 +1203,7 @@ class purchaseorder extends BaseController } function pageNotFound() { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } @@ -2141,7 +2141,7 @@ function addNewImportPurchaseOrder() /* All Function following This command for FINANCE TEAM PO APPROVAL SCREEN*/ function poapproval(){ $q="APPROVAL"; - $this->global['pageTitle'] = 'Siddharth : Purchase Order Approval'; + $this->global['pageTitle'] = 'Resico : Purchase Order Approval'; // $data['Status']= $this->purchaseorder_model->getStatus(); $userID = $this->session->userdata ( 'userId' ); //print_r($data['Status']);echo "CON"; @@ -2197,7 +2197,7 @@ function addNewImportPurchaseOrder() function porelease(){ $q="RELEASE"; - $this->global['pageTitle'] = 'Siddharth : Purchase Order Release'; + $this->global['pageTitle'] = 'Resico: Purchase Order Release'; // $data['Status']= $this->purchaseorder_model->getStatus(); $userID = $this->session->userdata ( 'userId' ); //print_r($data['Status']);echo "CON"; diff --git a/application/controllers/purchaseorder.php~ b/application/controllers/purchaseorder.php~ deleted file mode 100644 index 9c65ae6b..00000000 --- a/application/controllers/purchaseorder.php~ +++ /dev/null @@ -1,2805 +0,0 @@ -load->model('purchaseorder_model'); - - $this->load->library('session'); - $this->load->library('form_validation'); - $this->load->model('requistion_model'); - $this->isLoggedIn(); - } - - /** - * This function used to load the first screen of the user - */ - public function index() - { - $this->global['pageTitle'] = 'Siddharth : AddPO'; - - $this->loadViews("addPO", $this->global, NULL , NULL); - } - function viewfullpurchaseorder() - { - $this->global['pageTitle'] = 'Siddharth : View Purchase Order'; - - $this->loadViews("viewfullpurchaseorder", $this->global,Null); - - } - function advancerequest() - { - $this->global['pageTitle'] = 'Siddharth : Advance Request'; - - $data['PONO']=$this->purchaseorder_model->getadvancePONO('ST026'); - //print_r($data['PONO']); - - $this->loadViews("advancerequest", $this->global, $data, NULL); - } - function requisition() - { - $data['DeptList'] = $this->purchaseorder_model->getDepartmentListForAllReq(); - - $data['stList'] = $this->purchaseorder_model->getStatusListforAllReq(); - /* Cost code from Requisition - Client Review Fix - Start here */ - // $data['ReqList'] = $this->purchaseorder_model->getRequistionListbySearch(); - - $data['ReqList'] = $this->purchaseorder_model->getAllRequistionListToCreatePO(); - /* End Here */ - $this->global['pageTitle'] = 'Siddharth : Create PO from Requisition List'; - - $this->loadViews("createPOfromRequistion", $this->global, $data,Null); - } - - - /** - * This function is used to load the purchaseorder list - */ - function PurchaseOrderList() - { - - $this->load->library('pagination'); - - // $count = $this->purchaseorder_model->purchaseorderListingCount(''); - - //$returns = $this->paginationCompress ( "purchaseorderListing/", $count, 10 ); - - $this->purchaseorder_model->UpdateRequistionStatus(); - - $data['POData'] = $this->purchaseorder_model->purchaseorderListing(); - - $this->global['pageTitle'] = 'Siddharth : Purchase Orders'; - - $this->loadViews("POlist", $this->global, $data, NULL); - - } - function Req_validate($selectValue) -{ - //echo 'select_validate method called'; - // 'none' is the first option and the text says something like "-Choose one-" - if(strlen($selectValue) == 0) - { - $this->form_validation->set_message('Req_validate', 'Please Select Requisition Number to Create PO.'); - return false; - } - else // user picked something - { - return true; - } -} - - /** - * This function used to show the Purchase Order Screen - */ - function CreatePurchaseOrder() - { - - $this->form_validation->set_rules('txtReqNo', 'txtReqNo', 'callback_Req_validate'); - - if($this->form_validation->run() == FALSE) - { - $this->requisition(); - - } - else - { - - $this->global['pageTitle'] = 'Siddharth : Purchase order' ; - $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); - $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); - $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); - $data['Payment']=$this->purchaseorder_model->getPaymentTermsDetails(); - // print_r($data['Payment']); - - $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); - - - - - - $SelectedReq = json_decode($this->input->post('txtReqNo')); - - $Req = $SelectedReq->Req; - $data['ReqList'] = $Req ; - $ReqArray = array(); - $ReqType = $this->input->post('txtReqType'); - $result = array(); - - foreach ($Req as $SID): - $ReqArray[] = $SID->ReqNo ; - $result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo); - if($ReqType == '') - { - $ReqType = $SID->ReqType; - } - - endforeach; - - - $data['MaterialList'] = $result; - //print_r($data['MaterialList']); - /* Cost code from Requisition - Client Review Fix - Start here */ - $ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray); - $data['RequistionDetails'] = $ReqDetails; - $CostCode = ''; - - $this->load->model('costcenter_model'); - $FYStart = ''; - $FYEnd = ''; - $FiscalYear = $this->costcenter_model->getFiscalYear(); - if(!empty($FiscalYear)) - { - foreach ($FiscalYear as $Fy) - { - $FYStart =$Fy->StartYear; - $FYEnd =$Fy->EndYear; - //$FYEnd=$FYStart+1; - } - - } - - $FYdt = $FYStart." - ".$FYEnd ; - - //echo $FYEnd; - - foreach ($ReqDetails as $Rs): - $CostCode = $Rs->CostCenterCode; - endforeach; - - $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType); - - - if(count($AvlBudget)>0) - { - $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; - } - /* End Here */ - - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - //print_r($data['CompanyDetails']); - // $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); - $data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate(); - $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); - $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); - //print_r($data['INRSYMBOL']); - - $AvlimportBudget = $this->purchaseorder_model->GetAvailableImportBudgetAmount($CostCode,$FYdt,$ReqType); - - // $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); - - - //print_r($AvlimportBudget); - - - if(count($AvlimportBudget)>0) - { - $data['AvlimportBudAmt'] = $AvlimportBudget[0]['BudgetAmount'] - $AvlimportBudget[0]['TotalValue']; - } - - //print_r($data['AvlimportBudAmt']); - - - // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; - //$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); - - $ViewName = ''; - if($ReqType == REVENUE) - { - $ViewName = 'purchaseorder'; - } - else if($ReqType == SERVICE) - { - $ViewName = 'servicePurchaseorder'; - } - else if($ReqType == IMPORT) - { - $ViewName = 'importpo'; - } - else if($ReqType == CAPITAL) - { - $CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode,$FYdt,$ReqType); - - - if(count($CapitalAvlBudget)>0) - { - - - $data['AvlCapitalBudAmt'] = $CapitalAvlBudget[0]['BudgetAmount'] - $CapitalAvlBudget[0]['Totalvalue']; - } - $ViewName = 'capitalpurchaseorder'; - } - $this->loadViews($ViewName, $this->global,$data, NULL); - } - } - function CreatePOPrint() - { - $PONO = $_GET['PONO']; - $ReqType = $_GET['ReqType']; - - 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); - - } - } - - - function CreateMRIRPOPrint() - { - $PONO = $_GET['PONO']; - $POType = $_GET['POType']; - - if($POType == SERVICE) - { - $this ->mrirservicepoprint($PONO); - - } - else if($POType == REVENUE) - { - $this ->mrirrevenuepoprint($PONO); - - } - - else if($POType == IMPORT) - { - $this ->mririmportpoprint($PONO); - - } - else if($POType == CAPITAL) - { - $this ->mrirCapitalPoPrint($PONO); - - } - } - - function CreaterevenuePOPrint() - { - $this->load->View("revenuepopdf", NULL); - } - function CreateservicePOPrint() - { - $this->load->View("servicepopdf", NULL); - } - function CreateimportPOPrint() - { - $this->load->View("importpopdf", NULL); - } - function CreatecapitalPOPrint() - { - $this->load->View("capitalpopdf", NULL); - } - //To View/Update Purchase Order - //To View/Update Purchase Order - function EditPurchaseOrder() - { - $PONO = $_GET['PONO']; - $ReqType = $_GET['ReqType']; - - $Req = $this->purchaseorder_model->getRequistionNoFromPO($PONO); - - $data['ReqList'] = $Req ; - - $result = array(); - $ReqArray = array(); - foreach ($Req as $SID): - $ReqArray[] = $SID->ReqNo ; - $result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo); - endforeach; - - $data['MaterialList'] = $result;//$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray); - $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); - - $data['Payment']=$this->purchaseorder_model->getPaymentTermsDetails(); - $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); - /* Cost code from Requisition - Client Review Fix - Start here */ - - $ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray); - - $data['RequistionDetails'] = $ReqDetails; - foreach ($data['RequistionDetails'] as $ReqDet) - { - - $Status=$ReqDet->Status; - } - - $data['POSTATUS']=$this->purchaseorder_model->GetPOStatus($Status); - - foreach ($data['POSTATUS'] as $POST) - { - $Status=$POST->StatusName; - } - - $CostCode = ''; - $this->load->model('costcenter_model'); - $FYStart = ''; - $FYEnd = ''; - $FiscalYear = $this->costcenter_model->getFiscalYear(); - if(!empty($FiscalYear)) - { - foreach ($FiscalYear as $Fy) - { - $FYStart =$Fy->StartYear; - $FYEnd =$Fy->EndYear; - } - - } - - $FYdt = $FYStart." - ".$FYEnd ; - foreach ($ReqDetails as $Rs): - $CostCode = $Rs->CostCenterCode; - endforeach; - $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType); - if(count($AvlBudget)>0) - { - $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; - } - /* End Here */ - - $data['POMaster'] = $this->purchaseorder_model->GetServicePurchaseOrder($PONO); - //$data['POSTATUS']=$this->purchaseorder_model->GetServicePurchaseOrder($PONO); - //print_r($data['POMaster']); - foreach ($data['POMaster'] as $Exc) - { - $exRate=$Exc->ExchangeRate; - } - foreach ($data['POMaster'] as $TER) - { - $PAYTERM=$TER->PaymentTerms; - } - - - $data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate(); - $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); - $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); - if($ReqType == SERVICE) - { - - $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO); - - $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); - //$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); - - $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); - $this->global['pageTitle'] = 'Siddharth : Edit Service Purchase order form'; - $this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL); - } - else if($ReqType == REVENUE) - { - - $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($PONO); - $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); - $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); - $this->global['pageTitle'] = 'Siddharth : Edit Revenue Purchase order form'; - $this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL); - } - else if($ReqType == IMPORT) - { - $AvlBudget = $this->purchaseorder_model->GetAvailableImportBudgetAmount($CostCode,$FYdt,$ReqType); - - - if(count($AvlBudget)>0) - { - $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['TotalValue']; - } - //print_r($data['AvlBudAmt']); - $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetails($PONO); - $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); - foreach($data['POMaster'] as $CUR) - { - //print_r($CUR->CurrencyType); - $Currency=$CUR->CurrencyType; - } - // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; - $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); - $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); - //print_r($data['PaymentTerms']); - $unicode =''; - foreach ($data['CurrencyDetail'] as $Detail) - { - $unicode=$Detail->FontCode2000; - } - foreach ($data['CurrencyDetail'] as $Detail) - { - $currencycode=$Detail->Currency_Code; - } - //print_r($unicode); - $data['unicode']=$unicode; - $data['currencycode']=$currencycode; - $this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form'; - $this->loadViews("editimportpo", $this->global, $data, NULL); - } - else if($ReqType == CAPITAL) - { - $CapitalRange = $_GET['CapitalRange']; - - $CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode,$FYdt,$ReqType); - - - if(count($CapitalAvlBudget)>0) - { - - - $data['AvlCapitalBudAmt'] = $CapitalAvlBudget[0]['BudgetAmount'] - $CapitalAvlBudget[0]['Totalvalue']; - } - - if($CapitalRange=='0'){ - $data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO); - } - else if($CapitalRange=='1'){ - $data['POItem'] = $this->purchaseorder_model->getDomesticCapitalPurchaseOrderDetails($PONO); - } - $data['requestedBy'] = $this->purchaseorder_model->GetRequesedByDetails($PONO); - - - //$CapitalRange=''; - foreach($data['POItem'] as $Rate) - { - $exRate=$Rate->ExchangeRate; - $CapitalRange=$Rate->CapitalRange; - } - foreach($data['POItem'] as $CUR) - { - - $Currency=$CUR->CurrencyType; - } - - if($CapitalRange=='0'){ - $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); - $data['ExchangeRate']=$exRate; - $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); - } - else if($CapitalRange=='1'){ - $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail('INR'); - $data['ExchangeRate']=$exRate; - $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); - } - - - $this->global['pageTitle'] = 'Siddharth : Edit Capital Purchase order form'; - $this->loadViews("editCapitalPo", $this->global, $data, NULL); - } - - } - - // To get the Material value based on the MaterialCode - function getDetailsforReq() - { - - - $SearchFilter= $this->input->post('id'); - // $reqDate= $this->input->post('ReqDate'); - $DeptCode = $SearchFilter[0]; - $MatType = $SearchFilter[1]; - $ReqNo = $SearchFilter[2]; - // $ReqDetai = $this->purchaseorder_model->getRequistDetails( $EmpID ); - - $CostList = $this->requistion_model->GetCostCenterByDept( $DeptCode); - - $HTML = ""; - $BudAmount = ""; - if(count($CostList) > 0) - { - for ($j = 0; $j < count($CostList); $j++) - { - $Code = $CostList[$j]['CostCenterCode']; - $Name = $CostList[$j]['CostCenterName']; - $HTML .=""; - } - } - $MaterialDetails = $this->purchaseorder_model->getRawMaterialListForPO($MatType,$ReqNo); - - $HTML1 = ""; - - if(count($MaterialDetails) > 0) - { - for ($j = 0; $j < count($MaterialDetails); $j++) - { - $Code = $MaterialDetails[$j]['MaterialCode']; - $Name = $MaterialDetails[$j]['MaterialName']; - $HTML1 .=""; - - } - - } - // print_r($HTML1); - - die(json_encode(array('MatDetail' =>$HTML1,'Cost'=> $HTML))); - } - /* This method to get the status based on the Department selection in th - */ - function getStatusByDepartment() - { - $DepId = $this->input->post('id'); - - $data = $this->purchaseorder_model->getStatusByDepartment($DepId); - - $HTML = ""; - if(count($data) > 0) - { - for ($j = 0; $j < count($data); $j++) - { - $Code = $data[$j]['StatusCode']; - $Name = $data[$j]['StatusName']; - $HTML .=""; - } - } - //echo $HTML; - die(json_encode(array('depStaus' => $HTML))); - } - - // To get the available Budget Amount - function AvilBudgetAmount() - { - $SearchFilter= $this->input->post('id'); - // $reqDate= $this->input->post('ReqDate'); - $CostCode = $SearchFilter[0]; - $ReqType = $SearchFilter[1]; - print_r($SearchFilter); - $CostCode= $this->input->post('id'); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - $Year = $dt->format('Y'); - $this->load->model('purchaseorder_model'); - $result = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); - //print_r($result); - $AvilBudAmt = ''; - if(count($result)>0) - { - $AvilBudAmt = $result[0]['BudgetAmount'] - $result[0]['Totalvalue']; - } - - print_r($AvilBudAmt); - - } - - - function getDateformat($Val) - { - $date = new DateTime($Val,new DateTimeZone('Asia/Kolkata')); - $retDate = $date->format('Y-m-d H:i:s'); - return $retDate; - } - /* Method to get the Requistion list based on the search filter*/ - - function SearchListofRequistion() - { - $SearchFilter= $this->input->post('id'); - - $DEPCode = $SearchFilter[0]; - $Status = $SearchFilter[1]; - $rng = $SearchFilter[2];; - - $FromDate =''; - $ToDate = ''; - - $Dt = explode("-",$rng); - - if(count( $Dt)>1) - { - $FDate = $Dt[0]; - $TDate = $Dt[1]; - $FromDate = $this->getDateformat($FDate); - $ToDate = $this->getDateformat($TDate); - } - - $result = $this->purchaseorder_model->getRequistionListbySearch($DEPCode,$Status,$FromDate,$ToDate); - - - $HTML=""; - for ($i = 0; $i < count($result); $i++) - { - $SNo = $i + 1; - $ReqNo = $result[$i]['ReqNo']; - $ReqType = $result[$i]['ReqType']; - $Reqedby = $result[$i]['FirstName']; - $ReqDate = $result[$i]['ReqDate']; - $Status = $result[$i]['StatusName']; - $Department = $result[$i]['DepartmentName']; - $Designation = $result[$i]['Designation']; - - $HTML.=" - - ". $ReqNo." - - ".$ReqType." - - ".$Reqedby." - ".$ReqDate." - ".$Status." - ".$Department." - ".$Designation." - "; - } - die(json_encode(array('ReqList' =>$HTML))); - } - - - /* To View the request details*/ - function ListPORequistion() - { - $ReqNo= $this->input->post('id'); - $result = $this->requistion_model->getRequistItemList($ReqNo); - $ReqList = $this->requistion_model->getRequistDetails($ReqNo); - $DepNo = $ReqList[0]['DEPCode']; - $CostList = $this->requistion_model->GetCostCenterByDept($DepNo); - $HTML=""; - for ($i = 0; $i < count($result); $i++) - { - $SNo = $i + 1; - $MaterialCode = $result[$i]['MaterialCode']; - $MaterialName = $result[$i]['MaterialName']; - $UOM = $result[$i]['UOM']; - $Quantity = $result[$i]['Quantity']; - $HTML.=" - ".$SNo." - ". $MaterialCode." - - ".$MaterialName." - - ".$UOM." - ".$Quantity." - "; - - //$index = $index + 1; - - } - - $CostCenter = ""; - if(count($CostList) > 0) - { - for ($j = 0; $j < count($CostList); $j++) - { - $Code = $CostList[$j]['CostCenterCode']; - $Name = $CostList[$j]['CostCenterName']; - $CostCenter .=""; - } - } - - die(json_encode(array('Items' =>$HTML,'Requist'=>$ReqList,'Cost'=>$CostCenter))); - } - - //This used to Create Revenue Purchase Order - - function addNewPurchaseOrder() - { - - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('DeliveryAddr'); - $dt = $this->input->post('Deliverydt'); - $POType = $this->input->post('POType'); - $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } - - - $POType = $this->input->post('POType'); - $PoRange = $this->input->post('txtPoRange'); - - $SpcialInstruction = $this->input->post('SpcialInstruction'); - $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); - $POStatus = $this->input->post('txtStatus'); - - $CreateBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $createddt = $dt->format('Y-m-d H:i:s'); - - $PaymentTerms=$this->input->post('PaymentTerms'); - $OtherPayment=$this->input->post('Otherpayment'); - $Local_Interstate=$this->input->post('Range'); - // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment); - - //print_r($POList); - //die(); - - - $POMaster = $this->purchaseorder_model->addPOMaster($POList); - - $PONO = ''; - if(count($POMaster)>0) - { - $PONO = $POMaster[0]['PONO']; - } - - // PO Line Items - $LineItemStatus = REQITEM_NEW; - - for ($i = 1; $i <= $RowCount; $i++) - { - - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - - $DiscountType = $this->input->post('DisType'.$i); - $DiscountValue = $this->input->post('DisVal'.$i); - $AfterDiscount = $this->input->post('AfterDisVal'.$i); - $PackagingOption = $this->input->post('PackOption'.$i); - $PackagingType = $this->input->post('PackType'.$i); - $PackagingValue = $this->input->post('PackVal'.$i); - $AfterPackagingValue = $this->input->post('AfterPackVal'.$i); - - $FreightType = $this->input->post('FreightType'.$i); - $FreightValue = $this->input->post('FreightVal'.$i); - $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); - $NOOfTrip = $this->input->post('NoOfTrip'.$i); - $InsuranceValue = $this->input->post('Insval'.$i); - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - $CostCenter = $this->input->post('costCode'.$i); - $Cgst = $this->input->post('RevenueCgst'.$i); - $Sgst = $this->input->post('RevenueSgst'.$i); - $Igst = $this->input->post('RevenueIgst'.$i); - $AfterCgst = $this->input->post('RevenueAfterCgst'.$i); - $AfterSgst = $this->input->post('RevenueAfterSgst'.$i); - $AfterIgst = $this->input->post('RevenueAfterIgst'.$i); - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); - - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - - $LineItemNo = ''; - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - //echo $LineItemNo; - - if(trim($POType) == REVENUE ) - { - // echo 'Success'; - $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip); - - $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); - //echo 'Revenue tax Success'; - } - } - - } - echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ; - - } - //This used to Edit the Revenue Purchase Order - function EditRevenuePurchaseOrder() - { - - $PONO =$this->input->post('txtPONO'); - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('txtDeliveryAddress'); - $dt = $this->input->post('Deliverydt'); - //$Deliverydt = $this->getDateformat($dt); - $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } - - - - - - $POType = $this->input->post('POType'); - $PoRange = $this->input->post('txtPoRange'); - - $SpcialInstruction = $this->input->post('SpcialInstruction'); - $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); - $POStatus = $this->input->post('txtStatus'); - - $updatedBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $updateddt = $dt->format('Y-m-d H:i:s'); - - $PaymentTerms=$this->input->post('PaymentTerms'); - $OtherPayment=$this->input->post('Otherpayment'); - $Local_Interstate=$this->input->post('Range'); - // PO Master - // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment); - - $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); - - $LineItemStatus = REQITEM_NEW; - - - for ($i = 1; $i <= $RowCount; $i++) - { - - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - - $DiscountType = $this->input->post('DisType'.$i); - $DiscountValue = $this->input->post('DisVal'.$i); - $AfterDiscount = $this->input->post('AfterDisVal'.$i); - $PackagingOption = $this->input->post('PackOption'.$i); - $PackagingType = $this->input->post('PackType'.$i); - $PackagingValue = $this->input->post('PackVal'.$i); - $AfterPackagingValue = $this->input->post('AfterPackVal'.$i); - $Cgst = $this->input->post('RevenueCgst'.$i); - $Sgst = $this->input->post('RevenueSgst'.$i); - $Igst = $this->input->post('RevenueIgst'.$i); - $AfterCgst = $this->input->post('RevenueAfterCgst'.$i); - $AfterSgst = $this->input->post('RevenueAfterSgst'.$i); - $AfterIgst = $this->input->post('RevenueAfterIgst'.$i); - $FreightType = $this->input->post('FreightType'.$i); - $FreightValue = $this->input->post('FreightVal'.$i); - $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); - $NOOfTrip = $this->input->post('NoOfTrip'.$i); - $InsuranceValue = $this->input->post('Insval'.$i); - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - $POLineItemNo = $this->input->post('LineItemNo'.$i); - $CostCenter = $this->input->post('costCode'.$i); - $LineItemNo = ''; - - - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - - if($SkipInsert == "False") - { - - if(strlen($POLineItemNo) == 0) - { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter); - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - - } - else - { - - $LineItemNo = $POLineItemNo; - - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter); - $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList); - - } - $isExists = $this->purchaseorder_model->LineItemExistsinRevenueTax($LineItemNo); - if(count($isExists) == 0) - { - $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip); - - $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); - - } - else - { - - $RevenueTaxList = array('DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'CreatedBy'=>$updatedBy,'NoOfTrip'=>$NOOfTrip); - - $this->purchaseorder_model->updateRevenueTax($LineItemNo,$RevenueTaxList); - - } - } - - } - - echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ; - } - function pageNotFound() - { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; - - $this->loadViews("404", $this->global, NULL, NULL); - } - - public function revenuepoprint($PONO) - { - // Load all views as normal - - - //$PONO = $_GET['PO']; - - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO); - $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); - - $Currencycode=''; - - $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; - - $totalAmt=sprintf("%.2f", $TotalOrderValue); - - $data['TotalAmountInWords']= $this->convertNumber($totalAmt); - $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); - // Add header to pdf - //$this->load->view('includes/pdfheader'); - - // Load the pdf page with multiviews - $this->load->View("revenuepopdf", $data); - - // Add header to pdf - //$this->load->view('includes/pdffooter'); - - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("RevenuePOReport.pdf",$data,$php); - -} - - - -public function mrirrevenuepoprint($PONO) - { - // Load all views as normal - - - //$PONO = $_GET['PO']; - - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO); - $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); - - $Currencycode=''; - - $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; - - $AdvanceAmount=0.00; - foreach ($data['POItem'] as $POI) - { - $AdvanceAmount=$POI->AdvanceAmount; - } - - //echo "total $TotalOrderValue"; - //echo "Advance $TotaltoPay"; - $TotaltoPay=0.00; - $TotaltoPay=$TotalOrderValue-$AdvanceAmount; - // echo "$TotaltoPay"; - - $totalAmt=sprintf("%.2f",$TotaltoPay); - - $data['TotalAmountInWords']= $this->convertNumber($totalAmt); - $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); - // Add header to pdf - //$this->load->view('includes/pdfheader'); - - // Load the pdf page with multiviews - $this->load->View("mrirrevenuepopdf", $data); - - // Add header to pdf - //$this->load->view('includes/pdffooter'); - - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("RevenuePOReport.pdf",$data,$php); - -} - public function servicepoprint($PONO) - { - - // $this->load->view('includes/pdfheader'); - - // Load the pdf page with multiviews - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetailsForPrint($PONO); - - - $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); - - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); - - //print_r( $data['CurrencySymbol']); - - $TotalOrderValue=0; - $Currencycode=''; - foreach ($data['POItem'] as $POValue) - { - - $TotalOrderValue=$TotalOrderValue + $POValue->TotalValue; - - - } - - - - $totalAmt=sprintf("%.2f", $TotalOrderValue); - - $data['TotalAmountInWords']= $this->convertNumber($totalAmt); - - $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); - - $this->load->View("servicepopdf", $data); - - // Add header to pdf - //$this->load->view('includes/pdffooter'); - - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("ServicePOReport.pdf",$data,$php); - -} - - - - -public function mrirservicepoprint($PONO) - { - - // $this->load->view('includes/pdfheader'); - - // Load the pdf page with multiviews - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetailsForPrint($PONO); - - - $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); - - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); - - //print_r( $data['CurrencySymbol']); - - $TotalOrderValue=0; - $Currencycode=''; - foreach ($data['POItem'] as $POValue) - { - - $TotalOrderValue=$TotalOrderValue + $POValue->TotalValue; - - } - - $Advance=0.00; - foreach ($data['POItem'] as $PO) - { - $Advance=$PO->AdvanceAmount; - } - - $TotaltoPay=0.00; - $TotaltoPay=$TotalOrderValue-$Advance; - //echo $TotaltoPay; - - - $totalAmt=sprintf("%.2f", $TotaltoPay); - - $data['TotalAmountInWords']= $this->convertNumber($totalAmt); - - $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); - - $this->load->View("mrirservicepopdf", $data); - - // Add header to pdf - //$this->load->view('includes/pdffooter'); - - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("ServicePOReport.pdf",$data,$php); - -} - -public function importpoprint($PONO) - { - - //$this->load->view('includes/pdfheader'); - - // Load the pdf page with multiviews - $Requester=''; - $Depcode=''; - $Currencycode=''; - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO); - $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); - //print_r( $data['releasedetails']); - foreach ($data['POItem'] as $Reqdby) - { - $Requester=$Reqdby->Requestedby; - - } - - foreach ($data['POItem'] as $CURTYPE) - { - $Currencycode=$CURTYPE->CurrencyType; - } - - $data['Requestername']=$this->purchaseorder_model->GerRequesterName($Requester); - - foreach ($data['Requestername'] as $ReqDep) - { - $Depcode=$ReqDep->Departmentcode; - } - - $data['DEPCODE']=$this->purchaseorder_model->GerRequesterDep($Depcode); - //print_r($data['Requestername']); - $data['Currencytype']=$this->purchaseorder_model->GerCurrencyCodeName($Currencycode); - $ProductPrice=''; - $TotalOrderValue = ''; - foreach ($data['POItem'] as $PO ) - { - $TotalOrderValue=$PO->TotalOrderValue; - } - - //$totalAmt=sprintf("%.2f", $ProductPrice); - //$data['TotalAmountInWords']= $this->convertNumber($totalAmt); - //print_r($data['TotalAmountInWords']); - - //$this->load->View("importpopdf", $data); - - - $CurrencyType=''; - if(!empty($data['POItem'])){ - $CurrencyType=$data['POItem'][0]->CurrencyType; - } - //echo $CurrencyType; - - if($CurrencyType=='') - { - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); - } - else - { - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType); - } - - // $TotalOrderValue=$data['POItem'][0]->$TotalOrderValue; - //print_r($data['POItem'][0]); - - $totalAmt=sprintf("%.2f", $TotalOrderValue); - - $data['TotalAmountInWords']= $this->convertNumber($totalAmt); - - - - - $SymbolCurrency = ''; - $SymbolCurrencyName =''; - $PaiseVal = ''; - if(!empty($data['CurrencySymbol']) >0) - { - $SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000; - $SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency; - $PaiseVal=$data['CurrencySymbol'][0]->PaiseVal; - } - $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; - - $totalAmt=sprintf("%.2f", $TotalOrderValue); - - $data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal); - - - $this->load->View("importpopdf", $data); - - // $this->load->View("mririmportpopdf", $data); - - - // Add header to pdf - //s $this->load->view('includes/pdffooter'); - - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - //$this->dompdf->set_paper(array(0, 0, 841.89, 1190.55), 'landscape'); - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("ImportPOReport.pdf",$data,$php); - -} - - - -public function mririmportpoprint($PONO) - { - - //$this->load->view('includes/pdfheader'); - - // Load the pdf page with multiviews - $Requester=''; - $Depcode=''; - $Currencycode=''; - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO); - $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); - //print_r( $data['POItem']); - foreach ($data['POItem'] as $Reqdby) - { - $Requester=$Reqdby->Requestedby; - - } - - foreach ($data['POItem'] as $CURTYPE) - { - $Currencycode=$CURTYPE->CurrencyType; - } - - $data['Requestername']=$this->purchaseorder_model->GerRequesterName($Requester); - - foreach ($data['Requestername'] as $ReqDep) - { - $Depcode=$ReqDep->Departmentcode; - } - - $data['DEPCODE']=$this->purchaseorder_model->GerRequesterDep($Depcode); - //print_r($data['Requestername']); - $data['Currencytype']=$this->purchaseorder_model->GerCurrencyCodeName($Currencycode); - $ProductPrice=''; - $TotalOrderValue = ''; - foreach ($data['POItem'] as $PO ) - { - $TotalOrderValue=$PO->TotalOrderValue; - } - - foreach ($data['POItem'] as $POI) - { - $AdvanceAmount=$POI->AdvanceAmount; - } - - //echo "Total $TotalOrderValue"; - //echo "Advance $AdvanceAmount"; - //$TotaltoPay=0.00; - $TotaltoPay=$TotalOrderValue-$AdvanceAmount; - //echo "Total to pay $TotaltoPay"; - //$totalAmt=sprintf("%.2f", $ProductPrice); - //$data['TotalAmountInWords']= $this->convertNumber($totalAmt); - //print_r($data['TotalAmountInWords']); - - //$this->load->View("importpopdf", $data); - - - $CurrencyType=''; - if(!empty($data['POItem'])){ - $CurrencyType=$data['POItem'][0]->CurrencyType; - } - //echo $CurrencyType; - - if($CurrencyType=='') - { - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); - } - else - { - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType); - } - - // $TotalOrderValue=$data['POItem'][0]->$TotalOrderValue; - //print_r($data['POItem'][0]); - - $totalAmt=sprintf("%.2f", $TotaltoPay); - //echo $totalAmt; - - $data['TotalAmountInWords']= $this->convertNumber($totalAmt); - - - - - $SymbolCurrency = ''; - $SymbolCurrencyName =''; - $PaiseVal = ''; - if(!empty($data['CurrencySymbol']) >0) - { - $SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000; - $SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency; - $PaiseVal=$data['CurrencySymbol'][0]->PaiseVal; - } - $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; - - $totalAmt=sprintf("%.2f", $TotaltoPay); - - $data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal); - - - // $this->load->View("importpopdf", $data); - - $this->load->View("mririmportpopdf", $data); - - - // Add header to pdf - //s $this->load->view('includes/pdffooter'); - - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - //$this->dompdf->set_paper(array(0, 0, 841.89, 1190.55), 'landscape'); - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("ImportPOReport.pdf",$data,$php); - -} - -/** - * This function used to load the Delete the Requistion Items - */ - function DeletePODetails() - { - - $ReqList= $this->input->post('id'); - $LineItemNo = ''; - $ReqNo =''; - $MaterialCode = ''; - $POType = ''; - if(count($ReqList) > 0) - { - $LineItemNo = $ReqList[0]; - $ReqNo = $ReqList[1]; - $MaterialCode = $ReqList[2]; - $POType = $ReqList[3]; - } - // print_r($ReqList); - - - If($POType == REVENUE) - { - $this->purchaseorder_model->DeletePORevenueTax($LineItemNo); - } - else If($POType == SERVICE) - { - $this->purchaseorder_model->DeletePOServiceTax($LineItemNo); - } - else If($POType == IMPORT) - { - $this->purchaseorder_model->DeletePOImportTax($LineItemNo); - } - else If($POType == CAPITAL) - { - $this->purchaseorder_model->DeletePOImportTax($LineItemNo); - $this->purchaseorder_model->DeletePOServiceTax($LineItemNo); - } - $this->purchaseorder_model->DeletePOLineItem($LineItemNo , $ReqNo,$MaterialCode); - echo "Successfully Deleted the Line item".$LineItemNo; - - } - - - -function addNewImportPurchaseOrder() - {//echo ("ggh"); - - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('DeliveryAddr'); - //$dt = $this->input->post('Deliverydt'); - //$Deliverydt = $this->getDateformat($dt); - $POType = $this->input->post('POType'); - $PoRange = $this->input->post('txtPoRange'); - //$Dispatchinstruction=$this->post('Dispatch'); - //echo $Dispatchinstruction; - //die(); - //$Schedule=$this->post('Scheduleby'); - $DeliveryOption = $this->input->post('DateRange'); - - //echo $DeliveryOption; - //die(); - $DeliverySchedule=''; - $Dispatch=''; - if($DeliveryOption==1) - { - $Dispatch=''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - - - else - { - $Dispatch = $this->input->post('Dispatch'); - $DeliverySchedule = ''; - } - - - // $PaymentDate=$this->input->post('Payment'); - // if($PaymentDate==1) - // { - // $PaymentDays='After'; - // } - // else - // { - // $PaymentDays='Before'; - // } - - //echo $PaymentDays; - //die(); - - $SpcialInstruction = $this->input->post('txtSpcialInstruction'); - $TotalOrder = $this->input->post('txtToatlOrder'); - $POStatus = $this->input->post('textStatus'); - //echo "$POStatus"; - //die(); - - $CreateBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $createddt = $dt->format('Y-m-d H:i:s'); - $Exchangerate=$this->input->post('ExchangeRate'); - $ExchangeRateCalculatedon=$this->input->post('Exchangerateon'); - $CurrencyType=$this->input->post('currencytype'); - - $PaymentTerms=$this->input->post('PaymentTerms'); - $Palaceoforigin=$this->input->post('PlaceOforigin'); - // $Payableat=$this->input->post('PayableAT'); - - - - // $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); - - - $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); - - //print_r($POList); - //die(); - $POMaster = $this->purchaseorder_model->addPOMaster($POList); - - $PONO = ''; - if(count($POMaster)>0) - { - $PONO = $POMaster[0]['PONO']; - } - //echo $PONO; - //echo $POType; - // PO Line Items - $LineItemStatus = REQITEM_NEW; - //echo ' test:'.REVENUE; - //echo $RowCount; - for ($i = 1; $i <= $RowCount; $i++) - { - //echo "AS"; - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - - //$Exchangerate = $this->input->post('Exchangerate'.$i); - $BasicPriceinmton = $this->input->post('BasicPriceinUS'.$i); - $Productprice = $this->input->post('BasicAmt'.$i); - $LandingCharge = $this->input->post('LandingChargee'.$i); - $AfterLandingCharge = $this->input->post('AfterLandingChargee'.$i); - $HighSeas = $this->input->post('Highseass'.$i); - $AfterHighSeas = $this->input->post('AfterHighseass'.$i); - - $CustomDuty = $this->input->post('Customduty'.$i); - $AfterCustomDuty = $this->input->post('AfterCustomduty'.$i); - - $ExciseDuty = $this->input->post('ExcisedutyTax'.$i); - $AfterExciseDuty = $this->input->post('AfterExcisedutyTax'.$i); - $ExciseDutyEd = $this->input->post('ExcisedutyED'.$i); - $AfterExciseDutyEd = $this->input->post('AfterExcisedutyED'.$i); - - $ExciseDutySH = $this->input->post('ExcisedutySH'.$i); - $AfterExciseDutySH = $this->input->post('AfterExcisedutySH'.$i); - - $CustomEd= $this->input->post('CustomEDcess'.$i); - $AfterCustomEd= $this->input->post('AfterCustomEDcess'.$i); - - $CustomSH = $this->input->post('CustomSHcess'.$i); - $AfterCustomSH = $this->input->post('AfterCustomSHcess'.$i); - - $AddAdtional = $this->input->post('AdditionalExciseduty'.$i); - $AfterAddAdtional = $this->input->post('AfterAdditionalExciseduty'.$i); - - $Grossdutypayable = $this->input->post('Grossdutypayable'.$i); - $AvailableModvat = $this->input->post('AvilableModvat'.$i); - $Grossexpensesduetocustomduty = $this->input->post('Grossexpenses'.$i); - $purchaseratePerKG = $this->input->post('purchaserate'.$i); - $CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpenses'.$i); - $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); - $QuantityKG = $this->input->post('PurQuantity'.$i); - - //$currencytypeID = $this->input->post('currencytype'); - $Totalvalueitem=$this->input->post('TotalExp'.$i); - - //echo $BasicPriceinmton; - $CostCenter = $this->input->post('costCode'.$i); - - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); - - //print_r($POLineItemList); - //die(); - - - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - - $LineItemNo = ''; - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - //echo $LineItemNo; - - if(trim($POType) == IMPORT ) - { - // echo 'Success'; - $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem); - //print_r($ImportTaxList); - //die(); - - - $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList); - - } - } - - } - echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ; - } - - - function EditImportPurchaseOrder() - { - - //echo "dfds"; - //die(); - $PONO =$this->input->post('txtPONO'); - $POdt = ''; - $createddt=''; - - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('DeliveryAddr'); - $dt = $this->input->post('Deliverydt'); - $Deliverydt = $this->getDateformat($dt); - $POType = $this->input->post('POType'); - //$PoRange = $this->input->post('txtPoRange'); - //$DeliveryOption = $this->input->post('DateRange'); - - $Exchangerate=$this->input->post('ExchangeRate'); - $ExchangeRateCalculatedon=$this->input->post('Exchangerateon'); - $CurrencyType=$this->input->post('currencytype'); - - $DeliveryOption = $this->input->post('DateRange'); - - //echo $DeliveryOption; - //die(); - $DeliverySchedule=''; - $Dispatch=''; - if($DeliveryOption==1) - { - $Dispatch=''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - - - else - { - $Dispatch = $this->input->post('Dispatch'); - $DeliverySchedule = ''; - } - - - // if($DeliveryOption==1){ - // $Deliverydt = ''; - // $DeliverySchedule = $this->input->post('Scheduleby'); - // } - // else{ - // $Deliverydt = $this->getDateformat($dt); - // $DeliverySchedule = ''; - // } - // $PaymentDate=$this->input->post('Payment'); - // if($PaymentDate==1) - // { - // $PaymentDays='After'; - // } - // else - // { - // $PaymentDays='Before'; - // } - - $SpcialInstruction = $this->input->post('txtSpcialInstruction'); - //$TotalOrder = $this->input->post('txtToatlOrder'); - $TotalOrder = $this->input->post('txttot'); - // echo $TotalOrder; - //die(); - $POStatus = $this->input->post('txtStatus'); - - $CreateBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $updateddt = $dt->format('Y-m-d H:i:s'); - - $PaymentTerms=$this->input->post('PaymentTerms'); - - $Palaceoforigin=$this->input->post('PlaceOforigin'); - // $Payableat=$this->input->post('PayableAT'); - // PO Master - // PO Master - // $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms); - - - - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'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); - //echo $PONO; - //echo $TotalOrder; - //print_r($POList); - //die(); - - $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); - //echo "sdasds"; - $LineItemStatus = REQITEM_NEW; - //echo $LineItemStatus; - - - - //echo $RowCount; - for ($i = 1; $i <= $RowCount; $i++) - { - - $MaterialCode = $this->input->post('materialCode'.$i); - - $Quantity = $this->input->post('quantity'.$i); - //echo $Quantity; - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - ; - //die(); - - //$Exchangerate = $this->input->post('Exchangerate'.$i); - $BasicPriceinmton = $this->input->post('BasicPriceInMTon'.$i); - $Productprice = $this->input->post('TotalValue'.$i); - //echo $ProductPrice; - //die(); - $LandingCharge = $this->input->post('LandingCharge'.$i); - $AfterLandingCharge = $this->input->post('AfterLandingCharge'.$i); - $HighSeas = $this->input->post('HighSeasSalesCharge'.$i); - $AfterHighSeas = $this->input->post('AfterHighSeasSalesCharge'.$i); - - $CustomDuty = $this->input->post('CustomDuty'.$i); - $AfterCustomDuty = $this->input->post('AfterCustomDuty'.$i); - - $ExciseDuty = $this->input->post('ExciseDuty'.$i); - $AfterExciseDuty = $this->input->post('AfterExciseDuty'.$i); - $ExciseDutyEd = $this->input->post('ExciseDutyEdCess'.$i); - $AfterExciseDutyEd = $this->input->post('AfterExciseDutyEdCess'.$i); - - $ExciseDutySH = $this->input->post('ExciseDutySHCess'.$i); - $AfterExciseDutySH = $this->input->post('AfterExciseDutySHCess'.$i); - - $CustomEd= $this->input->post('CustomEdCess'.$i); - $AfterCustomEd= $this->input->post('AfterCustomEdCess'.$i); - - $CustomSH = $this->input->post('CustomSHCess'.$i); - $AfterCustomSH = $this->input->post('AfterCustomSHCess'.$i); - - $AddAdtional = $this->input->post('AddlExciseDuty'.$i); - $AfterAddAdtional = $this->input->post('AfterAddlExciseDuty'.$i); - - $Grossdutypayable = $this->input->post('Grossdutypayable'.$i); - //echo $Grossdutypayable; - //die(); - - $AvailableModvat = $this->input->post('AvailableModvat'.$i); - - $Grossexpensesduetocustomduty = $this->input->post('Grossexpensesduetocustomduty'.$i); - - - $purchaseratePerKG = $this->input->post('purchaseratePerKG'.$i); - - $CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpensesPerKG'.$i); - - $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomersPerKG'.$i); - - $QuantityKG = $this->input->post('QuantityKG'.$i); - - $POLineItemNo = $this->input->post('LineItemNo'.$i); - - $CostCenter = $this->input->post('costCode'.$i); - - //$ExciseDutySH = $this->input->post('ExcisedutySH'.$i); - $Totalvalueitem=$this->input->post('TotalValue'.$i); - // echo $Totalvalueitem; - //die(); - $LineItemNo = ''; - //echo "sdsfsd"; - //die(); - - $currencytypeID = $this->input->post('currencytype'); - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - if(strlen($POLineItemNo) == 0) - { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); - $POLineItem=$this->purchaseorder_model->addPOLineItem($POLineItemList); - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - - } - else - { - - - - $LineItemNo = $POLineItemNo; - //echo $LineItemNo; - //die(); - - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter); - $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList); - - } - $isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo); - //echo $isExists; - - //die(); - if(count($isExists) == 0) - { - print_r(count($isExists)); - //echo $isExists; - //die(); - $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'UpdatedOn'=>$updateddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem); - - - //print_r($ImportTaxList); - //die(); - $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList); - - } - else - { - //echo "xxcx"; - //die(); - $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'UpdatedOn'=>$updateddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem); - //echo "cxvc "; - //die(); - //print_r($ImportTaxList); - //die(); - $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList); - - - } - } - - } - - - echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ; - } - - - - /* All Function following This command for FINANCE TEAM PO APPROVAL SCREEN*/ - function poapproval(){ - $q="A"; - $this->global['pageTitle'] = 'Siddharth : Purchase Order Approval'; - // $data['Status']= $this->purchaseorder_model->getStatus(); - $userID = $this->session->userdata ( 'userId' ); - //print_r($data['Status']);echo "CON"; - $data['AppList'] = $this->purchaseorder_model->getPOList($q); - $this->loadViews("poapproval_view", $this->global,$data, NULL); - - } - - function getDateformat2($Val) - { - $date = new DateTime($Val); - $retDate = $date->format('Y-m-d H:i:s'); - return $retDate; - } - - - function ApprovePO() - { - $StatusCode= Trim($_POST['SCode']); - - $PONO= Trim($_POST['PONO']); - $Remarks= Trim($_POST['NewRemarks']); - - $ApprovedBy = $this->session->userdata ( 'userId' ); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $ApprovedDate = $dt->format('Y-m-d H:i:s'); - - if($StatusCode == 'ST025') - { - - $store = array('Status'=>$StatusCode,'ApprovedOn'=>$ApprovedDate,'Approvedby'=>$ApprovedBy,'Remarks'=>$Remarks); - $this->purchaseorder_model->UpdatePO($store,$PONO); - echo "Successfully Approve the Purchase Order No: ".$PONO; - } - else{ - $store = array('Status'=>$StatusCode,'OnHoldOn'=>$ApprovedDate,'OnHoldBy'=>$ApprovedBy,'Remarks'=>$Remarks); - $this->purchaseorder_model->UpdatePO($store,$PONO); - echo "The Purchase Order No: ".$PONO ."is On Hold"; - - } - - - - - } - - - - - /* FOLLOWING CODES FOR PO RELEASE SCREEN FUNCTIONALITIES*/ - - - function porelease(){ - - $q="R"; - $this->global['pageTitle'] = 'Siddharth : Purchase Order Release'; - // $data['Status']= $this->purchaseorder_model->getStatus(); - $userID = $this->session->userdata ( 'userId' ); - //print_r($data['Status']);echo "CON"; - $data['AppList'] = $this->purchaseorder_model->getPOList($q); - $this->loadViews("porelease_view", $this->global,$data, NULL); - - } - - - function ReleasePO() - { - $StatusCode= Trim($_POST['SCode']); - - $PONO= Trim($_POST['PONO']); - $Remarks= Trim($_POST['NewRemarks']); - - $ReleasedBy = $this->session->userdata ( 'userId' ); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $ReleasedDate = $dt->format('Y-m-d H:i:s'); - - if($StatusCode == 'ST026') - { - - $store = array('Status'=>$StatusCode,'ReleasedOn'=>$ReleasedDate,'ReleasedBy'=>$ReleasedBy,'Remarks'=>$Remarks); - $this->purchaseorder_model->UpdatePO($store,$PONO); - echo "Successfully Released the Purchase Order No: ".$PONO; - } - else{ - $store = array('Status'=>$StatusCode,'OnHoldOn'=>$ReleasedDate,'OnHoldBy'=>$ReleasedBy,'Remarks'=>$Remarks); - $this->purchaseorder_model->UpdatePO($store,$PONO); - echo "The Purchase Order No: ".$PONO ."is On Hold"; - - } -} -/* Add capital Po*/ - function addNewCapitalPurchaseOrder() - { - - - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('DeliveryAddr'); - $dt = $this->input->post('Deliverydt'); - - $POType = $this->input->post('POType'); - $PoRange = $this->input->post('txtPoRange'); - - /* $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } */ - - $DeliveryOption = $this->input->post('DateRange'); - - - $DeliverySchedule=''; - $Dispatch=''; - $Deliverydt=''; - if($DeliveryOption==1) - { - $Dispatch=''; - $Deliverydt=''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else if($DeliveryOption==2) - { - $Deliverydt=''; - $DeliverySchedule = ''; - $Dispatch = $this->input->post('Dispatch'); - } - - else - { - $Dispatch = ''; - $DeliverySchedule = ''; - $Deliverydt = $this->getDateformat($dt); - } - $capitalType = $this->input->post('capitalType'); - if($capitalType=='Domestic'){ - $CapitalRange = '1'; - $ExchangeRateOn = ''; - $ExchangeRate=''; - $Palaceoforigin=''; - } - else{ - - $CapitalRange = '0'; - $ExchangeRateOn = $this->input->post('ExchangeRateOn'); - $ExchangeRate=$this->input->post('ExchangeRt'); - $Palaceoforigin=$this->input->post('PlaceOforigin'); - } - - $PaymentMethod = $this->input->post('PaymentMethod'); - $OtherPayment=$this->input->post('Otherpayment'); - - - - - $SpcialInstruction = $this->input->post('txtSpcialInstruction'); - $TotalOrder = $this->input->post('CapitalToatlOrder'); - $POStatus = $this->input->post('txtStatus'); - - - $CreateBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $createddt = $dt->format('Y-m-d H:i:s'); - $currencytypeID = $this->input->post('currencytype'); - - $POList = array('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); - - // $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); - - - $POMaster = $this->purchaseorder_model->addPOMaster($POList); - - $PONO = ''; - if(count($POMaster)>0) - { - $PONO = $POMaster[0]['PONO']; - } - - $LineItemStatus = REQITEM_NEW; - - for ($i = 1; $i <= $RowCount; $i++) - { - - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - //echo $itemRate; - //die(); - - - $BasicPriceinmton = $this->input->post('rateInUs'.$i); - $Productprice = $this->input->post('basicvalInINR'.$i); - $LandingCharge = $this->input->post('beforeLanding'.$i); - $AfterLandingCharge = $this->input->post('landingCharge'.$i); - $HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i); - $AfterHighSeas = $this->input->post('HighSeasSalesCharge'.$i); - - $CustomDuty = $this->input->post('beforeCustomDuty'.$i); - $AfterCustomDuty = $this->input->post('CustomDuty'.$i); - - $ExciseDuty = $this->input->post('beforeExciseDuty'.$i); - $AfterExciseDuty = $this->input->post('ExciseDuty'.$i); - $ExciseDutyEd = $this->input->post('beforeExciseDutyEDCess'.$i); - $AfterExciseDutyEd = $this->input->post('ExciseDutyEDCess'.$i); - - $ExciseDutySH = $this->input->post('beforeExciseDutySHCess'.$i); - $AfterExciseDutySH = $this->input->post('ExciseDutySHCess'.$i); - - $CustomEd= $this->input->post('beforeCustomEDCess'.$i); - $AfterCustomEd= $this->input->post('CustomEDCess'.$i); - - $CustomSH = $this->input->post('beforeCustomSHCess'.$i); - $AfterCustomSH = $this->input->post('CustomSHCess'.$i); - - $AddAdtional = $this->input->post('beforeAdditionalExciseDuty'.$i); - $AfterAddAdtional = $this->input->post('AdditionalExciseDuty'.$i); - - $Grossdutypayable = $this->input->post('GrossDutyPayable'.$i); - $AvailableModvat = $this->input->post('AvailableModvat'.$i); - $Grossexpensesduetocustomduty = $this->input->post('GrossExpensesDuetoCustom'.$i); - $purchaseratePerKG = $this->input->post('purchaseRate'.$i); - $CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpenses'.$i); - $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); - $QuantityKG = $this->input->post('PurQuantity'.$i); - - - $Totalvalueitem=$this->input->post('PerKgExpense'.$i); - - //echo $BasicPriceinmton; - $CostCenter = $this->input->post('CPCostCode'.$i); - - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - $Cgst = $this->input->post('Cgst'.$i); - $Sgst = $this->input->post('Sgst'.$i); - $Igst = $this->input->post('Igst'.$i); - $AfterCgst = $this->input->post('AfterCgst'.$i); - $AfterSgst = $this->input->post('AfterSgst'.$i); - $AfterIgst = $this->input->post('AfterIgst'.$i); - - $OtherAmt = $this->input->post('OtherAmt'.$i); - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); - - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - - $LineItemNo = ''; - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - //echo $LineItemNo; - - if(trim($POType) == CAPITAL ) - { - if($CapitalRange=='1') - { - $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'otherallowance'=>$OtherAmt,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); - - $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); - - } - if($CapitalRange=='0') - { - //echo "dsc"; - //die(); - $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem); - - //print_r( $ImportTaxList); - //die(); - - - $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList); - } - - - } - } - - } - echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ; - } - - -/*Edit Capital po*/ - function EditCapitalPurchaseOrder() - { - - - $PONO =$this->input->post('txtPONO'); - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('DeliveryAddr'); - $dt = $this->input->post('Deliverydt'); - - $POType = $this->input->post('POType'); - $PoRange = $this->input->post('txtPoRange'); - - /* $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - //$Deliverydt = $this->getDateformat($dt); - $Deliverydt = ''; - $DeliverySchedule = ''; - } */ - - - $DeliveryOption = $this->input->post('DateRange'); - - $DeliverySchedule=''; - $Dispatch=''; - $Deliverydt=''; - if($DeliveryOption==1) - { - $Dispatch=''; - $Deliverydt=''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else if($DeliveryOption==2) - { - $Deliverydt=''; - $DeliverySchedule = ''; - $Dispatch = $this->input->post('Dispatch'); - } - - else - { - $Dispatch = ''; - $DeliverySchedule = ''; - $Deliverydt = $this->getDateformat($dt); - } - - - - $capitalType = $this->input->post('capitalType'); - $currencytypeID = $this->input->post('currencytype'); - if($capitalType=='1'){ - $CapitalRange = '1'; - $ExchangeRateOn = ''; - $ExchangeRate=''; - - } - else{ - - $CapitalRange = '0'; - $ExchangeRateOn = $this->input->post('ExchangeRateOn'); - $ExchangeRate=$this->input->post('ExchangeRt'); - } - $PaymentMethod = $this->input->post('PaymentMethod'); - $OtherPayment=$this->input->post('Otherpayment'); - - - - $SpcialInstruction = $this->input->post('txtSpcialInstruction'); - $TotalOrder = $this->input->post('CapitalToatlOrder'); - $POStatus = $this->input->post('txtStatus'); - $Palaceoforigin=$this->input->post('PlaceOforigin'); - - - $CreateBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $createddt = $dt->format('Y-m-d H:i:s'); - $updateddt = $dt->format('Y-m-d H:i:s'); - - - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment); - - - $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); - - $LineItemStatus = REQITEM_NEW; - - - - - for ($i = 1; $i <= $RowCount; $i++) - { - - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - - $Exchangerate = $this->input->post('echangeRate'.$i); - $BasicPriceinmton = $this->input->post('rateInUs'.$i); - $Productprice = $this->input->post('basicvalInINR'.$i); - $LandingCharge = $this->input->post('beforeLanding'.$i); - $AfterLandingCharge = $this->input->post('landingCharge'.$i); - $HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i); - $AfterHighSeas = $this->input->post('HighSeasSalesCharge'.$i); - - $CustomDuty = $this->input->post('beforeCustomDuty'.$i); - $AfterCustomDuty = $this->input->post('CustomDuty'.$i); - - $ExciseDuty = $this->input->post('beforeExciseDuty'.$i); - $AfterExciseDuty = $this->input->post('ExciseDuty'.$i); - $ExciseDutyEd = $this->input->post('beforeExciseDutyEDCess'.$i); - $AfterExciseDutyEd = $this->input->post('ExciseDutyEDCess'.$i); - - $ExciseDutySH = $this->input->post('beforeExciseDutySHCess'.$i); - $AfterExciseDutySH = $this->input->post('ExciseDutySHCess'.$i); - - $CustomEd= $this->input->post('beforeCustomEDCess'.$i); - $AfterCustomEd= $this->input->post('CustomEDCess'.$i); - - $CustomSH = $this->input->post('beforeCustomSHCess'.$i); - $AfterCustomSH = $this->input->post('CustomSHCess'.$i); - - $AddAdtional = $this->input->post('beforeAdditionalExciseDuty'.$i); - $AfterAddAdtional = $this->input->post('AdditionalExciseDuty'.$i); - - $Grossdutypayable = $this->input->post('GrossDutyPayable'.$i); - $AvailableModvat = $this->input->post('AvailableModvat'.$i); - $Grossexpensesduetocustomduty = $this->input->post('GrossExpensesDuetoCustom'.$i); - $purchaseratePerKG = $this->input->post('purchaseRate'.$i); - $CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpenses'.$i); - $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); - $QuantityKG = $this->input->post('PurQuantity'.$i); - - - $Totalvalueitem=$this->input->post('PerKgExpense'.$i); - - //echo $BasicPriceinmton; - $CostCenter = $this->input->post('CPCostCode'.$i); - - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - $POLineItemNo = $this->input->post('LineItemNo'.$i); - $Cgst = $this->input->post('Cgst'.$i); - $Sgst = $this->input->post('Sgst'.$i); - $Igst = $this->input->post('Igst'.$i); - $AfterCgst = $this->input->post('AfterCgst'.$i); - $AfterSgst = $this->input->post('AfterSgst'.$i); - $AfterIgst = $this->input->post('AfterIgst'.$i); - - $OtherAmt = $this->input->post('OtherAmt'.$i); - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - if(strlen($POLineItemNo) == 0) - { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); - - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - - $LineItemNo = ''; - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - - - if(trim($POType) == CAPITAL ) - { - if($capitalType=='1') - { - $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'otherallowance'=>$OtherAmt,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); - - $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); - } - if($capitalType=='0') - { - $ImportTaxList = array('LineItemNo'=>$LineItemNo, 'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem); - $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList); - } - - - - } - - } - else - { - $LineItemNo = $POLineItemNo; - - - - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); - $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$LineItemNo,$POLineItemList); - if($capitalType=='1') - { - $ServiceTaxList = array('CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'otherallowance'=>$OtherAmt,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$CreateBy,'UpdatedOn'=>$createddt); - - $ServiceTax = $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList); - } - if($capitalType=='0') - { - $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem); - - - $ImportList= $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList); - } - } - - } - - } - - echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ; - } - - /* capital po print/pdf*/ - - public function CapitalPoPrint($PONO) - { - - - // Load the pdf page with multiviews - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - - $data['POItem'] = $this->purchaseorder_model->GetCapitalPurchaseOrderDetailsForPDF($PONO); - - $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); - - $CurrencyType=''; - if(!empty($data['POItem'])){ - $CurrencyType=$data['POItem'][0]->CurrencyType; - } - - - if($CurrencyType=='' OR $CurrencyType=='0'){ - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); - - $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; - - $totalAmt=sprintf("%.2f", $TotalOrderValue); - - $data['TotalAmountInWords']= $this->convertNumber($totalAmt); - } - - - else{ - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType); - $SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000; - $SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency; - $PaiseVal=$data['CurrencySymbol'][0]->PaiseVal; - - $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; - - $totalAmt=sprintf("%.2f", $TotalOrderValue); - - $data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal); - } - - - - - - - $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); - - - - $this->load->View("capitalpopdf", $data); - - // Add header to pdf - //$this->load->view('includes/pdffooter'); - - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("CapitalPOReport.pdf",$data,$php); - -} - - - - - public function mrirCapitalPoPrint($PONO) - { - - - // Load the pdf page with multiviews - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - - $data['POItem'] = $this->purchaseorder_model->GetCapitalPurchaseOrderDetailsForPDF($PONO); - - $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); - - $CurrencyType=''; - if(!empty($data['POItem'])){ - $CurrencyType=$data['POItem'][0]->CurrencyType; - } - - - if($CurrencyType=='' OR $CurrencyType=='0'){ - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); - - $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; - - $totalAmt=sprintf("%.2f", $TotalOrderValue); - - $data['TotalAmountInWords']= $this->convertNumber($totalAmt); - } - - - else{ - $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType); - $SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000; - $SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency; - $PaiseVal=$data['CurrencySymbol'][0]->PaiseVal; - - $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; - - $totalAmt=sprintf("%.2f", $TotalOrderValue); - - $data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal); - } - - - - - - - $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); - - - - $this->load->View("mrircapitalpopdf", $data); - - // Add header to pdf - //$this->load->view('includes/pdffooter'); - - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("CapitalPOReport.pdf",$data,$php); - -} - - - - - /*This function is used to convert amount(digit) into words*/ - - public function convertNumber($amt){ -$ShowPaise='0'; -$totalAmt=explode(".",$amt); - -$number = $totalAmt[0]; - $no = $number; - -if(!empty($totalAmt[1]) && $totalAmt[1]!=0){ -$point = $totalAmt[1]; - $ShowPaise='1'; -} - else{ -$point=0; - $ShowPaise='0'; -} - - - $hundred = null; - $digits_1 = strlen($no); - - $i = 0; - $str = array(); - $words = array('0' => '', '1' => 'one', '2' => 'two', - '3' => 'three', '4' => 'four', '5' => 'five', '6' => 'six', - '7' => 'seven', '8' => 'eight', '9' => 'nine', - '10' => 'ten', '11' => 'eleven', '12' => 'twelve', - '13' => 'thirteen', '14' => 'fourteen', - '15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen', - '18' => 'eighteen', '19' =>'nineteen', '20' => 'twenty', - '30' => 'thirty', '40' => 'forty', '50' => 'fifty', - '60' => 'sixty', '70' => 'seventy', - '80' => 'eighty', '90' => 'ninety'); - $digits = array('', 'hundred', 'thousand', 'lakh', 'crore'); - while ($i < $digits_1) { - $divider = ($i == 2) ? 10 : 100; - $number = floor($no % $divider); - $no = floor($no / $divider); - $i += ($divider == 10) ? 1 : 2; - if ($number) { - $plural = (($counter = count($str)) && $number > 9) ? 's' : null; - $hundred = ($counter == 1 && $str[0]) ? ' and ' : null; - $str [] = ($number < 21) ? $words[$number] . - " " . $digits[$counter] . $plural . " " . $hundred - : - $words[floor($number / 10) * 10] - . " " . $words[$number % 10] . " " - . $digits[$counter] . $plural . " " . $hundred; - } else $str[] = null; - } - $str = array_reverse($str); - $result = implode('', $str); - - $points = ($point) ? - " " . $words[$point / 10] . " " . - $words[$point = $point % 10] : ''; - -if($ShowPaise=='0'){ - -$amountInWords = "Rupee " . $result." Only"; -} -else{ - -$amountInWords = "Rupee " . $result ." Paise ". $points." Only"; -} - - - return $amountInWords; - } -public function convertNumberSymbol($amt,$symbol,$name,$paise){ -$ShowPaise='0'; -$totalAmt=explode(".",$amt); - -$number = $totalAmt[0]; - $no = $number; -if(!empty($totalAmt[1]) && $totalAmt[1]!=0){ -$point = $totalAmt[1]; - $ShowPaise='1'; -} - else{ -$point=0; - $ShowPaise='0'; -} - - $hundred = null; - $digits_1 = strlen($no); - - $i = 0; - $str = array(); - $words = array('0' => '', '1' => 'one', '2' => 'two', - '3' => 'three', '4' => 'four', '5' => 'five', '6' => 'six', - '7' => 'seven', '8' => 'eight', '9' => 'nine', - '10' => 'ten', '11' => 'eleven', '12' => 'twelve', - '13' => 'thirteen', '14' => 'fourteen', - '15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen', - '18' => 'eighteen', '19' =>'nineteen', '20' => 'twenty', - '30' => 'thirty', '40' => 'forty', '50' => 'fifty', - '60' => 'sixty', '70' => 'seventy', - '80' => 'eighty', '90' => 'ninety'); - $digits = array('', 'hundred', 'thousand', 'lakh', 'crore'); - while ($i < $digits_1) { - $divider = ($i == 2) ? 10 : 100; - $number = floor($no % $divider); - $no = floor($no / $divider); - $i += ($divider == 10) ? 1 : 2; - if ($number) { - $plural = (($counter = count($str)) && $number > 9) ? 's' : null; - $hundred = ($counter == 1 && $str[0]) ? ' and ' : null; - $str [] = ($number < 21) ? $words[$number] . - " " . $digits[$counter] . $plural . " " . $hundred - : - $words[floor($number / 10) * 10] - . " " . $words[$number % 10] . " " - . $digits[$counter] . $plural . " " . $hundred; - } else $str[] = null; - } - $str = array_reverse($str); - $result = implode('', $str); - - $points = ($point) ? - " " . $words[$point / 10] . " " . - $words[$point = $point % 10] : ''; - -if($ShowPaise=='0'){ -$amountInWords = $name." " . $result." Only"; -} -else{ -$amountInWords = $name." " . $result.$paise ." ". $points." Only"; -} - - - return $amountInWords; - } - - - -function addadvancerequest() -{ - - $PONO =$this->input->post('PONO'); - $AdvancePercentage=$this->input->post('AdvanceIn'); - $AdvanceAmount=$this->input->post('AdvanceAmount'); - $Remarks=$this->input->post('Remarks'); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $createddt = $dt->format('Y-m-d H:i:s'); - $CreateBy = $this->session->userdata ( 'userId' ); - - - $advance=array('PONO'=>$PONO,'AdvancePercentage'=>$AdvancePercentage,'AdvanceAmount'=>$AdvanceAmount,'Remarks'=>$Remarks,'CreatedBy'=>$CreateBy ,'CreatedDt'=>$createddt); - $this->purchaseorder_model->addadvanceRequest($advance); - - -if($advance > 0) - { - // $this->session->set_flashdata('success', 'New Asset created successfully'); - echo ""; - redirect('purchaseorder/advancerequest','refresh'); - - } - -} - - - -} - -?> diff --git a/application/controllers/rawmaterialdetails.php b/application/controllers/rawmaterialdetails.php index d4cc43d0..c28fc220 100644 --- a/application/controllers/rawmaterialdetails.php +++ b/application/controllers/rawmaterialdetails.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : RawMaterial (PurchaseorderController) + * Class : rawmaterialdetails (Raw Material Detail - Controller) * User Class to control all user related operations. - * @author : Gandhimathi + * @author : Venba Info Tech - Gandhimathi * @version : 1.1 - * @since : 12 Apr 2017 + * @since : 18 November 2017 */ class rawmaterialdetails extends BaseController { @@ -232,7 +232,7 @@ class rawmaterialdetails extends BaseController $data['cfUOM'] = $this->rawmaterialdetails_model->getConversionfactorUOM(); $data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode(); $this->global['pageTitle'] = 'Resico : Edit Material Master'; - $this->loadViews("editOldRawmaterial", $this->global,$data, NULL); + $this->loadViews("editRawmaterial", $this->global,$data, NULL); } diff --git a/application/controllers/report.php b/application/controllers/report.php index e1395829..c9fdd07d 100644 --- a/application/controllers/report.php +++ b/application/controllers/report.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Inward Gate Register Controller (security) + * Class :report (Report Details - Controller) * User Class to control all user related operations. - * @author : Saravana kumar + * @author : Venba Info Tech - Saravana kumar * @version : 1.1 - * @since : 10 Jun 2017 + * @since : 18 November 2017 */ class report extends BaseController { diff --git a/application/controllers/requisitionform.php b/application/controllers/requisitionform.php index 501d9949..46d0c929 100644 --- a/application/controllers/requisitionform.php +++ b/application/controllers/requisitionform.php @@ -5,9 +5,9 @@ require APPPATH . '/libraries/BaseController.php'; /** * Class : requisitionform (requisitionformController) * User Class to control all user related operations. - * @author : VenbaMail Mali + * @author : Venba Info Tech - * @version : 1.1 - * @since : 15 Feb 2016 + * @since : 18 November 2017 */ class requisitionform extends BaseController { @@ -29,7 +29,7 @@ class requisitionform extends BaseController */ function requisitionlisting() { - $this->global['pageTitle'] = 'Siddharth : Requisition Listing'; + $this->global['pageTitle'] = 'Resico : Requisition Listing'; $userID = $this->session->userdata ( 'userId' ); @@ -47,7 +47,7 @@ class requisitionform extends BaseController function requisition() { - $this->global['pageTitle'] = 'Siddharth : Raise Requisition'; + $this->global['pageTitle'] = 'Resico : Raise Requisition'; $data['RequestType'] = $this->requistion_model->getConfigValue('C020'); @@ -67,7 +67,7 @@ class requisitionform extends BaseController */ function requisitionlistApproval() { - $this->global['pageTitle'] = 'Siddharth : Requisition Approval'; + $this->global['pageTitle'] = 'Resico : Requisition Approval'; $data['Status']= $this->requistion_model->getStatus(); @@ -86,7 +86,7 @@ class requisitionform extends BaseController */ function EditRequistionForm() { - $this->global['pageTitle'] = 'Siddharth : Edit Requisition'; + $this->global['pageTitle'] = 'Resico : Edit Requisition'; $ReqNo= $_GET['ReqNo']; $ReqType= $_GET['ReqType']; @@ -190,7 +190,7 @@ class requisitionform extends BaseController $data['AppList'] = $this->requistion_model->getApproverRequistList($userID,$Status,$FromDate, $ToDate); - $this->global['pageTitle'] = 'Siddharth : Requisition Approval'; + $this->global['pageTitle'] = 'Resico : Requisition Approval'; $data['Status']= $this->requistion_model->getStatus(); @@ -661,7 +661,7 @@ class requisitionform extends BaseController function pageNotFound() { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/requisitionform.php~ b/application/controllers/requisitionform.php~ deleted file mode 100644 index a45f0e60..00000000 --- a/application/controllers/requisitionform.php~ +++ /dev/null @@ -1,542 +0,0 @@ -load->model('requistion_model'); - - $this->load->library('session'); - $this->load->library('form_validation'); - - $this->isLoggedIn(); - } - /** - * This function used to load the first screen of the Requistion - */ - function requisitionlisting() - { - $this->global['pageTitle'] = 'Siddharth : Requisition Listing'; - - $userID = $this->session->userdata ( 'userId' ); - - // $data['ReqList'] = $this->requistion_model->getRequistListUserID($userID); - $data['Status'] = $this->requistion_model->CheckDraftStatus($userID); - - $data['TotNoOfLine'] =$this->requistion_model->getRequistionList($userID); - - - $this->loadViews("requisitionlisting", $this->global, $data, NULL); - } - /** - * This function used to load the first screen of the requisition Form - */ - - function requisition() - { - $this->global['pageTitle'] = 'Siddharth : Raise Requisition'; - - $data['RequestType'] = $this->requistion_model->getConfigValue('C020'); - - $data['EmpList'] = $this->requistion_model->getAllEmployees(); - $data['ServiceOption'] = $this->requistion_model->getConfigValue('C022'); - $userID = $this->session->userdata ( 'userId' ); - - $data['Emp'] = $this->requistion_model->getEmpIdByUserID($userID); - - $data['CostCenter'] = $this->requistion_model->getCostCenterUserID($userID); - - $this->loadViews("requisitionform", $this->global, $data,null); - } - - /** - * This function used to load the first screen of the Requistion List Approval Screen - */ - function requisitionlistApproval() - { - $this->global['pageTitle'] = 'Siddharth : Requisition Approval'; - - $data['Status']= $this->requistion_model->getStatus(); - - $userID = $this->session->userdata ( 'userId' ); - - $data['AppList'] = $this->requistion_model->getApproverRequistList($userID); - - - - $this->loadViews("requisitionlistapproval", $this->global, $data, NULL); - } - - - /** - * This function used to load the Edit Requistion Form - */ - function EditRequistionForm() - { - $this->global['pageTitle'] = 'Siddharth : Edit Requisition'; - - $ReqNo= $_GET['ReqNo']; - $ReqType= $_GET['ReqType']; - - $userID = $this->session->userdata ( 'userId' ); - - $data['ReqDetails'] = $this->requistion_model->getRequistDetails($ReqNo,'Yes'); - - - $data['LineItem'] = $this->requistion_model->getEditRequistItemList($ReqNo); - $data['CostCenter'] = $this->requistion_model->getCostCenterUserID($userID); - $data['MaterialCode'] = $this->requistion_model->EditMaterialCode($ReqNo, $ReqType); - $data['ServiceOption'] = $this->requistion_model->getConfigValue('C022'); - $this->loadViews("editrequisitionform", $this->global, $data, NULL); - } - - /** - * This function used to load the Delete the Requistion Items - */ - function DeleteRequistionForm() - { - - $ReqList= $this->input->post('id'); - $ReqNo =''; - $MaterialCode = ''; - if(count($ReqList) > 0) - { - $ReqNo = $ReqList[0]; - $MaterialCode = $ReqList[1]; - } - - $this->requistion_model->DeleteRequistionLineItem( $ReqNo,$MaterialCode); - - echo "Successfully Deleted the Line item".$ReqNo; - - } - - /** - * This function used to load the Delete the Requistion Items - */ - function DeleteReqNo() - { - - $ReqNo= $this->input->post('id'); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $updateddt = $dt->format('Y-m-d H:i:s'); - $Request = array('Status'=>REQ_DELETED,'updatedOn'=>$updateddt); - - $this->requistion_model->UpdateRequistion( $Request,$ReqNo); - - echo "Successfully Deleted the ".$ReqNo; - - } - - function SearchRequistList() - { - $userID = $this->session->userdata ( 'userId' ); - $ReqValue = $this->input->post('SearchDate'); - - $Dt = explode("-",$ReqValue); - - $FromDate =''; - $ToDate = ''; - $Status= ''; - if(count( $Dt)>1) - { - $FDate = $Dt[0]."-".$Dt[1]."-".$Dt[2]; - $TDate = $Dt[3]."-".$Dt[4]."-".$Dt[5]; - $FromDate = $this->getDateformat($FDate); - $ToDate = $this->getDateformat($TDate); - } - - $St = $this->input->post('RequisitionStatus'); - - if($St == "-1") - { - $Status = ''; - } - else - { - $Status = $St; - } - - $data['AppList'] = $this->requistion_model->getApproverRequistList($userID,$Status,$FromDate, $ToDate); - - $this->global['pageTitle'] = 'Siddharth : Requisition Approval'; - - $data['Status']= $this->requistion_model->getStatus(); - - $this->loadViews("requisitionlistapproval", $this->global, $data, NULL); - - } - - - - function getDateformat($Val) - { - $date = new DateTime($Val); - $retDate = $date->format('Y-m-d H:i:s'); - return $retDate; - } - /** - * This function used to load the Employee details based on the EmpID selection - */ - function GetSelectedEmpDetails() - { - $ReqType = $_GET['ReqType']; - $EmpID = $this->input->post('id'); - $empDetails = $this->requistion_model->GetEmployeeDetails( $EmpID ); - $DeptCode = $empDetails[0]['DEPCode']; - $CostList = $this->requistion_model->GetCostCenterByDept( $DeptCode); - $HTML = ""; - $BudAmount = ""; - if(count($CostList) > 0) - { - for ($j = 0; $j < count($CostList); $j++) - { - $Code = $CostList[$j]['CostCenterCode']; - $Name = $CostList[$j]['CostCenterName']; - $HTML .=""; - } - } - if(count($CostList) == 1) - { - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - $Year = $dt->format('Y'); - $CostCode = $CostList[0]['CostCenterCode']; - - $Cost = $this->requistion_model->GetAvailableBudgetAmount( $CostCode,$Year,$ReqType); - if(count($Cost) >0) - { - $BudAmount = $Cost[0]['BudgetAmount']; - } - } - die(json_encode(array('emp' => $empDetails,'Cost' => $HTML,'AvlAmount' => $BudAmount))); - } - - function getAvailableBudAmount() - { - $ReqType = $_GET['ReqType']; - $CostCode= $this->input->post('id'); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - $Year = $dt->format('Y'); - - $Cost = $this->requistion_model->GetAvailableBudgetAmount( $CostCode,$Year,$ReqType); - - die(json_encode(array('Cost' =>$Cost))); - } - // To get the Material code based on the Request type - function getMaterialCode() - { - - $ReqType= $this->input->post('id'); - - $MaterialCode = $this->requistion_model->GetMaterialCode( $ReqType); - $MaterialName = ""; - $UOM = ""; - $HTML = ""; - - if(count($MaterialCode) > 0) - { - for ($j = 0; $j < count($MaterialCode); $j++) - { - $Code = $MaterialCode[$j]['MaterialCode']; - $Name = $MaterialCode[$j]['MaterialName']; - $HTML .=""; - - } - $MaterialName = $MaterialCode[0]['MaterialName']; - $UOM = $MaterialCode[0]['UOM']; - } - - die(json_encode(array('Material' =>$HTML,'MaterialName'=>$MaterialName,'UOM'=>$UOM))); - } - - // To get the Material value based on the MaterialCode - function getMaterialDetails() - { - - $Material= $this->input->post('id'); - - $MaterialDetails = $this->requistion_model->getRawMaterialList($Material); - - - die(json_encode(array('MatDetail' =>$MaterialDetails))); - } - - /* - To Insert the Requistion Details to Database - */ - /** - * This function is used to add new Cost to the system - */ - function addNewRequistion() - { - - $this->form_validation->set_rules('RequestType','RequestType','trim|required'); - $this->form_validation->set_rules('EmpID','EmpID','trim|required'); - - if($this->form_validation->run() == FALSE) - { - $this->requisition(); - } - else - { - $Status= $_GET['ID']; - $RequestType = strtoupper(trim($this->input->post('RequestType'))); - $Requestedby = strtoupper(trim($this->input->post('EmpID'))); - $CostCenter = $this->input->post('CostCenter'); - $CreateBy = $this->session->userdata ( 'userId' ); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $createddt = $dt->format('Y-m-d H:i:s'); - - $DeletedRow = $this->input->post('txtDeletedRow'); - $RowCount = $this->input->post('txtRowCount'); - - $comma_separated = explode(':', $DeletedRow); - $serviceSchedule = $this->input->post('serviceSchedule'); - $servicePeriod = $this->input->post('servicePeriod'); - $noOfService = $this->input->post('noOfService'); - - $IsExists = $this->requistion_model->RequistionIsExists($Requestedby); - // print_r($IsExists); - - if(count( $IsExists) == 0) - { - //echo 'Not Exists'; - $Request = array('ReqType'=>$RequestType, 'Requestedby'=>$Requestedby,'ReqDate'=>$createddt,'CostCenterCode'=>$CostCenter,'Status'=>$Status,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy,'Schedule_Type'=>$serviceSchedule,'NumberOfService'=>$noOfService,'Service_Period'=>$servicePeriod); - - //print_r($Request); - - $Req = $this->requistion_model->addRequistion($Request); - } - else - { - //echo 'Exists'; - $Request = array('ReqType'=>$RequestType, 'Requestedby'=>$Requestedby,'ReqDate'=>$createddt,'Status'=>$Status,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy,'CostCenterCode'=>$CostCenter,'Schedule_Type'=>$serviceSchedule,'NumberOfService'=>$noOfService,'Service_Period'=>$servicePeriod); - $UpdateReq = $this->requistion_model->UpdateRequistion($Request,$IsExists[0]['ReqNo']); - } - $ReqNumber = ''; - if(count($Req)>0) - { - $ReqNumber = $Req[0]['ReqNo']; - } - else - { - $ReqNumber = $IsExists[0]['ReqNo']; - } - - $SkipInsert = False; - for ($i = 1; $i <= $RowCount; $i++) - { - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - - if($SkipInsert == "False") - { - $MaterialCode = $this->input->post('MaterialCode'.$i); - $Quantity = $this->input->post('Quantity'.$i); - - $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity); - $this->requistion_model->addRequistionDetails($ReqDetails); - } - - } - if($Status == REQ_DRAFT) - { - echo 'Successfully Saved the Requistion details'; - } - else - { - echo 'Successfully Created the Requistion details'; - } - - } - - } - function EditRequistion() - { - $Status = $this->input->post('txtStatus'); - $ReqNumber = $this->input->post('txtReqNo'); - $CostCenter = $this->input->post('CostCenter'); - $UpdatedBy = $this->session->userdata ( 'userId' ); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $updatedDate = $dt->format('Y-m-d H:i:s'); - - $DeletedRow = $this->input->post('txtDeletedRow'); - $RowCount = $this->input->post('txtRowCount'); - $serviceSchedule = $this->input->post('serviceSchedule'); - $servicePeriod = $this->input->post('servicePeriod'); - $noOfService = $this->input->post('noOfService'); - if(strlen($Status) > 1) - { - $Request = array( 'Status'=>$Status,'CreatedDate'=>$updatedDate,'CreatedBy'=>$UpdatedBy,'CostCenterCode'=>$CostCenter,'Schedule_Type'=>$serviceSchedule,'NumberOfService'=>$noOfService,'Service_Period'=>$servicePeriod); - $UpdateReq = $this->requistion_model->UpdateRequistion($Request, $ReqNumber); - } - else - { - $Request = array( 'Status'=>REQ_PENDING_APPROVAL,'updatedOn'=>$updatedDate,'CostCenterCode'=>$CostCenter,'Schedule_Type'=>$serviceSchedule,'NumberOfService'=>$noOfService,'Service_Period'=>$servicePeriod); - $UpdateReq = $this->requistion_model->UpdateRequistion($Request, $ReqNumber); - } - - - $comma_separated = explode(':', $DeletedRow); - - /* Table value update and Insert in the table */ - //echo "RowCOunt:" .$RowCount; - $SkipInsert = False; - for ($i = 1; $i <= $RowCount; $i++) - { - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - - if($SkipInsert == "False") - { - $MaterialCode = $this->input->post('MaterialCode'.$i); - $Quantity = $this->input->post('Quantity'.$i); - $IsExists = $this->requistion_model->LineItemIsExists($ReqNumber,$MaterialCode); - if(count( $IsExists) == 0) - { - $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate); - - $this->requistion_model->addRequistionDetails($ReqDetails); - } - else - { - $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate); - - $this->requistion_model->UpdateRequistionLineItem($ReqDetails,$ReqNumber,$MaterialCode); - } - - - } - - } - echo 'Successfully updated the Requistion details'; - // $this->requisitionlisting(); - - - - - } -/* To Edit the request*/ - function ViewRequest() - { - - $ReqNo= $this->input->post('id'); - $result = $this->requistion_model->getRequistItemList($ReqNo); - $ReqList = $this->requistion_model->getRequistDetails($ReqNo); - $DepNo = $ReqList[0]['DEPCode']; - //$CostList = $this->requistion_model->GetCostCenterByDept($DepNo); - $HTML=""; - for ($i = 0; $i < count($result); $i++) - { - $SNo = $i + 1; - $MaterialCode = $result[$i]['MaterialCode']; - $MaterialName = $result[$i]['MaterialName']; - $UOM = $result[$i]['UOM']; - $Quantity = $result[$i]['Quantity']; - $Quantity = $result[$i]['Quantity']; - $POQTY = $result[$i]['POQTY']; - $StatusName= $result[$i]['StatusName']; - $HTML.=" - ".$SNo." - ". $MaterialCode." - - ".$MaterialName." - - ".$UOM." - ".$Quantity." - ".$POQTY." - ".$StatusName." - "; - - //$index = $index + 1; - - } - $CostCode = ''; - $ReqType = ''; - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - $Year = $dt->format('Y'); - if(count($ReqList)>0) - { - - $ReqType = $ReqList[0]['ReqType']; - - $CostCode = $ReqList[0]['CostCenterCode']; - } - $this->load->model('purchaseorder_model'); - $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); - //print_r($result); - $AvilBudAmt = '0'; - if(count($AvlBudget)>0) - { - $AvilBudAmt = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; - } - //echo $AvilBudAmt; - die(json_encode(array('Items' =>$HTML,'Requist'=>$ReqList,'AvilBudAmount'=>number_format($AvilBudAmt,2)))); - } - - function ApproveRequest() - { - $Status= Trim($_GET['Status']); - - $ReqNo= $_GET['ReqNo']; - $Remarks = trim($this->input->post('id')); - $ApprovedBy = $this->session->userdata ( 'userId' ); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $ApprovedDate = $dt->format('Y-m-d H:i:s'); - $Request = array('Status'=>$Status,'Comments'=>$Remarks,'ApprovedOn'=>$ApprovedDate,'Approvedby'=>$ApprovedBy); - $this->requistion_model->UpdateRequistion($Request,$ReqNo); - echo "Successfully Updated the Requistion No: ".$ReqNo; - - } - - function pageNotFound() - { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; - - $this->loadViews("404", $this->global, NULL, NULL); - } -} - -?> \ No newline at end of file diff --git a/application/controllers/servicepurchaseorder.php b/application/controllers/servicepurchaseorder.php index 179ef65f..3e6f0cde 100644 --- a/application/controllers/servicepurchaseorder.php +++ b/application/controllers/servicepurchaseorder.php @@ -5,11 +5,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : purchaseorder (PurchaseorderController) + * Class : servicepurchaseorder (Service Purchase Order Details - Controller) * User Class to control all user related operations. - * @author : VenbaMail Mali + * @author : Venba Info Tech - * @version : 1.1 - * @since : 15 Feb 2016 + * @since : 15 November 2017 */ class servicepurchaseorder extends BaseController { @@ -30,7 +30,7 @@ class servicepurchaseorder extends BaseController function viewServicePOReportForBilling() { - $this->global['pageTitle'] = 'Siddharth : Service Purchase Order for Billing'; + $this->global['pageTitle'] = 'Resico : Service Purchase Order for Billing'; $data["Billing"] = $this->purchaseorder_model->GetServicePOListforBilling(); @@ -42,7 +42,7 @@ class servicepurchaseorder extends BaseController function UpdateServicePOStatus() { - $this->global['pageTitle'] = 'Siddharth : Update Service PO Status'; + $this->global['pageTitle'] = 'Resico : Update Service PO Status'; $data['PO'] = $this->purchaseorder_model->GetServicePOListforStatusUpdate(); $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); @@ -487,7 +487,7 @@ $result = $this->purchaseorder_model->GetPODetailforBillingServicePO($PO); } function pageNotFound() { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/servicepurchaseorder.php~ b/application/controllers/servicepurchaseorder.php~ deleted file mode 100644 index b645cb8e..00000000 --- a/application/controllers/servicepurchaseorder.php~ +++ /dev/null @@ -1,325 +0,0 @@ - - -load->model('purchaseorder_model'); - - $this->load->library('session'); - $this->load->library('form_validation'); - $this->load->model('requistion_model'); - $this->isLoggedIn(); - } - - - // To get the available Budget Amount - function AvilBudgetAmount() - { - // echo 'Controller called'; - $CostCode = $this->input->post('id'); - $ReqType = $_GET['ReqType']; - - - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - $Year = $dt->format('Y'); - $this->load->model('purchaseorder_model'); - $result = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); - //print_r($result); - $AvilBudAmt = '0'; - if(count($result)>0) - { - $AvilBudAmt = $result[0]['BudgetAmount'] - $result[0]['Totalvalue']; - } - - // echo 'Test'; - print_r($AvilBudAmt); - //die(json_encode(array('Cost' => $AvilBudAmt))); - } - - - function getDateformat($Val) - { - $date = new DateTime($Val,new DateTimeZone('Asia/Kolkata')); - // print_r($date); - $retDate = $date->format('Y-m-d H:i:s'); - return $retDate; - } - - //This used to Create Service Purchase Order - function addNewServicePurchaseOrder() - { - - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('DeliveryAddr'); - $dt = $this->input->post('Deliverydt'); - //$Deliverydt = $this->getDateformat($dt); - $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1) - { - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } - - $PaymentTerms=$this->input->post('PaymentTerms'); - - - $POType = $this->input->post('POType'); - - $SpcialInstruction = $this->input->post('ScopeOfWork'); - $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); - $POStatus = $this->input->post('txtStatus'); - - $CreateBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $createddt = $dt->format('Y-m-d H:i:s'); - - $WorkStatus=$this->input->post('workstatus'); - // PO Master - $POList = array('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'=>$WorkStatus,'POType'=>$POType ); - - $POMaster = $this->purchaseorder_model->addPOMaster($POList); - - $PONO = ''; - if(count($POMaster)>0) - { - $PONO = $POMaster[0]['PONO']; - } - - // PO Line Items - $LineItemStatus = REQITEM_NEW; - - for ($i = 1; $i <= $RowCount; $i++) - { - - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - $Cgst = $this->input->post('Cgst'.$i); - $Sgst = $this->input->post('Sgst'.$i); - $Igst = $this->input->post('Igst'.$i); - $AfterCgst = $this->input->post('AfterCgst'.$i); - $AfterSgst = $this->input->post('AfterSgst'.$i); - $AfterIgst = $this->input->post('AfterIgst'.$i); - $CostCenter = $this->input->post('costCode'.$i); - $ServiceFrequency=$this->input->post('Frequency'.$i); - $ItemDescription = $this->input->post('ItemDescription'.$i); - $OtherAmt = $this->input->post('OtherAmt'.$i); - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency,'ServiceMaterialDescription'=>$ItemDescription); - //print_r($POLineItemList); - //die(); - - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - - $LineItemNo = ''; - - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - //echo $LineItemNo; - - if(trim($POType) == SERVICE ) - { - // echo 'Success'; - $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'otherallowance'=>$OtherAmt); - - $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); - - } - } - - } - echo 'Service Purchase Order Created Successfully!The PO NO Is: '.$PONO; - - } - function UpdateServicePurchaseOrder() - { - $PONO =$this->input->post('txtPONO'); - //echo $PONO; - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); - - $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('txtDeliveryAddress'); - $dt = $this->input->post('Deliverydt'); - $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } - - - - - $PaymentTerms=$this->input->post('PaymentTerms'); - $Payableat=$this->input->post('PayableAT'); - - $POType = $this->input->post('POType'); - - $SpcialInstruction = $this->input->post('ScopeofWork'); - $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); - $POStatus = $this->input->post('txtStatus'); - - $updatedBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $updateddt = $dt->format('Y-m-d H:i:s'); - $WorkStatus=$this->input->post('workstatus'); - - - // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus ); - - $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); - - $LineItemStatus = REQITEM_NEW; - - for ($i = 1; $i <= $RowCount; $i++) - { - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('quantity'.$i); - $Reqnumber = $this->input->post('Reqnumber'.$i); - $itemRate = $this->input->post('itemRate'.$i); - $Cgst = $this->input->post('Cgst'.$i); - $Sgst = $this->input->post('Sgst'.$i); - $Igst = $this->input->post('Igst'.$i); - $AfterCgst = $this->input->post('AfterCgst'.$i); - $AfterSgst = $this->input->post('AfterSgst'.$i); - $AfterIgst = $this->input->post('AfterIgst'.$i); - $CostCenter = $this->input->post('costCode'.$i); - $ServiceFrequency=$this->input->post('Frequency'.$i); - $POLineItemNo = $this->input->post('LineItemNo'.$i); - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - $ItemDescription = $this->input->post('ItemDescription'.$i); - $OtherAmt = $this->input->post('OtherAmt'.$i); - - $POLineItem = array(); - $LineItemNo = ''; - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - if(strlen($POLineItemNo) == 0) - { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency,'ServiceMaterialDescription'=>$ItemDescription); - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - - } - else - { - $LineItemNo = $POLineItemNo; - - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceMaterialDescription'=>$ItemDescription); - $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList); - - } - - - - if(trim($POType) == SERVICE ) - { - $isExists = $this->purchaseorder_model->LineItemExists($LineItemNo); - - if(count($isExists) == 0) - { - $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'otherallowance'=>$OtherAmt); - - $this->purchaseorder_model->addServiceTax($ServiceTaxList); - - } - else - { - $ServiceTaxList1 = array('CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'otherallowance'=>$OtherAmt); - - $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList1); - - } - - } - - } - } - echo 'Successfully updated the Service Purchase Order'; - } - function pageNotFound() - { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; - - $this->loadViews("404", $this->global, NULL, NULL); - } -} - -?> diff --git a/application/controllers/storerequisition.php b/application/controllers/storerequisition.php index 37d43f32..b40563e5 100644 --- a/application/controllers/storerequisition.php +++ b/application/controllers/storerequisition.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Cost Center (Cost Center Controller) + * Class :storerequisition (Store Requisition Detail - Controller ) * User Class to control all user related operations. - * @author : VenbaMail Mali + * @author : Venba Info Tech - * @version : 1.1 - * @since : 15 Feb 2016 + * @since : 18 November 2017 */ class storerequisition extends BaseController { @@ -29,38 +29,38 @@ class storerequisition extends BaseController */ public function index() { - //$this->global['pageTitle'] = 'Siddharth : storesrequisitionslip'; + //$this->global['pageTitle'] = 'Resico : storesrequisitionslip'; //$this->loadviews('storesrequisitionslip',$this->global); } function addstorerequisitionslip() { - $this->global['pageTitle'] = 'Siddharth : Add Store Requisition'; + $this->global['pageTitle'] = 'Resico : Add Store Requisition'; $this->loadviews('addstorerequisitionslip',$this->global); } function storerequisitionlist() { - $this->global['pageTitle'] = 'Siddharth : Store Requisition List'; + $this->global['pageTitle'] = 'Resico : Store Requisition List'; $this->loadviews('storerequisitionlist',$this->global); } function storerequisitionlisting() { - $this->global['pageTitle'] = 'Siddharth : Store Requisition Listing'; + $this->global['pageTitle'] = 'Resico : Store Requisition Listing'; $this->loadviews('storerequisitionlisting',$this->global); } function approvalstorerequisition() { - $this->global['pageTitle'] = 'Siddharth : Approval Store Requisition'; + $this->global['pageTitle'] = 'Resico : Approval Store Requisition'; $this->loadviews('approvalstorerequisitionslip',$this->global); } function pageNotFound() { - $this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/storerequisitionlist.php b/application/controllers/storerequisitionlist.php index dbfe0acc..49780dc4 100644 --- a/application/controllers/storerequisitionlist.php +++ b/application/controllers/storerequisitionlist.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Cost Center (Cost Center Controller) + * Class :storerequisitionlist (Store Stock list details - Controller) * User Class to control all user related operations. - * @author : VenbaMail Mali + * @author : Venba Info Tech - * @version : 1.1 - * @since : 15 Feb 2016 + * @since : 18 November 2017 */ class storerequisitionlist extends BaseController { @@ -32,7 +32,7 @@ class storerequisitionlist extends BaseController { - $this->global['pageTitle'] = 'Siddharth : StoreRequisition Listing'; + $this->global['pageTitle'] = 'Resico : StoreRequisition Listing'; $userId= $this->session->userdata ('userId'); $data['DEPCode'] = $this->session->userdata('DEPCode'); $data['DepName'] = $this->session->userdata('DepartmentName'); @@ -48,7 +48,7 @@ class storerequisitionlist extends BaseController function addstore() { - $this->global['pageTitle'] = 'Siddharth : StoreRequisition Listing'; + $this->global['pageTitle'] = 'Resico : StoreRequisition Listing'; $userId= $this->session->userdata ('userId'); $data['Store'] = $this->storerequistion_model->Storeall($userId); @@ -78,7 +78,7 @@ class storerequisitionlist extends BaseController $StoreReqNo = $_GET['StoreReqNo']; //$StoreReqNo= $this->input->post('id'); - $this->global['pageTitle'] = 'Siddharth : StoreRequisition Listing'; + $this->global['pageTitle'] = 'Resico : StoreRequisition Listing'; $this->load->model('storerequistion_model'); $data['cost'] = $this->storerequistion_model->editRequistDetails($StoreReqNo); @@ -191,7 +191,7 @@ class storerequisitionlist extends BaseController function addstorerequisitionlist() { - $this->global['pageTitle'] = 'Siddharth : StoreRequisition Listing'; + $this->global['pageTitle'] = 'Resico : StoreRequisition Listing'; $this->load->model('storerequistion_model'); $data['Status']= $this->storerequistion_model->getStatus(); @@ -206,7 +206,7 @@ class storerequisitionlist extends BaseController function issuestorerequisition() { - $this->global['pageTitle'] = 'Siddharth : Issue StoreRequisition'; + $this->global['pageTitle'] = 'Resico : Issue StoreRequisition'; $this->load->model('storerequistion_model'); $StoreReqNo= $_GET['ReqNo']; @@ -359,7 +359,7 @@ class storerequisitionlist extends BaseController $data['AppList'] = $this->storerequistion_model->getApproverRequistList($userID); //print_r($data['AppList']); - $this->global['pageTitle'] = 'Siddharth : ApprovalStoreRequisitionSlip'; + $this->global['pageTitle'] = 'Resico : ApprovalStoreRequisitionSlip'; $data['Status']= $this->storerequistion_model->getStatus(); $this->loadViews("approvalstorerequisitionslip", $this->global, $data, NULL); @@ -390,7 +390,7 @@ class storerequisitionlist extends BaseController */ function requisitionlistApproval() { - $this->global['pageTitle'] = 'Siddharth :Approvalstorerequisitionlist'; + $this->global['pageTitle'] = 'Resico :Approvalstorerequisitionlist'; //$data['Status']= $this->storerequistion_model->getStatus(); diff --git a/application/controllers/storestatus.php b/application/controllers/storestatus.php index aa36f56c..1ae0acc0 100644 --- a/application/controllers/storestatus.php +++ b/application/controllers/storestatus.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Supplier Controller (supplier) + * Class : storestatus (Store Stock Status -Controller) * User Class to control all user related operations. - * @author : Saravana kumar + * @author : Venba Info Tech - Saravana kumar * @version : 1.1 - * @since : 4 July 2017 + * @since : 18 November 2017 */ class storestatus extends BaseController { @@ -28,7 +28,7 @@ class storestatus extends BaseController */ public function index() { - $this->global['pageTitle'] = 'Siddharth Industries : Store Status'; + $this->global['pageTitle'] = 'Resico Industries : Store Status'; $this->loadViews("storestatus", $this->global, NULL , NULL); } @@ -44,7 +44,7 @@ class storestatus extends BaseController //$data['userRecords'] = $this->supplier_model->supplierListing(); - $this->global['pageTitle'] = 'Siddharth Industries : Store Status'; + $this->global['pageTitle'] = 'Resico Industries : Store Status'; //viewStock $data['Stock'] = $this->store_model->viewStock(); @@ -150,7 +150,7 @@ class storestatus extends BaseController function pageNotFound() { - $this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/controllers/supplier.php b/application/controllers/supplier.php index e513dcfe..a3a37533 100644 --- a/application/controllers/supplier.php +++ b/application/controllers/supplier.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : Supplier Controller (supplier) + * Class : supplier (Supplier Details - Controller) * User Class to control all user related operations. - * @author : Gandhimathi + * @author :Venba Info Tech - Gandhimathi * @version : 1.1 - * @since : 12 Apr 2017 + * @since : 18 November 2017 */ class supplier extends BaseController { @@ -415,7 +415,7 @@ class supplier extends BaseController $data['supplier'] = $this->supplier_model->getSupplierInfo($supplierID); //$data['payment'] = $this->supplier_model->getpayment($Payment ); $data['payment'] = $this->supplier_model->getPaymentTerms($Payment); - $this->global['pageTitle'] = 'Siddharth : Edit Supplier'; + $this->global['pageTitle'] = 'Resico : Edit Supplier'; $this->loadViews("editSupplier", $this->global,$data, NULL); } diff --git a/application/controllers/supplier.php~ b/application/controllers/supplier.php~ deleted file mode 100644 index 56422769..00000000 --- a/application/controllers/supplier.php~ +++ /dev/null @@ -1,513 +0,0 @@ -load->model('supplier_model'); - $this->load->library('form_validation'); - $this->load->library('pagination'); - $this->load->library('Excel'); - $this->isLoggedIn(); - } - /** - * This function used to load the first screen of the user - */ - public function index() - { - $this->global['pageTitle'] = 'Siddharth : Supplier'; - - $this->loadViews("supplierListing", $this->global, NULL , NULL); - } - - /** - * This function is used to load the Supplier list - */ - function supplierListing() - { - - $this->load->model('supplier_model'); - - $data['userRecords'] = $this->supplier_model->supplierListing(); - - $this->global['pageTitle'] = 'Siddharth Industries : Supplier Listing'; - - $this->loadViews("supplierListing", $this->global, $data, NULL); - - } - /** - * This function is used to load the add new supplier */ - function addsupplier() - { - - //$data['payment'] = $this->supplier_model->getpayment(); - $data['payment'] = $this->supplier_model->getPaymentTerms(); - //$data['users'] = $this->purchaseorder_model->getusers(); - - $this->global['pageTitle'] = 'siddharth : Add New Supplier'; - - $this->loadViews("addsupplier", $this->global,$data, NULL); - - } - /** - * This function is used to check whether PAN already exist or not - */ - - function CheckPAN() - { - - $id = $this->input->post('id'); - - $query = $this->supplier_model->checkPAN($id ); - - $query = $query[0]['PAN']; - - print_r($query); - - } - - /* To Check the Pan Number is exists in the database or not for the selected Supplier */ - function checkPanValidateSupplier() { - - $SupplierID = $this->input->post('SupplierID'); - $PanNo = $this->input->post('panno'); - // echo 'Sup'. $SupplierID ; - $query = $this->supplier_model->checkPAN($PanNo,$SupplierID); - if (count($query)> 0) - { - $this->form_validation->set_message('checkPanValidateSupplier', 'The Entered PAN Number is already exists in the Database.'); - return false; - } - else - { - return true; - } - } - - /* To Check the Pan Number is exists in the database or not */ - function checkPanValidate() - { - // alert('validation pan'); - - $PanNo = $this->input->post('panno'); - - $query = $this->supplier_model->checkPAN($PanNo); - if (count($query)> 0) - { - $this->form_validation->set_message('checkPanValidate', 'The Entered PAN Number is already exists in the Database.'); - return false; - } - else - { - return true; - } - } - - - - function CheckGST() - { - //alert('check validation GST'); - $id = $this->input->post('id'); - $query = $this->supplier_model->checkGST($id); - $query = $query[0]['GSTNO']; - print_r($query); - - } - - - /* To Check the GST Number is exists in the database or not for the selected Supplier */ - function checkGstValidateSupplier() { - //alert(' gst validation GST'); - $SupplierID = $this->input->post('SupplierID'); - $GstNo = $this->input->post('GSTNo'); - //echo 'Sup'. $SupplierID ; - $query = $this->supplier_model->checkGST($GstNo,$SupplierID); - if (count($query)> 0) - { - $this->form_validation->set_message('checkGstValidateSupplier', 'The Entered GST Number is already exists in the Database.'); - return false; - } - else - { - return true; - } - } - - - /* To Check the GST Number is exists in the database or not */ - function checkGstValidate() - { - - $GstNo = $this->input->post('GSTNo'); - $query = $this->supplier_model->checkGST($GstNo); - if (count($query)> 0) - { - $this->form_validation->set_message('checkGstValidate', 'The Entered GST Number is already exists in the Database.'); - return false; - } - else - { - return true; - } - } - - - /** - * This function is used to add new Supplier to the system - */ - function addNewsupplier() - { - - - $this->form_validation->set_rules('SupplierName','Supplier Name','trim|required'); - $this->form_validation->set_rules('Address','Address','trim|required|'); - $this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]'); - $this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]'); - $this->form_validation->set_rules('emailid','emailid', 'valid_email|max_length[128]|required'); - $this->form_validation->set_rules('TIN','TIN','trim|required|max_length[11]'); - $this->form_validation->set_rules('panno', 'panno', 'trim|required|max_length[10]');//|callback_checkPanValidate'); - $this->form_validation->set_rules('GSTNo','GSTNo','trim|requried|max_length[15]|callback_checkGstValidate'); - - if($this->form_validation->run() == FALSE) - { - $this->addsupplier(); - } - else - { - $SupplierName = $this->input->post('SupplierName'); - $Address = $this->input->post('Address'); - $ContactNumber = $this->input->post('ContactNumber'); - $AlternateContactNumber = $this->input->post('AlternateContactNumber'); - $EmailAddress = $this->input->post('emailid'); - $Exiseregistration = $this->input->post('Exciseregistration'); - $TIN = $this->input->post('TIN'); - $PAN = strtoupper($this->input->post('panno')); - $GSTNo = strtoupper($this->input->post('GSTNo')); - $GSTRange = $this->input->post('GSTRange'); - $CollectrateAddress = $this->input->post('CollectrateAddress'); - $UANumber = $this->input->post('UANumber'); - //$PaymentTerms = $this->input->post('paymentname'); - //$Payment = $this->input->post('Payment'); - //$PayableAT = $this->input->post('PayableAT'); - $CSTNo = $this->input->post('CSTNo'); - - $CSTDt = $this->input->post('dateofCST'); - - if($CSTDt != '') - { - $CSTDate = $this->getDateformat($CSTDt); - } - else - { - $CSTDate = null; - } - - $EMSNo = $this->input->post('EMSNo'); - $TSNo = $this->input->post('TSNo'); - $IMSNo = $this->input->post('IMSNo'); - $ISONo = $this->input->post('ISONo'); - $OSHASNo = $this->input->post('OSHASNo'); - $accno = $this->input->post('accno'); - $ifsc = $this->input->post('ifsc'); - $branchname = $this->input->post('branchname'); - $bankaddress = $this->input->post('bankaddress'); - $Createdby = $this->session->userdata ( 'userId' ); - $date = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $createddate = $date->format('Y-m-d H:i:s'); - $service = $this->input->post('service'); - $rawmaterial =$this->input->post('rawmaterial'); - $maintenance = $this->input->post('maintanance'); - $PaymentId = $this->input->post('paymentid'); - - - $supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'Exiseregistration'=>$Exiseregistration,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentID'=>$PaymentId,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'Cert_EMS'=>$EMSNo, 'Cert_TS'=>$TSNo, 'Cert_IMS'=>$IMSNo, 'Cert_ISO'=>$ISONo, 'Cert_OSHAS'=>$OSHASNo, 'BankAcNumber'=>$accno, 'IFSCCode'=>$ifsc, 'BranchName'=>$branchname, 'BankAddress'=>$bankaddress,'Createdby'=>$Createdby,'IsService'=>$service,'IsMaintanance'=>$maintenance,'IsRawMaterial'=>$rawmaterial); //,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$Payment,'PayableAT'=>$PayableAT); - //print_r($supplier);die(); - $result = $this->supplier_model->addNewsupplier($supplier); - - - if($result > 0) - { - redirect('supplierListing','refresh'); - echo ""; - } - - else - { - redirect('supplierListing','refresh'); - echo ""; - } - } - - } - - function getDateformat($Val) - { - $date = new DateTime($Val); - $retDate = $date->format('Y-m-d H:i:s'); - return $retDate; - } - /** - * This function is used to edit the Supplier information - */ - function editsupplier() - { - $this->form_validation->set_rules('SupplierName','Supplier Name','trim|required'); - $this->form_validation->set_rules('Address','Address','trim|required|'); - $supplierID = $this->input->post('SupplierID'); - //echo 'supID' . $supplierID ; - $this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]'); - $this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]'); - $this->form_validation->set_rules('emailid','emailid','valid_email|max_length[128]|required'); - $this->form_validation->set_rules('TIN','TIN','trim|required|max_length[11]'); - $this->form_validation->set_rules('panno', 'panno', 'trim|required|max_length[10]|callback_checkPanValidateSupplier'); - $this->form_validation->set_rules('GSTNo','GSTNo','trim|requried|max_length[15]|callback_checkGstValidateSupplier'); - - - - if($this->form_validation->run() == FALSE) - { - $this->viewsupplier($supplierID); - } - else - { - - $SupplierName = $this->input->post('SupplierName'); - $Address = $this->input->post('Address'); - $ContactNumber = $this->input->post('ContactNumber'); - $AlternateContactNumber = $this->input->post('AlternateContactNumber'); - $EmailAddress = $this->input->post('emailid'); - $Exiseregistration = $this->input->post('Exciseregistration'); - $TIN = $this->input->post('TIN'); - $PAN = strtoupper($this->input->post('panno')); - $GSTNo = strtoupper($this->input->post('GSTNo')); - $GSTRange = $this->input->post('GSTRange'); - $CollectrateAddress = $this->input->post('CollectrateAddress'); - $UANumber = $this->input->post('UANumber'); - $PaymentTerms = $this->input->post('paymentname'); - //print_r($PaymentTerms); - $UpdatedBy = $this->session->userdata ( 'userId' ); - $chked = $this->input->post('isactive'); - - if( $chked != '') - { - $IsActive = '1'; - } - else - { - $IsActive = '0'; - } - - $CSTNo = $this->input->post('CSTNo'); - $CSTDt = $this->input->post('dateofCST'); - - if($CSTDt != '') - { - $CSTDate = $this->getDateformat($CSTDt); - } - else - { - $CSTDate = null; - } - - $EMSNo = $this->input->post('EMSNo'); - $TSNo = $this->input->post('TSNo'); - $IMSNo = $this->input->post('IMSNo'); - $ISONo = $this->input->post('ISONo'); - $OSHASNo = $this->input->post('OSHASNo'); - $accno = $this->input->post('accno'); - $ifsc = $this->input->post('ifsc'); - $branchname = $this->input->post('branchname'); - $bankaddress = $this->input->post('bankaddress'); - $service = $this->input->post('service'); - $rawmaterial =$this->input->post('rawmaterial'); - $maintanance = $this->input->post('maintanance'); - $PaymentId = $this->input->post('paymentid'); - - $supplier = array(); - $supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'Exiseregistration'=>$Exiseregistration,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentID'=>$PaymentId,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'Cert_EMS'=>$EMSNo, 'Cert_TS'=>$TSNo, 'Cert_IMS'=>$IMSNo, 'Cert_ISO'=>$ISONo, 'Cert_OSHAS'=>$OSHASNo, 'BankAcNumber'=>$accno, 'IFSCCode'=>$ifsc, 'BranchName'=>$branchname, 'BankAddress'=>$bankaddress,'UpdatedBy'=>$UpdatedBy,'IsActive'=>$IsActive,'IsService'=>$service,'IsMaintanance'=>$maintanance,'IsRawMaterial'=>$rawmaterial); //'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$Payment); - //SupplierID, SupplierName, Address, ContactNumber, AlternateContactNumber, EmailAddress, Exiseregistration, TIN, PAN, CSTNO, CSTDate, GSTNO, GSTRange, CollectrateAddress, UANumber, PaymentTerms, PaymentDays, PayableAT, Cert_EMS, Cert_TS, Cert_IMS, Cert_ISO, Cert_OSHAS, BankAcNumber, IFSCCode, BranchName, BankAddress, Createdby, UpdatedBy, Updatedon, CreatedOn, IsActive); - // print_r($supplier);die(); - $result = $this->supplier_model->UpdateSupplier($supplier, $supplierID); - - - if($result == True) - { - redirect('supplierListing','refresh'); - echo ""; - } - - else - { - redirect('supplierListing','refresh'); - echo ""; - } - } - - } - - function viewsupplier($SID = '') - { - $Payment = ''; - if($SID == '') - { - $supplierID = $_GET['SID']; - $Payment = $_GET['Payment']; - } - else - { - - $supplierID = $SID; - } - - - $data['supplier'] = $this->supplier_model->getSupplierInfo($supplierID); - //$data['payment'] = $this->supplier_model->getpayment($Payment ); - $data['payment'] = $this->supplier_model->getPaymentTerms($Payment); - $this->global['pageTitle'] = 'Siddharth : Edit Supplier'; - - $this->loadViews("editSupplier", $this->global,$data, NULL); - } - - /** this function can be use for excel report **/ - - function export_supplierdetails(){ - - - $this->load->library('excel'); - $this->excel->setActiveSheetIndex(0); - - $this->excel->getActiveSheet()->setTitle('supplier details'); - $this->excel->getActiveSheet()->setCellValue('A1', 'SupplierID'); - $this->excel->getActiveSheet()->setCellValue('B1', 'SupplierName'); - $this->excel->getActiveSheet()->setCellValue('C1', 'Address'); - $this->excel->getActiveSheet()->setCellValue('D1', 'ContactNumber'); - $this->excel->getActiveSheet()->setCellValue('E1', 'AlternateContactNumber'); - $this->excel->getActiveSheet()->setCellValue('F1', 'EmailAddress'); - $this->excel->getActiveSheet()->setCellValue('G1', 'Exiseregistration'); - $this->excel->getActiveSheet()->setCellValue('H1', 'TIN'); - $this->excel->getActiveSheet()->setCellValue('I1', 'PAN'); - $this->excel->getActiveSheet()->setCellValue('J1', 'CSTNO'); - $this->excel->getActiveSheet()->setCellValue('K1', 'CST Date'); - $this->excel->getActiveSheet()->setCellValue('L1', 'GST NO'); - $this->excel->getActiveSheet()->setCellValue('M1', 'GST Range'); - $this->excel->getActiveSheet()->setCellValue('N1', 'Collectrate Address'); - $this->excel->getActiveSheet()->setCellValue('O1', 'UANumber'); - $this->excel->getActiveSheet()->setCellValue('P1', 'PaymentTerms'); - - $this->excel->getActiveSheet()->setCellValue('Q1', 'Createdby'); - $this->excel->getActiveSheet()->setCellValue('R1', 'UpdatedBy'); - $this->excel->getActiveSheet()->setCellValue('S1', 'IsActive'); - - - - - $this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('B1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('B1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('C1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('C1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('D1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('D1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('E1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('E1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('F1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('F1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('G1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('G1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('H1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('H1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('I1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('I1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('J1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('J1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('K1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('K1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('L1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('L1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('M1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('M1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('N1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('N1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('O1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('O1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('P1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('P1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('Q1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('Q1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('R1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('R1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('S1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('S1')->getFont()->setBold(true); - - - - $exportData = $this->supplier_model->export_excel(); - - if ($exportData) { - $i = 2; - $s = 1; - foreach ($exportData as $data) { - - $this->excel->getActiveSheet()->setCellValue('A' . $i,$data['SupplierID']); - $this->excel->getActiveSheet()->setCellValue('B' . $i,$data['SupplierName']); - $this->excel->getActiveSheet()->setCellValue('C' . $i,$data['Address']); - $this->excel->getActiveSheet()->setCellValue('D' . $i,$data['ContactNumber']); - $this->excel->getActiveSheet()->setCellValue('E' . $i,$data['AlternateContactNumber']); - $this->excel->getActiveSheet()->setCellValue('F' . $i,$data['EmailAddress']); - $this->excel->getActiveSheet()->setCellValue('G' . $i,$data['Exiseregistration']); - $this->excel->getActiveSheet()->setCellValue('H' . $i,$data['TIN']); - $this->excel->getActiveSheet()->setCellValue('I' . $i,$data['PAN']); - $this->excel->getActiveSheet()->setCellValue('J' . $i,$data['CSTNO']); - $this->excel->getActiveSheet()->setCellValue('K' . $i,$data['CSTDate']); - $this->excel->getActiveSheet()->setCellValue('L' . $i,$data['GSTNO']); - $this->excel->getActiveSheet()->setCellValue('M' . $i,$data['GSTRange']); - $this->excel->getActiveSheet()->setCellValue('N' . $i,$data['CollectrateAddress']); - $this->excel->getActiveSheet()->setCellValue('O' . $i,$data['UANumber']); - $this->excel->getActiveSheet()->setCellValue('P' . $i,$data['PaymentTerms']); - - $this->excel->getActiveSheet()->setCellValue('Q' . $i,$data['firstname']); - $this->excel->getActiveSheet()->setCellValue('R' . $i,$data['Update_by']); - $this->excel->getActiveSheet()->setCellValue('S' . $i,$data['IsActive']); - - $i++; - $s++; - } - } - - $filename = 'supplierdetails' .' '. '.xls'; //save our workbook as this file name - header('Content-Type: application/vnd.ms-excel'); //mime type - header('Content-Disposition: attachment;filename="' . $filename . '"'); //tell browser what's the file name - header('Cache-Control: max-age=0'); //no cache - $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5'); - if (ob_get_contents()) ob_end_clean(); - ob_start(); - $objWriter->save('php://output'); - - - } - - - function pageNotFound() - { - $this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found'; - - $this->loadViews("404", $this->global, NULL, NULL); - } -} - -?> \ No newline at end of file diff --git a/application/controllers/user.php b/application/controllers/user.php index d1c796e0..f6c52b1f 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -3,11 +3,11 @@ require APPPATH . '/libraries/BaseController.php'; /** - * Class : User (UserController) + * Class : user (User Details - Controller) * User Class to control all user related operations. - * @author : Kishor Mali + * @author : Venba Info Tech - * @version : 1.1 - * @since : 15 November 2016 + * @since : 18 November 2017 */ class user extends BaseController { @@ -388,7 +388,7 @@ class user extends BaseController function pageNotFound() { - $this->global['pageTitle'] = 'Resico Industries : 404 - Page Not Found'; + $this->global['pageTitle'] = 'Resico : 404 - Page Not Found'; $this->loadViews("404", $this->global, NULL, NULL); } diff --git a/application/models/purchaseorder_model.php~ b/application/models/purchaseorder_model.php~ deleted file mode 100644 index 18615f1e..00000000 --- a/application/models/purchaseorder_model.php~ +++ /dev/null @@ -1,1545 +0,0 @@ -db->distinct(); - $this->db->select('PO.PONO'); - $this->db->from('T_PurchaseOrder_Master PO'); - $this->db->Join('T_PurchaseOrder_LineItem Line','PO.PONO = Line.PONO'); - $this->db->Join('T_Requestion_Master Req','Req.ReqNo = Line.ReqNo'); - $this->db->Join('T_Employee_Details Emp','Emp.EmpID= Req.Requestedby'); - $this->db->where('PO.POType',SERVICE); - $this->db->where('PO.status',PO_RELEASED); - $this->db->where('Emp.Departmentcode',$this->session->userdata('DEPCode')); - $query = $this->db->get(); - - return $query->result(); - } - - function GetPODetailforBillingServicePO($PONO) - { - - $subQuery ='select mast.ReqNo,mast.ReqDate,supp.SupplierName,PODate,st.StatusName as WorkStatus,ServiceWorkStatus,POMast.PaymentTerms, - POMast.ServiceWorkStatus,LineItem.*,mat.MaterialName,mat.UOM,emp.FirstName,emp.LastName,POMast.TotalOrderValue - from T_PurchaseOrder_Master POMast - join T_PurchaseOrder_LineItem LineItem on LineItem.PONO = POMast.PONO - join T_SupplierDetailsN supp on supp.SupplierID = POMast.SupplierID - join T_MaterialMaster mat on mat.MaterialCode = LineItem.MaterialCode - join T_Status Stat on Stat.StatusCode = POMast.Status - join T_Status st on st.StatusCode = POMast.ServiceWorkStatus - join T_Requestion_Master mast on mast.ReqNo = LineItem.ReqNo - join tbl_users users on users.userId = mast.CreatedBy - join T_Employee_Details emp on emp.EmpID = users.EmpID - where POMast.POType=? and POMast.PONO=?'; - - $query = $this->db->query($subQuery,array(SERVICE,$PONO)); - - return $query->result_array(); - - } - - function GetServicePOListforBilling() - { - $subQuery ='select POMast.PONO,supp.SupplierName,PODate,POMast.PaymentTerms,POMast.ServiceWorkStatusRemarks, - LineItem.*,mat.MaterialName,mat.UOM,emp.FirstName,emp.LastName,Tax.TotalValue,Cost.CostCenterName,AdvanceAmount - ,Dept.DepartmentName from T_PurchaseOrder_Master POMast - join T_PurchaseOrder_LineItem LineItem on LineItem.PONO = POMast.PONO - join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - left join T_PurchaseOrder_AdvanceRequest PUADV on POMast.PONO=PUADV.PONO - join T_SupplierDetailsN supp on supp.SupplierID = POMast.SupplierID - join T_MaterialMaster mat on mat.MaterialCode = LineItem.MaterialCode - join T_Status Stat on Stat.StatusCode = POMast.Status - join T_Requestion_Master mast on mast.ReqNo = LineItem.ReqNo - join tbl_users users on users.userId = POMast.CreatedBy - join T_Employee_Details emp on emp.EmpID = mast.Requestedby - join T_DepartmentDetails Dept on Dept.DEPCode = emp.Departmentcode - join T_CostCenter_Master Cost on Cost.CostCenterCode=LineItem.CostCenterCode - where POMast.POType=? and ServiceWorkStatus=?'; - - $query = $this->db->query($subQuery,array(SERVICE,SERVICE_COMPLETED)); - - //print_r( $this->db->last_query()); - return $query->result(); - - } - - /** - * This function is used to get the user listing count - * @param string $searchText : This is optional search text - * @return number $count : This is row count - */ - function purchaseorderListingCount() - { - $this->db->distinct(); - $this->db->select('POMast.PONO,supp.SupplierName,TotalOrderValue,PODate,Stat.StatusName,Req.ReqType,DeliveryDate'); - $this->db->from('T_PurchaseOrder_Master POMast'); - $this->db->join('T_SupplierDetailsN supp', 'supp.SupplierID = POMast.SupplierID'); - $this->db->join('T_Status Stat', 'Stat.StatusCode = POMast.Status'); - $this->db->join('T_PurchaseOrder_LineItem LineItem', 'POMast.PONO = LineItem.PONO'); - $this->db->join('T_Requestion_Master Req', 'Req.ReqNo = LineItem.ReqNo'); - // print_r( $this->db->last_query()); - $query = $this->db->get(); - - return count($query->result()); - } - - /** - * This function is used to get the user listing count - * @param string $searchText : This is optional search text - * @param number $page : This is pagination offset - * @param number $segment : This is pagination limit - * @return array $result : This is result - */ - -function purchaseorderListing($forwhat='') - { - $this->db->distinct(); - $this->db->select('POMast.PONO,supp.SupplierName,TotalOrderValue,PODate,Stat.StatusName,Stat.StatusCode,POMast.POType as ReqType,DeliveryDate,DeliverySchedule,DeliveryOption,POMast.CapitalRange'); - $this->db->from('T_PurchaseOrder_Master POMast'); - $this->db->join('T_SupplierDetailsN supp', 'supp.SupplierID = POMast.SupplierID'); - $this->db->join('T_Status Stat', 'Stat.StatusCode = POMast.Status'); - $this->db->join('T_PurchaseOrder_LineItem LineItem', 'POMast.PONO = LineItem.PONO'); - $this->db->join('T_Requestion_Master Req', 'Req.ReqNo = LineItem.ReqNo'); - if($forwhat=='amendment') - { - $this->db->where('POMast.Status',PO_RELEASED); - } - else - { - $this->db->where('POMast.Status !=',PO_AMENDED); - // $this->db->order_by('POMast.Status !=',PO_AMENDED); - } - $query = $this->db->get(); - //print_r( $this->db->last_query()); - $result = $query->result(); - return $result; - } - - /** - * This function is used to get the SupplierID and SupplierName information - * @return array $result : This is result of the query - */ - function getSupplierName($supID='') - { - $this->db->select('SupplierID, SupplierName,Address,PaymentID'); - $this->db->from('T_SupplierDetailsN'); - if($supID != '') - { - $this->db->where('SupplierID',$supID); - } - //$this->db->where('roleId !=', 1); - $query = $this->db->get(); - - return $query->result(); - } - /** - * This function is used to get the userId information - * @return array $result : This is result of the query - */ - function getusers() - { - $this->db->select('userId, name'); - $this->db->from('tbl_users'); - //$this->db->where('roleId !=', 1); - $query = $this->db->get(); - - return $query->result(); - } -/** - * This function is used to get the Raw Material information - * @return array $result : This is result of the query - */ - function getRawPOMaterialList($ReqNo,$IsArray='') - { - - $result = $this->db-> query("CALL P_GET_REQUISTIONLIST('".$ReqNo."')") or die(mysql_error()); - - $result ->next_result(); - - //print_r($this->db->last_query()); - - if ($result->num_rows > 0) - { - //echo 'PO Line item Inserted successfully'; - if($IsArray != '') - { - return $result->result_array(); - } - else - { - return $result->result(); - } - } - - } - - /** - This Function to get the List of Requistion which require to create PO - */ - function getAllRequistionListToCreatePO() - { - $result = $this->db-> query("CALL P_PURCHASEORDER_DETAILS()") or die(mysql_error()); - - $result ->next_result(); - - - if ($result->num_rows > 0) - { - - return $result->result(); - } - } - - /** - * This function is used to get the Raw Material information - * @return array $result : This is result of the query - */ - function getRawMaterialList($MatType='',$ReqNoList='') - { - - $this->db->select('ReqNo,Req.MaterialCode,MaterialName,UOM,Req.Quantity'); - $this->db->from('T_Requestion_Details Req'); - $this->db->join('T_MaterialMaster mat', 'Req.MaterialCode = mat.MaterialCode'); - $this->db->where('mat.MaterialType', $MatType); - $this->db->where_in('Req.ReqNo', $ReqNoList); - - $query = $this->db->get(); - //print_r($this->db->last_query()); - return $query->result(); - } - /** - * This function is used to get the Raw Material information - * @return array $result : This is result of the query - */ - function getRawMaterialListForPO($MatType='',$ReqNo='') - { - $subQuery ='SELECT ReqNo,Req.MaterialCode,MaterialName,UOM,Req.Quantity - FROM T_Requestion_Details Req - JOIN T_MaterialMaster mat ON Req.MaterialCode = mat.MaterialCode - where mat.MaterialType = ? - AND Req.ReqNo = ? - AND mat.MaterialCode != (SELECT MaterialCode FROM T_PurchaseOrder_LineItem WHERE ReqNo =? - )'; - - $query = $this->db->query($subQuery,array($MatType,$ReqNo,$ReqNo)); - - return $query->result_array(); - - - } - function GetAvailableBudgetAmount($CostCode,$Year,$BudgetType) - { - /* $this->db->select('BudgetAmount'); - $this->db->from('T_CostCenter_Budget'); - $this->db->where('CostCenterCode',$CostCode ); - $this->db->where('BudgetYear',$Year ); - $this->db->where('BudgetType',$BudgetType ); - $query = $this->db->get(); - - return $query->result_array(); */ - - /* $subQuery ='select BudgetAmount, (select ifnull(sum(TotalOrderValue),0) as Totalvalue from - T_PurchaseOrder_Master PO join T_PurchaseOrder_LineItem Item on - Item.PONO = PO.PONO join T_Requestion_Master mast on mast.ReqNo = Item.ReqNo where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue - from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and - BudgetYear = ? and BudgetType =?'; */ - - $subQuery ='select BudgetAmount, (select ifnull(sum(Quantity*Rate)-tax.AfterDiscount,0) as Totalvalue from - T_PurchaseOrder_LineItem Item join T_Requestion_Master mast - on mast.ReqNo = Item.ReqNo left join T_Revenue_Tax tax on - tax.LineItemNo = Item.LineItemNo where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue - from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and - BudgetYear = ? and BudgetType =?'; - - $query = $this->db->query($subQuery,array($CostCode,$BudgetType,$CostCode,$Year,$BudgetType)); - //print_r($this->db->last_query()); - return $query->result_array(); - - } - - - function GetAvailableImportBudgetAmount($CostCode,$Year,$BudgetType) - { - $subQuery='select BudgetAmount,(select ifnull(sum((Quantity*Rate*ExchangeRate)),0)as TValue from T_PurchaseOrder_LineItem LineItem - join T_PurchaseOrder_Master Mast on Mast.PONO=LineItem.PONO where POType=? - and CostCenterCode=?)as TotalValue from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and BudgetYear=? and BudgetType=?'; - $query = $this->db->query($subQuery,array($BudgetType,$CostCode,$CostCode,$Year,$BudgetType)); - //print_r($this->db->last_query()); - return $query->result_array(); - - - } - - /** - * This function is used to get the Requsition List for the login user - * @return array $result : This is result of the query - */ - function getRequistDetails($ReqNoList='') - { - $this->db->distinct(); - $this->db->select('ReqNo,ReqType,Status,Requestedby,mast.CreatedDate,mast.Schedule_Type,mast.NumberOfService,mast.Service_Period,emp.FirstName,emp.EmpID,emp.Designation, Dept.DEPCode,Dept.DepartmentName,mast.ReqDate,mast.CostCenterCode,mast.Status'); - $this->db->from('T_Requestion_Master mast'); - $this->db->join('T_Employee_Details emp', 'mast.Requestedby = emp.EmpID'); - $this->db->join('T_DepartmentDetails Dept', 'emp.Departmentcode = Dept.DEPCode'); - $this->db->where_in('mast.ReqNo', $ReqNoList); - - $query = $this->db->get(); - //print_r($this->db->last_query()); - return $query->result(); - } - /** - * This function is used to get the Requsition List for the login user - * @return array $result : This is result of the query - */ - function getRequistDetailsForPO($ReqNoList='') - { - $this->db->distinct(); - $this->db->select('ReqNo,ReqType,Status,Requestedby,mast.CreatedDate,emp.FirstName,emp.EmpID,emp.Designation, Dept.DEPCode,Dept.DepartmentName,mast.ReqDate'); - $this->db->from('T_Requestion_Master mast'); - $this->db->join('T_Employee_Details emp', 'mast.Requestedby = emp.EmpID'); - $this->db->join('T_DepartmentDetails Dept', 'emp.Departmentcode = Dept.DEPCode'); - $this->db->where_in('mast.ReqNo', $ReqNoList); - - $query = $this->db->get(); - - return $query->result(); - } - /** - * This function is used to get the Cost center information - * @return array $result : This is result of the query - */ - function getCostCenter() - { - - $this->db->select('CostName, Description'); - $this->db->from('T_CostCentre'); - - $query = $this->db->get(); - - return $query->result(); - } - - - /** - * This function is used to get the CostCenter for the Selected Requistion Number - * @return array $result : This is result of the query - */ - function getCostCenterbyRequist($ReqNo='',$BudYear='',$ReqType='') - { - - $this->db->distinct(); - $this->db->select('Mast.CostCenterCode,Mast.CostCenterName,Bud.BudgetAmount,ReqNo'); - $this->db->from('T_CostCenter_Master Mast'); - $this->db->join('T_CostCenter_Departments CostDept', 'CostDept.CostCenterCode = Mast.CostCenterCode'); - $this->db->join('T_CostCenter_Budget Bud', 'Bud.CostCenterCode = Mast.CostCenterCode'); - $this->db->join('T_Employee_Details emp', 'CostDept.DEPCode = emp.Departmentcode'); - $this->db->join('T_Requestion_Master req', 'req.Requestedby = emp.EmpID'); - - $this->db->where('BudgetType ',$ReqType ); - $this->db->where('BudgetYear ',$BudYear ); - if($ReqNo != '') - { - $this->db->where('ReqNo ',$ReqNo); - } - - $query = $this->db->get(); - return $query->result(); - } - -/** - * This function is used to get the Config value from configuration table - * @return array $result : This is result of the query - */ - function getRequistionNoFromPO($PONO='') - { - $this->db->distinct(); - $this->db->select('ReqNo,'); - $this->db->from('T_PurchaseOrder_LineItem'); - if($PONO != '') - { - $this->db->where('PONO ',$PONO ); - } - - $query = $this->db->get(); - - return $query->result(); - } - - - /** - * This function is used to get the Config value from configuration table - * @return array $result : This is result of the query - */ - function getConfigValue($ConfigID ,$ConfigValue = '') - { - - $this->db->select('ConfigValue'); - $this->db->from('T_ConfigDetails'); - $this->db->where('Config_id ',$ConfigID ); - if($ConfigValue != '') - { - $this->db->where('ConfigValue != ',$ConfigValue ); - } - $query = $this->db->get(); - - return $query->result(); - } - - - - - /** - * This function is used to get the Company information from T_Company_Details table - * @return array $result : This is result of the query - */ - function getCompanyInformation() - { - - $this->db->select('CompanyName,Address'); - $this->db->from('T_Company_Details'); - - $query = $this->db->get(); - - return $query->result(); - } - /** - * This function is used to get the Employee List - * @return array $result : This is result of the query - */ - function getAllEmployees() - { - $this->db->select('EmpID,FirstName,LastName'); - $this->db->from('T_Employee_Details'); - $query = $this->db->get(); - - return $query->result(); - } - - /** - * This function is used to get the Employee List - * @return array $result : This is result of the query - */ - function getLastCreatedPODate() - { - $this->db->select('max(PODate) as PODate'); - $this->db->from('T_PurchaseOrder_Master'); - $query = $this->db->get(); - - return $query->result(); - } - - function getLastReleasedPODate() - { - $this->db->select('max(ReleasedOn) as PODate'); - $this->db->from('T_PurchaseOrder_Master'); - $query = $this->db->get(); - - return $query->result(); - } - /** - * This function is used to add New Purchase order to the system - - */ - function addPOMaster($POMaster) - { - $this->db->trans_start(); - $this->db->insert('T_PurchaseOrder_Master', $POMaster); - $insert_id = $this->db->affected_rows(); - $this->db->trans_complete(); - // print_r($this->db->last_query()); - if($insert_id>0) - { - $subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master'; - - $query = $this->db->query($subQuery); - - return $query->result_array(); - } - } - - - function addAmendPOMaster($POMaster,$CreatedBy,$ParentPO) - { - // print_r($POMaster); - $this->db->trans_start(); - $this->db->insert('T_PurchaseOrder_Master', $POMaster); - $insert_id = $this->db->affected_rows(); - $this->db->trans_complete(); - // print_r($this->db->last_query()); - if($insert_id>0) - { - $subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master where CreatedBy=? and ParentPO=?'; - - $query = $this->db->query($subQuery,array($CreatedBy,$ParentPO)); - - return $query->result_array(); - } - } - - /** - * This function is used to add New Purchase order Line Item to the system - */ - function addPOLineItem($POLineItem) - { - $this->db->trans_start(); - $this->db->insert('T_PurchaseOrder_LineItem', $POLineItem); - $insert_id = $this->db->affected_rows(); - $this->db->trans_complete(); - // print_r($this->db->last_query()); - if($insert_id>0) - { - $subQuery = 'select max(LineItemNo) as LineItemNo from T_PurchaseOrder_LineItem'; - - $query = $this->db->query($subQuery); - - return $query->result_array(); - } - } - - /** - * This function is used to add Revenue Tax to the system - */ - function addRevenueTax($RevenueTaxList) - { - $this->db->trans_start(); - $this->db->insert('T_Revenue_Tax', $RevenueTaxList); - $insert_id = $this->db->affected_rows(); - $this->db->trans_complete(); - return $insert_id; - } - /** - * This function is used to add Service Tax to the system - */ - function addServiceTax($ServiceTaxList) - { - $this->db->trans_start(); - $this->db->insert('T_Service_Tax', $ServiceTaxList); - $insert_id = $this->db->affected_rows(); - $this->db->trans_complete(); - return $insert_id; - } - - - /** - * This function is used to add Service Tax to the system - */ - function addImportTax($ImportTaxList) - { - $this->db->trans_start(); - $this->db->insert('T_Import_Tax', $ImportTaxList); - $insert_id = $this->db->affected_rows(); - $this->db->trans_complete(); - return $insert_id; - } - - - - function addadvanceRequest($advance) - { - $this->db->trans_start(); - $this->db->insert('T_PurchaseOrder_AdvanceRequest', $advance); - $insert_id = $this->db->affected_rows(); - $this->db->trans_complete(); - return $insert_id; - - - } - - - /** - * This function used to get user information by id - * @param number $userId : This is user id - * @return array $result : This is user information - */ - function getuserInfo($PO) - { - $this->db->select('POType, PODate, SupplierID,SpecialOrder,UserID,RequestedDate,RequesterEmail,RequesterPh, PurchasingCategory,BudgetManager,BudgetManagerDepartment,'); - $this->db->from('T_PurchaseOrderDetails'); - $this->db->where('PONO', $PO); - $query = $this->db->get(); - - return $query->result(); - } - - // This Method to get the Service PO Details for Edit the Item - - function GetServicePurchaseOrder($PONO = '') - { - $this->db->distinct(); - $this->db->select('ReqNo,POMast.PONO,POMast.PaymentTerms,POMast.PaymentOtherDescription,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,POMast.ServiceWorkStatus,POMast.*'); - $this->db->from('T_PurchaseOrder_Master POMast'); - $this->db->join('T_SupplierDetailsN supp', 'supp.SupplierID = POMast.SupplierID'); - $this->db->join('T_Status Stat', 'Stat.StatusCode = POMast.Status'); - $this->db->join('T_PurchaseOrder_LineItem LineItem', 'POMast.PONO = LineItem.PONO'); - - $this->db->where('POMast.PONO', $PONO); - $query = $this->db->get(); - - $result = $query->result(); - - return $result; - } - - // This Method to get the Service PO Child Details for Edit the Item - - -// This Method to get the Service PO Child Details for Edit the Item - function GetServicePurchaseOrderDetails($PONO = '') - { - - $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,ReceivedQuantity,Rate,LineItem.Status,(Quantity *Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount - ,TotalValue,CGST,After_CGST,SGST,After_SGST,IGST,After_IGST,otherallowance,LineItem.CostCenterCode,LineItem.ServiceFrequency,LineItem.ServiceMaterialDescription,Req.Schedule_Type,Req.NumberOfService,Req.Service_Period - FROM T_PurchaseOrder_LineItem LineItem - join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo - where LineItem.PONO =?'; - - $query = $this->db->query($subQuery,array($PONO)); - - return $query->result(); - - - } - // This Method to get the Service PO Child Details for Edit the Item - function GetServicePurchaseOrderDetailsForPrint($PONO = '') - { - - $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.ServiceMaterialDescription,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Mat.HSNCODE, - LineItem.Quantity,LineItem.Rate,(LineItem.Quantity *LineItem.Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount - ,TotalValue,CGST,SGST,IGST,After_CGST,After_SGST,After_IGST,otherallowance,LineItem.CostCenterCode,sup.SupplierName,sup.Address,POMaster.DeliveryAddress,POMaster.DeliveryDate,POMaster.Status,POMaster.PODate,POMaster.PONO,POMaster.ServiceDescription,POMaster.PaymentOtherDescription,POMaster.DeliveryOption,POMaster.DeliverySchedule,ReqMat.NumberOfService,ReqMat.Service_Period,ReqMat.Schedule_Type,Payment.PaymentID,Payment.PaymentTerms,AdvanceAmount FROM - T_PurchaseOrder_LineItem LineItem - join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO - join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID - join T_Requestion_Master ReqMat on ReqMat.ReqNo = LineItem.ReqNo - join T_PaymentTerms Payment on Payment.PaymentID = POMaster.PaymentTerms - left join T_PurchaseOrder_AdvanceRequest PurAdv on POMaster.PONO=PurAdv.PONO - where LineItem.PONO =?'; - - $query = $this->db->query($subQuery,array($PONO)); - - return $query->result(); - - - } - - function GetServicePurchaseOrderAmendDetailsforPdfprint($PONO = '') - { - - - - $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.ServiceMaterialDescription,Mat.MaterialCode,Mat.MaterialName, - Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue,POMaster.AmendedDetails,LineItem.AmendedDetails as lineamenddetails, - ROUND(( Tax.After_SGST + Tax.After_CGST + Tax.After_IGST ) ,2)as Taxamount,ReqMat.NumberOfService,ReqMat.Schedule_Type,ReqMat.Service_Period, - TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,Payment.PaymentTerms - FROM T_PurchaseOrder_LineItem LineItem - join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO - join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID - join T_PaymentTerms Payment on Payment.PaymentID = POMaster.PaymentTerms - join T_Requestion_Master ReqMat on ReqMat.ReqNo = LineItem.ReqNo - where LineItem.PONO =?'; - - $query = $this->db->query($subQuery,array($PONO)); - - return $query->result(); - - - } - - // This Method to get the Revenue PO Child Details for Edit the Item - function GetRevenuePurchaseOrderDetails($PONO = '') - { - - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,(Quantity *Rate) as BasicValue , ((AfterPackagingValue + AfterFreightValue + AfterSGST + AfterCGST + - AfterIGST + Insurance)) as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName - FROM T_PurchaseOrder_LineItem LineItem - join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo - join T_Employee_Details emp on Req.Requestedby = emp.EmpID - join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode - where LineItem.PONO =?'; - - $query = $this->db->query($subQuery,array($PONO)); - - return $query->result(); - - - } - - // This Method to get the Revenue PO Child Details for Edit the Item - function GetRevenuePurchaseOrderDetailsForPDF($PONO = '') - { - - $subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName, - Mat.UOM,Mat.HSNCODE,Quantity,Rate,(Quantity *Rate) as BasicValue , - (AfterPackagingValue + AfterFreightValue + AfterSGST + AfterCGST + - AfterIGST + Insurance) as Taxamount,AdvanceAmount, - TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,Payment.PaymentID,Payment.PaymentTerms - FROM T_PurchaseOrder_LineItem LineItem - join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO - join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID - - join T_PaymentTerms Payment on Payment.PaymentID = POMaster.PaymentTerms - left join T_PurchaseOrder_AdvanceRequest PurAdv on POMaster.PONO=PurAdv.PONO - where LineItem.PONO =?'; - - $query = $this->db->query($subQuery,array($PONO)); - - return $query->result(); - - - } -// This Method to get the Revenue PO Child Details for Edit the Item - function GetRevenuePurchaseOrderDetailsForAmendPDF($PONO = '') - { - - $subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName,POMaster.PaymentOtherDescription, - Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue , - ROUND(((AfterPackagingValue + AfterFreightValue + AfterSGST + AfterCGST + - AfterIGST + Insurance)) ,2)as Taxamount, - TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,Payment.PaymentTerms - FROM T_PurchaseOrder_LineItem LineItem - join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO - join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID - join T_PaymentTerms Payment on Payment.PaymentID = POMaster.PaymentTerms - where LineItem.PONO =?'; - - $query = $this->db->query($subQuery,array($PONO)); - - return $query->result(); - - - } - -function GetImportPurchaseOrderDetailsForPDF($PONO = '') - { - - // $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName, - // Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount, - // ProductPrice,Tax.*,LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.Address - // FROM T_PurchaseOrder_LineItem LineItem - // join T_Requestion_Master ReqMas on ReqMas.ReqNo=LineItem.ReqNo - // join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - // join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - // join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO - // join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID - // where LineItem.PONO =?'; - - $subQuery='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails, -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 -FROM T_PurchaseOrder_LineItem LineItem -join T_Requestion_Master ReqMas on ReqMas.ReqNo=LineItem.ReqNo -join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode -join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo -join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO -join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID -left join T_PurchaseOrder_AdvanceRequest PurAdv on POMaster.PONO=PurAdv.PONO -join T_Requestion_Master ReqMast on LineItem.ReqNo=ReqMast.ReqNo -join T_PaymentTerms Pay on POMaster.PaymentTerms=Pay.PaymentID -where LineItem.PONO =?'; - - $query = $this->db->query($subQuery,array($PONO)); - //print_r($this->db->last_query()); - - return $query->result(); - - - } - - - function GetCurrencyDetail($Currency='') - { - - $subQuery='SELECT * from T_Currency_Details where Currency_Code=?'; - $query=$this->db->query($subQuery,array($Currency)); - //print_r($query); - return $query->result(); - - } - - - function GerRequesterName($Requester='') - { - $subQuery='SELECT EmpID,FirstName,Departmentcode from T_Employee_Details where EmpID=?'; - - $query=$this->db->query($subQuery,array($Requester)); - - return $query->result(); - } - - - function GerRequesterDep($Depcode='') - { - $subQuery='SELECT DepartmentName from T_DepartmentDetails where DEPCode=?'; - $query=$this->db->query($subQuery,array($Depcode)); - - return $query->result(); - - } - - function GerCurrencyCodeName($Currencycode='') - { - $subQuery='SELECT * from T_Currency_Details where Currency_Code=?'; - $query=$this->db->query($subQuery,array($Currencycode)); - //print_r($this->db->last_query()); - return $query->result(); - - } - - - function GetPOStatus($Status='') - { - $subQuery='SELECT StatusName from T_Status where StatusCode=?'; - $query=$this->db->query($subQuery,array($Status)); - return $query->result(); - - } - - - function GetPaymentTerms($PONO='') - { - $subQuery='SELECT PaymentTerms from T_PurchaseOrder_Master where PONO=?'; - $query=$this->db->query($subQuery,array($PONO)); - //print_r($query); - return $query->result(); - - } - - - - - // function getSupplierPayment($Currency='') - // { - - // $subQuery='select distinct PaymentTerms from T_SupplierDetailsN'; - // $query=$this->db->query($subQuery,array($Currency)); - // //print_r($this->db->last_query()); - // return $query->result(); - - // } - - function getSupplierPayment($Config_ID='') - { - - // $subQuery='select distinct PaymentTerms from T_SupplierDetailsN'; - $subQuery='select ConfigValue from T_ConfigDetails where Config_ID=?'; - $query=$this->db->query($subQuery,array($Config_ID)); - //print_r($this->db->last_query()); - return $query->result(); - - } - - function GetWorkStatus($Config_ID='') - { - $subQuery = 'select ConfigValue from T_ConfigDetails where Config_ID=?'; - $query=$this->db->query($subQuery,array($Config_ID)); - //print_r($query); - return $query->result(); - } - - - - - -function GetImportPurchaseOrderDetails($PONO = '') - { - - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName, -Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue,ReceivedQuantity, -QuantityRejected,ROUND(ReceivedQuantity-QuantityRejected)as PendingQty, - ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((Quantity *Rate)+(RMCIncludingCustomersPerKG*Quantity),2)as TotalOrderValue,ROUND((POMast.ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue,CurrencyType,ReceivedQuantity, - - Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem - join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO - join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo - join T_Employee_Details emp on Req.Requestedby = emp.EmpID - - left join T_MRIR_Details Det on Det.MaterialCode=LineItem.MaterialCode - - join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode where LineItem.PONO =?'; - //print_r($subQuery); - - $query = $this->db->query($subQuery,array($PONO)); - - return $query->result(); - - - } - - function GetCapitalAmendPurchaseOrderDetailsForprintPDF($PONO = '') - { - //echo $PONO; - - $subQuery ='SELECT distinct LineItem.PONO,LineItem.AmendedDetails as lineamd,LineItem.LineItemNo,SUP.SupplierName,SUP.Address,POMast.DeliveryAddress,POMast.DeliveryDate,POMast.PODate,POMast.DeliveryOption,POMast.ServiceDescription,POMast.ServiceDescription,POMast.Import_DispatchDetails,POMast.Import_PlaceofOrgin,POMast.AmendedDetails,POMast.DeliverySchedule,POMast.TotalOrderValue,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, -Mat.UOM,Quantity,Rate,POMast.Status,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.PaymentOtherDescription,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,POMast.CurrencyType,Payment.PaymentTerms, - Req.CostCenterCode FROM T_PurchaseOrder_LineItem LineItem - join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO - join T_SupplierDetailsN SUP on SUP.SupplierID=POMast.SupplierID -join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - join T_Service_Tax ServiceTax on ServiceTax.LineItemNo = LineItem.LineItemNo - join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo - join T_PaymentTerms Payment on Payment.PaymentID = POMast.PaymentTerms - join T_Employee_Details emp on Req.Requestedby = emp.EmpID where LineItem.PONO =?'; - $query = $this->db->query($subQuery,array($PONO)); - //print_r ($query->result()); - return $query->result(); - - - } - - - -function GetCurrencytype() - { - - $subQuery = 'select * from T_Currency_Details'; - - $query = $this->db->query($subQuery); - - return $query->result(); - } - - function GetINRCurrencytype($Currency_Code='') - { - $subQuery='select * from T_Currency_Details where Currency_Code=?'; - $query=$this->db->query($subQuery,array($Currency_Code)); - //print_r($this->db->last_query()); - return $query->result(); - - } - - - - - - - // To Update the PO - function updatePOMaster($PONO,$PODetails) - { - $this->db->where('PONO', $PONO); - $this->db->update('T_PurchaseOrder_Master', $PODetails); - - return TRUE; - } - - - // To update Parent PO as Amended PO - function updateAmendPOMaster($PONO,$PODetail) - { - //echo $PONO."from model"; - - - $this->db->where('PONO', $PONO); - $this->db->update('T_PurchaseOrder_Master', $PODetail); - $insert_id = $this->db->affected_rows(); - - return $insert_id; - } - /** - * This function is used to check the Line Item is already available in the database - * @return array $result : This is result of the query - */ - function LineItemExists($LineItemNo) - { - $this->db->select('LineItemNo,TaxID'); - $this->db->from('T_Service_Tax'); - $this->db->where('LineItemNo ',$LineItemNo ); - //$this->db->where('Requestedby ',$ReqBy ); - $query = $this->db->get(); - - if ($query->num_rows > 0) { - //echo $result->num_rows; - return $query->result_array(); - } - } - /** - * This function is used to check the Revenue Line Item is already available in the database - * @return array $result : This is result of the query - */ - function LineItemExistsinRevenueTax($LineItemNo) - { - $this->db->select('LineItemNo'); - $this->db->from('T_Revenue_Tax'); - $this->db->where('LineItemNo ',$LineItemNo ); - $query = $this->db->get(); - - if ($query->num_rows > 0) { - return $query->result_array(); - } - } - - - function LineItemExistsinImportTax($LineItemNo) - { - $this->db->select('LineItemNo'); - $this->db->from('T_Import_Tax'); - $this->db->where('LineItemNo ',$LineItemNo ); - $query = $this->db->get(); - - if ($query->num_rows > 0) { - return $query->result_array(); - } - } - // To Update the PO Line Item - function updatePOLineItem($PONO,$LineItemNo,$PODetails) - { - $this->db->where('PONO', $PONO); - $this->db->where('LineItemNo', $LineItemNo); - $this->db->update('T_PurchaseOrder_LineItem', $PODetails); - - return TRUE; - } - /*// To Update the Service Tax Item */ - function updateServiceTax($LineItemNo,$PODetails) - { - - $this->db->where('LineItemNo', $LineItemNo); - $this->db->update('T_Service_Tax', $PODetails); - - // print_r($this->db->last_query()); - - return TRUE; - } - - /*// To Update the Revenue Tax Item */ - function updateRevenueTax($LineItemNo,$PODetails) - { - $this->db->where('LineItemNo', $LineItemNo); - $this->db->update('T_Revenue_Tax', $PODetails); - - // print_r($this->db->last_query()); - - return TRUE; - } - - function updateImportTax($LineItemNo,$PODetails) - { - $this->db->where('LineItemNo', $LineItemNo); - $this->db->update('T_Import_Tax', $PODetails); - - // print_r($this->db->last_query()); - - return TRUE; - } - - function getLastInsertedPO() - { - $this->db->select('max(PONO) as PO'); - $this->db->from('T_PurchaseOrderDetails'); - $query = $this->db->get(); - - return $query->result_array(); - } - - - /* This Method to get all the Department name for the requistion */ - function getDepartmentListForAllReq() - { - $subQuery ='SELECT DISTINCT DEPT.DEPCode,DEPT.DepartmentName FROM T_Requestion_Master REQ - JOIN T_Employee_Details EMP ON REQ.Requestedby = EMP.EmpID - JOIN T_DepartmentDetails DEPT ON EMP.Departmentcode = DEPT.DEPCode WHERE REQ.Status not in(?,?,?,?)'; - - $query = $this->db->query($subQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED)); - //print_r($query); - return $query->result(); - } - /* - This Method to get all department list - */ - function getDepartmentAllList() - { - $subQuery ='SELECT DISTINCT DEPCode,DepartmentName FROM T_DepartmentDetails'; - - $query = $this->db->query($subQuery); - //print_r($query); - return $query->result(); - } - - - function getStatusListforAllReq() - { - $subQuery ='SELECT DISTINCT STAT.StatusCode, STAT.StatusName FROM T_Requestion_Master REQ - JOIN T_Status STAT on REQ.Status = STAT.StatusCode where STAT.StatusCode not in (?,?,?,?)'; - $query = $this->db->query($subQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED)); - - // print_r( $this->db->last_query()); - - return $query->result(); - } - - function getStatusByDepartment($DepNo='') - { - - $subQuery ='SELECT DISTINCT STAT.StatusCode ,STAT.StatusName FROM T_Requestion_Master REQ - JOIN T_Employee_Details EMP ON REQ.Requestedby = EMP.EmpID - JOIN T_DepartmentDetails DEPT ON EMP.Departmentcode = DEPT.DEPCode - JOIN T_Status STAT ON REQ.Status = STAT.StatusCode - WHERE DEPT.DEPCode=? AND REQ.Status NOT IN (?,?,?,?)'; - $query = $this->db->query($subQuery,array($DepNo,REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED)); - - return $query->result_array(); - } - - function getRequistionListbySearch($Depid='',$Status='',$FromDate='',$ToDate='') - { - $subQuery =' SELECT ReqNo,ReqType,Requestedby,EMP.FirstName,EMP.Designation,STAT.StatusCode ,STAT.StatusName,ReqDate,DEPT.DEPCode,DEPT.DepartmentName FROM T_Requestion_Master REQ - JOIN T_Employee_Details EMP ON REQ.Requestedby = EMP.EmpID - JOIN T_DepartmentDetails DEPT ON EMP.Departmentcode = DEPT.DEPCode - JOIN T_Status STAT on REQ.Status = STAT.StatusCode - where REQ.Status NOT IN (?,?,?,?,?)'; - - $appendQuery = $subQuery ; - - if($Depid != '' && $Status != '' && $FromDate != '' && $ToDate != '') - { - $appendQuery .= ' AND DEPT.DEPCode=? AND STAT.StatusCode=? AND ReqDate >= ? AND ReqDate <= ?'; - //echo "$appendQuery";die(); - $query = $this->db->query($appendQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED,REQ_PO_CREATED,$Depid ,$Status,$FromDate,$ToDate)); - //print_r($this->db->last_query()); - return $query->result_array(); - } - else if($Depid != '' && $Status == '' && $FromDate == '' && $ToDate == '') - { - $appendQuery .= ' AND DEPT.DEPCode=?'; - - $query = $this->db->query($appendQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED,REQ_PO_CREATED,$Depid)); - //print_r($this->db->last_query()); - return $query->result_array(); - } - else if($Depid == '' && $Status != '' && $FromDate == '' && $ToDate == '') - { - $appendQuery .= ' AND STAT.StatusCode=?'; - - $query = $this->db->query($appendQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED,REQ_PO_CREATED,$Status)); - //print_r($this->db->last_query()); - return $query->result_array(); - } - else if($Depid == '' && $Status == '' && $FromDate != '' && $ToDate != '') - { - $appendQuery .= ' AND ReqDate >= ? AND ReqDate <= ?'; - - $query = $this->db->query($appendQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED,REQ_PO_CREATED,$FromDate,$ToDate)); - //print_r($this->db->last_query()); - return $query->result_array(); - } - else if($Depid != '' && $Status != '' && $FromDate == '' && $ToDate == '') - { - $appendQuery .= ' AND DEPT.DEPCode=? AND STAT.StatusCode=?'; - - $query = $this->db->query($appendQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED,REQ_PO_CREATED,$Depid ,$Status)); - // print_r($this->db->last_query()); - return $query->result_array(); - } - else if($Depid != '' && $Status == '' && $FromDate != '' && $ToDate != '') - { - $appendQuery .= ' AND DEPT.DEPCode=? AND ReqDate >= ? AND ReqDate <= ?'; - - $query = $this->db->query($appendQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED,REQ_PO_CREATED,$Depid ,$FromDate,$ToDate)); - //print_r($this->db->last_query()); - return $query->result_array(); - } - else if($Depid == '' && $Status != '' && $FromDate != '' && $ToDate != '') - { - $appendQuery .= ' AND STAT.StatusCode=? AND ReqDate >= ? AND ReqDate <= ?'; - - $query = $this->db->query($appendQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED,REQ_PO_CREATED,$Status ,$FromDate,$ToDate)); - // print_r($this->db->last_query()); - return $query->result_array(); - } - else - { - $query = $this->db->query($subQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED,REQ_PO_CREATED)); - //print_r($this->db->last_query()); - return $query->result(); - } - - } - - function UpdateRequistItemStatus() - { - $query = $this->db->query("update T_Requestion_Details REQ - JOIN T_PurchaseOrder_LineItem line ON REQ.ReqNo = line.ReqNo - JOIN T_PurchaseOrder_Master PO ON PO.PONO = line.PONO - set REQ.Status = CASE WHEN REQ.Quantity = line.Quantity THEN 'ST022' WHEN REQ.Quantity > line.Quantity THEN 'ST023' ELSE 'ST003' END , - REQ.updatedOn= CURRENT_TIMESTAMP - where PO.Status ='".PO_CREATED."'"); - - //$query ->next_result(); - - } - function UpdateRequistionStatus() - { - $result = $this->db-> query("CALL P_UPDATE_REQUISTIONSTATUS_New()") or die(mysql_error()); - - $result ->next_result(); - - } - /** - * This function is used to delete the Line item from details into Database - * @return array $result : This is result of the query - */ - function DeletePOLineItem( $LineItem='',$ReqNo='',$MaterialCode='') - { - $this->db->where('LineItemNo', $LineItem); - $this->db->where('ReqNo', $ReqNo); - $this->db->where('MaterialCode', $MaterialCode); - $this->db->delete('T_PurchaseOrder_LineItem'); - - return TRUE; - } - - /** - * This function is used to delete the Revenue item from details into Database - * @return array $result : This is result of the query - */ - function DeletePORevenueTax( $LineItem='') - { - $this->db->where('LineItemNo', $LineItem); - $this->db->delete('T_Revenue_Tax'); - - return TRUE; - } - - /** - * This function is used to delete Service Tax from details into Database - * @return array $result : This is result of the query - */ - function DeletePOServiceTax( $LineItem='') - { - $this->db->where('LineItemNo', $LineItem); - $this->db->delete('T_Service_Tax'); - - return TRUE; - } - - - function DeletePOImportTax( $LineItem='') - { - $this->db->where('LineItemNo', $LineItem); - $this->db->delete('T_Import_Tax'); - - return TRUE; - } - - /** - * This function is used to get the List of PO details to the approver - * @return array $result : This is result of the query - join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode - */ - function getPOList($Amendment) - { - - $this->db->distinct(); - $this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,ccm.CostCenterCode,mast.POType as ReqType,mast.Remarks,DepartmentName,mast.ApprovedBy,(select EmpID from tbl_users where userId=mast.ApprovedBy )as EID, -(select FirstName from T_Employee_Details where EmpID=EID)as Approver'); - $this->db->from('T_PurchaseOrder_Master mast'); - // $this->db->order_by('mast.Status',"PO_CREATED"); - $this->db->join('T_Status st', 'st.StatusCode=mast.Status'); - - $this->db->join('T_PurchaseOrder_LineItem req', 'req.PONO= mast.PONO'); - $this->db->join('T_Requestion_Master rmast','rmast.ReqNo=req.ReqNo'); - //$this->db->join('T_CostCenter_Budget bud','bud.CostCenterCode = req.CostCenterCode and bud.BudgetType = rmast.ReqType'); - $this->db->join('T_CostCenter_Master ccm','ccm.CostCenterCode = req.CostCenterCode'); - $this->db->join('tbl_users tbl', 'rmast.createdby=tbl.userid'); - $this->db->join('T_Employee_Details as emp', 'emp.empid=tbl.empid'); - $this->db->join('T_DepartmentDetails as Dep','Dep.DEPCode=emp.Departmentcode'); - // $this->db->where('mast.Status',PO_AMENDED); // EMERGENGY PO - if($Amendment=='A'){ //A- Approved - $this->db->or_where('mast.Status',PO_CREATED);//PO CREATED - $this->db->or_where('mast.Status',PO_ONHOLD);//ON HOLD - $this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED - $this->db->or_where('mast.Status',PO_RELEASED);//PO RELEASED - $this->db->or_where('mast.Status',REQITEM_Emergency_PO_CREATED); - $this->db->order_by('mast.Status'); // EMERGENGY PO - // $this->db->or_where('mast.Status',PO_AMENDED); // EMERGENGY PO - } - else if($Amendment=='R'){ // R -RELEASED - $this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED - $this->db->or_where('mast.Status',PO_RELEASED); - $this->db->order_by('mast.Status','asc'); - } - $result=$this->db->get(); - // print_r($this->db->last_query()); - return $result->result(); - - } - - - function UpdatePO($store, $PONO) - { - - $this->db->where('PONO', $PONO); - $this->db->update('T_PurchaseOrder_Master', $store); - - return TRUE; - } - - function GetReleasedDetails($PONO){ - $this->db->select('mast.ReleasedOn,re.FirstName'); - $this->db->from('T_PurchaseOrder_Master mast'); - $this->db->join('tbl_users tbl','mast.ReleasedBy=tbl.userid'); - $this->db->join('T_Employee_Details re','re.EmpID=tbl.EmpID'); - $this->db->where('mast.PONO',$PONO); - $result=$this->db->get(); - //print_r($this->db->last_query()); -//die(); - return $result->result(); - - } - //This is get the capital po list for edit - -function getCapitalPurchaseOrderDetails($PONO = '') - { - - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, -Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status, - ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,POMast.CurrencyType, - - Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem - join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO -join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - - join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo - join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo - join T_Employee_Details emp on Req.Requestedby = emp.EmpID - - join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode where LineItem.PONO =?'; - //print_r($subQuery); - - $query = $this->db->query($subQuery,array($PONO)); - - return $query->result(); - - - } - -// This Method to get the Capital PO Details for pdf - function GetCapitalPurchaseOrderDetailsForPDF($PONO = '') - { - - $subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName, - Mat.UOM,Mat.HSNCODE,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue , - LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.Address,Payment.PaymentID,Payment.PaymentTerms - FROM T_PurchaseOrder_LineItem LineItem - join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - - join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO - join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID - join T_PaymentTerms Payment on Payment.PaymentID = POMaster.PaymentTerms - where LineItem.PONO =?'; - $query = $this->db->query($subQuery,array($PONO)); - - return $query->result(); - - - } - // get requested by details - function GetRequesedByDetails($PONO){ - $this->db->select('mast.CreatedBy,re.FirstName,Dept.DEPCode,Dept.DepartmentName'); - $this->db->from('T_PurchaseOrder_Master mast'); - $this->db->join('tbl_users tbl','mast.CreatedBy=tbl.userid'); - $this->db->join('T_Employee_Details re','re.EmpID=tbl.EmpID'); - $this->db->join('T_DepartmentDetails Dept', 're.Departmentcode = Dept.DEPCode'); - - $this->db->where('mast.PONO',$PONO); - $result=$this->db->get(); - - return $result->result(); - - } - - // get domestic capital po list - - - function getDomesticCapitalPurchaseOrderDetails($PONO = '') - { - - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, - Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,ROUND((ServiceTax.After_CGST + ServiceTax.After_SGST + ServiceTax.After_IGST + ServiceTax.otherallowance),2) as ServiceTaxamount - ,ServiceTax.TotalValue,ServiceTax.CGST,ServiceTax.After_CGST,ServiceTax.SGST,ServiceTax.After_SGST,ServiceTax.IGST,ServiceTax.After_IGST,ServiceTax.otherallowance, - POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,ROUND((POMast.TotalOrderValue),2) as BasicINRValue,POMast.CurrencyType, - - Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem - join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO - join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode - join T_Service_Tax ServiceTax on ServiceTax.LineItemNo = LineItem.LineItemNo - join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo - join T_Employee_Details emp on Req.Requestedby = emp.EmpID - - join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode where LineItem.PONO =?'; - //print_r($subQuery); - - $query = $this->db->query($subQuery,array($PONO)); - - return $query->result(); - - - } - //get pdf po requistion details - - - function GetPdfRequistionDetails($PONO){ - $this->db->select('LineItem.ReqNo'); - $this->db->from('T_PurchaseOrder_LineItem LineItem'); - $this->db->where('LineItem.PONO',$PONO); - $result=$this->db->get(); - $ReqNo=''; - - foreach ($result->result() as $res){ - - if($ReqNo==$res->ReqNo){ - - } - else{ - $ReqNo = $res->ReqNo; - $this->db->select('ReqMast.ReqNo,ReqMast.CostCenterCode,ReqMast.ReqDate,ReqMast.Schedule_Type,ReqMast.NumberOfService,ReqMast.Service_Period,re.FirstName,Dept.DEPCode,Dept.DepartmentName'); - $this->db->from('T_Requestion_Master ReqMast'); - $this->db->join('T_Employee_Details re','re.EmpID=ReqMast.Requestedby'); - $this->db->join('T_DepartmentDetails Dept', 're.Departmentcode = Dept.DEPCode'); - $this->db->where('ReqMast.ReqNo',$ReqNo); - $Reqresult=$this->db->get(); - $Details['RequistionNo']= $Reqresult->result()[0]->ReqNo; - $Detaisl['ReqDate']=$Reqresult->result()[0]->ReqDate; - $Details['RequestedName']= $Reqresult->result()[0]->FirstName; - $Details['RequestedDept']= $Reqresult->result()[0]->DepartmentName; - $Details['CostCenterCode']= $Reqresult->result()[0]->CostCenterCode; - $date = new DateTime($Reqresult->result()[0]->ReqDate,new DateTimeZone('Asia/Kolkata')); - $retDate = $date->format('d-m-Y'); - $Details['ReqDate']= $retDate; - $ScheduleType = $Reqresult->result()[0]->Schedule_Type; - if($ScheduleType!='Recurring'){ - $Details['Frequency']= $Reqresult->result()[0]->Schedule_Type; - - } - else{ - $Details['Frequency']= $Reqresult->result()[0]->Service_Period.' - '.$Reqresult->result()[0]->NumberOfService; - } - - $ResultArray[]=$Details; - } - - } - - $RequistionDetails = $ResultArray; - return $RequistionDetails; - } - function GetLineItemReceivedQty($ParentPO,$MaterialCode) - { - $this->db->select('ReceivedQuantity'); - $this->db->from('T_PurchaseOrder_LineItem'); - - $this->db->where('PONO',$ParentPO); - $this->db->where('MaterialCode',$MaterialCode); - $result=$this->db->get(); - - return $result->result_array(); - } - - //get paymentTerms details - - function getPaymentTermsDetails($Payment_ID='') - { - - - $getpaymentQuery='select distinct PaymentID,PaymentTerms,Details from T_PaymentTerms'; - $paymentQuery=$this->db->query($getpaymentQuery); - - return $paymentQuery->result(); - - } - /** - * This function is used to get status in status table - - */ - function getStatus($StatusType = '') - { - $this->db->select('StatusCode,StatusName '); - $this->db->from('T_Status'); - $this->db->where('StatusType', $StatusType); - $query = $this->db->get(); - - return $query->result(); - } - - - function edit_mrir($MrirNo) - { - $this->db->distinct(); - $this->db->select('TMM.MRIRNO,TMM.PONO,TMM.IGRNO,TMM.Createdon,TMD.ActualQuantityReceived,IGRM.DeliveryChellanOrInvoiceNo,IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,IGRM.CreatedDate,IGRD.QuantityAsPerInvoice,SUPP.SupplierName,SUPP.Address,POMR.PODate,POMR.DeliveryDate,POMR.ServiceDescription,TMD.MaterialCode,MM.MaterialName,MM.UOM,POLT.Quantity,POLT.ReceivedQuantity,ED.FirstName as PORasiedbyName,ED1.FirstName as MRIRRasiedbyName, ED2.FirstName as IGRRasiedbyName,TMM.MRIRStatus,TMM.Createdon as MRIRCreatedon,POLT.CostCenterCode,CostCenterName,QuantityAccepted,QuantityRejected,TMD.Remarks'); - $this->db->from ('T_MRIR_Master TMM'); - $this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO = TMD.MRIRNO','left');//to get IGRNO,PONO,MRIRNO,mrirdate, - $this->db->join ('T_IGR_Master IGRM', 'IGRM.IGRNO = TMM.IGRNO','left');//to get actualquantity,deliverydate,Invoicedate,vechileno,courierno,igrdate, - $this->db->join ('T_PurchaseOrder_Master POMR ','IGRM.PONO = POMR.PONO','left');//to get podate,deliverydate,servicedescription - $this->db->join ('T_PurchaseOrder_LineItem POLT','IGRM.PONO=POLT.PONO','left');//to get receivedquantity,quantity - - $this->db->join ('T_IGR_Details IGRD','IGRD.IGRNO = IGRM.IGRNO','left');//to get invoicequantity - $this->db->join ('T_MaterialMaster MM','IGRD.MaterialCode = MM.MaterialCode','left'); - $this->db->join ('T_SupplierDetailsN SUPP','POMR.SupplierID = SUPP.SupplierID','left');//to get suppliername,supplieraddress - $this->db->join ('tbl_users user','user.userid = POMR.CreatedBy','left');//to get poraisedby - $this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID','left'); - $this->db->join ('tbl_users user1','user1.userid=TMM.CreatedBy','left');//to get mrirraisedby - $this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID','left'); - $this->db->join ('tbl_users user2','user2.userid=IGRM.CreatedBy','left');//to get igrraisedby - $this->db->join ('T_Employee_Details ED2','ED2.EmpID = user2.EmpID','left'); - $this->db->join('T_CostCenter_Master TCOST','POLT.CostCenterCode=TCOST.CostCenterCode'); - $this->db->where('TMM.MRIRNO',$MrirNo); - $this->db->group_by('TMM.MRIRNO,TMD.MaterialCode'); - $query = $this->db->get(); - $result = $query->result(); - //print_r( $this->db->last_query()); - return $result; - - } - - - - - - function getadvancePONO($Status='') - { - $this->db->select ('Mast.PONO,POType,Mast.CreatedDate,Mast.ReleasedOn,Mast.TotalOrderValue,Mast.SupplierID,DeliveryDate,DeliverySchedule,DeliveryOption,Mast.PaymentTerms as Paycode,Payterm.PaymentTerms,LineItem.ReqNo,Requestedby,Departmentcode,DepartmentName,LineItem.CostCenterCode,SupDet.SupplierName,Import_DispatchDetails,CurrencyType,AdvancePercentage,AdvanceAmount,POAdv.Remarks'); - $this->db->from('T_PurchaseOrder_Master Mast'); - $this->db->join('T_PurchaseOrder_LineItem LineItem','Mast.PONO=LineItem.PONO'); - $this->db->join('T_Requestion_Master ReqMa','LineItem.ReqNo=ReqMa.ReqNo'); - $this->db->join('T_Employee_Details EmpDet','ReqMa.Requestedby=EmpDet.EmpID'); - $this->db->join('T_DepartmentDetails DepDet','EmpDet.Departmentcode=DepDet.DEPCode'); - $this->db->join('T_SupplierDetailsN SupDet','Mast.SupplierID=SupDet.SupplierID'); - $this->db->join('T_PurchaseOrder_AdvanceRequest POAdv','Mast.PONO=POAdv.PONO','left'); - $this->db->join('T_PaymentTerms Payterm','Mast.PaymentTerms=Payterm.PaymentID'); - $this->db->where('Mast.Status',$Status); - $query = $this->db->get(); - //print_r($this->db->last_query()); - return $query->result(); - - } - //get available budget for capital - function GetAvailableCapitalBudgetAmount($CostCode,$Year,$BudgetType) - { - - $subQuery ='select BudgetAmount, (select ifnull(sum(IF(POMaster.ExchangeRate>0,Quantity*Rate*POMaster.ExchangeRate,Quantity*Rate)),0) as Totalvalue from - T_PurchaseOrder_LineItem Item join T_Requestion_Master mast - on mast.ReqNo = Item.ReqNo join T_PurchaseOrder_Master POMaster on POMaster.PONO=Item.PONO where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue - from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and - BudgetYear = ? and BudgetType =?'; - - $query = $this->db->query($subQuery,array($CostCode,$BudgetType,$CostCode,$Year,$BudgetType)); - - return $query->result_array(); - - } -} diff --git a/application/models/requistion_model.php~ b/application/models/requistion_model.php~ deleted file mode 100644 index eb896e9c..00000000 --- a/application/models/requistion_model.php~ +++ /dev/null @@ -1,500 +0,0 @@ -db->select('SupplierID, SupplierName,ADeleteRequistionLineItemddress'); - $this->db->from('T_SupplierDetailsN'); - //$this->db->where('roleId !=', 1); - $query = $this->db->get(); - - return $query->result(); - } - /** - * This function is used to get the userId information - * @return array $result : This is result of the query - */ - function getusers() - { - $this->db->select('userId, name'); - $this->db->from('tbl_users'); - //$this->db->where('roleId !=', 1); - $query = $this->db->get(); - - return $query->result(); - } - /* This function is used to getEditRequistItemList view the information - * @return array $result : This is result of the query - */ - function getEditRequistItemList($ReqNo) - { - - /* $result = $this->db-> query("CALL P_GET_REQUISTITEMLIST('".$ReqNo."')") or die(mysql_error()); - - - //echo 'REQUISTITEMLIST Line item view successfully'; - - - - $result ->next_result(); - - if($result->num_rows > 0) - { - - return $result->result(); - } - - */ - $subQuery ='select distinct Req.ReqNo, Mat.MaterialCode,Mat.MaterialName,Mat.UOM, Req.Quantity,if (Po.Quantity is null,0,Po.Quantity) as POQTY,sta.StatusName from T_MaterialMaster Mat join T_Requestion_Details Req on Req.MaterialCode = Mat.MaterialCode - left join T_PurchaseOrder_LineItem Po on Po.ReqNo = Req.ReqNo and Po.MaterialCode = Req.MaterialCode - left join T_Status sta on sta.StatusCode = Req.Status - where Req.ReqNo = ?'; - - $query = $this->db->query($subQuery, array($ReqNo)); - - // print_r($this->db->last_query()); - return $query->result(); - - } - - /** - * This function is used to get the userId information - * @return array $result : This is result of the query - */ - function getStatus() - { - $this->db->select('StatusCode,StatusName '); - $this->db->from('T_Status'); - $this->db->where('StatusType', REQUISTSTATUS); - $this->db->where('StatusCode !=', REQ_DRAFT); - $query = $this->db->get(); - - return $query->result(); - } - /* This function is used to get the Raw Material information - * @return array $result : This is result of the query - */ - function getRequistionList($ReqNo,$IsArray='') - { - - $result = $this->db-> query("CALL P_GET_AllREQUISTION('".$ReqNo."')") or die(mysql_error()); - - { - //echo 'PO Line item Inserted successfully'; - if($IsArray != '') - { - - return $result->result_array(); - } - else - { - return $result->result(); - } - } - - - } - - /** - * This function is used to get Employee details based on Employee ID Selection - * @return array $result : This is result of the query - */ - function GetEmployeeDetails($EmpID) - { - - $this->db->select(' EMP.EmpID,EMP.Designation,DEPT.DEPCode,DEPT.DepartmentName'); - $this->db->from('T_Employee_Details EMP'); - $this->db->join('T_DepartmentDetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode'); - $this->db->where('EMP.EmpID ',$EmpID ); - $query = $this->db->get(); - - return $query->result_array(); - } - - /** - * This function is used to get the Cost Center details for the Login user department - * @return array $result : This is result of the query - */ - function GetCostCenterByDept($DeptId) - { - - $this->db->select('Mast.CostCenterCode,Mast.CostCenterName'); - $this->db->from('T_CostCenter_Master Mast '); - $this->db->join('T_CostCenter_Departments COST', 'COST.CostCenterCode = Mast.CostCenterCode'); - $this->db->where('COST.DEPCode ',$DeptId ); - $query = $this->db->get(); - // print_r( $this->db->last_query()); - return $query->result_array(); - } - /** - * This function is used to get the Available BudgetAmount for the Cost center - * @return array $result : This is result of the query - */ - function GetAvailableBudgetAmount($CostCode,$Year,$BudgetType) - { - $this->db->select('BudgetAmount'); - $this->db->from('T_CostCenter_Budget'); - $this->db->where('CostCenterCode',$CostCode ); - $this->db->where('BudgetYear',$Year ); - $this->db->where('BudgetType',$BudgetType ); - $query = $this->db->get(); - - return $query->result_array(); - } - - function EditMaterialCode($ReqNo,$ReqType) - { - $subQuery ='SELECT Mat.MaterialCode,Mat.MaterialName,Mat.UOM - from T_MaterialMaster Mat where Mat.MaterialCode not in (select Req.MaterialCode from T_Requestion_Details Req - join T_Requestion_Master mast on Req.ReqNo = mast.ReqNo where mast.ReqNo=? and mast.ReqType=? - ) and Mat.MaterialType=?'; - - $query = $this->db->query($subQuery, array($ReqNo,$ReqType,$ReqType)); - - - return $query->result(); - - } - - - /** - * This function is used to get the Material details for the Request type - * @return array $result : This is result of the query - */ - function GetMaterialCode($ReqType,$NotArray='') - { - $this->db->select('MaterialCode, MaterialName,UOM'); - $this->db->from('T_MaterialMaster'); - $this->db->where('MaterialType',$ReqType ); - - $query = $this->db->get(); - if($NotArray == '') - { - return $query->result_array(); - } - else - { - return $query->result(); - } - } - /** - * This function is used to get the Raw Material information - * @return array $result : This is result of the query - */ - function getRawMaterialList($MaterialCode) - { - $this->db->select('MaterialName,UOM'); - $this->db->from('T_MaterialMaster'); - $this->db->where('MaterialCode',$MaterialCode ); - $query = $this->db->get(); - - return $query->result_array(); - } - - /** - * This function is used to get the Config value from configuration table - * @return array $result : This is result of the query - */ - function getConfigValue($ConfigID ,$ConfigValue = '') - { - - $this->db->select('ConfigValue'); - $this->db->from('T_ConfigDetails'); - $this->db->where('Config_id ',$ConfigID ); - if($ConfigValue != '') - { - $this->db->where('ConfigValue != ',$ConfigValue ); - } - $query = $this->db->get(); - - return $query->result(); - } - - - /** - * This function is used to get the All employees - * @return array $result : This is result of the query - */ - function getAllEmployees() - { - $this->db->select('EmpID,FirstName,LastName'); - $this->db->from('T_Employee_Details'); - $query = $this->db->get(); - - return $query->result(); - } - - /** - * This function is used to get the Employee Details - * @return array $result : This is result of the query - */ - function getEmpIdByUserID($UserID) - { - $subQuery ='SELECT EMP.EmpID,EMP.FirstName,EMP.Designation,DEPT.DEPCode,DEPT.DepartmentName - FROM T_Employee_Details EMP JOIN T_DepartmentDetails DEPT ON - EMP.Departmentcode = DEPT.DEPCode - WHERE EMP.EmpID=(select EmpID from tbl_users where userId=?)'; - - $query = $this->db->query($subQuery, array($UserID)); - - - return $query->result(); - } - - /** - * This function is used to get the CostCenter for the Selected Employee - * @return array $result : This is result of the query - */ - function getCostCenterUserID($UserID) - { - $subQuery ='SELECT Mast.CostCenterCode,Mast.CostCenterName from T_CostCenter_Master Mast - LEFT JOIN T_CostCenter_Departments COST ON COST.CostCenterCode = Mast.CostCenterCode - WHERE COST.DEPCode=(select Departmentcode from T_Employee_Details where EmpID = (select EmpID from tbl_users where userId=?))'; - - $query = $this->db->query($subQuery, array($UserID)); - //print_r($this->db->last_query()); - return $query->result(); - } - - /** - * This function is used to get the Purchase order Type - * @return array $result : This is result of the query - */ - function CheckDraftStatus($UserID) - { - - $subQuery = 'select count(ReqNo) as cnt,ReqNo from T_Requestion_Master where - Requestedby= ( select EmpID from tbl_users where userId=?) and status=?'; - - $query = $this->db->query($subQuery, array($UserID,REQ_DRAFT)); - - return $query->result(); - } - /** - * This function is used to get the Requsition List for the login user - * @return array $result : This is result of the query - */ - function getRequistDetails($ReqID,$NoArray='') - { - - $subQuery = 'select distinct ReqNo,ReqType,Status,Requestedby,DATE_FORMAT(mast.CreatedDate, "%d-%m-%Y") as CreatedDate,Schedule_Type,NumberOfService,Service_Period ,emp.FirstName,emp.EmpID,emp.Designation, Dept.DEPCode,Dept.DepartmentName,DATE_FORMAT(mast.ReqDate, "%d-%m-%Y") as ReqDate,CostCenterCode - from T_Requestion_Master mast - join T_Employee_Details emp on mast.Requestedby = emp.EmpID - join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode - where ReqNo=?'; - - $query = $this->db->query($subQuery, array($ReqID)); - if($NoArray == '') - { - return $query->result_array(); - } - else - { - return $query->result(); - } - } - /** - * This function is used to get the Requsition List for the login user - * @return array $result : This is result of the query - */ - function getRequistListUserID($UserID) - { - - $subQuery = 'select ReqNo, ReqType ,Status,CreatedDate ,StatusName from T_Requestion_Master mast - join T_Status st on st.StatusCode= mast.Status where - Requestedby = ( select EmpID from tbl_users where userId=?) and Status != ? '; - - $query = $this->db->query($subQuery, array($UserID,REQ_DELETED)); - - return $query->result(); - } - /** - * This function is used to get the Requsition List for the login user - * @return array $result : This is result of the query - */ - function getRequistItemList($ReqID,$NoArray='') - { - - $subQuery = 'select distinct Req.ReqNo, Mat.MaterialCode,Mat.MaterialName,Mat.UOM, Req.Quantity,sum(Po.Quantity) as POQTY,sta.StatusName from T_MaterialMaster Mat - left join T_Requestion_Details Req on Req.MaterialCode = Mat.MaterialCode - left join T_PurchaseOrder_LineItem Po on Po.ReqNo = Req.ReqNo and Po.MaterialCode = Req.MaterialCode - left join T_Status sta on sta.StatusCode = Req.Status where Req.ReqNo=? group by Po.ReqNo,Req.MaterialCode'; - - - $query = $this->db->query($subQuery, array($ReqID)); - if($NoArray == '') - { - return $query->result_array(); - } - else - { - return $query->result(); - } - } - - /** - * This function is used to add the Requistion into the Database - * @return array $result : This is result of the query - */ - function addRequistion($Requistion) - { - $this->db->trans_start(); - $this->db->insert('T_Requestion_Master', $Requistion); - $insert_id = $this->db->affected_rows(); - $this->db->trans_complete(); - if($insert_id>0) - { - $subQuery = 'select max(ReqNo) as ReqNo from T_Requestion_Master'; - - $query = $this->db->query($subQuery); - - return $query->result_array(); - } - - } - /** - * This function is used to check the Request is in Draft status - * @return array $result : This is result of the query - */ - function RequistionIsExists($ReqBy) - { - $this->db->select('ReqNo'); - $this->db->from('T_Requestion_Master'); - $this->db->where('Status ',REQ_DRAFT ); - $this->db->where('Requestedby ',$ReqBy ); - $query = $this->db->get(); - - if ($query->num_rows > 0) { - //echo $result->num_rows; - return $query->result_array(); - } - } - /** - * This function is used to check the Request Line Item is in Draft status - * @return array $result : This is result of the query - */ - function LineItemIsExists($ReqNo,$MaterialCode) - { - $this->db->select('ReqNo'); - $this->db->from('T_Requestion_Details'); - $this->db->where('ReqNo ',$ReqNo ); - $this->db->where('MaterialCode ',$MaterialCode ); - $query = $this->db->get(); - - if ($query->num_rows > 0) { - //echo $result->num_rows; - return $query->result_array(); - } - } - /** - * This function is used to add the Line item details to the Database - * @return array $result : This is result of the query - */ - function addRequistionDetails($Requistion) - { - $this->db->trans_start(); - $this->db->insert('T_Requestion_Details', $Requistion); - $insert_id = $this->db->affected_rows(); - $this->db->trans_complete(); - // print_r($this->db->last_query()); - return $insert_id; - - } - /** - * This function is used to delete the Line item from details into Database - * @return array $result : This is result of the query - */ - function DeleteRequistionLineItem( $ReqNo,$MaterialCode) - { - $this->db->where('ReqNo', $ReqNo); - $this->db->where('MaterialCode', $MaterialCode); - $this->db->delete('T_Requestion_Details'); - - return TRUE; - } - - /** - * This function is used to update the details into Database - * @return array $result : This is result of the query - */ - function UpdateRequistionLineItem($Requist, $ReqNo,$MaterialCode) - { - $this->db->where('ReqNo', $ReqNo); - $this->db->where('MaterialCode', $MaterialCode); - $this->db->update('T_Requestion_Details',$Requist); - - return TRUE; - } - - /** - * This function is used to update the details into Database - * @return array $result : This is result of the query - */ - function UpdateRequistion($Requistion, $ReqNo) - { - $this->db->where('ReqNo', $ReqNo); - $this->db->update('T_Requestion_Master', $Requistion); - - return TRUE; - } - - - - /** - * This function is used to get the List of Requist details to the approver - * @return array $result : This is result of the query - */ - function getApproverRequistList($UserID,$Status = '',$FromDate='' ,$ToDate='') - { - // echo 'UserId: '.$UserID . 'From: '.$FromDate .'TO: '. $ToDate. 'Status: '. $Status; - - $subQuery = 'select distinct ReqNo,Status,mast.CreatedDate,Requestedby,emp.FirstName,mast.Comments,st.StatusName - from T_Requestion_Master mast join T_Employee_Details emp on mast.Requestedby = emp.EmpID - join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode - join T_Status st on st.StatusCode = mast.Status - where status not in(?,?,?) and emp.Departmentcode in (select DEPCode from T_DepartmentDetails where HeadDept= - (select HeadDept from T_DepartmentDetails where DEPCode = (select Departmentcode from T_Employee_Details where - EmpID=(select EmpID from tbl_users where userId=?))))'; - $subQuery1 = $subQuery; - $query =''; - - if($FromDate != '' && $ToDate != '' && $Status !='' ) - { - - $Where = 'and mast.CreatedDate >= ? and mast.CreatedDate <= ? and Status=?'; - $subQuery1 .= $Where; - $query = $this->db->query($subQuery1, array(REQ_DRAFT,REQ_DELETED,REQ_REJECTED,$UserID,$FromDate,$ToDate,$Status)); - } - else if($FromDate != '' && $ToDate != '' && $Status =='') - { - $Where = 'and mast.CreatedDate >= ? and mast.CreatedDate <= ? '; - $subQuery1 .= $Where; - $query = $this->db->query($subQuery1, array(REQ_DRAFT,REQ_DELETED,REQ_REJECTED,$UserID,$FromDate,$ToDate)); - } - else if($Status != '' && $FromDate == '' && $ToDate == '') - { - $Where = 'and Status = ?'; - $subQuery1 .= $Where; - $query = $this->db->query($subQuery1, array(REQ_DRAFT,REQ_DELETED,REQ_REJECTED,$UserID,$Status)); - } - - else - { - $query = $this->db->query($subQuery, array(REQ_DRAFT,REQ_DELETED,REQ_REJECTED,$UserID)); - } - - //print_r($this->db->last_query()); - return $query->result(); - } - - - -} - - \ No newline at end of file diff --git a/application/views/Editmaterialinspectionreport.php~ b/application/views/Editmaterialinspectionreport.php~ deleted file mode 100644 index c32229d9..00000000 --- a/application/views/Editmaterialinspectionreport.php~ +++ /dev/null @@ -1,507 +0,0 @@ -MRIRNO; - $MRIRDate=$MRIR->MRIRCreatedon; - $mrir_date = strtotime( $MRIRDate ); - $mrirdate = date( 'd/m/Y', $mrir_date ); - $MRIRRasiedbyName=$MRIR->MRIRRasiedbyName; - $IGRNO = $MRIR->IGRNO; - $IGRDate = $MRIR->IGRCreated; - $igr_date = strtotime( $IGRDate ); - $igrdate = date( 'd/m/Y', $igr_date ); - $IGRRasiedbyName=$MRIR->IGRRasiedbyName; - $PONO = $MRIR->PONO; - $PODate=$MRIR->PODate; - $PORasiedbyName=$MRIR->PORasiedbyName; - $po_date = strtotime( $PODate ); - $podate = date( 'd/m/Y', $po_date ); - $VehicleNo = $MRIR->VehicleNo; - $CourierNo= $MRIR->CourierNo; - $DeliveryChellanOrInvoiceNo=$MRIR->DeliveryChellanOrInvoiceNo; - $SupplierName=$MRIR->SupplierName; - $DeliveryChellanDate=$MRIR->DeliveryChellanDate; - $dc_date = strtotime( $DeliveryChellanDate ); - $dcdate = date( 'd/m/Y', $dc_date ); - $Address=$MRIR->Address; - //$CreatedBy=$MRIR->CreatedBy; - $ServiceDescription=$MRIR->ServiceDescription; - $MRIRStatus = $MRIR->MRIRStatus; - } -} - ?> - - - - -
- -
-

-
Siddharth Industries - Edit Material Receipt And Inspection Report (MRIR) -
-

- - 'form-label-left MRIR ','name' => 'MRIR','id' => 'MRIR'); - echo form_open($this->config->base_url().'/MRIRcontroller/generateMRIR/',$attributes); ?> -
-

-
-
- -
- - -
- -
- 'SupplierName','value' => set_value('SupplierName',$SupplierName),'id'=>'SupplierName', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
-
- -
- 'MRIRDate','value' => set_value('MRIRDate',$mrirdate),'id'=>'MRIRDate', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
-
- -
- 'MRIRRaisedby','value' => set_value('MRIRRaisedby',$MRIRRasiedbyName),'id'=>'MRIRDate', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
-
- -
- 'IGRNO','value' => set_value('IGRNO',$IGRNO),'id'=>'IGRNO', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
-
- -
- 'IGRDate','value' => set_value('IGRDate',$igrdate),'id'=>'IGRDate', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
- -
- -
- 'IGRRaisedBy','value' => set_value('IGRRaisedBy',$IGRRasiedbyName),'id'=>'IGRRaisedBy', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
-
- -
-
- -
- 'PONO','value' => set_value('PONO',$PONO),'id'=>'PONO', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'PODate','value' => set_value('PODate',$podate),'id'=>'PODate', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'PORasiedbyName','value' => set_value('PORasiedbyName',$PORasiedbyName),'id'=>'PORasiedbyName', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'DeliveryChellanOrInvoiceNo','value' => set_value('DeliveryChellanOrInvoiceNo',$DeliveryChellanOrInvoiceNo),'id'=>'DeliveryChellanOrInvoiceNo', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'DeliveryChellanDate','value' => set_value('DeliveryChellanDate',$dcdate),'id'=>'DeliveryChellanDate', 'class' => 'form-control num','readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'VehicleNo','value' => set_value('VehicleNo',$VehicleNo),'id'=>'VehicleNo', 'class' => 'form-control', 'readonly' => 'true','align' => 'left'); - echo form_input($data); - ?> -
-
-
- -
- 'CourierNo','value' => set_value('CourierNo',$CourierNo),'id'=>'CourierNo', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
S.NOItem CodeMaterial NameUOMOrdered QuantityAdviced QuantityActual Quantity ReceivedAccepted QuantityRejected QuantityRemarks
MaterialCode?>MaterialName?>UOM?>Quantity?>QuantityAsPerInvoice?>ActualQuantityReceived ?>
-
- - Update MRIR - - OK - - - - -
-
- -
-
- -
-
- - - \ No newline at end of file diff --git a/application/views/EditservicePurchaseorder.php~ b/application/views/EditservicePurchaseorder.php~ deleted file mode 100644 index 8a5448fa..00000000 --- a/application/views/EditservicePurchaseorder.php~ +++ /dev/null @@ -1,2803 +0,0 @@ -FontCode2000; - - } -} - -if(!empty($MaxPODate)) -{ - foreach ($MaxPODate as $date) - { - $MaxPoDate = $date->PODate; - - } -} -if(!empty($POMaster)) -{ - foreach ($POMaster as $Req) - { - - $SupId = $Req->SupplierID; - $SupName = $Req->SupplierName; - $Address = $Req->Address; - $pdt = new DateTime($Req->PODate); - $PODate = $pdt->format('Y-m-d'); - $DeliverOption = $Req->DeliveryOption; - $DeliverSchedule = $Req->DeliverySchedule; - $Ddt = new DateTime($Req->DeliveryDate); - $Deliverydt = $Ddt->format('Y-m-d'); - - $DeliveryAddress =$Req->DeliveryAddress; - $PONOStatus = $Req->StatusCode; - $PONO = $Req->PONO; - $ServiceDescription = $Req->ServiceDescription; - - - $WrkStatus=$Req->ServiceWorkStatus; - $StatusName=$Req->StatusName; - } -} - - -if(!empty($RequistionDetails)) -{ - - foreach ($RequistionDetails as $ReqDet) - { - // $Reqon=$ReqDet->ReqDate; - $Reqonn=new DateTime($ReqDet->ReqDate); - $Reqon=$Reqonn->format('Y-m-d'); - $Requestedby=$ReqDet->Requestedby; - $RequesterName=$ReqDet->FirstName; - //$Status=$ReqDet->Status; - } -} - -//echo "$WrkStatus"; - -if(!empty($AvlBudAmt)) -{ - - $AvlAmount = number_format($AvlBudAmt, 2, '.', ''); - -} - - -foreach ($PaymentTerms as $TER) -{ - $Terms=$TER->PaymentTerms; -} - - - -// foreach ($POSTATUS as $PST ) -// { -// $POStatus=$PST->StatusName; -// } -?> - - - - - - - - - - -
- 'form-label-left ServicePO ','name' => 'ServicePO','id' => 'ServicePO'); - - echo form_open($this->config->base_url().'/purchaseorder/addPO/',$attributes); ?> - -
-
-
-
-

Siddharth Industries - Edit Service Purchase Order -

-
-
-
-
-
- - - - 'Selected Requisition Numbers'); - if(!empty($ReqList)) - { - foreach ($ReqList as $SID): - - $options[$SID->ReqNo] = $SID->ReqNo ; - endforeach; - } - echo form_multiselect('RequistionNo', $options,set_value('RequistionNo'),'id="RequistionNo"' , 'required="true"'); - - ?> -
-
- -
- 'PODate','value' => set_value('PODate',$PODate),'id'=>'PODate', 'class' => 'form-control num' ,'required' => 'true','onkeypress'=>'return false;'); - echo form_input($data); - ?> -
-
- -
-
-
-
- - 'Select Supplier'); - //print_r( $options); - - if(!empty($Suplist)) - { - foreach ($Suplist as $SID): - - - $options[$SID->SupplierID] = $SID->SupplierID.' '.' - '.' '.$SID->SupplierName; - - endforeach; - } - - echo form_dropdown('drpSupplier', $options,set_value('drpSupplier',$SupId ),'id="drpSupplier"' ,'required="true"' ,'class="form-control select2'); - - ?> - -
-

- -
- 'SupAddress','value' => set_value('SupAddress',$Address),'id'=>'SupAddress', 'class' => 'form-control' ,'readonly' => 'true','rows' => '3', 'cols' => '40'); - echo Form_textarea($data); - ?> -
-
-
-
-
- -
- - 'POType','value' => set_value('POType',SERVICE),'id'=>'POType', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'DeliveryAddr','value' => set_value('DeliveryAddr',$DeliveryAddress),'id'=>'DeliveryAddr', 'class' => 'form-control' ,'required' => 'true', 'rows' => '3', 'cols' => '40'); - echo Form_textarea($data); - ?> - -
-
-
-
-
- Select Delivery By
- - - 'DateRange', 'value' => '0', 'checked' => ('0' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Date')); ?> - - - - 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?> - - - -
-
- - StatusCode){ - $optionsWork[$WorkSID->StatusCode] = $WorkSID->StatusName; - } - - - endforeach; - foreach ($WorkStatus as $SID): - if($WrkStatus!=$SID->StatusCode){ - $optionsWork[$SID->StatusCode] = $SID->StatusName; - } - - - endforeach; - } - - echo form_dropdown('workstatus', $optionsWork,set_value('workstatus'),'id="workstatus"' ,'required="true"' ,'class="form-control select2'); - - ?> -
-

- -
- 'Deliverydt','value' => set_value('Deliverydt',$Deliverydt),'id'=>'Deliverydt', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;'); - echo form_input($data); - ?> -
-
- -
- -
-
- Payment Details - -
- - - PaymentID){ - - $optionsPay[$pay2->PaymentID] = $pay2->PaymentTerms; - - } - endforeach; - foreach ($Payment as $pay1): - - if($Terms!=$pay1->PaymentID){ - - $optionsPay[$pay1->PaymentID] = $pay1->PaymentTerms; - - } - endforeach; - } - - echo form_dropdown('PaymentTerms', $optionsPay,set_value('PaymentTerms'),'id="PaymentTerms"' ,'required="true"' ,'class="form-control select2'); - - ?> - - - - -
- -
-
-
-
-
-
- - - - - - - -
-
- - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - Schedule_Type!='Recurring'){ - $FrequencyNo=intval(1); - $Frequency='One Time'; - } - else{ - $FrequencyNo=$record->NumberOfService; - $Frequency=$record->Service_Period; - } - - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - After_CGST; - $TotalSgst = $TotalSgst + $record->After_SGST; - $TotalIgst = $TotalIgst + $record->After_IGST; - $OtherAmt = $OtherAmt + $record->otherallowance; - $TotalSummary = $TotalSummary + $record->TotalValue; - - - $TotalBasicAmount = $TotalBasicAmount + $record->BasicValue; - - } - ?> - - -
SNoRequisition NoItem CodeItem DescriptionQuantityUOMRateBasic AmountTax AmountTotal Order AmountActual QuantityReceived QuantityPending QuantityAction
ReqNo ?>MaterialCode ?>ServiceMaterialDescription ?>Quantity ?>UOM ?>Rate ?>BasicValue * $FrequencyNo, 2, '.', ''); ?>Taxamount ?>TotalValue ?>Quantity ?>ReceivedQuantity ?>Quantity - $record->ReceivedQuantity, 2, '.', ''); ?>     - -    
-
- - -
-
- -
- - 'txtTotBasicAmount','value' => set_value('txtTotBasicAmount',number_format($TotalBasicAmount, 2, '.', '')),'id'=>'txtTotBasicAmount', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
- - 'txtTotCgst','value' => set_value('txtTotCgst',number_format($TotalCgst, 2, '.', '')),'id'=>'txtTotCgst', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
- - -
- - 'txtTotSgst','value' => set_value('txtTotSgst',number_format($TotalSgst, 2, '.', '')),'id'=>'txtTotSgst', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
- - 'txtTotIgst','value' => set_value('txtTotIgst',number_format($TotalIgst, 2, '.', '')),'id'=>'txtTotIgst', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
- -
- - 'ToatalOtherAllowances','value' => set_value('ToatalOtherAllowances',number_format($OtherAmt, 2, '.', '')),'id'=>'ToatalOtherAllowances', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
- - 'txtTotalOrderValueSummary','value' => set_value('txtTotalOrderValueSummary',number_format($TotalSummary, 2, '.', '')),'id'=>'txtTotalOrderValueSummary', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
- -
- - -
-
- 'ScopeofWork','value' => set_value('ScopeofWork',$ServiceDescription),'id'=>'ScopeofWork', 'class' => 'form-control', 'rows' => '10', 'cols' => '40' ); - echo form_textarea($data); - ?> -
- -
-
-

-
- - - - -   Save -   Submit - - -   OK -

-
-
-
-

-
-
- Request On - 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;'); - echo form_input($data); - ?> -
-
- Request By - 'RequestBy','value' => set_value('RequestBy',$RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true'); - echo form_input($data); - ?> -
-
- Status - 'Select Status'); - // echo form_dropdown('Status', $options,set_value('Status'),'id="Status"' ,'required="true"' ,'class="form-control select2') - // $options = array("0"=>$PONOStatus); - // echo form_dropdown('Status', $options,set_value('Status',$StatusName),'id="Status"' ,'required="true"' ,'class="form-control select2') - - - $data = array('name' => 'Status','value' => set_value('Status',$StatusName),'id'=>'Status', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
-
- -
-
- - - - - \ No newline at end of file diff --git a/application/views/addCostCenter.php b/application/views/addCostCenter.php index e521cfce..57b94a50 100644 --- a/application/views/addCostCenter.php +++ b/application/views/addCostCenter.php @@ -70,7 +70,7 @@ $(function() {

-
Siddharth Industries - Add Cost List
+
Resico Industries - Add Cost List

diff --git a/application/views/addasset.php b/application/views/addasset.php index 58f2363a..1c250a02 100644 --- a/application/views/addasset.php +++ b/application/views/addasset.php @@ -51,7 +51,7 @@ $(function() {

-
Siddharth Industries - Add Asset Details
+
Resico Industries - Add Asset Details

diff --git a/application/views/addcost.php b/application/views/addcost.php deleted file mode 100644 index c7029a7c..00000000 --- a/application/views/addcost.php +++ /dev/null @@ -1,99 +0,0 @@ -
- -
-

-
Cost List
- -

- -
- -
-
- Back -
-
- -
- -
- - - - -
-
-

Add Cost Details

-
- - -
-
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
- load->helper('form'); - $error = $this->session->flashdata('error'); - if($error) - { - ?> -
- - session->flashdata('error'); ?> -
- - session->flashdata('success'); - if($success) - { - ?> -
- - session->flashdata('success'); ?> -
- - -
-
- ', '
'); ?> -
-
-
-
-
- - - \ No newline at end of file diff --git a/application/views/assetListing.php b/application/views/assetListing.php index f048700f..e9227e83 100644 --- a/application/views/assetListing.php +++ b/application/views/assetListing.php @@ -4,7 +4,7 @@
-

Siddharth Industries - Asset Details

+

Resicos Industries - Asset Details

diff --git a/application/views/costListing.php b/application/views/costListing.php index 21fc3090..14dd7a1c 100644 --- a/application/views/costListing.php +++ b/application/views/costListing.php @@ -4,7 +4,7 @@
-

Siddharth Industries - Cost Details

+

Resico Industries - Cost Details

diff --git a/application/views/editOldcost.php b/application/views/editCostCenter.php similarity index 99% rename from application/views/editOldcost.php rename to application/views/editCostCenter.php index 7048f2a6..a419ca82 100644 --- a/application/views/editOldcost.php +++ b/application/views/editCostCenter.php @@ -172,7 +172,7 @@ $( document ).ready(function() {

-
Siddharth Industries - Edit Cost Center
+
Resico Industries - Edit Cost Center

diff --git a/application/views/editOldRawmaterial.php b/application/views/editRawmaterial.php similarity index 100% rename from application/views/editOldRawmaterial.php rename to application/views/editRawmaterial.php diff --git a/application/views/editRevenuepurchaseorder.php~ b/application/views/editRevenuepurchaseorder.php~ deleted file mode 100644 index 718c9be5..00000000 --- a/application/views/editRevenuepurchaseorder.php~ +++ /dev/null @@ -1,4571 +0,0 @@ -format('Y-m-d'); -$MaxPoDate = ''; -$AvlAmount = 0; -$DeliverSchedule=''; -$DeliverOption=''; -$StatusName=''; - -if(!empty($MaxPODate)) -{ - foreach ($MaxPODate as $date) - { - $MaxPoDate = $date->PODate; - } -} -if(!empty($CompanyDetails)) -{ - foreach ($CompanyDetails as $Req) - { - $CompanyAddress = $Req->Address; - } -} -if(!empty($AvlBudAmt)) -{ - - $AvlAmount = number_format($AvlBudAmt, 2, '.', ''); - -} - -if(!empty($INRSYMBOL)) -{ - - foreach($INRSYMBOL as $INRS) - { - $INRSYM=$INRS->FontCode2000; - - } -} - -foreach ($PaymentTerms as $TER) -{ - $Terms=$TER->PaymentTerms; -} - - $SupId = ''; - $SupName = ''; - $Address = ''; - $PODate = ''; - $Deliverydt =''; - $DeliveryAddress =''; - $PONOStatus = ''; - $PONO = ''; - $totBasicAmt = 0; - $totDiscountAmt = 0.0; - $totPackagingAmt = 0.0; - $totCgst = 0.0; - $totSgst = 0.0; - $totIgst = 0.0; - $totFreightAmt = 0.0; - $totInsuranceAmt = 0.0; - $totOrderSummaryAmt = 0.0; - - $ServiceDescription = ''; - $CapitalRange = ''; - $otherPayment=''; -if(!empty($POMaster)) -{ - foreach ($POMaster as $Req) - { - $SupId = $Req->SupplierID; - $SupName = $Req->SupplierName; - $Address = $Req->Address; - - $Pdt = new DateTime($Req->PODate); - $PODate = $Pdt->format('Y-m-d'); - $DeliverOption = $Req->DeliveryOption; - $DeliverSchedule = $Req->DeliverySchedule; - - $Ddt = new DateTime($Req->DeliveryDate); - $Deliverydt = $Ddt->format('Y-m-d'); - - $DeliveryAddress =$Req->DeliveryAddress; - $PONOStatus = $Req->StatusCode; - $PONO = $Req->PONO; - $ServiceDescription = $Req->ServiceDescription; - $CapitalRange = $Req->CapitalRange; - $StatusName=$Req->StatusName; - $otherPayment = $Req->PaymentOtherDescription; - } -} - - - - -if(!empty($RequistionDetails)) -{ - - foreach ($RequistionDetails as $ReqDet) - { - $Reqonn=new DateTime($ReqDet->ReqDate); - $Reqon=$Reqonn->format('Y-m-d'); - - // $Pdt = new DateTime($Req->PODate); - // $PODate = $Pdt->format('Y-m-d'); - $Requestedby=$ReqDet->Requestedby; - $RequesterName=$ReqDet->FirstName; - //$Status=$ReqDet->Status; - } -} - - -// foreach ($POSTATUS as $PST ) -// { -// $POStatus=$PST->StatusName; -// } - -?> - - - - - - - - -
- 'form-label-left CreatePO ','name' => 'CreatePO','id' => 'CreatePO'); - - echo form_open($this->config->base_url().'/purchaseorder/addPO/',$attributes); ?> - -
-
-
-
-

Siddharth Industries - Edit Revenue Purchase Order -

-
-
-
-
-
- - 'Selected Requisition Numbers'); - if(!empty($ReqList)) - { - foreach ($ReqList as $SID): - - $options[$SID->ReqNo] = $SID->ReqNo ; - //$ReqType = $SID->ReqType; - endforeach; - } - echo form_multiselect('RequistionNo', $options,set_value('RequistionNo'),'id="RequistionNo"' ,'required="true"' , 'height="400px"' ); - ?> -
-
- -
- 'PODate','value' => set_value('PODate',$PODate),'id'=>'PODate', 'class' => 'form-control num' ,'required' => 'true','onkeypress'=>'return false;'); - echo form_input($data); - ?> -
-
-
-
-
-
- - 'Select Supplier'); - //print_r( $options); - - if(!empty($Suplist)) - { - foreach ($Suplist as $SID): - - - $options[$SID->SupplierID] = $SID->SupplierID.' '.' - '.' '.$SID->SupplierName; - - endforeach; - } - - echo form_dropdown('drpSupplier', $options,set_value('drpSupplier',$SupId),'id="drpSupplier"' ,'required="true"' ,'class="form-control select2'); - - ?> -
-
- -
- - 'POType','value' => set_value('POType',REVENUE),'id'=>'POType', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
-
- Select Tax Range
- - - - 'Range', 'value' => '0', 'checked' => ('0' == $CapitalRange) ? TRUE : FALSE, 'id' => 'Local','onchange'=>'SetVatorCST();')); ?> - - - - 'Range', 'value' => '1', 'checked' => ('1' == $CapitalRange) ? TRUE : FALSE, 'id' => 'Inter_state','onchange'=>'SetVatorCST();')); ?> - - - -
- - -
-
- - Select Delivery By
- - - 'DateRange', 'value' => '0', 'checked' => ('0' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Date')); ?> - - - 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?> - - - - -
-
-
-
- -
- 'SupAddress','value' => set_value('SupAddress',$Address),'id'=>'SupAddress', 'class' => 'form-control' ,'readonly' => 'true' ,'rows' => '3', 'cols' => '40'); - echo Form_textarea($data); - ?> -
-
-
- -
- 'DeliveryAddr','value' => set_value('DeliveryAddr',$DeliveryAddress),'id'=>'DeliveryAddr', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40'); - echo Form_textarea($data); - ?> -
-
-
- -
- 'Deliverydt','value' => set_value('Deliverydt',$Deliverydt),'id'=>'Deliverydt', 'class' => 'form-control num' ,'required' => 'true','onkeypress'=>'return false;'); - echo form_input($data); - ?> - -
-
- -
-
-
- -
- Payment Details - - -
- - - PaymentID] = $pay->PaymentTerms; - - - endforeach; - } - - echo form_dropdown('PaymentTerms', $options6,set_value('PaymentTerms',$Terms),'id="PaymentTerms"' ,'required="true"' ,'class="form-control select2'); - - ?> - - - - -
- - -
-
-
- - - - - - - - - - - -
- -
- - - - - -
- -
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BasicValue; - $totDiscountAmt = $totDiscountAmt + $record->AfterDiscount; - $totPackagingAmt = $totPackagingAmt + $record->AfterPackagingValue; - $totCgst = $totCgst + $record->AfterCGST; - $totSgst = $totSgst + $record->AfterSGST; - $totIgst = $totIgst + $record->AfterIGST; - - $totFreightAmt = $totFreightAmt + $record->AfterFreightValue; - $totInsuranceAmt = $totInsuranceAmt + $record->Insurance; - $totOrderSummaryAmt = $totOrderSummaryAmt +$record->TotalValue; - - } - ?> - - -
SNoRequisition NoItem CodeItem DescriptionQuantityUOMRateIn INRBasic Amount In INRTax Amount In INRTotal Order Amount In INRActual QuantityReceived QuantityPending QuantityAction
ReqNo ?>MaterialCode ?>MaterialName ?>Quantity ?>UOM ?>Rate ?>BasicValue, 2, '.', ''); ?>Taxamount ?>TotalValue ?>Quantity ?>ReceivedQuantity ?>Quantity - $record->ReceivedQuantity, 2, '.', ''); ?>     - -    
-
- - - - -
-
-
- - - 'txtTotBasicAmount','value' => set_value('txtTotBasicAmount',number_format($totBasicAmt, 2, '.', '')),'id'=>'txtTotBasicAmount', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); - echo form_input($data); - ?> - - -
-
- - - 'txtTotalDiscount','value' => set_value('txtTotalDiscount',number_format($totDiscountAmt, 2, '.', '')),'id'=>'txtTotalDiscount', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); - echo form_input($data); - ?> - -
-
- - - 'txtTotalSGST','value' => set_value('txtTotalSGST',number_format($totSgst, 2, '.', '')),'id'=>'txtTotalSGST', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); - echo form_input($data); - ?> - -
- -
- - - 'txtTotalCGST','value' => set_value('txtTotalCGST',number_format($totCgst, 2, '.', '')),'id'=>'txtTotalCGST', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); - echo form_input($data); - ?> - -
-
-
- - -
- - - 'txtTotalPackaing','value' => set_value('txtTotalPackaing',number_format($totPackagingAmt, 2, '.', '')),'id'=>'txtTotalPackaing', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); - echo form_input($data); - ?> - -
-
- - - 'txtTotalInsurance','value' => set_value('txtTotalInsurance',number_format($totInsuranceAmt, 2, '.', '')),'id'=>'txtTotalInsurance', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); - echo form_input($data); - ?> - - -
-
- - - 'txtTotalFreight','value' => set_value('txtTotalFreight',number_format($totFreightAmt, 2, '.', '')),'id'=>'txtTotalFreight', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); - echo form_input($data); - ?> - -
-
- - 'txtTotalOrderValueSummary','value' => set_value('txtTotalOrderValueSummary',number_format($totOrderSummaryAmt, 2, '.', '')),'id'=>'txtTotalOrderValueSummary', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); - echo form_input($data); - ?> -
-
- -
-
- 'txtSpcialInstruction','value' => set_value('txtSpcialInstruction',$ServiceDescription),'id'=>'txtSpcialInstruction', 'class' => 'form-control' ); - echo form_textarea($data); - ?> - -
-
-
-

- - - - - - - -   Save -   Submit - - -   OK - - - -

-
-
-
-
-
-
- - 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;','readonly' => 'true'); - echo form_input($data); - ?> -
-

-
-
-
- 'RequestBy','value' => set_value('RequestBy', $RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true'); - echo form_input($data); - ?> -
-

- -
-
- 'Status','value' => set_value('Status',$StatusName),'id'=>'Status', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -

-
-
-
-
-
- -
-
- - - \ No newline at end of file diff --git a/application/views/editServiceAmendPO.php~ b/application/views/editServiceAmendPO.php~ deleted file mode 100644 index 05c6f270..00000000 --- a/application/views/editServiceAmendPO.php~ +++ /dev/null @@ -1,2013 +0,0 @@ -FontCode2000; - - } -} - -if(!empty($MaxPODate)) -{ - foreach ($MaxPODate as $date) - { - $MaxPoDate = $date->PODate; - - } -} - - -if(!empty($POMaster)) -{ - foreach ($POMaster as $Req) - { - - $SupId = $Req->SupplierID; - $SupName = $Req->SupplierName; - $Address = $Req->Address; - $pdt = new DateTime($Req->PODate); - $PODate = $pdt->format('Y-m-d'); - $DeliverOption = $Req->DeliveryOption; - $DeliverSchedule = $Req->DeliverySchedule; - // echo "*" . $Req->DeliveryDate . "*"; - $Ddt = new DateTime($Req->DeliveryDate); - $Deliverydt = $Ddt->format('Y-m-d'); - // echo "-" . $Deliverydt . "-"; - $DeliveryAddress =$Req->DeliveryAddress; - $PONOStatus = $Req->StatusCode; - $PONO = $Req->PONO; - $ServiceDescription = $Req->ServiceDescription; - //Terms=$Req->PaymentTerms; - $PaymentOtherDescription=$Req->PaymentOtherDescription; - $WrkStatus=$Req->ServiceWorkStatus; - $StatusName=$Req->StatusName; - } -} - - -if(!empty($RequistionDetails)) -{ - - foreach ($RequistionDetails as $ReqDet) - { - // $Reqon=$ReqDet->ReqDate; - $Reqonn=new DateTime($ReqDet->ReqDate); - $Reqon=$Reqonn->format('Y-m-d'); - $Requestedby=$ReqDet->Requestedby; - $RequesterName=$ReqDet->FirstName; - //$Status=$ReqDet->Status; - } -} - -//echo "$WrkStatus"; - -if(!empty($AvlBudAmt)) -{ - - $AvlAmount = number_format($AvlBudAmt, 2, '.', ''); - -} - - -foreach ($PaymentTerms as $TER) -{ - //print_r($PaymentTerms); - //print_r($Payment); - $Terms=$TER->PaymentTerms; - - //echo "CURRENT TERMS :" . $Terms; -} - - - -// foreach ($POSTATUS as $PST ) -// { -// $POStatus=$PST->StatusName; -// } -?> - - - - - - - - - - - -
- 'form-label-left ServicePO ','name' => 'ServicePO','id' => 'ServicePO'); - - echo form_open($this->config->base_url().'/purchaseorder/addPO/',$attributes); ?> - -
-
-
-

Siddharth Industries - Amendment Service Purchase Order -

-
-
-
-
-
- - - - 'Selected Requisition Numbers'); - if(!empty($ReqList)) - { - foreach ($ReqList as $SID): - - $options[$SID->ReqNo] = $SID->ReqNo ; - endforeach; - } - echo form_multiselect('RequistionNo', $options,set_value('RequistionNo'),'id="RequistionNo"' , 'required="true"'); - - ?> -
-
- -
- 'PODate','value' => set_value('PODate',$PODate),'id'=>'PODate', 'class' => 'form-control num' ,'required' => 'true','onkeypress'=>'return false;'); - echo form_input($data); - ?> -
-
- -
-
-
-
- - 'Select Supplier'); - //print_r( $options); - - if(!empty($Suplist)) - { - foreach ($Suplist as $SID): - - - $options[$SID->SupplierID] = $SID->SupplierID.' '.' - '.' '.$SID->SupplierName; - - endforeach; - } - - echo form_dropdown('drpSupplier', $options,set_value('drpSupplier',$SupId ),'id="drpSupplier"' ,'required="true"' ,'class="form-control select2'); - - ?> - -
-

- -
- 'SupAddress','value' => set_value('SupAddress',$Address),'id'=>'SupAddress', 'class' => 'form-control' ,'readonly' => 'true','rows' => '3', 'cols' => '40'); - echo Form_textarea($data); - ?> -
-
-
-
-
- -
- - 'POType','value' => set_value('POType',SERVICE),'id'=>'POType', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'DeliveryAddr','value' => set_value('DeliveryAddr',$DeliveryAddress),'id'=>'DeliveryAddr', 'class' => 'form-control' ,'required' => 'true', 'rows' => '3', 'cols' => '40'); - echo Form_textarea($data); - ?> - -
-
-
-
-
- Select Delivery By
- - - 'DateRange', 'value' => '0', 'checked' => ('0' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Date')); ?> - - - - 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?> - - - -
-
- - StatusName){ - - $optionsWork[$WorkSID->StatusName] = $WorkSID->StatusName; - } - - - endforeach; - foreach ($WorkStatus as $SID): - if($WrkStatus!=$SID->StatusName){ - $optionsWork[$SID->StatusName] = $SID->StatusName; - } - - - endforeach; - } - - echo form_dropdown('workstatus', $optionsWork,set_value('workstatus'),'id="workstatus"' ,'required="true"' ,'class="form-control select2'); - - ?> -
-

- - - -
- 'Deliverydt','value' => set_value('Deliverydt',$Deliverydt),'id'=>'Deliverydt', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;'); - echo form_input($data); - ?> -
-
- -
- -
-
- Payment Details - -
- - - - - PaymentID){ - ?> - - PaymentID] = $pay2->PaymentTerms; - - } - - foreach ($Payment as $pay1): - - if($Terms!=$pay1->PaymentID){ - - $optionsPay[$pay1->PaymentID] = $pay1->PaymentTerms; - - } - endforeach; - } - - echo form_dropdown('PaymentTerms', $optionsPay,set_value('PaymentTerms'),'id="PaymentTerms"' ,'required="true"' ,'class="form-control select2'); - - ?> - - - - -
- - -
-
-
-
-
-
- - - - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - Schedule_Type!='Recurring'){ - $FrequencyNo=intval(1); - $Frequency='One Time'; - } - else{ - $FrequencyNo=$record->NumberOfService; - $Frequency=$record->Service_Period; - } - - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - After_CGST; - $TotalSgst = $TotalSgst + $record->After_SGST; - $TotalIgst = $TotalIgst + $record->After_IGST; - $Totalotherallowance=$Totalotherallowance+ $record->otherallowance; - $TotalSummary = $TotalSummary + $record->TotalValue; - - - $TotalBasicAmount = $TotalBasicAmount + $record->BasicValue; - - } - ?> - - -
SNoRequisition NoItem CodeItem DescriptionQuantityUOMRateBasic AmountTax AmountTotal Order AmountActual QuantityReceived QuantityPending QuantityAction
ReqNo ?>MaterialCode ?>MaterialName ?>Quantity ?>UOM ?>Rate ?>BasicValue * $FrequencyNo, 2, '.', ''); ?>Taxamount ?>TotalValue ?>Quantity ?>ReceivedQuantity ?>Quantity - $record->ReceivedQuantity, 2, '.', ''); ?>     - - - -
-
- - -
-
- -
- - 'txtTotBasicAmount','value' => set_value('txtTotBasicAmount',number_format($TotalBasicAmount, 2, '.', '')),'id'=>'txtTotBasicAmount', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
- - 'txtTotCgst','value' => set_value('txtTotCgst',number_format($TotalCgst, 2, '.', '')),'id'=>'txtTotCgst', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
- - -
- - 'txtTotSgst','value' => set_value('txtTotSgst',number_format($TotalSgst, 2, '.', '')),'id'=>'txtTotSgst', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
- - 'txtTotIgst','value' => set_value('txtTotIgst',number_format($TotalIgst, 2, '.', '')),'id'=>'txtTotIgst', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
- -
- - 'ToatalOtherAllowances','value' => set_value('ToatalOtherAllowances',number_format($Totalotherallowance, 2, '.', '')),'id'=>'ToatalOtherAllowances', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
- - - 'txtTotalOrderValueSummary','value' => set_value('txtTotalOrderValueSummary',number_format($TotalSummary, 2, '.', '')),'id'=>'txtTotalOrderValueSummary', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
- -
- - -
-
- 'ScopeofWork','value' => set_value('ScopeofWork',$ServiceDescription),'id'=>'ScopeofWork', 'class' => 'form-control', 'rows' => '10', 'cols' => '40' ); - echo form_textarea($data); - ?> -
- -
-
-

-
- - - - - -   Submit - - - -

-
-
-
-

-
-
-
-
-
- - 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true','readonly' => 'true'); - echo form_input($data); - ?> -
-

-
-
-
- 'RequestBy','value' => set_value('RequestBy', $RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true'); - echo form_input($data); - ?> -
-

- -
-
- 'Status','value' => set_value('Status',$StatusName),'id'=>'Status', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -

-
-
-
-
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/application/views/editOldasset.php b/application/views/editasset.php similarity index 99% rename from application/views/editOldasset.php rename to application/views/editasset.php index befb3ad3..059e00a8 100644 --- a/application/views/editOldasset.php +++ b/application/views/editasset.php @@ -153,7 +153,7 @@ $(function() {

-
Siddharth Industries - Edit Asset Details-
+
Resico Industries - Edit Asset Details-

diff --git a/application/views/editrequisitionform.php~ b/application/views/editrequisitionform.php~ deleted file mode 100644 index 0a482937..00000000 --- a/application/views/editrequisitionform.php~ +++ /dev/null @@ -1,1047 +0,0 @@ - -ReqNo; - $ReqType = $Req->ReqType; - $Requestedby = $Req->Requestedby; - $FirstName =$Req->FirstName; - $Designation =$Req->Designation; - $DepartmentName = $Req->DepartmentName; - $Status = $Req->Status; - $CostCenterCode = $Req->CostCenterCode; - $serviceSchedule=$Req->Schedule_Type; - - $servicePeriod=$Req->Service_Period; - $noOfService=$Req->NumberOfService; - - } -} - - -?> - - -
- - -
- -
-

Siddharth Industries - Edit Requisition Form

-
-
- - 'form-label-left requistion ','name' => 'requistion','id' => 'requistion'); - - echo form_open($this->config->base_url().'requisitionform/EditRequistion',$attributes); ?> -
-
- -
- -
- - 'RequestType','value' => set_value('RequestType',$ReqType),'id'=>'RequestType', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - - ?> - - -
-
-
- -
- - 'EmpID','value' => set_value('EmpID',$FirstName),'id'=>'EmpID', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - - ?> - -
-
-
- -
- 'DeptName','value' => set_value('DeptName',$DepartmentName),'id'=>'DeptName', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'Designation','value' => set_value('Designation',$Designation),'id'=>'Designation', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
-
- -
- - -
- $CostCenterCode); - //print_r( $options); - - if(!empty($CostCenter)) - { - foreach ($CostCenter as $SID): - // echo $SID->ConfigValue; - $Costs[$SID->CostCenterCode] = $SID->CostCenterCode .'-'. $SID->CostCenterName ; - - endforeach; - - } - echo form_dropdown('CostCenter', $Costs,set_value('CostCenter'),'id="CostCenter"' ,'class = "form-control"'); - - ?> -
-
- -
-   -
- 'AvlBudgetAmount','value' => set_value('AvlBudgetAmount'),'id'=>'AvlBudgetAmount', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
- -
- - - - -
- -
-
- -
- -
-
- - Add Line Item - - - - -

- - -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SNoMaterial CodeMaterial NameUomRequestedQuantityPoQuantityStatusAction
MaterialCode ; ?>MaterialName ; ?>UOM ; ?>Quantity ; ?>POQTY ; ?>StatusName ;?> -     - - -
- -
- - - - -   Save -   Submit - - - - -   Update - - - - - -
-
-
-
- -
-
- - - - diff --git a/application/views/inwardgateregister.php~ b/application/views/inwardgateregister.php~ deleted file mode 100644 index 30c44c9f..00000000 --- a/application/views/inwardgateregister.php~ +++ /dev/null @@ -1,576 +0,0 @@ - - - - - - -
- -
-

-
Siddharth Industries - Inward Gate Register (IGR) Entry
-

-
-

-
-
-
-
- 'form-label-left IGR ','name' => 'IGR','id' => 'IGR'); - - echo form_open($this->config->base_url().'/inwardgateregister/addNewigr/',$attributes); ?> - - - 'Purchase Order No'); - - if(!empty($PO_NO)) - { - //print_r($PO_NO); - foreach ($PO_NO as $SI): - - $options[$SI->PONO] = $SI->PONO .'-'. $SI->SupplierName ; - $PONO = $SI->PONO; - - - endforeach; - - } - - echo form_dropdown('PONO', $options,set_value('PONO'),'id="PONO"' ,'class="form-control select2"' , 'required="true"'); - ?> - -
- -
- -
- 'SupplierName','value' => set_value('SupplierName'),'id'=>'Sup', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
- - - - -
- - 'InvoiceNo','value' => set_value('InvoiceNo'),'id'=>'InvoiceNo', 'class' => 'form-control', 'required=>"true"' ); - - echo form_input($data); - ?> -
-
- - 'InvoiceDate','value' => set_value('InvoiceDate'),'id'=>'InvoiceDate', 'class' => 'form-control num', 'required'=>'true' ); - echo form_input($data); - ?> - -
- -
- - 'VehicleNo','value' => set_value('VehicleNo'), 'id'=>'VehicleNo', 'class' => 'form-control', ); - echo form_input($data); - ?> - -
-
- - 'CourierNo','value' => set_value('CourierNo'),'id'=>'CourierNo', 'class' => 'form-control' ); - echo form_input($data); - ?> -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
S.NOItem CodeMaterialUOMOrdered QuantityReceived QuantityPending QuantityAdvised QuantityRemarks
- - - -
-
- - - Generate IGR -
-
- - - - - - - - - - - -
- - -
-
- - - - - - - - - - - - - \ No newline at end of file diff --git a/application/views/materialinspectionreport.php~ b/application/views/materialinspectionreport.php~ deleted file mode 100644 index e81f2d2d..00000000 --- a/application/views/materialinspectionreport.php~ +++ /dev/null @@ -1,394 +0,0 @@ -IGRNO; - $PONO = $IGR->PONO; - $VehicleNo = $IGR->VehicleNo; - $CourierNo= $IGR->CourierNo; - $DeliveryChellanOrInvoiceNo=$IGR->DeliveryChellanOrInvoiceNo; - $SupplierName=$IGR->SupplierName; - //$DeliveryChellanDate=$IGR->DeliveryChellanDate; - - $dc_date = new DateTime( $IGR->DeliveryChellanDate ); - $dcdate = $dc_date->format('d/m/Y');; - $Address=$IGR->Address; - $PORasiedbyName=$IGR->FirstName; - $PODate=$IGR->PODate; - $po_date = strtotime( $PODate ); - $podate = date( 'd/m/Y', $po_date ); - $IGRDate=$IGR->CreatedDate; - $igr_date = strtotime( $IGRDate ); - $igrdate = date( 'd/m/Y', $igr_date ); - $ServiceDescription=$IGR->ServiceDescription; - - - - } -} - - ?> - - - -
- -
-

-
Siddharth Industries - Material Receipt And Inspection Report (MRIR)
-

- - 'form-label-left MRIR ','name' => 'MRIR','id' => 'MRIR'); - echo form_open($this->config->base_url().'/MRIRcontroller/generateMRIR/',$attributes); ?> -
-

-
-
- -
-
- -
- 'IGRNO','value' => set_value('IGRNO',$IGRNO),'id'=>'IGRNO', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
-
- -
- 'IGRDate','value' => set_value('IGRDate',$igrdate),'id'=>'IGRDate', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
- -
- -
- - -
'PONO','value' => set_value('PONO',$PONO),'id'=>'PONO', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'PODate','value' => set_value('PODate',$podate),'id'=>'PODate', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
'PORasiedbyName','value' => set_value('PORasiedbyName',$PORasiedbyName),'id'=>'PORasiedbyName', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
-
- -
- 'SupplierName','value' => set_value('SupplierName',$SupplierName),'id'=>'SupplierName', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'DeliveryChellanOrInvoiceNo','value' => set_value('DeliveryChellanOrInvoiceNo',$DeliveryChellanOrInvoiceNo),'id'=>'DeliveryChellanOrInvoiceNo', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
'DeliveryChellanDate','value' => set_value('DeliveryChellanDate',$dcdate),'id'=>'DeliveryChellanDate', 'class' => 'form-control num','readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'VehicleNo','value' => set_value('VehicleNo',$VehicleNo),'id'=>'VehicleNo', 'class' => 'form-control' ,'readonly' => 'true','align' => 'left'); - echo form_input($data); - ?> -
-
-
- -
'CourierNo','value' => set_value('CourierNo',$CourierNo),'id'=>'CourierNo', 'class' => 'form-control','readonly' => 'true'); - echo form_input($data); - ?> -
-
- -
- - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
S.NOItem CodeMaterialUOMOrdered QuantityAdviced Quantity as per the ChallanActual Quantity ReceivedRemarks
MaterialCode?>MaterialName?>UOM?>Quantity?>QuantityAsPerInvoice?>
-
- - -
-
- - -
-
- - - - - - \ No newline at end of file diff --git a/application/views/requisitionform.php~ b/application/views/requisitionform.php~ deleted file mode 100644 index 7964887f..00000000 --- a/application/views/requisitionform.php~ +++ /dev/null @@ -1,901 +0,0 @@ - -EmpID ; - $FirstName = $Emp->FirstName ; - $Designation = $Emp->Designation; - $DepartmentName =$Emp->DepartmentName; - } -} -?> - -
- - -
- -
-

Siddharth Industries - Requisition Form

-
-
- 'form-label-left requistion ','name' => 'requistion','id' => 'requistion'); - - echo form_open($this->config->base_url().'requisitionform/SearchRequistList',$attributes); ?> -
-
-
- -
- 'Select Request Type'); - - //print_r( $options); - - if(!empty($RequestType)) - { - foreach ($RequestType as $RID): - - - $options[$RID->ConfigValue] = $RID->ConfigValue; - - endforeach; - } - - echo form_dropdown('RequestType', $options,set_value('ConfigValue'),'id="RequestType"' ,'class = "form-control select2"','required="true"'); - - ?> - -
-
-
- -
- - 'EmpID','value' => set_value('EmpID',$FirstName),'id'=>'EmpID', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> - /> -
-
-
- -
- 'DeptName','value' => set_value('DeptName',$DepartmentName),'id'=>'DeptName', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'Designation','value' => set_value('Designation',$Designation),'id'=>'Designation', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
-
- -
- -
- 'Select Cost Center Name'); - //print_r( $options); - - if(!empty($CostCenter)) - { - foreach ($CostCenter as $SID): - // echo $SID->ConfigValue; - $Costs[$SID->CostCenterCode] = $SID->CostCenterCode .'-'. $SID->CostCenterName ; - - endforeach; - - } - echo form_dropdown('CostCenter', $Costs,set_value('CostCenter'),'id="CostCenter"' ,'class = "form-control"'); - - ?> - -
-
-
-   -
- 'AvlBudgetAmount','value' => set_value('AvlBudgetAmount'),'id'=>'AvlBudgetAmount', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
- - - - - -
- -
- - -
-
-
- -
- -
-
- Add Line Item - - - - -

- - -

- -
- - - - - - - - - - - - - - - -
SNoMaterial CodeMaterial NameUomQuantityAction
- -
- - -   Save - - - - -
-
-
-
- -
-
- - - - diff --git a/application/views/revenuepopdf.php~ b/application/views/revenuepopdf.php~ deleted file mode 100644 index 4b69b338..00000000 --- a/application/views/revenuepopdf.php~ +++ /dev/null @@ -1,326 +0,0 @@ -CompanyName; - $CompanyAddress = $CO->Address; - - } - } - if(!empty($POItem)) - { - - foreach ($POItem as $PO) - { - $PONO = $PO->PONO; - $postatus= $PO->Status; - $SuplierName = $PO->SupplierName; - $SuplierAddress = $PO->Address; - $DeliveryAddress = $PO->DeliveryAddress; - $postatus= $PO->Status; - $dt = new DateTime($PO->PODate, new DateTimeZone('Asia/Kolkata')); - $Podt = $dt->format('d-m-Y'); - if($PO->DeliveryOption=='1'){ - $DeliveryDate = ''; - $DeliverySchedule = $PO->DeliverySchedule; - } - else{ - $dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata')); - $DeliveryDate = $dtDe->format('d-m-Y'); - $DeliverySchedule = ''; - } - - - $ServiceDescription =$PO->ServiceDescription; - $PaymentTerms = $PO->PaymentTerms; - $PaymentDays=$PO->PaymentDays; - $PayableAT=$PO->PayableAT; - - } -} - $currencyName='INR'; - $currencyCode =''; - if(!empty($CurrencySymbol)) - { - foreach ($CurrencySymbol as $Curr) - { - - $currencyCode = $Curr->FontCode2000; - //$currencyName = $currencyName; - - - } - - } - - - ?> - - -
-
- DRAFT
'; - - } - - ?> -
- -
PURCHASE ORDER - PO NO:
- - - - - - - - - - - - - - - - - - -
-

-

-
-

Vendor Address :

-


-
-

Delivery To :

-

-
PO DATE :DELIVERY DATE / SCHEDULE BY :
- - -
- - - - - - - - - - - - - - - - - -
Requistion NumberRequested ByRequested DepartmentCost Center  
-

 

-

 

- - - - - - - - - - - - - - - - - - -BasicValue+$record->Taxamount; - ?> - - - - - - - - - - - - - - - - - - - - - BasicValue; - $TotalTax = $TotalTax+$record->Taxamount; - $OrderValue = $SubTotalAmount + $TotalTax; - - } - - - - } - - ?> - - -
#Item NameUOMQtyRate In INRBasic Value In INRDiscount In INRSGST In INRCGST In INRIGST In INRPackaging In INRInsurance In INRFreight In INRTotal Amount In INR
MaterialName ; ?>UOM ; ?>Quantity ; ?>Rate ; ?>BasicValue;?>AfterDiscount;?>AfterSGST ; ?>AfterCGST ; ?>AfterIGST ; ?>AfterPackagingValue;?>AfterFreightValue;?>Insurance;?>
-

 

- - - - - -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -

Total Amount In Words


- -

- -
Total Amount Before Tax In INR
Total Tax Amount In INR
Total Amount After Tax In INR
- -

Payment Terms 

- -

- -
- -

Certified that the particulars given above are true and correct

- -

- -

 

- -

Authorized Signatory

-
-

Special Instruction:

-

-ReleasedOn, new DateTimeZone('Asia/Kolkata')); - - - ?> - - - -

 

-
Released By : FirstName;?>
-
Released On : format('d-m-Y');?>
- - - - \ No newline at end of file diff --git a/application/views/servicePurchaseorder.php~ b/application/views/servicePurchaseorder.php~ deleted file mode 100644 index 1a02c2f5..00000000 --- a/application/views/servicePurchaseorder.php~ +++ /dev/null @@ -1,2136 +0,0 @@ -format('Y-m-d'); -$MaxPoDate = ''; -$AvlAmount = 0; -$Value="₹"; -if(!empty($MaxPODate)) -{ - foreach ($MaxPODate as $date) - { - $MaxPoDate = $date->PODate; - } -} -if(!empty($CompanyDetails)) -{ - foreach ($CompanyDetails as $Req) - { - $CompanyAddress = $Req->Address; - } -} -if(!empty($AvlBudAmt)) -{ - - $AvlAmount = $AvlBudAmt; - -} - - -if(!empty($INRSYMBOL)) -{ - - foreach($INRSYMBOL as $INRS) - { - $INRSYM=$INRS->FontCode2000; - - } -} - - -?> - - - - - - - -
- 'form-label-left ServicePO ','name' => 'ServicePO','id' => 'ServicePO'); - - echo form_open($this->config->base_url().'/purchaseorder/addPO/',$attributes); ?> - -
-
-
-
-

Siddharth Industries - Service Purchase Order

-
- -
-
-
-
- - - - 'Selected Requisition Numbers'); - if(!empty($ReqList)) - - { - foreach ($ReqList as $SID): - - // print_r($SID->ReqNo); - $options[$SID->ReqNo] = $SID->ReqNo ."-". $SID->ReqBy; - $ReqType = $SID->ReqType; - endforeach; - } - echo form_multiselect('RequistionNo', $options,set_value('RequistionNo'),'id="RequistionNo"' , 'required="true"'); - - ?> -
-
- -
- 'PODate','value' => set_value('PODate',$CurrentDate),'id'=>'PODate', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;'); - echo form_input($data); - ?> -
-
- -
-
-
-
- - - 'Select Supplier'); - //print_r( $options); - - if(!empty($Suplist)) - { - foreach ($Suplist as $SID): - - - $options[$SID->SupplierID] = $SID->SupplierID.' '.' - '.' '.$SID->SupplierName; - - endforeach; - } - - echo form_dropdown('drpSupplier', $options,set_value('drpSupplier'),'id="drpSupplier"' ,'required="true"' ,'class="form-control select2'); - - ?> - -
-

- -
- 'SupAddress','value' => set_value('SupAddress'),'id'=>'SupAddress', 'class' => 'form-control' ,'readonly' => 'true','rows' => '3', 'cols' => '40'); - echo Form_textarea($data); - ?> -
-
-
-
-
- -
- - 'POType','value' => set_value('POType',SERVICE),'id'=>'POType', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- -
- 'DeliveryAddr','value' => set_value('DeliveryAddr',$CompanyAddress),'id'=>'DeliveryAddr', 'class' => 'form-control' ,'required' => 'true', 'rows' => '3', 'cols' => '40'); - echo Form_textarea($data); - ?> -
-
-
-
-
- Select Delivery By
- - - "DateRange", "id"=>"Date", "value"=>"0", 'checked'=>set_radio('DateRange', '0', TRUE))); ?> - - "DateRange", "id"=>"Schedule", "value"=>"1", 'checked'=>set_radio('DateRange', '1', FALSE))); ?> - - - - -
-
- - 'Select Work Status'); - //print_r( $options); - - if(!empty($WorkStatus)) - { - foreach ($WorkStatus as $WID): - - - $optionsWork[$WID->StatusCode] = $WID->StatusName; - - endforeach; - } - - echo form_dropdown('workstatus', $optionsWork,set_value('workstatus'),'id="workstatus"' ,'required="true"' ,'class="form-control select2'); - - - ?> -
-

- -
- 'Deliverydt','value' => set_value('Deliverydt',$CurrentDate),'id'=>'Deliverydt', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;'); - echo form_input($data); - ?> -
-
- -
- -
-
- Payment Details - -
- - - 'Select Payment Terms '); - foreach ($Payment as $pay): - - - - $options6[$pay->PaymentID] = $pay->PaymentTerms; - - - endforeach; - } - - echo form_dropdown('PaymentTerms', $options6,set_value('PaymentTerms'),'id="PaymentTerms"' ,'required="true"' ,'class="form-control select2'); - - ?> - - - - -
- - - -
-
-
- -
- -
-
- - - - - - - - - - -
- -
- -
-
- - - - - - - - - - - - - - - - - - - -
SNoRequisition NoItem CodeItem DescriptionQuantityUOMRateBasic AmountTax AmountTotal Order AmountAction
-
- - -
-
- -
- - 'txtTotBasicAmount','value' => set_value('txtTotBasicAmount'),'id'=>'txtTotBasicAmount', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
- - 'txtTotCgst','value' => set_value('txtTotCgst'),'id'=>'txtTotCgst', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
- - -
- - 'txtTotSgst','value' => set_value('txtTotSgst'),'id'=>'txtTotSgst', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
- - 'txtTotIgst','value' => set_value('txtTotIgst'),'id'=>'txtTotIgst', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
- -
- - 'TotalOtherAllowances','value' => set_value('TotalOtherAllowances'),'id'=>'TotalOtherAllowances', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
- - 'txtTotalOrderValueSummary','value' => set_value('txtTotalOrderValueSummary'),'id'=>'txtTotalOrderValueSummary', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> - -
-
-
-
- 'ScopeOfWork','value' => set_value('ScopeOfWork'),'id'=>'ScopeOfWork', 'class' => 'form-control' ,'rows' => '10', 'cols' => '40' ); - echo form_textarea($data); ?> -
- -
-
-
-
-
- - - - - -   Save -   Submit - -

-
-
-
-

-
- -
-
-
-
- - - - diff --git a/application/views/servicepopdf.php~ b/application/views/servicepopdf.php~ deleted file mode 100644 index 96803adb..00000000 --- a/application/views/servicepopdf.php~ +++ /dev/null @@ -1,431 +0,0 @@ -CompanyName; - $CompanyAddress = $CO->Address; - - } - } - - $currencyName='INR'; - $currencyCode =''; - if(!empty($CurrencySymbol)) - { - foreach ($CurrencySymbol as $Curr) - { - - $currencyCode = $Curr->FontCode2000; - //$currencyName = $currencyName; - - - } - - } - - - - - if(!empty($POItem)) - { - - foreach ($POItem as $PO) - { - - $PONO = $PO->PONO; - $postatus= $PO->Status; - $SuplierName = $PO->SupplierName; - $SuplierAddress = $PO->Address; - $DeliveryAddress = $PO->DeliveryAddress; - $dt = new DateTime($PO->PODate, new DateTimeZone('Asia/Kolkata')); - $Podt = $dt->format('d-m-Y'); - $dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata')); - $DeliveryDate = $dtDe->format('d-m-Y'); - $ServiceDescription =$PO->ServiceDescription; - $PaymentTerms = $PO->PaymentTerms; - - - } -} - - - ?> - - - - -
-
- DRAFT
'; - - } - - ?> -
- -
PURCHASE ORDER - PO NO:
- - - - - - - - - - - - - - - - - - -
-

-

-
-

Vendor Address :

-


-
-

Delivery To :

-

-
PO DATE :DELIVERY DATE / SCHEDULE BY :
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Requistion NumberRequested ByRequested DepartmentCost Center  
- -

 

- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - After_SGST; - $Cgst =$Cgst + $record->After_CGST; - $Igst = $Igst + $record->After_IGST; - - - } - - $TotalTax =$TotalTax+ $Sgst + $Cgst+$Igst; - $OrderValue = $OrderValue + $SubTotalAmount + $TotalTax; - } - - ?> - - - -
#Item NameService DescriptionUOMQtyRate In INRBasic Value In INRCGST In INRSGST In INRIGST In INROther Allow In INRTotal Amount In INR
MaterialName ; ?>ServiceMaterialDescription ; ?>UOM ; ?>Quantity ; ?>Rate ; ?>NumberOfService==0 || $record->NumberOfService==''){ - echo $record->BasicValue; - $TotalAmount = $record->BasicValue + $record->Taxamount + $record->otherallowance; - $SubTotalAmount = $SubTotalAmount + $record->BasicValue + $record->otherallowance; - } - else{ - echo $record->BasicValue * $record->NumberOfService; - $TotalAmount = $record->BasicValue * $record->NumberOfService + $record->Taxamount + $record->otherallowance; - $SubTotalAmount = $SubTotalAmount + $record->BasicValue * $record->NumberOfService + $record->otherallowance; - } - ?>After_SGST ; ?>After_CGST ; ?>After_IGST ; ?>otherallowance ; ?>
- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -

Total Amount In Words


- - - -

- - - -
Total Amount Before Tax In INR -
Total Tax Amount In INR -
Total Amount After Tax In INR -
- - - -

Payment Terms 

- - - - -

- - - -
- - - -

Certified that the particulars given above are true and correct

- - - -

- - - -

 

- - - -

Authorized Signatory

- -
- -

Scope Of Work:

- -

- - ReleasedOn, new DateTimeZone('Asia/Kolkata')); - - - ?> - - - -

 

-
Released By : FirstName;?>
-
Released On : format('d-m-Y');?>
- - - - - - - \ No newline at end of file diff --git a/application/views/statusofservicepurchaseorder.php~ b/application/views/statusofservicepurchaseorder.php~ deleted file mode 100644 index 95f21f79..00000000 --- a/application/views/statusofservicepurchaseorder.php~ +++ /dev/null @@ -1,189 +0,0 @@ - - - - - -
- -
-

-
Status Of Service Purchase Order
-

-
-

- 'form-label-left Status ','name' => 'Status','id' => 'Status'); - - echo form_open($this->config->base_url().'servicepurchaseorder/UpdateServiceStatus',$attributes); ?> - -
-
-
-
- 'form-label-left ','name' => 'IGR','id' => ''); */ - - /* echo form_open($this->config->base_url().'/inwardgateregister/addNewigr/',$attributes); */?> - -
- 'Purchase Order No'); - - if(!empty($PO)) - { - //print_r($PO_NO); - foreach ($PO as $SI): - - $options[$SI->PONO] = $SI->PONO ; - // $PONO = $SI->PONO; - - endforeach; - - } - - echo form_dropdown('PONO', $options,set_value('PONO'),'id="PONO"' ,'class="form-control select2"' , 'required="true"'); - -?> - -
-
-
- -
- StatusCode] = $SI->StatusName ; - - - endforeach; - - } - - echo form_dropdown('WorkStatus', $options,set_value('WorkStatus'),'id="WorkStatus"' ,'class="form-control"' , 'required="true"'); - -?> - -
-
-
- -
- 'Remarks','value' => set_value('Remarks'),'id'=>'Remarks', 'class' => 'form-control' ); - echo form_input($data); - - -?> - -
- - - -
-

- - - -
-
- - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
S.NOReq NoReq ByReq DateSupplier NameItem CodeDescriptionUOMOrdered QuantityRateWork Status
- - - -
- -
- -
-
- \ No newline at end of file