From 81f45c4202e968eaebd64b7bdfe5b5406e67880c Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 7 Aug 2017 16:49:22 +0530 Subject: [PATCH] capital po and ui issue fixed --- application/controllers/purchaseorder.php | 41 +- application/controllers/purchaseorder.php~ | 2060 ++++--- application/controllers/supplier.php | 23 +- application/controllers/supplier.php~ | 513 ++ application/models/purchaseorder_model.php | 15 + application/models/purchaseorder_model.php~ | 357 +- .../views/Editmaterialinspectionreport.php | 28 +- .../views/Editmaterialinspectionreport.php~ | 507 ++ application/views/alterpurchaseorder.php | 2 +- application/views/alterpurchaseorder.php~ | 504 +- application/views/capitalpopdf.php | 2 +- application/views/capitalpopdf.php~ | 325 + application/views/capitalpurchaseorder.php | 6 +- application/views/capitalpurchaseorder.php~ | 4415 ++++++++++++++ application/views/editCapitalPo.php | 68 +- application/views/editCapitalPo.php~ | 5414 +++++++++++++++++ .../views/editRevenuepurchaseorder.php | 14 +- .../views/editRevenuepurchaseorder.php~ | 568 +- application/views/editServiceAmendPO.php | 49 +- application/views/editServiceAmendPO.php~ | 2013 ++++++ application/views/inwardgateregister.php | 2 +- application/views/inwardgateregister.php~ | 576 ++ .../views/materialinspectionreport.php | 20 +- .../views/materialinspectionreport.php~ | 394 ++ .../views/statusofservicepurchaseorder.php | 16 +- .../views/statusofservicepurchaseorder.php~ | 189 + 26 files changed, 16645 insertions(+), 1476 deletions(-) create mode 100755 application/controllers/supplier.php~ create mode 100755 application/views/Editmaterialinspectionreport.php~ create mode 100755 application/views/capitalpopdf.php~ create mode 100755 application/views/capitalpurchaseorder.php~ create mode 100755 application/views/editCapitalPo.php~ create mode 100755 application/views/editServiceAmendPO.php~ create mode 100755 application/views/inwardgateregister.php~ create mode 100755 application/views/materialinspectionreport.php~ create mode 100755 application/views/statusofservicepurchaseorder.php~ diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index e0312e29..9c65ae6b 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -233,6 +233,15 @@ class purchaseorder extends BaseController } 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); @@ -456,13 +465,15 @@ class purchaseorder extends BaseController { $CapitalRange = $_GET['CapitalRange']; - $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType); - - - if(count($AvlBudget)>0) + $CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode,$FYdt,$ReqType); + + + if(count($CapitalAvlBudget)>0) { - $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; - } + + + $data['AvlCapitalBudAmt'] = $CapitalAvlBudget[0]['BudgetAmount'] - $CapitalAvlBudget[0]['Totalvalue']; + } if($CapitalRange=='0'){ $data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO); @@ -2627,16 +2638,19 @@ function addNewImportPurchaseOrder() /*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])){ + +if(!empty($totalAmt[1]) && $totalAmt[1]!=0){ $point = $totalAmt[1]; + $ShowPaise='1'; } else{ $point=0; + $ShowPaise='0'; } @@ -2679,7 +2693,8 @@ $point=0; " " . $words[$point / 10] . " " . $words[$point = $point % 10] : ''; -if(($point=='' || $point=='00' || $point=='0') && $points==''){ +if($ShowPaise=='0'){ + $amountInWords = "Rupee " . $result." Only"; } else{ @@ -2691,16 +2706,18 @@ $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])){ +if(!empty($totalAmt[1]) && $totalAmt[1]!=0){ $point = $totalAmt[1]; + $ShowPaise='1'; } else{ $point=0; + $ShowPaise='0'; } $hundred = null; @@ -2742,7 +2759,7 @@ $point=0; " " . $words[$point / 10] . " " . $words[$point = $point % 10] : ''; -if(($point=='' || $point=='00' || $point=='0') && $points==''){ +if($ShowPaise=='0'){ $amountInWords = $name." " . $result." Only"; } else{ diff --git a/application/controllers/purchaseorder.php~ b/application/controllers/purchaseorder.php~ index 07dd895d..9c65ae6b 100755 --- a/application/controllers/purchaseorder.php~ +++ b/application/controllers/purchaseorder.php~ @@ -41,11 +41,14 @@ class purchaseorder extends BaseController $this->loadViews("viewfullpurchaseorder", $this->global,Null); } - function advancerequest() + function advancerequest() { - $this->global['pageTitle'] = 'Siddharth : Advance Request'; + $this->global['pageTitle'] = 'Siddharth : Advance Request'; + + $data['PONO']=$this->purchaseorder_model->getadvancePONO('ST026'); + //print_r($data['PONO']); - $this->loadViews("advancerequest", $this->global, NULL , NULL); + $this->loadViews("advancerequest", $this->global, $data, NULL); } function requisition() { @@ -103,105 +106,146 @@ class purchaseorder extends BaseController /** * This function used to show the Purchase Order Screen */ - function CreatePurchaseOrder() + function CreatePurchaseOrder() { - - $this->form_validation->set_rules('txtReqNo', 'txtReqNo', 'callback_Req_validate'); - - if($this->form_validation->run() == FALSE) + + $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->getSupplierPayment('C009'); - $data['Payment']=$this->purchaseorder_model->getPaymentTermsDetails(); - //$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); - $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); - + $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 = ''; - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - $Year = $dt->format('Y'); + $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 = ''; - foreach ($ReqDetails as $Rs): - $CostCode = $Rs->CostCenterCode; - endforeach; - - $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); - - - if(count($AvlBudget)>0) + $this->load->model('costcenter_model'); + $FYStart = ''; + $FYEnd = ''; + $FiscalYear = $this->costcenter_model->getFiscalYear(); + if(!empty($FiscalYear)) { - $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; - } - /* End Here */ + foreach ($FiscalYear as $Fy) + { + $FYStart =$Fy->StartYear; + $FYEnd =$Fy->EndYear; + //$FYEnd=$FYStart+1; + } - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - // $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']); + } + + $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'; - } + + $ViewName = ''; + if($ReqType == REVENUE) + { + $ViewName = 'purchaseorder'; + } else if($ReqType == SERVICE) - { - $ViewName = 'servicePurchaseorder'; - } - else if($ReqType == IMPORT) - { - $ViewName = 'importpo'; - } - else if($ReqType == CAPITAL) - { - $ViewName = 'capitalpurchaseorder'; - } + { + $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() { @@ -231,6 +275,35 @@ class purchaseorder extends BaseController } } + + 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); @@ -290,12 +363,25 @@ class purchaseorder extends BaseController } $CostCode = ''; - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $Year = $dt->format('Y'); + $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,$Year,$ReqType); + $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType); if(count($AvlBudget)>0) { $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; @@ -318,7 +404,7 @@ class purchaseorder extends BaseController $data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate(); $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); - if($ReqType == SERVICE) + if($ReqType == SERVICE) { $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO); @@ -335,20 +421,20 @@ class purchaseorder extends BaseController $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($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 Revenue Purchase order form'; $this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL); } else if($ReqType == IMPORT) { - $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); + $AvlBudget = $this->purchaseorder_model->GetAvailableImportBudgetAmount($CostCode,$FYdt,$ReqType); if(count($AvlBudget)>0) { - $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; + $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['TotalValue']; } - // print_r($data); + //print_r($data['AvlBudAmt']); $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetails($PONO); $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); foreach($data['POMaster'] as $CUR) @@ -375,17 +461,20 @@ class purchaseorder extends BaseController $this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form'; $this->loadViews("editimportpo", $this->global, $data, NULL); } - else if($ReqType == CAPITAL) + else if($ReqType == CAPITAL) { $CapitalRange = $_GET['CapitalRange']; - $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); - - - if(count($AvlBudget)>0) + $CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode,$FYdt,$ReqType); + + + if(count($CapitalAvlBudget)>0) { - $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; - } + + + $data['AvlCapitalBudAmt'] = $CapitalAvlBudget[0]['BudgetAmount'] - $CapitalAvlBudget[0]['Totalvalue']; + } + if($CapitalRange=='0'){ $data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO); } @@ -395,7 +484,7 @@ class purchaseorder extends BaseController $data['requestedBy'] = $this->purchaseorder_model->GetRequesedByDetails($PONO); - $CapitalRange=''; + //$CapitalRange=''; foreach($data['POItem'] as $Rate) { $exRate=$Rate->ExchangeRate; @@ -406,6 +495,7 @@ class purchaseorder extends BaseController $Currency=$CUR->CurrencyType; } + if($CapitalRange=='0'){ $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); $data['ExchangeRate']=$exRate; @@ -622,44 +712,35 @@ class purchaseorder extends BaseController } //This used to Create Revenue Purchase Order + function addNewPurchaseOrder() { + $POdt =$this->input->post('PODate'); $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); + $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 = ''; - } + $DeliveryOption = $this->input->post('DateRange'); + 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'; - } - $POType = $this->input->post('POType'); $PoRange = $this->input->post('txtPoRange'); - $SpcialInstruction = $this->input->post('txtSpcialInstruction'); + $SpcialInstruction = $this->input->post('SpcialInstruction'); $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); - $POStatus = $this->input->post('txtStatus'); + $POStatus = $this->input->post('txtStatus'); - $CreateBy = $this->session->userdata ( 'userId' ); + $CreateBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('txtRowCount'); $DeletedRow = $this->input->post('txtDeletedRow'); @@ -669,9 +750,13 @@ $DeliveryOption = $this->input->post('DateRange'); $createddt = $dt->format('Y-m-d H:i:s'); $PaymentTerms=$this->input->post('PaymentTerms'); - $Payableat=$this->input->post('PayableAT'); + $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,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays,'POType'=>$POType); + $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); @@ -700,26 +785,20 @@ $DeliveryOption = $this->input->post('DateRange'); $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); + $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) { @@ -751,7 +830,7 @@ $DeliveryOption = $this->input->post('DateRange'); 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); + $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'; @@ -765,6 +844,7 @@ $DeliveryOption = $this->input->post('DateRange'); //This used to Edit the Revenue Purchase Order function EditRevenuePurchaseOrder() { + $PONO =$this->input->post('txtPONO'); $POdt =$this->input->post('PODate'); $PODate = $this->getDateformat($POdt); @@ -773,27 +853,18 @@ $DeliveryOption = $this->input->post('DateRange'); $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 = ''; - } + 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'; - } $POType = $this->input->post('POType'); $PoRange = $this->input->post('txtPoRange'); @@ -811,18 +882,17 @@ $DeliveryOption = $this->input->post('DateRange'); $updateddt = $dt->format('Y-m-d H:i:s'); $PaymentTerms=$this->input->post('PaymentTerms'); - $Payableat=$this->input->post('PayableAT'); + $OtherPayment=$this->input->post('Otherpayment'); + $Local_Interstate=$this->input->post('Range'); // PO Master // 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,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays); + $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; - - //echo $RowCount; for ($i = 1; $i <= $RowCount; $i++) { @@ -838,23 +908,17 @@ $DeliveryOption = $this->input->post('DateRange'); $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); + $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); - $InsuranceValue = $this->input->post('Insval'.$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); @@ -876,10 +940,12 @@ $DeliveryOption = $this->input->post('DateRange'); } } + 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) @@ -890,6 +956,7 @@ $DeliveryOption = $this->input->post('DateRange'); } else { + $LineItemNo = $POLineItemNo; $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter); @@ -899,14 +966,15 @@ $DeliveryOption = $this->input->post('DateRange'); $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); + $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,'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); + + $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); @@ -965,6 +1033,63 @@ $DeliveryOption = $this->input->post('DateRange'); $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) { @@ -1020,6 +1145,69 @@ $DeliveryOption = $this->input->post('DateRange'); } + + +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) { @@ -1109,7 +1297,9 @@ public function importpoprint($PONO) $data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal); - $this->load->View("importpopdf", $data); + $this->load->View("importpopdf", $data); + + // $this->load->View("mririmportpopdf", $data); // Add header to pdf @@ -1131,6 +1321,130 @@ public function importpoprint($PONO) } + +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 */ @@ -1374,9 +1688,9 @@ function addNewImportPurchaseOrder() //echo "dfds"; //die(); - $PONO =$this->input->post('txtPONO'); -$POdt = ''; -$createddt=''; + $PONO =$this->input->post('txtPONO'); + $POdt = ''; + $createddt=''; $PODate = $this->getDateformat($POdt); $SupplierID = $this->input->post('drpSupplier'); @@ -1430,8 +1744,9 @@ $createddt=''; // } $SpcialInstruction = $this->input->post('txtSpcialInstruction'); - $TotalOrder = $this->input->post('txtToatlOrder'); - //echo $TotalOrder; + //$TotalOrder = $this->input->post('txtToatlOrder'); + $TotalOrder = $this->input->post('txttot'); + // echo $TotalOrder; //die(); $POStatus = $this->input->post('txtStatus'); @@ -1714,207 +2029,280 @@ $createddt=''; } } /* Add capital Po*/ - function addNewCapitalPurchaseOrder() + function addNewCapitalPurchaseOrder() { - $POdt =$this->input->post('PODate'); - $PODate = $this->getDateformat($POdt); + $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'); + $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){ + /* $DeliveryOption = $this->input->post('DateRange'); + if($DeliveryOption==1){ $Deliverydt = ''; $DeliverySchedule = $this->input->post('Scheduleby'); } - else{ - $Deliverydt = $this->getDateformat($dt); + 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'); - $PayableAT = $this->input->post('PayableAT'); + $OtherPayment=$this->input->post('Otherpayment'); + - $PaymentDate=$this->input->post('PaymentDate'); - $SpcialInstruction = $this->input->post('txtSpcialInstruction'); - $TotalOrder = $this->input->post('CapitalToatlOrder'); - $POStatus = $this->input->post('txtStatus'); - + + $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'); + $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'); + $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,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID); + $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); + + $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); + + $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); + $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); + $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); + $ExciseDutySH = $this->input->post('beforeExciseDutySHCess'.$i); + $AfterExciseDutySH = $this->input->post('ExciseDutySHCess'.$i); - $CustomEd= $this->input->post('beforeCustomEDCess'.$i); - $AfterCustomEd= $this->input->post('CustomEDCess'.$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); + $CustomSH = $this->input->post('beforeCustomSHCess'.$i); + $AfterCustomSH = $this->input->post('CustomSHCess'.$i); - $AddAdtional = $this->input->post('beforeAdditionalExciseDuty'.$i); - $AfterAddAdtional = $this->input->post('AdditionalExciseDuty'.$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); + $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); + + $Totalvalueitem=$this->input->post('PerKgExpense'.$i); - //echo $BasicPriceinmton; - $CostCenter = $this->input->post('CPCostCode'.$i); - $ServiceTax = $this->input->post('AfterServiceTax'.$i); - $EduCess = $this->input->post('AfterEduCess'.$i); - $SecHighTax = $this->input->post('AfterSecHighTax'.$i); - $KrishiTax = $this->input->post('AfterKrishiTax'.$i); - $SwachhTax = $this->input->post('AfterSwachhTax'.$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); - - $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - - $LineItemNo = ''; - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - //echo $LineItemNo; - - if(trim($POType) == CAPITAL ) - { - $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); + //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'){ - $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); + $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 ; + + + } + } + + } + 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'); - $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){ + /* $DeliveryOption = $this->input->post('DateRange'); + if($DeliveryOption==1){ $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); + $DeliverySchedule = $this->input->post('Scheduleby'); } else{ - $Deliverydt = $this->getDateformat($dt); + //$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'){ @@ -1930,167 +2318,180 @@ $createddt=''; $ExchangeRate=$this->input->post('ExchangeRt'); } $PaymentMethod = $this->input->post('PaymentMethod'); - $PayableAT = $this->input->post('PayableAT'); + $OtherPayment=$this->input->post('Otherpayment'); - $PaymentDate=$this->input->post('PaymentDate'); - $SpcialInstruction = $this->input->post('txtSpcialInstruction'); - $TotalOrder = $this->input->post('CapitalToatlOrder'); - $POStatus = $this->input->post('txtStatus'); - + + $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'); + $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,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID); - - - $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); + $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'); + - $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); + $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); - $CustomDuty = $this->input->post('beforeCustomDuty'.$i); - $AfterCustomDuty = $this->input->post('CustomDuty'.$i); + + $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); - $ExciseDuty = $this->input->post('beforeExciseDuty'.$i); - $AfterExciseDuty = $this->input->post('ExciseDuty'.$i); - $ExciseDutyEd = $this->input->post('beforeExciseDutyEDCess'.$i); - $AfterExciseDutyEd = $this->input->post('ExciseDutyEDCess'.$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); - $ExciseDutySH = $this->input->post('beforeExciseDutySHCess'.$i); - $AfterExciseDutySH = $this->input->post('ExciseDutySHCess'.$i); + $CustomDuty = $this->input->post('beforeCustomDuty'.$i); + $AfterCustomDuty = $this->input->post('CustomDuty'.$i); - $CustomEd= $this->input->post('beforeCustomEDCess'.$i); - $AfterCustomEd= $this->input->post('CustomEDCess'.$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); - $CustomSH = $this->input->post('beforeCustomSHCess'.$i); - $AfterCustomSH = $this->input->post('CustomSHCess'.$i); + $ExciseDutySH = $this->input->post('beforeExciseDutySHCess'.$i); + $AfterExciseDutySH = $this->input->post('ExciseDutySHCess'.$i); - $AddAdtional = $this->input->post('beforeAdditionalExciseDuty'.$i); - $AfterAddAdtional = $this->input->post('AdditionalExciseDuty'.$i); + $CustomEd= $this->input->post('beforeCustomEDCess'.$i); + $AfterCustomEd= $this->input->post('CustomEDCess'.$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); + $CustomSH = $this->input->post('beforeCustomSHCess'.$i); + $AfterCustomSH = $this->input->post('CustomSHCess'.$i); - - $Totalvalueitem=$this->input->post('PerKgExpense'.$i); + $AddAdtional = $this->input->post('beforeAdditionalExciseDuty'.$i); + $AfterAddAdtional = $this->input->post('AdditionalExciseDuty'.$i); - //echo $BasicPriceinmton; - $CostCenter = $this->input->post('CPCostCode'.$i); - $ServiceTax = $this->input->post('AfterServiceTax'.$i); - $EduCess = $this->input->post('AfterEduCess'.$i); - $SecHighTax = $this->input->post('AfterSecHighTax'.$i); - $KrishiTax = $this->input->post('AfterKrishiTax'.$i); - $SwachhTax = $this->input->post('AfterSwachhTax'.$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); - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); - $POLineItemNo = $this->input->post('LineItemNo'.$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']; - } - //echo $LineItemNo; - - if(trim($POType) == CAPITAL ) - { - $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); + + $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); - $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); - - } - - } - else - { - $LineItemNo = $POLineItemNo; + $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); - $ServiceTaxList = array('ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt); - - $ServiceTax = $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList); - $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 ; + + $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) + public function CapitalPoPrint($PONO) { @@ -2159,529 +2560,242 @@ $createddt=''; } + + + + 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($number) - -{ - - list($integer, $fraction) = explode(".", (string) $number); - - $output = "Rupee"." "; - - if ($integer{0} == "-") - - { - - $output = "negative "; - - $integer = ltrim($integer, "-"); - - } - - else if ($integer{0} == "+") - - { - - $output = "positive "; - - $integer = ltrim($integer, "+"); - - } - - if ($integer{0} == "0") - - { - - $output .= "zero"; - - } - - else - - { - - $integer = str_pad($integer, 36, "0", STR_PAD_LEFT); - - $group = rtrim(chunk_split($integer, 3, " "), " "); - - $groups = explode(" ", $group); - - $groups2 = array(); - - foreach ($groups as $g) - - { - - $groups2[] = $this->convertThreeDigit($g{0}, $g{1}, $g{2}); - - } - - for ($z = 0; $z < count($groups2); $z++) - - { - - if ($groups2[$z] != "") - - { - - $output .= $groups2[$z] . $this->convertGroup(11 - $z) . ( - - $z < 11 - - && !array_search('', array_slice($groups2, $z + 1, -1)) - - && $groups2[11] != '' - - && $groups[11]{0} == '0' - - ? " " - - : ", " - - ); - - } - - } - - $output = rtrim($output, ", "); - - } - - if ($fraction > 0) - - { - - $output .= " paise"; - - for ($i = 0; $i < strlen($fraction); $i++) - - { - - $output .= " " . $this->convertDigit($fraction{$i}); - - } - - } - - return $output; + 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'; } - /* get symbol based amount in words*/ - - - public function convertNumberSymbol($number,$symbol,$name,$paise) - -{ - - list($integer, $fraction) = explode(".", (string) $number); - - $output = $name." "; - - if ($integer{0} == "-") - - { - - $output = "negative "; - - $integer = ltrim($integer, "-"); - - } - - else if ($integer{0} == "+") - - { - - $output = "positive "; - - $integer = ltrim($integer, "+"); - - } - - if ($integer{0} == "0") - - { - - $output .= "zero"; - - } - - else - - { - - $integer = str_pad($integer, 36, "0", STR_PAD_LEFT); - - $group = rtrim(chunk_split($integer, 3, " "), " "); - - $groups = explode(" ", $group); - - $groups2 = array(); - - foreach ($groups as $g) - - { - - $groups2[] = $this->convertThreeDigit($g{0}, $g{1}, $g{2}); - - } - - for ($z = 0; $z < count($groups2); $z++) - - { - - if ($groups2[$z] != "") - - { - - $output .= $groups2[$z] . $this->convertGroup(11 - $z) . ( - - $z < 11 - - && !array_search('', array_slice($groups2, $z + 1, -1)) - - && $groups2[11] != '' - - && $groups[11]{0} == '0' - - ? " " - - : ", " - - ); - - } - - } - - $output = rtrim($output, ", "); - - } - - if ($fraction > 0) - - { - - $output .= $paise; - - for ($i = 0; $i < strlen($fraction); $i++) - - { - - $output .= " " . $this->convertDigit($fraction{$i}); - - } - - } - - return $output; - -} -public function convertGroup($index) - -{ - - switch ($index) - - { - - case 11: - - return " decillion"; - - case 10: - - return " nonillion"; - - case 9: - - return " octillion"; - - case 8: - - return " septillion"; - - case 7: - - return " sextillion"; - - case 6: - - return " quintrillion"; - - case 5: - - return " quadrillion"; - - case 4: - - return " trillion"; - - case 3: - - return " billion"; - - case 2: - - return " million"; - - case 1: - - return " thousand"; - - case 0: - - return ""; - - } - + else{ +$point=0; + $ShowPaise='0'; } -public function convertThreeDigit($digit1, $digit2, $digit3) -{ + $hundred = null; + $digits_1 = strlen($no); - $buffer = ""; + $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); - if ($digit1 == "0" && $digit2 == "0" && $digit3 == "0") + $points = ($point) ? + " " . $words[$point / 10] . " " . + $words[$point = $point % 10] : ''; - { +if($ShowPaise=='0'){ - return ""; +$amountInWords = "Rupee " . $result." Only"; +} +else{ - } +$amountInWords = "Rupee " . $result ." Paise ". $points." Only"; +} + - if ($digit1 != "0") - - { - - $buffer .= $this->convertDigit($digit1) . " hundred"; - - if ($digit2 != "0" || $digit3 != "0") - - { - - $buffer .= " and "; - - } - - } - - if ($digit2 != "0") - - { - - $buffer .= $this->convertTwoDigit($digit2, $digit3); - - } - - else if ($digit3 != "0") - - { - - $buffer .= $this->convertDigit($digit3); - - } - - return $buffer; + 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'; } -public function convertTwoDigit($digit1, $digit2) - -{ - - if ($digit2 == "0") - - { - - switch ($digit1) - - { - - case "1": - - return "ten"; - - case "2": - - return "twenty"; - - case "3": - - return "thirty"; - - case "4": - - return "forty"; - - case "5": - - return "fifty"; - - case "6": - - return "sixty"; - - case "7": - - return "seventy"; - - case "8": - - return "eighty"; - - case "9": - - return "ninety"; - - } - - } else if ($digit1 == "1") - - { - - switch ($digit2) - - { - - case "1": - - return "eleven"; - - case "2": - - return "twelve"; - - case "3": - - return "thirteen"; - - case "4": - - return "fourteen"; - - case "5": - - return "fifteen"; - - case "6": - - return "sixteen"; - - case "7": - - return "seventeen"; - - case "8": - - return "eighteen"; - - case "9": - - return "nineteen"; - - } - - } else - - { - - $temp = $this->convertDigit($digit2); - - switch ($digit1) - - { - - case "2": - - return "twenty-$temp"; - - case "3": - - return "thirty-$temp"; - - case "4": - - return "forty-$temp"; - - case "5": - - return "fifty-$temp"; - - case "6": - - return "sixty-$temp"; - - case "7": - - return "seventy-$temp"; - - case "8": - - return "eighty-$temp"; - - case "9": - - return "ninety-$temp"; - - } - - } - + $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"; +} + -public function convertDigit($digit) + 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' ); + - switch ($digit) - - { - - case "0": - - return "zero"; - - case "1": - - return "one"; - - case "2": - - return "two"; - - case "3": - - return "three"; - - case "4": - - return "four"; - - case "5": - - return "five"; - - case "6": - - return "six"; - - case "7": - - return "seven"; - - case "8": - - return "eight"; - - case "9": - - return "nine"; - - } + $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/supplier.php b/application/controllers/supplier.php index ec94df7b..56422769 100755 --- a/application/controllers/supplier.php +++ b/application/controllers/supplier.php @@ -407,11 +407,10 @@ class supplier extends BaseController $this->excel->getActiveSheet()->setCellValue('N1', 'Collectrate Address'); $this->excel->getActiveSheet()->setCellValue('O1', 'UANumber'); $this->excel->getActiveSheet()->setCellValue('P1', 'PaymentTerms'); - $this->excel->getActiveSheet()->setCellValue('Q1', 'PaymentDays'); - $this->excel->getActiveSheet()->setCellValue('R1', 'PayableAT'); - $this->excel->getActiveSheet()->setCellValue('S1', 'Createdby'); - $this->excel->getActiveSheet()->setCellValue('T1', 'UpdatedBy'); - $this->excel->getActiveSheet()->setCellValue('U1', 'IsActive'); + + $this->excel->getActiveSheet()->setCellValue('Q1', 'Createdby'); + $this->excel->getActiveSheet()->setCellValue('R1', 'UpdatedBy'); + $this->excel->getActiveSheet()->setCellValue('S1', 'IsActive'); @@ -454,10 +453,7 @@ class supplier extends BaseController $this->excel->getActiveSheet()->getStyle('R1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('S1')->getFont()->setSize(12); $this->excel->getActiveSheet()->getStyle('S1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('T1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('T1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('U1')->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle('U1')->getFont()->setBold(true); + $exportData = $this->supplier_model->export_excel(); @@ -483,11 +479,10 @@ class supplier extends BaseController $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['PaymentDays']); - $this->excel->getActiveSheet()->setCellValue('R' . $i,$data['PayableAT']); - $this->excel->getActiveSheet()->setCellValue('S' . $i,$data['firstname']); - $this->excel->getActiveSheet()->setCellValue('T' . $i,$data['Update_by']); - $this->excel->getActiveSheet()->setCellValue('U' . $i,$data['IsActive']); + + $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++; diff --git a/application/controllers/supplier.php~ b/application/controllers/supplier.php~ new file mode 100755 index 00000000..56422769 --- /dev/null +++ b/application/controllers/supplier.php~ @@ -0,0 +1,513 @@ +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/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index d728c889..18615f1e 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -1527,4 +1527,19 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode 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/purchaseorder_model.php~ b/application/models/purchaseorder_model.php~ index 18f900ac..18615f1e 100755 --- a/application/models/purchaseorder_model.php~ +++ b/application/models/purchaseorder_model.php~ @@ -2,6 +2,69 @@ class purchaseorder_model extends CI_Model { + function GetServicePOListforStatusUpdate() + { + $this->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 @@ -60,7 +123,7 @@ function purchaseorderListing($forwhat='') */ function getSupplierName($supID='') { - $this->db->select('SupplierID, SupplierName,Address,PaymentTerms,PayableAT,PaymentDays'); + $this->db->select('SupplierID, SupplierName,Address,PaymentID'); $this->db->from('T_SupplierDetailsN'); if($supID != '') { @@ -183,8 +246,10 @@ function purchaseorderListing($forwhat='') from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and BudgetYear = ? and BudgetType =?'; */ - $subQuery ='select BudgetAmount, (select ifnull(sum(Quantity*Rate),0) as Totalvalue from - T_PurchaseOrder_LineItem Item join T_Requestion_Master mast on mast.ReqNo = Item.ReqNo where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue + $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 =?'; @@ -194,7 +259,7 @@ function purchaseorderListing($forwhat='') } - + function GetAvailableImportBudgetAmount($CostCode,$Year,$BudgetType) { $subQuery='select BudgetAmount,(select ifnull(sum((Quantity*Rate*ExchangeRate)),0)as TValue from T_PurchaseOrder_LineItem LineItem @@ -289,7 +354,7 @@ function purchaseorderListing($forwhat='') */ function getRequistionNoFromPO($PONO='') { - + $this->db->distinct(); $this->db->select('ReqNo,'); $this->db->from('T_PurchaseOrder_LineItem'); if($PONO != '') @@ -468,6 +533,19 @@ function purchaseorderListing($forwhat='') $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; + + + } /** @@ -490,7 +568,7 @@ function purchaseorderListing($forwhat='') function GetServicePurchaseOrder($PONO = '') { $this->db->distinct(); - $this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.PaymentDays,POMast.PayableAT,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,POMast.ServiceWorkStatus,POMast.*'); + $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'); @@ -511,7 +589,7 @@ function purchaseorderListing($forwhat='') function GetServicePurchaseOrderDetails($PONO = '') { - $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,ReceivedQuantity,Rate,LineItem.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,ROUND((After_CGST + After_SGST + After_IGST),2)as Taxamount + $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 @@ -525,13 +603,62 @@ function purchaseorderListing($forwhat='') } - - // This Method to get the Revenue PO Child Details for Edit the Item - function GetRevenuePurchaseOrderDetails($PONO = '') + // This Method to get the Service PO Child Details for Edit the Item + function GetServicePurchaseOrderDetailsForPrint($PONO = '') { - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue , ROUND(((AfterPackagingValue + AfterFreightValue + AfterExciseDuty + AfterVAT + AfterCST + AfterGST + AfterOtherTaxes + Insurance) - AfterDiscount ),2)as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName - FROM T_PurchaseOrder_LineItem LineItem + $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 @@ -551,15 +678,18 @@ function purchaseorderListing($forwhat='') { $subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName, - Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue , - ROUND(((AfterPackagingValue + AfterFreightValue + AfterExciseDuty + AfterVAT + AfterCST + - AfterGST + AfterOtherTaxes + Insurance)) ,2)as Taxamount , - TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address + 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)); @@ -568,7 +698,29 @@ function purchaseorderListing($forwhat='') } +// 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 = '') { @@ -586,16 +738,20 @@ function GetImportPurchaseOrderDetailsForPDF($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 , POMaster.*,sup.SupplierName,sup.Address +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)); + $query = $this->db->query($subQuery,array($PONO)); + //print_r($this->db->last_query()); return $query->result(); @@ -723,6 +879,28 @@ QuantityRejected,ROUND(ReceivedQuantity-QuantityRejected)as PendingQty, } + + 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(); + + + } @@ -763,7 +941,7 @@ function GetCurrencytype() // To update Parent PO as Amended PO function updateAmendPOMaster($PONO,$PODetail) { - echo $PONO."from model"; + //echo $PONO."from model"; $this->db->where('PONO', $PONO); @@ -1067,37 +1245,39 @@ function GetCurrencytype() { $this->db->distinct(); - $this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,mast.POType as ReqType,bud.BudgetAmount,mast.Remarks'); + $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('tbl_users tbl', 'mast.createdby=tbl.userid'); - $this->db->join('T_Employee_Details as emp', 'emp.empid=tbl.empid'); + $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 and ccm.CostCenterCode = bud.CostCenterCode'); + //$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); // EMERGENGY PO + $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()); + // print_r($this->db->last_query()); return $result->result(); - - - - - - } + + } function UpdatePO($store, $PONO) @@ -1126,15 +1306,14 @@ function GetCurrencytype() function getCapitalPurchaseOrderDetails($PONO = '') { - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName, -Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount - ,ServiceTax.TotalValue,ServiceTax,EducessTax,ServiceTax.SecHigherEducessTax,ServiceTax.KrishiKalyantax,ServiceTax.SwachhBharattax, + $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_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_Employee_Details emp on Req.Requestedby = emp.EmpID @@ -1150,18 +1329,18 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode } // This Method to get the Capital PO Details for pdf - function GetCapitalPurchaseOrderDetailsForPDF($PONO = '') + function GetCapitalPurchaseOrderDetailsForPDF($PONO = '') { $subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName, - Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue , - ROUND((ServiceTax + EducessTax + SecHigherEducessTax + KrishiKalyantax + SwachhBharattax),2)as Taxamount - ,TotalValue,ServiceTax,EducessTax,SecHigherEducessTax,KrishiKalyantax,SwachhBharattax,CostCenterCode , POMaster.*,sup.SupplierName,sup.Address + 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_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 where LineItem.PONO =?'; $query = $this->db->query($subQuery,array($PONO)); @@ -1187,12 +1366,12 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode // get domestic capital po list - function getDomesticCapitalPurchaseOrderDetails($PONO = '') + function getDomesticCapitalPurchaseOrderDetails($PONO = '') { - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName, - Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount - ,ServiceTax.TotalValue,ServiceTax,EducessTax,ServiceTax.SecHigherEducessTax,ServiceTax.KrishiKalyantax,ServiceTax.SwachhBharattax, + $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 @@ -1214,7 +1393,7 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode //get pdf po requistion details - function GetPdfRequistionDetails($PONO){ + function GetPdfRequistionDetails($PONO){ $this->db->select('LineItem.ReqNo'); $this->db->from('T_PurchaseOrder_LineItem LineItem'); $this->db->where('LineItem.PONO',$PONO); @@ -1228,16 +1407,29 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode } else{ $ReqNo = $res->ReqNo; - $this->db->select('ReqMast.ReqNo,ReqMast.CostCenterCode,re.FirstName,Dept.DEPCode,Dept.DepartmentName'); + $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; } @@ -1246,7 +1438,7 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode $RequistionDetails = $ResultArray; return $RequistionDetails; } - function GetLineItemReceivedQty($ParentPO,$MaterialCode) + function GetLineItemReceivedQty($ParentPO,$MaterialCode) { $this->db->select('ReceivedQuantity'); $this->db->from('T_PurchaseOrder_LineItem'); @@ -1283,4 +1475,71 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode return $query->result(); } -} \ No newline at end of file + + + 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/views/Editmaterialinspectionreport.php b/application/views/Editmaterialinspectionreport.php index d2b45292..c32229d9 100755 --- a/application/views/Editmaterialinspectionreport.php +++ b/application/views/Editmaterialinspectionreport.php @@ -93,9 +93,9 @@ if(!empty($MRIRDetails))

-
-
-
+
+ +
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
@@ -310,8 +310,8 @@ if(!empty($MRIRDetails)) - - + + + + + +
+ +
+

+
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/alterpurchaseorder.php b/application/views/alterpurchaseorder.php index e0691320..5641f45a 100755 --- a/application/views/alterpurchaseorder.php +++ b/application/views/alterpurchaseorder.php @@ -2337,7 +2337,7 @@ function populateValueMainFormForDeleteItem(rowid)
-
+ diff --git a/application/views/alterpurchaseorder.php~ b/application/views/alterpurchaseorder.php~ index 6befbaf6..5641f45a 100755 --- a/application/views/alterpurchaseorder.php~ +++ b/application/views/alterpurchaseorder.php~ @@ -1,4 +1,3 @@ - tinymce.init({ - selector: "textarea#ScopeOfWork"//, + selector: "textarea#ScopeOfWork", - //plugins: "link image" + menubar: false, + statusbar: false, + toolbar: false }); tinymce.init({ - selector: "textarea#txtSpcialInstruction"//, + selector: "textarea#txtSpcialInstruction", - //plugins: "link image" + menubar: false, + statusbar: false, + toolbar: false }); + - \ No newline at end of file + // set default null value + function clearTotalItemValues(){ + + $('#txtTotBasicAmount').val(''); + $('#txtTotCgst').val(''); + $('#txtTotSgst').val(''); + $('#txtTotIgst').val(''); + $('#txtTotOtherAllo').val(''); + $('#txtTotalOrderValueSummaryService').val(''); + $('#txtTotBasicAmountRevenue').val(''); + $('#txtTotalDiscount').val(''); + $('#txtTotalPackaing').val(''); + + $('#txtTotalCGST').val(''); + $('#txtTotalSGST').val(''); + $('#txtTotalIGST').val(''); + + $('#txtTotalFreight').val(''); + $('#txtTotalInsurance').val(''); + $('#txtTotalOrderValueSummary').val(''); + + } + + \ No newline at end of file diff --git a/application/views/capitalpopdf.php b/application/views/capitalpopdf.php index fb489ff7..dcac429b 100755 --- a/application/views/capitalpopdf.php +++ b/application/views/capitalpopdf.php @@ -274,7 +274,7 @@ Total Amount In Words

- Total Order Amount in Total Order Amount in
+ Total Order Amount in Total Order Amount in
diff --git a/application/views/capitalpopdf.php~ b/application/views/capitalpopdf.php~ new file mode 100755 index 00000000..dcac429b --- /dev/null +++ b/application/views/capitalpopdf.php~ @@ -0,0 +1,325 @@ +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; + $Import_DispatchDetails=''; + } + else{ + $dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata')); + $DeliveryDate = $dtDe->format('d-m-Y'); + $DeliverySchedule = ''; + $Import_DispatchDetails=$PO->Import_DispatchDetails; + } + + + $ServiceDescription =$PO->ServiceDescription; + if($PO->PaymentID!='PT08'){ + $PaymentTerms = $PO->PaymentTerms; + } + else{ + $PaymentTerms = $PO->PaymentTerms . ' ( '.$PO->PaymentOtherDescription.' ) '; + } + $Placeoforigin=$PO->Import_PlaceofOrgin; + $ExchangeRate = $PO->ExchangeRate; + $CapitalRange = $PO->CapitalRange; + } +} + $currencyName='INR'; + $currencyCode =''; + if(!empty($CurrencySymbol)) + { + foreach ($CurrencySymbol as $Curr) + { + + $currencyCode = $Curr->FontCode2000; + $currencyName = $Curr->Currency_Code; + + + } + + } + + + ?> + + +
+
+ DRAFT
'; + + } + + ?> +
+ +
PURCHASE ORDER - PO NO:/C
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+

+
+

Vendor Address :

+


+
+

Delivery To :

+

+
PO DATE :  DISPATCH / SCHEDULE BY :  PLACE OF ORIGIN:
PO DATE :  DELIVERY DATE/ SCHEDULE BY :  
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
Requistion NumberRequistion DateRequested ByRequested DepartmentCost Center  
+

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Quantity*$record->Rate; + ?> + + + + + + + + + + + + + + + + +
#Item CodeItem NameHSN CodeQtyUOMRate Per Unit in Rate Per Unit in Total Amount in Total Amount in
MaterialCode ; ?>MaterialName ; ?>HSNCODE ; ?>Quantity ; ?>UOM ; ?>Rate),2, '.', '') ; ?>Quantity * $record->Rate),2, '.', '');?>
+

 

