on ‎2018 Dec 04 10:43 PM
Hello,
I wrote a query to view sales transaction from CCO manager data base,
I could find article description but couldnt found anywhere the article id is stored,
can you please tell me in which table the article of the sales transaction is stored:
select
t0.POS_SYSTEM_ID as'point of sale code',
t0.id as'receipt code ',
t1.[DESCRIPTION] as'item name',
sum(t1.QUANTITY)as'quantity',
t1.UNITGROSSAMOUNT as'unit price',
t0.DISCOUNTAMOUNT as'discount',
t0.TOTALGROSSAMOUNT as'total before discount and tax',
t0.TOTALTAXAMOUNT,
t0.TOTALNETAMOUNT as'total net',
t0.BUPAEXTERNALID as'customer code'
from [CCOCS].[RECEIPT] t0 innerjoin [CCOCS].[SALESITEM] t1 on t0.OBJECTKEY=t1.RECEIPT_OBJECTKEY
where t0.POS_SYSTEM_ID='P001'
groupby t0.POS_SYSTEM_ID ,
t0.id ,
t1.[DESCRIPTION] ,
t1.UNITGROSSAMOUNT ,
t0.DISCOUNTAMOUNT ,
t0.TOTALGROSSAMOUNT ,
t0.TOTALTAXAMOUNT,
t0.TOTALNETAMOUNT ,
t0.BUPAEXTERNALID
Kind regards
Nir
Request clarification before answering.
Hello Nir,
You can find the Article ID in the table MATERIAL, column EXTERNALID
In your query, it is necessary to create a new join and link it with the table SALESITEM.
E.g.
left join [CCOCS].MATERIAL t2 on t1.mat_key = t2.OBJECTKEY
If your question in answered, kindly select the answer as "Right Answer". This helps other member of the community to follow and easily locate answers.
Anything else, please let us know.
Best regards,
Anderson Schmitt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.