diff --git a/app/Models/Config_model.php b/app/Models/Config_model.php index ef2109e9..960118d6 100755 --- a/app/Models/Config_model.php +++ b/app/Models/Config_model.php @@ -229,15 +229,36 @@ class Config_model extends Model } public function getPONOcreatedBasedOnConfig($key_id){ - $builder = $this->db->table('t_purchaseorder_lineitem PL') - ->select('PL.PONO, MM.MaterialName, CD.ConfigValue as CategoryName') - ->join('t_materialmaster MM', 'MM.MaterialCode = PL.MaterialCode', 'left') - ->join('t_configdetails CD', 'CD.Key = MM.Category', 'left') - ->where('CD.Key', $key_id); + // $builder = $this->db->table('t_purchaseorder_lineitem PL') + // ->select('PL.PONO, MM.MaterialName, CD.ConfigValue as CategoryName') + // ->join('t_materialmaster MM', 'MM.MaterialCode = PL.MaterialCode', 'left') + // ->join('t_configdetails CD', 'CD.Key = MM.Category', 'left') + // ->where('CD.Key', $key_id); - $query = $builder->get(); - $result = $query->getResultArray(); - return $result; + // $query = $builder->get(); + // $result = $query->getResultArray(); + // return $result; + $builder = $this->db->table('t_purchaseorder_lineitem pl') + ->select(['po.PONO',"DATE_FORMAT(po.PODate, '%d-%m-%Y') as PODate",'mm.MaterialName','CD.Key','CD.ConfigValue as CategoryName','s.StatusName','s.statusCode']) + ->join('t_purchaseorder_master po', 'po.PONO = pl.PONO') + ->join('t_materialmaster mm', 'mm.MaterialCode = pl.MaterialCode') + ->join('t_configdetails CD', 'CD.Key = mm.Category') + ->join('t_status s', 's.statusCode = po.Status', 'left') + ->where('CD.Key', $key_id) + ->whereIn('po.Status', [PO_DRAFT,PO_CREATED,REQ_PO_CREATED,PO_RELEASED,REQITEM_Emergency_PO_CREATED,IGR_DRAFT,IGR_DRAFT,OPEN_ORDER_PO]) + ->groupBy('po.PONO') + ->orderBy('po.CreatedDate', 'DESC'); + $query = $builder->get(); + $result = $query->getResultArray(); + return $result; + // 'OPEN_ORDER_PO','ST073' + // 'IGR_DRAFT','ST074' + // 'IGR_CREATED','ST027' + // 'REQITEM_Emergency_PO_CREATED','ST024' + // 'PO_DRAFT','ST014' + // 'PO_CREATED','ST015' + // 'REQ_PO_CREATED','ST005' + // 'PO_RELEASED','ST026' } } \ No newline at end of file diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php index 0ad9e8fd..cc0eb274 100755 --- a/app/Models/Purchaseorder_model.php +++ b/app/Models/Purchaseorder_model.php @@ -1740,7 +1740,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath, $subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.Per,LineItem.ServiceMaterialDescription,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,Tax.*, 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,Tax.FreightType,Tax.NoOfTrip,Tax.FreightValue,Tax.AfterFreightValue,POMast.CurrencyType, - + LineItem.LineitemAuditorNotes, 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 @@ -1799,7 +1799,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath, Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,ROUND((ServiceTax.After_CGST + ServiceTax.After_SGST + ServiceTax.After_IGST),2) as ServiceTaxamount ,ServiceTax.TotalValue,ServiceTax.CGST,ServiceTax.After_CGST,ServiceTax.SGST,ServiceTax.After_SGST,ServiceTax.IGST,ServiceTax.After_IGST,ServiceTax.otherallowance,ServiceTax.discount,ServiceTax.discountval,ServiceTax.Afterdiscountval, POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,ROUND((POMast.TotalOrderValue),2) as BasicINRValue,POMast.CurrencyType,FreightType as Ftype,NoOfTrip as NoTrip,FreightValue as Fvalue,AfterFreightValue as Afvalue, - + LineItem.LineitemAuditorNotes, 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 diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index 734384d6..e035a431 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -78,9 +78,8 @@ const LineItemNoteForAuditor = $link.data('notes'); const id = $link.data('id'); var theForm = $(".CreatePO"); - - addHidden(theForm, "LineItemNoteForAuditor" + id, value); $link.text(value).show(); + $("#LineItemNoteForAuditor" + id).val(value); $editContainer.hide(); }); diff --git a/app/Views/importpo.php b/app/Views/importpo.php index 29c1f73d..2649fe30 100755 --- a/app/Views/importpo.php +++ b/app/Views/importpo.php @@ -158,8 +158,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) { const LineItemNoteForAuditor = $link.data('notes'); const id = $link.data('id'); var theForm = $(".CreatePO"); - - addHidden(theForm, "LineItemNoteForAuditor" + id, value); + $("#LineItemNoteForAuditor" + id).val(value); $link.text(value).show(); $editContainer.hide(); }); @@ -4205,6 +4204,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) { formData.append('txtRowCount', txtRowCount); formData.append('txtDeletedRow', txtDeletedRow); formData.append('textStatus', stat); + $.ajax({ // data:$('.ImportPO').serialize()+"&txtRowCount="+txtRowCount+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat, //data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeQletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextExchangerate"+ExcLandingCharge="+hangerate+"Status="+TextStatus, diff --git a/app/Views/servicePurchaseorder.php b/app/Views/servicePurchaseorder.php index 04501577..ca1c1f45 100755 --- a/app/Views/servicePurchaseorder.php +++ b/app/Views/servicePurchaseorder.php @@ -78,8 +78,7 @@ const LineItemNoteForAuditor = $link.data('notes'); const id = $link.data('id'); var theForm = $(".ServicePO"); - - addHidden(theForm, "LineItemNoteForAuditor" + id, value); + $("#LineItemNoteForAuditor" + id).val(value); $link.text(value).show(); $editContainer.hide(); });