+ +

Payment Terms: 

+ +

Special Instruction:

+

+ + + + + + + + + + + + + +
Total Amount In Words

+ + Total Order Amount in Total Order Amount in
+ ReleasedOn, new DateTimeZone('Asia/Kolkata')); + + + ?> + + + +

 

+
Released By : FirstName;?>
+
Released On : format('d-m-Y');?>
+ + + + + + +
+

Certified that the particulars given above are true and correct

+

+

 

+

Authorized Signatory

+
+

 

+ + +

 

+ +
\ No newline at end of file diff --git a/application/views/capitalpurchaseorder.php b/application/views/capitalpurchaseorder.php index 2ef31009..8cea8432 100755 --- a/application/views/capitalpurchaseorder.php +++ b/application/views/capitalpurchaseorder.php @@ -24,7 +24,7 @@ if(!empty($AvlBudAmt)) { - $AvlAmount = number_format($AvlBudAmt, 2, '.', ''); + $AvlAmount = number_format($AvlCapitalBudAmt, 2, '.', ''); } @@ -67,6 +67,9 @@ if(!empty($INRSYMBOL)) .select2{ width:100% ! important; } + .num{ + text-align:right; + } #DomesticNOT { margin-top:200px; z-index: 1080 !important; @@ -85,6 +88,7 @@ if(!empty($INRSYMBOL)) toolbar: false }); $(document).ready(function(){ + $("#PaymentMethod").select2(); clearTotalItemValues(); $('#CapitalToatlOrder').val(0); //Initialize Select2 Elements diff --git a/application/views/capitalpurchaseorder.php~ b/application/views/capitalpurchaseorder.php~ new file mode 100755 index 00000000..8cea8432 --- /dev/null +++ b/application/views/capitalpurchaseorder.php~ @@ -0,0 +1,4415 @@ + format('Y-m-d'); + $MaxPoDate = ''; + $AvlAmount = 0; + $paymentDate=''; + $paymentCheckDays='Before'; + $paymentCheckDays1='After'; + 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($AvlCapitalBudAmt, 2, '.', ''); + + } + + // if(!empty($AvlimportBudAmt)) + // { + + // $AvlAmount = $AvlimportBudAmt; + + // } + + + +$INR=''; +$INRSYM=''; +if(!empty($INRSYMBOL)) +{ + foreach ($INRSYMBOL as $INR) + { + $INRSYM=$INR->Currency_Code; + $INR=$INR->FontCode2000; + } +} + +// echo $INRSYM; +// echo $INR; + + ?> + + + + + + +
+ 'form-label-left CapitalPO ','name' => 'CapitalPO','id' => 'ImportPO'); + + echo form_open($this->config->base_url().'/purchaseorder/addPO/',$attributes); ?> + + +
+
+
+
+ +

