on 04-15-2018 8:14 AM
Buen dia
Tengo una duda con un query que estoy haciendo de factura de ventas abiertas y cerradas, como puedo hacer que en mi reporte aparezcan los montos en dolares, IVA, precio por unidad, total, etc y si mi factura es en pesos respete los montos en pesos, este es mi query, espero me puedan ayudar, gracias.
select T1.SeriesName [Serie], T0.DocNum [Folio],T0.DocEntry [Liga Documento],T0.LicTradNum [RFC],T0.CardName [Nombre Receptor],
T0.DocDate [Fecha Emision], T0.DocDueDate [Fecha de Vencimiento], T3.SlpName [Vendedor], T2.ItemCode [Producto],
--CASE when T4.BatchNum is null then O else T4.BatchNum end as [Lote]
T5.SalUnitMsr [Presentacion], T2.Price [Precio],
case when T2.ItemCode is null then 1 else T2.Quantity end as [Cantidad],
case when T2.ItemCode is null then T2.Price else T2.Price * T2. Quantity end as [Subtotal],
T2. VatSum [IVA Tras], T2.LineTotal + T2.VatSum [Total], T2.Currency [Moneda]
from OINV T0 left Join
NNM1 T1 on T0.Series = T1.Series left join
INV1 T2 on T0.DocEntry = T2.DocEntry left join
OSLP T3 on T0.SlpCode = T3.SlpCode left join
IBT1 T4 on T2.DocEntry = T4.BaseEntry and T2.ObjType = T4.BaseType and T2.LineNum = T4.BaseLinNum left join
OITM T5 on T2.ItemCode = T5.ItemCode
WHERE T0.[CANCELED] = 'N'
order by T0.DocNum
User | Count |
---|---|
102 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.