hi,
I am struck in writing a query; here is scenerio:
Following tables are involved:
product_codes(i tem_code,descri ption, unit_price,unit _size,PAY_GST...)
Vendor(account_ no,Name,address ,GST_NO,PST_NO....)
Inv_total (tran_id, total_amt,GST,pst,.......)
inv_detail(sr_n o, tran_id, item_code,unit_ price,qty....)
I want to generate daily closing summary report where I calculate total of all transections for a particular day: like this
GRP NAME AMOUNT PAID GST PST TOTAL
METALS
NON-METALS
PAPERS
UBC
Now the problem to calculate total GST and PST paid group wise.
I'll only talk about GST.
I want to calculate GST paid on all groups. The problem is GST is stored in inv_total and is summed up for all the products in a particular invoice.
GST is not paid on all items
GST is paid only on those items where
Product_codes.P AY_GST=TRUE and Vendor.PST_no<> NULL
Here is what I am looking for:
I want to sum up total of all groups(metals etc) and also total GST paid on against them.
I don't know if you guys understand my problem. Please please help me get the logic for it. IF you need more description or don't understand it, I can rephrase the issue.
Thanks in advance
I am struck in writing a query; here is scenerio:
Following tables are involved:
product_codes(i tem_code,descri ption, unit_price,unit _size,PAY_GST...)
Vendor(account_ no,Name,address ,GST_NO,PST_NO....)
Inv_total (tran_id, total_amt,GST,pst,.......)
inv_detail(sr_n o, tran_id, item_code,unit_ price,qty....)
I want to generate daily closing summary report where I calculate total of all transections for a particular day: like this
GRP NAME AMOUNT PAID GST PST TOTAL
METALS
NON-METALS
PAPERS
UBC
Now the problem to calculate total GST and PST paid group wise.
I'll only talk about GST.
I want to calculate GST paid on all groups. The problem is GST is stored in inv_total and is summed up for all the products in a particular invoice.
GST is not paid on all items
GST is paid only on those items where
Product_codes.P AY_GST=TRUE and Vendor.PST_no<> NULL
Here is what I am looking for:
I want to sum up total of all groups(metals etc) and also total GST paid on against them.
I don't know if you guys understand my problem. Please please help me get the logic for it. IF you need more description or don't understand it, I can rephrase the issue.
Thanks in advance
Comment