Siddharth Industries - Capital 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"'); + + ?> +
+
+ +
+ + + + 'Select Currency Type '); + //print_r( $options); + + if(!empty($Currency)) + { + + + foreach ($Currency as $Cur): + + $options[$Cur->Currency_Code] = $Cur->Currency_Code.' '.' - '.' '.$Cur->Country_and_Currency; + + endforeach; + } + + echo form_dropdown('currencytype', $options,set_value('currencytype'),'id="currencytype"','class="form-control select2"' , 'required="true"'); + + ?> + +
+
+ +
+
+
+
+ + + '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',CAPITAL),'id'=>'POType', 'class' => 'form-control' ,'readonly' => 'true'); + echo form_input($data); + ?> +
+
+
+ +
+ 'PODate','value' => set_value('PODate',$CurrentDate),'id'=>'PODate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;'); + 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"=>"2", 'checked'=>set_radio('DateRange', '2', FALSE))); ?>     +
+
+ + "DateRange", "id"=>"DeliverycheckDate", "value"=>"0", 'checked'=>set_radio('DateRange', '0', FALSE))); ?>     +
+ + "DateRange", "id"=>"Schedule", "value"=>"1", 'checked'=>'checked')); ?> + + + +
+ +
+ + + 'Scheduleby','value' => set_value('Scheduleby'),'id'=>'Scheduleby', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40'); + echo Form_textarea($data); + ?> + +
+ + + +
+ +
+
+ +
+
+ +
+ 'Exchangerateon','value' => set_value('Exchangerateon',$CurrentDate),'id'=>'Exchangerateon', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;'); + echo form_input($data); + ?> +
+
+
+ +
+ 'ExchangeRt','value' => set_value('ExchangeRt'),'id'=>'ExchangeRt', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);'); + echo form_input($data); + ?> +
+ +
+ + +
+ +
+ 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;'); + // echo form_input($data); + $data = array('name' => 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true'); + echo form_input($data); + ?> +
+
+
+
+
+ Payment Details + +
+ Payable Terms + + + + 'Select Payment method'); + //print_r( $options); + + if(!empty($Payment)) + { + foreach ($Payment as $payment): + + $options1[$payment->PaymentID] = $payment->PaymentTerms; + + endforeach; + } + + echo form_dropdown('PaymentMethod', $options1,set_value('PaymentMethod'),'id="PaymentMethod"' ,'class="form-control"'); + + ?> + +
+ + + + +
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + +
SNoRequisition NoItem CodeItem DescriptionQuantityUOMRateBasic AmountTax AmountTotal Order AmountAction
+
+
+ +
+
+ + + +
+ + + + + + + + + +
+ + +
+ + +
+ +
+
+ + '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); + ?> + +
+
+
+ +
+
+ +
+ + + 'txttotallanding','value' => set_value('txttotallanding'),'id'=>'txttotallanding', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalhighseas','value' => set_value('txttotalhighseas'),'id'=>'txttotalhighseas', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalcustom','value' => set_value('txttotalcustom'),'id'=>'txttotalcustom', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalexcise','value' => set_value('txttotalexcise'),'id'=>'txttotalexcise', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalexciseED','value' => set_value('txttotalexciseED'),'id'=>'txttotalexciseED', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ + +
+ + + 'txttotalexciseSH','value' => set_value('txttotalexciseSH'),'id'=>'txttotalexciseSH', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalcustomED','value' => set_value('txttotalcustomED'),'id'=>'txttotalcustomED', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalcustomSH','value' => set_value('txttotalcustomSH'),'id'=>'txttotalcustomSH', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalAdditionalExciseduty','value' => set_value('txttotalAdditionalExciseduty'),'id'=>'txttotalAdditionalExciseduty', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ + +
+ + + 'txttotalgrossduty','value' => set_value('txttotalgrossduty'),'id'=>'txttotalgrossduty', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalavlmodvat','value' => set_value('txttotalavlmodvat'),'id'=>'txttotalavlmodvat', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ + +
+ + + 'txttotalgrossexpense','value' => set_value('txttotalgrossexpense'),'id'=>'txttotalgrossexpense', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ +
+
+ + + 'CapitalToatlOrder','value' => set_value('CapitalToatlOrder'),'id'=>'CapitalToatlOrder', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:left;'); + echo form_input($data); + ?> +
+
+
+ 'txtSpcialInstruction','value' => set_value('txtSpcialInstruction'),'id'=>'txtSpcialInstruction', 'class' => 'form-control','rows' => '10', 'cols' => '40' ); + echo form_textarea($data); + ?> +
+ +
+ + + + + + + + + + +   Save +   Submit + + +
+
+
+
+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/application/views/editCapitalPo.php b/application/views/editCapitalPo.php index 367935cb..b1add54b 100755 --- a/application/views/editCapitalPo.php +++ b/application/views/editCapitalPo.php @@ -127,7 +127,7 @@ if(!empty($POMaster)) if(!empty($AvlBudAmt)) { - $AvlAmount = number_format($AvlBudAmt, 2, '.', ''); + $AvlAmount = number_format($AvlCapitalBudAmt, 2, '.', ''); } ?> @@ -146,6 +146,9 @@ if(!empty($AvlBudAmt)) .select2{ width:100% ! important; } + .num{ + text-align:right; + } + + + + + + + +
+
+ 'form-label-left CapitalPO ','name' => 'CapitalPO','id' => 'ImportPO'); + + $attributes = array('class' => 'form-label-left CapitalPO ','name' => 'CapitalPO','id' => 'CapitalPO'); + + + + echo form_open($this->config->base_url().'/purchaseorder/addPO/',$attributes); ?> + + +
+ +
+
+ +

