Fix to SQL mapping on S lines of receipts.
parent
30e028609c
commit
4e55415475
|
@ -85,15 +85,20 @@ DETAIL_STATEMENT = """
|
|||
"""
|
||||
|
||||
SUBDETAIL_STATEMENT = """
|
||||
select distinct
|
||||
[S]
|
||||
,[sta]
|
||||
,[pcu]
|
||||
,[qtypcu]
|
||||
,[lot]
|
||||
,[bpslot]
|
||||
,[sernum]
|
||||
select
|
||||
'S' [S],
|
||||
'A' [sta],
|
||||
[STJ].[PCU_0] [pcu],
|
||||
cast(cast(-1*[STJ].[QTYSTU_0] as int) as nvarchar) [qtypcu],
|
||||
[STJ].[LOT_0] [lot],
|
||||
'' [bpslot],
|
||||
'' [sernum]
|
||||
from [staging].[dbo].[shandex_receipt_details]
|
||||
left join x3.PROD.STOJOU STJ
|
||||
on STJ.VCRNUM_0 = [shandex_receipt_details].sdhnum
|
||||
and STJ.ITMREF_0 = [shandex_receipt_details].itmref
|
||||
and STJ.LOT_0 = [shandex_receipt_details].lot
|
||||
and STJ.VCRLIN_0 = [shandex_receipt_details].sddlin
|
||||
where sdhnum = :sdhnum
|
||||
and itmref = :itmref
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue