diff --git a/application/models/dahsboard_model.php b/application/models/dahsboard_model.php index 8840db06..612f5240 100755 --- a/application/models/dahsboard_model.php +++ b/application/models/dahsboard_model.php @@ -895,6 +895,7 @@ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IG ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0) as discount, ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0) as freight, ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0) as Package, +ifnull(rt.Insurance,0) as insurance, round(( if(POType = 'IMPORT',sum(distinct pm.ExchangeRate * (pl.Quantity * pl.Rate)), if(POType = 'CAPITAL' && CapitalRange = 0,sum(distinct pm.ExchangeRate * (pl.Quantity * pl.Rate)), @@ -904,6 +905,7 @@ ifnull(sum(pl.Quantity * pl.Rate),0))) + ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0) + ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0) + ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0) ++ ifnull(rt.Insurance,0) - ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)),2) as total FROM T_PurchaseOrder_Master pm join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO @@ -969,6 +971,7 @@ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IG ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0) as discount, ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0) as freight, ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0) as Package, +ifnull(rt.Insurance,0) as insurance, round(( if(POType = 'IMPORT',sum(distinct pm.ExchangeRate * (pl.Quantity * pl.Rate)), if(POType = 'CAPITAL' && CapitalRange = 0,sum(distinct pm.ExchangeRate * (pl.Quantity * pl.Rate)), @@ -978,6 +981,7 @@ ifnull(sum(pl.Quantity * pl.Rate),0))) + ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0) + ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0) + ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0) ++ ifnull(rt.Insurance,0) - ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)),2) as total FROM T_PurchaseOrder_Master pm left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO @@ -1127,8 +1131,7 @@ group by supplier_name,material_name"; case pm.POType when 'IMPORT' then ifnull((sum(distinct(pl.Quantity * pl.Rate) * pm.ExchangeRate) - -),0) +),0) + ifnull(rt.Insurance,0) when 'CAPITAL' then sum(distinct if(pm.CapitalRange=0,(( pl.Quantity * pl.Rate) * pm.ExchangeRate),( pl.Quantity * pl.Rate) - st.Afterdiscountval)) @@ -1136,6 +1139,7 @@ then sum(distinct if(pm.CapitalRange=0,(( pl.Quantity * pl.Rate) * pm.ExchangeR + ifnull(sum(distinct st.After_CGST),0) + ifnull(sum(distinct st.After_IGST),0) + ifnull(sum(distinct st.AfterFreightValue),0) ++ ifnull(rt.Insurance,0) when 'SERVICE' @@ -1144,6 +1148,7 @@ then ifnull(sum(distinct pl.Quantity * pl.Rate),0) + ifnull(sum(distinct st.After_CGST),0) + ifnull(sum(distinct st.After_IGST),0) + ifnull(sum(distinct st.AfterFreightValue),0) ++ ifnull(rt.Insurance,0) - ifnull(sum(distinct st.Afterdiscountval),0) when 'REVENUE' @@ -1154,6 +1159,7 @@ then ifnull(sum(distinct pl.Quantity * pl.Rate),0) + ifnull(sum(distinct rt.AfterIGST),0) + ifnull(sum(distinct rt.AfterFreightValue),0) + ifnull(sum(distinct rt.AfterPackagingValue),0) ++ ifnull(rt.Insurance,0) end as total @@ -1392,13 +1398,14 @@ group by supplier_name,material_name"; function ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$cat){ - $sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as pono,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, sum(id.QuantityAsPerInvoice) as quantity,pl.Rate as rate,sum(id.QuantityAsPerInvoice) * pl.Rate as value,if(POType = 'IMPORT' or POType = 'CAPITAL',sum(pm.ExchangeRate),0) as exchange_rate, + $sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as pono,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, sum(id.QuantityAsPerInvoice) as quantity,pl.Rate as rate,round(sum(id.QuantityAsPerInvoice) * pl.Rate,2) as value,if(POType = 'IMPORT' or POType = 'CAPITAL',sum(pm.ExchangeRate),0) as exchange_rate, ifnull(if(POType = 'REVENUE',sum(rt.AfterSGST),sum(st.After_SGST)),0) as sgst, ifnull(if(POType = 'REVENUE',sum(rt.AfterCGST),sum(st.After_CGST)),0) as cgst, ifnull(if(POType = 'REVENUE',sum(rt.AfterIGST),sum(st.After_IGST)),0) as igst, ifnull(if(POType = 'REVENUE',sum(rt.AfterDiscount),sum(st.Afterdiscountval)),0) as discount, ifnull(if(POType = 'REVENUE',sum(rt.AfterFreightValue),sum(st.AfterFreightValue)),0) as freight, ifnull(if(POType = 'REVENUE',sum(rt.AfterPackagingValue),0),0) as Package, +ifnull(rt.Insurance,0) as insurance, round(( if(POType = 'IMPORT',sum(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), if(POType = 'CAPITAL' && CapitalRange = 0,sum(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), @@ -1408,6 +1415,7 @@ ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0))) + ifnull(if(POType = 'REVENUE',sum(rt.AfterIGST),sum(st.After_IGST)),0) + ifnull(if(POType = 'REVENUE',sum(rt.AfterFreightValue),sum(st.AfterFreightValue)),0) + ifnull(if(POType = 'REVENUE',sum(rt.AfterPackagingValue),0),0) ++ ifnull(rt.Insurance,0) - ifnull(if(POType = 'REVENUE',sum(rt.AfterDiscount),sum(st.Afterdiscountval)),0)),2) as total,pb.FilePath as file from T_IGR_Master im @@ -1469,13 +1477,14 @@ $sql.="group by pono,material_name,category,supplier_name"; function ireport_purchase_link($cname,$prod,$fa,$aa,$m,$frm,$t,$sid,$mid,$d,$cat,$da,$po){ - $sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as pono,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, sum(id.QuantityAsPerInvoice) as quantity,pl.Rate as rate,sum(id.QuantityAsPerInvoice) * pl.Rate as value,if(POType = 'IMPORT' or POType = 'CAPITAL',sum(pm.ExchangeRate),0) as exchange_rate, + $sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as pono,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, sum(id.QuantityAsPerInvoice) as quantity,pl.Rate as rate,round(sum(id.QuantityAsPerInvoice) * pl.Rate,2) as value,if(POType = 'IMPORT' or POType = 'CAPITAL',sum(pm.ExchangeRate),0) as exchange_rate, ifnull(if(POType = 'REVENUE',sum(rt.AfterSGST),sum(st.After_SGST)),0) as sgst, ifnull(if(POType = 'REVENUE',sum(rt.AfterCGST),sum(st.After_CGST)),0) as cgst, ifnull(if(POType = 'REVENUE',sum(rt.AfterIGST),sum(st.After_IGST)),0) as igst, ifnull(if(POType = 'REVENUE',sum(rt.AfterDiscount),sum(st.Afterdiscountval)),0) as discount, ifnull(if(POType = 'REVENUE',sum(rt.AfterFreightValue),sum(st.AfterFreightValue)),0) as freight, ifnull(if(POType = 'REVENUE',sum(rt.AfterPackagingValue),0),0) as Package, +ifnull(rt.Insurance,0) as insurance, round(( if(POType = 'IMPORT',sum(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), if(POType = 'CAPITAL' && CapitalRange = 0,sum(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), @@ -1485,6 +1494,7 @@ ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0))) + ifnull(if(POType = 'REVENUE',sum(rt.AfterIGST),sum(st.After_IGST)),0) + ifnull(if(POType = 'REVENUE',sum(rt.AfterFreightValue),sum(st.AfterFreightValue)),0) + ifnull(if(POType = 'REVENUE',sum(rt.AfterPackagingValue),0),0) ++ ifnull(rt.Insurance,0) - ifnull(if(POType = 'REVENUE',sum(rt.AfterDiscount),sum(st.Afterdiscountval)),0)),2) as total,pb.FilePath as file from T_IGR_Master im @@ -1583,6 +1593,7 @@ ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0))) + ifnull(if(POType = 'REVENUE',sum(rt.AfterIGST),sum(st.After_IGST)),0) + ifnull(if(POType = 'REVENUE',sum(rt.AfterFreightValue),sum(st.AfterFreightValue)),0) + ifnull(if(POType = 'REVENUE',sum(rt.AfterPackagingValue),0),0) ++ ifnull(rt.Insurance,0) - ifnull(if(POType = 'REVENUE',sum(rt.AfterDiscount),sum(st.Afterdiscountval)),0)),2) as total,pb.FilePath as file1 from T_IGR_Master im @@ -1677,6 +1688,7 @@ group by material_name,supplier_name"; case pm.POType when 'IMPORT' then ifnull((sum((id.QuantityAsPerInvoice * pl.Rate) * pm.ExchangeRate) ++ ifnull(rt.Insurance,0) ),0) when 'CAPITAL' @@ -1686,6 +1698,7 @@ then sum( if(pm.CapitalRange=0,(( id.QuantityAsPerInvoice * pl.Rate) * pm.Excha + ifnull(sum(st.After_CGST),0) + ifnull(sum(st.After_IGST),0) + ifnull(sum(st.AfterFreightValue),0) ++ ifnull(rt.Insurance,0) when 'SERVICE' @@ -1694,6 +1707,7 @@ then ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0) + ifnull(sum(st.After_CGST),0) + ifnull(sum(st.After_IGST),0) + ifnull(sum(st.AfterFreightValue),0) ++ ifnull(rt.Insurance,0) - ifnull(sum(st.Afterdiscountval),0) when 'REVENUE' @@ -1704,6 +1718,7 @@ then ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0) + ifnull(sum(rt.AfterIGST),0) + ifnull(sum(rt.AfterFreightValue),0) + ifnull(sum(rt.AfterPackagingValue),0) ++ ifnull(rt.Insurance,0) end as total diff --git a/application/views/Report_Material_Master_ItemWise.php b/application/views/Report_Material_Master_ItemWise.php index 17d4e64b..8ab91d91 100755 --- a/application/views/Report_Material_Master_ItemWise.php +++ b/application/views/Report_Material_Master_ItemWise.php @@ -6,7 +6,7 @@ if(!empty($mmi)) } ?> - + @@ -664,7 +678,7 @@ - + diff --git a/application/views/Report_consolidate_inward.php b/application/views/Report_consolidate_inward.php index 38f505be..07efcc95 100755 --- a/application/views/Report_consolidate_inward.php +++ b/application/views/Report_consolidate_inward.php @@ -9,7 +9,7 @@ }); - +
@@ -132,7 +146,7 @@ Supplier Name - Material Name + Material Name Apr May Jun @@ -663,7 +677,7 @@
- + @@ -672,12 +686,14 @@ + diff --git a/application/views/Report_consolidate_month.php b/application/views/Report_consolidate_month.php index c684da3c..e3a9afcd 100755 --- a/application/views/Report_consolidate_month.php +++ b/application/views/Report_consolidate_month.php @@ -6,7 +6,7 @@ if(!empty($mms)) } ?> - + @@ -668,7 +682,7 @@ - + diff --git a/application/views/Report_consolidate_y.php b/application/views/Report_consolidate_y.php index c4fd4c01..c5ac1042 100755 --- a/application/views/Report_consolidate_y.php +++ b/application/views/Report_consolidate_y.php @@ -6,7 +6,7 @@ if(!empty($mms)) } ?> - + @@ -216,7 +229,7 @@ if(!empty($mms))
- +
@@ -234,6 +247,7 @@ if(!empty($mms)) + @@ -250,6 +264,7 @@ if(!empty($mms)) $tot_dis = 0; $tot_frg = 0; $tot_pac = 0; + $tot_inc = 0; $tot_tot = 0; foreach($purchase as $rel) @@ -295,6 +310,9 @@ if(!empty($mms)) $tot_pac= $tot_pac + $rel->Package; echo $rel->Package;?> + @@ -420,6 +438,16 @@ if(!empty($mms)) } + ?> + +
PO NoDiscount  () Freight  () Package  ()Insurance  () Total  ()
insurance; + echo $rel->insurance;?>total,2); echo number_format($rel->total,2,'.','');?> + + @@ -452,7 +480,7 @@ if(!empty($mms)) - + diff --git a/application/views/Report_purchase_inward.php b/application/views/Report_purchase_inward.php index 449327f6..adbac0d0 100755 --- a/application/views/Report_purchase_inward.php +++ b/application/views/Report_purchase_inward.php @@ -16,12 +16,11 @@ if(!empty($mms)) }); - + - -
@@ -217,27 +228,28 @@ if(!empty($mms))
- +
- - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -253,6 +265,7 @@ if(!empty($mms)) $tot_dis = 0; $tot_frg = 0; $tot_pac = 0; + $tot_inc = 0; $tot_tot = 0; foreach($purchase as $rel) @@ -300,6 +313,9 @@ if(!empty($mms)) $tot_pac= $tot_pac + $rel->Package; echo $rel->Package;?> + +
PO NoDateTimeMaterial NameCategorySupplier NameQuantityUOMRate  ()Value  ()Exchange RateSGST  ()CGST  ()IGST  ()Discount  ()Freight  ()Package  ()Total  ()PO NoDateTimeMaterial NameCategorySupplier NameQtyUOMRate  ()Value  ()Exchange RateSGST  ()CGST  ()IGST  ()Discount  ()Freight  ()Package  ()Insurance  ()Total  ()
insurance; + echo $rel->insurance;?>total,2); ?> + + + @@ -468,7 +494,7 @@ if(!empty($mms)) - + @@ -483,8 +509,13 @@ if(!empty($mms)) // Set up your table $(document).ready(function() { table = $('#cc').DataTable( { - responsive: true, - + + + "autoWidth": false, + orderCellsTop: true, + + + "dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" + "<'row'<'col-md-6'><'col-md-6'>>" + "<'row'<'col-md-12't>><'row'<'col-md-2'i><'col-md-10'p>>", @@ -503,6 +534,7 @@ $(document).ready(function() { 'colvis' ] + } ); } ); $('#mySelect').on('change',function(){ diff --git a/application/views/Report_supplier.php b/application/views/Report_supplier.php index d98379c7..a35f32bc 100755 --- a/application/views/Report_supplier.php +++ b/application/views/Report_supplier.php @@ -15,7 +15,7 @@ if(!empty($mms)) }); - +