Siddharth Industries - Edit Capital Purchase Order-

+ + +
+
+
+
+
+
+ + 'Selected Requisition Numbers'); + if(!empty($ReqList)) + { + + foreach ($ReqList as $SID): + + $options[$SID->ReqNo] = $SID->ReqNo ."-". $SID->ReqNo; + + endforeach; + } + echo form_multiselect('RequistionNo', $options,set_value('RequistionNo'),'id="RequistionNo"' , 'required="true"'); + + ?> +
+ + +
+
+
+
+ + + SupplierID] = $SID->SupplierID.' '.' - '.' '.$SID->SupplierName; + + endforeach; + } + + echo form_dropdown('drpSupplier', $options2,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',CAPITAL),'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' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?> + + + +
+ + + +

+ + + 'Dispatch','value' => set_value('Dispatch',$Import_DispatchDetails),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true'); + // echo form_input($data); + + $data = array('name' => 'Dispatch','value' => set_value('Dispatch',$Import_DispatchDetails),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40'); + echo Form_textarea($data); + ?> + +
+ +
+ +
+
+ + + + + +
+ +
+ 'PODate','value' => set_value('PODate',$PODate),'id'=>'PODate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;'); + echo form_input($data); + ?> +
+
+ +
+ +
+ 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;'); + // echo form_input($data); + $data = array('name' => 'PlaceOforigin','value' => set_value('PlaceOforigin',$Import_PlaceofOrgin),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true'); + echo form_input($data); + ?> +
+
+ + + +
+
+ Payment Details + +
+ + + PaymentTerms) + { + $options6[$rl->PaymentID] = $rl->PaymentTerms; + } + + endforeach; + + + if(!empty($Payment)) + { + foreach ($Payment as $rl2): + + if($PaymentTerms!=$rl2->PaymentTerms) + { + $options6[$rl2->PaymentID] = $rl2->PaymentTerms; + } + + endforeach; + } + + echo form_dropdown('PaymentMethod', $options6,set_value('PaymentMethod',$PaymentTerms),'id="PaymentMethod"' ,'required="true"' ,'class="form-control select2"'); + + ?> + + + +
+ + + + +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $record->MaterialCode,"ReqNo"=>$record->ReqNo); + array_push($res_arr_values, $row); + ?> + + + + +" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + After_CGST; + $TotalSgst = $TotalSgst + $record->After_SGST; + $TotalIgst = $TotalIgst + $record->After_IGST; + $OtherAmt = $OtherAmt + $record->otherallowance; + $TotalSummary = $TotalSummary+$record->ServiceTaxamount; + } + $TotalBasicAmount = $TotalBasicAmount+$record->BasicValue; + $ServiceDescription = $ServiceDescription; + if($CapitalRange=='0'){ + $TotalLanding = $TotalLanding + $record->AfterLandingCharge; + $tothighseas = $tothighseas + $record->AfterHighSeasSalesCharge; + $totcustom = $totcustom + $record->AfterCustomDuty; + $totexciseduty = $totexciseduty + $record->AfterExciseDuty; + $totexcisedutyED = $totexcisedutyED + $record->AfterExciseDutyEdCess; + $totexciseSH = $totexciseSH + $record->AfterExciseDutySHCess; + $totcustomED = $totcustomED +$record->AfterCustomEdCess; + + $totcustomSH = $totcustomSH + $record->AfterCustomSHCess; + $totaddtnlexcise= $totaddtnlexcise + $record->AfterAddlExciseDuty; + $totgrossduty = $totgrossduty + $record->Grossdutypayable; + $totavlmodvat = $totavlmodvat +$record->AvailableModvat; + + + $totgrossexpense=$totgrossexpense+$record->Grossexpensesduetocustomduty; + $ExchangeRate=$record->ExchangeRate; + + } + + + // $totorder=$totorder+$record->TotalOrderValue; + $totalCapitalOrder = $totalCapitalOrder+$record->Rate * $record->Quantity; + + + + } + ?> + + + + + + + +
SNoRequisition NoItem CodeItem DescriptionQuantityUOMRateBasic AmountTax AmountTotal Order AmountActual QuantityReceived QuantityPending QuantityAction
ReqNo ?>MaterialCode?>MaterialName?>Quantity ?>UOM ?>Rate ?>Rate * $record->Quantity, 2, '.', '') ?>ServiceTaxamount;?> Rate * $record->Quantity, 2, '.', '') ?>Quantity ?>ReceivedQuantity ?>Quantity - $record->ReceivedQuantity, 2, '.', ''); ?>     + +    
+
+
+ +
+
+ +
+
+ +
+
+ + + +
+
+
+
+
+ + '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); + ?> +
+ +
+ + 'TotalOtherAllowances','value' => set_value('TotalOtherAllowances',number_format($OtherAmt, 2, '.', '')),'id'=>'TotalOtherAllowances', 'class' => 'form-control num' ,'readonly' => 'true'); + echo form_input($data); + ?> + +
+
+
+ +
+
+ +
+ + + 'txttotallanding','value' => set_value('txttotallanding',number_format($TotalLanding, 2, '.', '')),'id'=>'txttotallanding', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalhighseas','value' => set_value('txttotalhighseas',number_format($tothighseas, 2, '.', '')),'id'=>'txttotalhighseas', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalcustom','value' => set_value('txttotalcustom',number_format($totcustom, 2, '.', '')),'id'=>'txttotalcustom', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalexcise','value' => set_value('txttotalexcise',number_format($totexciseduty, 2, '.', '')),'id'=>'txttotalexcise', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalexciseED','value' => set_value('txttotalexciseED',number_format($totexcisedutyED, 2, '.', '')),'id'=>'txttotalexciseED', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ + +
+ + + 'txttotalexciseSH','value' => set_value('txttotalexciseSH',number_format($totexciseSH, 2, '.', '')),'id'=>'txttotalexciseSH', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalcustomED','value' => set_value('txttotalcustomED',number_format($totcustomED, 2, '.', '')),'id'=>'txttotalcustomED', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalcustomSH','value' => set_value('txttotalcustomSH',number_format($totcustomSH, 2, '.', '')),'id'=>'txttotalcustomSH', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalAdditionalExciseduty','value' => set_value('txttotalAdditionalExciseduty',number_format($totaddtnlexcise, 2, '.', '')),'id'=>'txttotalAdditionalExciseduty', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ + +
+ + + 'txttotalgrossduty','value' => set_value('txttotalgrossduty',number_format($totgrossduty, 2, '.', '')),'id'=>'txttotalgrossduty', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ +
+ + + 'txttotalavlmodvat','value' => set_value('txttotalavlmodvat',number_format($totavlmodvat, 2, '.', '')),'id'=>'txttotalavlmodvat', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ + +
+ + + 'txttotalgrossexpense','value' => set_value('txttotalgrossexpense',number_format($totgrossexpense, 2, '.', '')),'id'=>'txttotalgrossexpense', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+ + + + + + + + + + +
+
+
+ + + 'CapitalToatlOrder','value' => set_value('CapitalToatlOrder',number_format($totalCapitalOrder, 2, '.', '')),'id'=>'CapitalToatlOrder', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); + echo form_input($data); + ?> +
+
+ +
+ 'txtSpcialInstruction','value' => set_value('txtSpcialInstruction',$ServiceDescription),'id'=>'txtSpcialInstruction', 'class' => 'form-control','rows' => '10', 'cols' => '40' ); + echo form_textarea($data); + ?> +
+ +
+
+
+
+
+ + 'Requeston','value' => set_value('Requeston',$UpdatedOn),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;','readonly' => 'true','readonly' => 'true'); + echo form_input($data); + ?> +
+

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

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

