|
select sheet.busno,
'' as orderEntryid,
sheet.billno as billcode,sheet.execdate as billDate,
sheet.execdate as txnDate,
billtype.billname as billType,sup.VENCUSCODE as suppliercode,sup.vencusname as supplierName,prod.warecode as prodcode,''as imei,'' as imei2,
''as prodBarcode,
'' as sn,
prod.warename as prodName,prod.warespec as prodspec,prod.wareunit as prodUnit,sheet.WAREQTY as prodQuantity,sheet.PURPRICE as prodPrice,sheet.PAYABLEAMT as prodAmount,sheet.makeno as prodNum,sheet.invalidate as expireDate,sheet.makedate as prodManufacturingDate,'GL'as stockType,''as stockTypeCode,'' as stockTypeName,
'' as brandName,
tf.factoryname as prodProducer,
'' as remark
FROM t_rpt_accept sheet
left join t_vencus_base sup on sup.vencusno=sheet.vencusno
left join t_ware prod on prod.compid=sheet.compid and prod.wareid=sheet.wareid left join t_factory tf on prod.factoryid=tf.factoryid
left join s_bill billtype on sheet.billcode=billtype.billcode
left join s_busi on sheet.busno=s_busi.busno
where
--((prod.factoryname like '%阿斯利康%' or prod.factoryname like '%大维信%' )and
-- prod.warename not like '%非洛地%') and
sheet.busno=2000
--and sheet.ownerid ='01'
and
billtype.billcode in('ACC','REJ')
and to_char( sheet.execdate,'yyyy-mm-dd') >= '2024-01-03'
and to_char( sheet.execdate,'yyyy-mm-dd') <= '2026-01-02'
and sheet.wareid ='1755389'
|
|