+
+
+
+ +
+ + + + + + + + +   Save +   Submit + + +   OK + +
+
+ +
+ + +
+
+ + + \ No newline at end of file diff --git a/application/views/editRevenuepurchaseorder.php b/application/views/editRevenuepurchaseorder.php index a90157a8..718c9be5 100755 --- a/application/views/editRevenuepurchaseorder.php +++ b/application/views/editRevenuepurchaseorder.php @@ -216,15 +216,7 @@ $(function() { minDate : 'now', dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' }); -$("#Requeston").datepicker({ - //minDate : d, - maxDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' -}); - - - - + $('#drpSupplier').change(function() { @@ -3540,7 +3532,7 @@ function calculateEditTaxValue()
'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;'); + $data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;','readonly' => 'true'); echo form_input($data); ?>
@@ -3549,7 +3541,7 @@ function calculateEditTaxValue()
'RequestBy','value' => set_value('RequestBy', $RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true'); + $data = array('name' => 'RequestBy','value' => set_value('RequestBy', $RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true'); echo form_input($data); ?>
diff --git a/application/views/editRevenuepurchaseorder.php~ b/application/views/editRevenuepurchaseorder.php~ index 29d7f10d..718c9be5 100755 --- a/application/views/editRevenuepurchaseorder.php~ +++ b/application/views/editRevenuepurchaseorder.php~ @@ -1,4 +1,3 @@ - ServiceDescription; $CapitalRange = $Req->CapitalRange; $StatusName=$Req->StatusName; + $otherPayment = $Req->PaymentOtherDescription; } } @@ -144,10 +145,11 @@ if(!empty($RequistionDetails)) @@ -173,6 +175,16 @@ $('#Deliverydt').val(''); $('#Scheduleby').val(SchName); } +var PaymentOther = ''; +var PayTerms = ''; +if(PayTerms=='PT08'){ + $('#otheroptiondiv').show(); + $('#Otherpayment').val(PaymentOther); +} +else{ +$('#otheroptiondiv').hide(); + $('#Otherpayment').val(''); +} }); +
+ '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/inwardgateregister.php b/application/views/inwardgateregister.php index 8e8a48e2..30c44c9f 100755 --- a/application/views/inwardgateregister.php +++ b/application/views/inwardgateregister.php @@ -58,7 +58,7 @@ Inputmask("A{2,3} 9{1,2} A{1,2} 9{4}").mask($("#VehicleNo"));

-
+
diff --git a/application/views/inwardgateregister.php~ b/application/views/inwardgateregister.php~ new file mode 100755 index 00000000..30c44c9f --- /dev/null +++ b/application/views/inwardgateregister.php~ @@ -0,0 +1,576 @@ + + + + + + +
+ +
+

+
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 index 8560e2d0..e81f2d2d 100755 --- a/application/views/materialinspectionreport.php +++ b/application/views/materialinspectionreport.php @@ -87,7 +87,7 @@ if(!empty($IGRDetails))

-
+
@@ -99,7 +99,7 @@ if(!empty($IGRDetails))
-
+
-
+
'PORasiedbyName','value' => set_value('PORasiedbyName',$PORasiedbyName),'id'=>'PORasiedbyName', 'class' => 'form-control' ,'readonly' => 'true'); @@ -148,8 +148,8 @@ if(!empty($IGRDetails)) ?>
-
- +
+
- +
'DeliveryChellanDate','value' => set_value('DeliveryChellanDate',$dcdate),'id'=>'DeliveryChellanDate', 'class' => 'form-control num','readonly' => 'true'); echo form_input($data); @@ -175,7 +175,7 @@ if(!empty($IGRDetails)) ?>
-
+
'CourierNo','value' => set_value('CourierNo',$CourierNo),'id'=>'CourierNo', 'class' => 'form-control','readonly' => 'true'); @@ -186,12 +186,12 @@ if(!empty($IGRDetails))
-
+
-
+
@@ -249,7 +249,7 @@ if(!empty($IGRDetails))
-
+ diff --git a/application/views/materialinspectionreport.php~ b/application/views/materialinspectionreport.php~ new file mode 100755 index 00000000..e81f2d2d --- /dev/null +++ b/application/views/materialinspectionreport.php~ @@ -0,0 +1,394 @@ +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/statusofservicepurchaseorder.php b/application/views/statusofservicepurchaseorder.php index 0b9066cb..95f21f79 100755 --- a/application/views/statusofservicepurchaseorder.php +++ b/application/views/statusofservicepurchaseorder.php @@ -10,7 +10,7 @@ -
+

@@ -93,9 +93,9 @@

-
+

- +
@@ -106,16 +106,16 @@
-
+
- - - - + + + + diff --git a/application/views/statusofservicepurchaseorder.php~ b/application/views/statusofservicepurchaseorder.php~ new file mode 100755 index 00000000..95f21f79 --- /dev/null +++ b/application/views/statusofservicepurchaseorder.php~ @@ -0,0 +1,189 @@ + + + + + +
+ +
+

+
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.NOReqNoReqedbyReqDateSupplierNameReq NoReq ByReq DateSupplier Name Item Code Description UOM
+ + + + + + + + + + + + + + + + + + + + + + +
S.NOReq NoReq ByReq DateSupplier NameItem CodeDescriptionUOMOrdered QuantityRateWork Status
+ + + +
+ +
+ +
+ + \ No newline at end of file