0
点赞
收藏
分享

微信扫一扫

金蝶云星空销售、MRP、采购、生产、委外全流程跟踪SQL

代码小姐 2022-02-16 阅读 23
select SalesOrderNumber,SalesReviewStatus,SalesClosedStatus,SalesOrderDate,SalesCustom,SalesItemNumber,
SalesItemName,SalesQty,SalesPrice,SalesTaxPrice,SalesOriginalCurrency,SalesAmountInBaseCurrency,SalesTaxRate,
SalesOriginalCurrencyTax,SalesBaseCurrencyTax,SalesTotalOriginalCurrencyPriceAndTax,SalesTotalBaseCurrencyPriceTax,
SalesCumulativeShipmentQty,SalesCumulativeOutboundQty,SalesCumulativeNumberOfReturn,SalesCumulativeReturnQty,PlannedOrderNumber,
PlannedOrderReviewStatus,PlannedOrderBusinessStatus,PlannedOrderItemNumber,PlannedOrderItemName,PlannedOrderItemDescription,PlannedOrderSuggestedQty,
PlannedOrderNetRequirements,PlannedOrderRequirementDate,PlannedOrderProposedPurchaseDate,PlannedOrderSuggestedArrivalDate,PlannedOrderRequirementDocumentNumber,
PlannedOrderRequirementDocumentNumber,BomVersion,ProductionOrderNumber,ProductionOrderDate,ProductionOrderReviewStatus,ProductionOrderItemNumber,ProductionOrderItemName,
ProductionOrderItemDescription,ProductionOrderQty,ProductionOrderFlnishedProductQty,ProductionOrderBusinessStatus,ProductionOrderPickingStatus,ProductionPickListNumber,
ProductionPicklistApprovalStatus,ProductionPicklistItemNumber,ProductionPicklistItemName,ProductionPicklistRequestQty,ProductionPickinglistActuallssusedQty,ProductionReceiptNumber,
ProductionReceiptOrderApprovalStatus,ProductionReceiptItemNumber,ProductionReceiptItemName,ProductionReceiptQtyReceivable,ProductionReceiptQtyReceived,ProductionReturnOrderNumber,
ProductionReturnOrderReviewStatus,ProductionReturnOrderItemNumber,ProductionReturnOrderItemName,ProductionReturnQtyReceivable,ProductionReturnQtyReceived,PurchaseRequisitionNumber,
PurchaseRequisitionDate,PurchaseRequisitionReviewStatus,PurchaseRequisitionItemNumber,PurchaseRequisitionItemName,PurchaseRequisitionRequestQty,PurchaseRequisitionApprovedQty,PurchaseRequisitionArrivalDate,
PurchaseRequisitionPrice,PurchaseRequisitionTaxPrice,PurchaseRequisitionRate,PurchaseRequisitionAmount,PurchaseRequisitionTaxAmount,PurchaseRequisitionProposalSupplierNumber,
PurchaseRequisitionProposalSupplierName,PurchaseOrderNumber,PurchaseOrderReviewStatus,PurchaseOrderSupplierNumber,PurchaseOrderSupplierName,PurchaseOrderItemNumber,PurchaseOrderItemName,PurchaseOrderPurchaseQty,
PurchaseOrderQuotationQty,PurchaseOrderPrice,PurchaseOrderTaxPrice,PurchaseOrderTax,PurchaseOrderAmount,PurchaseOrderTaxAmount,PurchaseOrderCumulativeReceiptQty,PurchaseOrderRemainingReceiptQty,
PurchaseOrderCumulativeInventoyQty,PurchaseOrderRemainingInventoryQty,PurchaseOrderCumulativeReturnQty,OutsourcingOrderNumber,OutsourcingOrderReviewStatus,OutsourcingOrderSupplierNumber,OutsourcingOrderSupplierName,
OutsourcingOrderItemNumber,OutsourcingOrderItemName,OutsourcedOrderOutsourcingQty,OutesourcedOrderReceiptQty,OutsourcedOrderUnstockedQty,OutsourcedOrderPlanStartDate,OutsourcedOrderPlannedCompletionDate,
OutsourcingOrderPickingStatus,OutsourcedOrderBusinessStatus,OutsourcedMaterialRequisitionNumber,OutsourcedMaterialRequisitionReviewStatus,OutsourcedPickingListSupplierNumber,OutsourcedPickingListSupplierName,
OutsourcedPickingListItemNumber,OutsourcedPickingListItemName,OutsourcedPickingListApplicationQty,QuantityOfOutsourcedMaterialRequisition,QuantityOfMaterialReturnedFromSubcontractingPicking from 
(select  tsorder.FBILLNO as SalesOrderNumber,
case tsorder.FDOCUMENTSTATUS WHEN 'A' THEN '创建'WHEN 'B' THEN '审核中'WHEN 'Z' THEN '暂存'WHEN 'C' THEN '已审核'WHEN 'D' THEN '重新审核'ELSE 'NULL'END as SalesReviewStatus,
case tsorder.FCLOSESTATUS	when 'B' then '关闭'when 'A' then '未关闭'else 'NULL'end AS SalesClosedStatus,tsorder.FDATE as SalesOrderDate,tbdcustoml.FNAME as SalesCustom,tbdmat.FNUMBER as SalesItemNumber,
tbdmatl.FNAME as SalesItemName,tsorderentry.FQTY as SalesQty,tsorderentryf.FPRICE as SalesPrice , tsorderentryf.FTAXPRICE as SalesTaxPrice,tsorderentryf.FAMOUNT as SalesOriginalCurrency,
tsorderentryf.FAMOUNT_LC as SalesAmountInBaseCurrency,tsorderentryf.FTAXRATE as SalesTaxRate,tsorderentryf.FTAXAMOUNT as SalesOriginalCurrencyTax,tsorderentryf.FTAXAMOUNT_LC as SalesBaseCurrencyTax,
tsorderentryf.FALLAMOUNT as SalesTotalOriginalCurrencyPriceAndTax,tsorderentryf.FALLAMOUNT_LC as SalesTotalBaseCurrencyPriceTax,tsorderentryr.FDeliQty as SalesCumulativeShipmentQty,
tsorderentryr.FStockOutQty as SalesCumulativeOutboundQty,tsorderentryr.FRetNoticeQty as SalesCumulativeNumberOfReturn,tsorderentryr.FReturnQty as SalesCumulativeReturnQty,tplnplan.FBILLNO as PlannedOrderNumber
,case tplnplan.FDOCUMENTSTATUS WHEN 'A' THEN '创建'WHEN 'B' THEN '审核中'WHEN 'Z' THEN '暂存'WHEN 'C' THEN '已审核'WHEN 'D' THEN '重新审核'ELSE 'NULL'END as PlannedOrderReviewStatus
,case tplnplan.FRELEASESTATUS when '0' then '计划'when '1' then '需求确认'when '2' then '供应确认'when '3' then '手工投放关闭'when '4' then '手动关闭'when '5' then '自动投放关闭'when '6' then '合并关闭'when '7' 
then '拆分关闭'else 'NULL'end as PlannedOrderBusinessStatus,tplnplan.FReleaseType,tbdmatjh.FNUMBER as PlannedOrderItemNumber,tbdmatljh.FNAME as PlannedOrderItemName,tbdmatljh.FSPECIFICATION as PlannedOrderItemDescription,
tplnplan.FSugQty as PlannedOrderSuggestedQty,tplnplan.FDemandQty as PlannedOrderNetRequirements,tplnplan.FDemandDate as PlannedOrderRequirementDate,tplnplan.FPlanStartDate as PlannedOrderProposedPurchaseDate,
tplnplan.FPlanFinishDate as PlannedOrderSuggestedArrivalDate,tplnplanB.FSaleOrderNo as PlannedOrderRequirementDocumentNumber,tplnplanB.FSaleOrderEntrySeq AS PlannedOrderRequirementDocumentLineNumber,
tengbom.FNUMBER  as BomVersion,tprd.FBILLNO as ProductionOrderNumber,tprd.FDATE as ProductionOrderDate,
case tprd.FDOCUMENTSTATUS WHEN 'A' THEN '创建'WHEN 'B' THEN '审核中'WHEN 'Z' THEN '暂存'WHEN 'C' THEN '已审核'WHEN 'D' THEN '重新审核'ELSE 'NULL'END as ProductionOrderReviewStatus,
tbdmatsc.FNUMBER as ProductionOrderItemNumber,tbdmatlsc.FNAME as ProductionOrderItemName,tbdmatlsc.FSpecification as ProductionOrderItemDescription,tprdmo.FQTY as ProductionOrderQty,
tprdmoentrya.FYieldQty as ProductionOrderFlnishedProductQty,
case tprdmoentrya.FSTATUS when '1' then '计划'when '2' then '计划确认'when '3' then '下达'when '4' then '开工'when '5' then '完工'when '6' then '结案'else 'NULL'end as ProductionOrderBusinessStatus,
case tprdmoentryq.FPickMtrlStatus when '1' then '未领料'when '2' then '部分领料'when '3' then '全部领料'when '4' then '超额领料'else 'NULL'end as ProductionOrderPickingStatus,
tprdpick.FBILLNO as ProductionPickListNumber,
case tprdpick.FDOCUMENTSTATUS WHEN 'A' THEN '创建'WHEN 'B' THEN '审核中'WHEN 'Z' THEN '暂存'WHEN 'C' THEN '已审核'WHEN 'D' THEN '重新审核'ELSE 'NULL'END as ProductionPicklistApprovalStatus,
tbdmatlll.FNUMBER as ProductionPicklistItemNumber,tbdmatllll.FNAME as ProductionPicklistItemName,tprdpickdata.FAppQty as ProductionPicklistRequestQty,tprdpickdata.FActualQty as ProductionPickinglistActuallssusedQty,
tprdin.FBILLNO as ProductionReceiptNumber,
case tprdin.FDOCUMENTSTATUS WHEN 'A' THEN '创建'WHEN 'B' THEN '审核中'WHEN 'Z' THEN '暂存'WHEN 'C' THEN '已审核'WHEN 'D' THEN '重新审核'ELSE 'NULL'END as ProductionReceiptOrderApprovalStatus,
tbdmatlscrk.FNUMBER as ProductionReceiptItemNumber,tbdmatlscrkl.FNAME as ProductionReceiptItemName,tprdinstock.FMustQty as ProductionReceiptQtyReceivable,tprdinstock.FRealQty as ProductionReceiptQtyReceived,
tprdrestock.fbillno as ProductionReturnOrderNumber,
case tprdrestock.FDOCUMENTSTATUS WHEN 'A' THEN '创建'WHEN 'B' THEN '审核中'WHEN 'Z' THEN '暂存'WHEN 'C' THEN '已审核'WHEN 'D' THEN '重新审核'ELSE 'NULL'END as ProductionReturnOrderReviewStatus,
tbdmatlsctk.FNUMBER as ProductionReturnOrderItemNumber,tbdmatlsctkl.FNAME as ProductionReturnOrderItemName,tprdrestockentry.FMUSTQTY as ProductionReturnQtyReceivable,tprdrestockentry.FREALQTY as ProductionReturnQtyReceived,
tpurreqstion.FBILLNO as PurchaseRequisitionNumber,tpurreqstion.FApplicationDate as PurchaseRequisitionDate,
case tpurreqstion.FDOCUMENTSTATUS WHEN 'A' THEN '创建'WHEN 'B' THEN '审核中'WHEN 'Z' THEN '暂存'WHEN 'C' THEN '已审核'WHEN 'D' THEN '重新审核'ELSE 'NULL'END as PurchaseRequisitionReviewStatus,
tbdmatlscsq.FNUMBER as PurchaseRequisitionItemNumber,tbdmatlscsql.FNAME as PurchaseRequisitionItemName,tpurreqentry.FReqQty as PurchaseRequisitionRequestQty,
tpurreqentry.FApproveQty as PurchaseRequisitionApprovedQty,tpurreqentry.FArrivalDate as PurchaseRequisitionArrivalDate,tpurreqentry.FEvaluatePrice as PurchaseRequisitionPrice,
tpurreqentry.FTAXPRICE as PurchaseRequisitionTaxPrice,tpurreqentry.FTAXRATE as PurchaseRequisitionRate,tpurreqentry.FAmount as PurchaseRequisitionAmount ,tpurreqentry.FReqAmount as PurchaseRequisitionTaxAmount,
tbdsup.FNUMBER as PurchaseRequisitionProposalSupplierNumber,tbdsupl.FNAME as PurchaseRequisitionProposalSupplierName,tpurpoorder.FBILLNO as PurchaseOrderNumber,
case tpurpoorder.FDOCUMENTSTATUS WHEN 'A' THEN '创建'WHEN 'B' THEN '审核中'WHEN 'Z' THEN '暂存'WHEN 'C' THEN '已审核'WHEN 'D' THEN '重新审核'ELSE 'NULL'END as PurchaseOrderReviewStatus,
tbdsupdd.FNUMBER as PurchaseOrderSupplierNumber,tbdsupddl.FNAME as PurchaseOrderSupplierName,tbdmatlsccgdd.FNUMBER as PurchaseOrderItemNumber,tbdmatlsccgddl.FNAME as PurchaseOrderItemName,
tpurpoordentry.FQTY as PurchaseOrderPurchaseQty,tpurpoordentryf.FPriceUnitQty as PurchaseOrderQuotationQty,tpurpoordentryf.FPRICE as PurchaseOrderPrice,tpurpoordentryf.FTaxPrice as PurchaseOrderTaxPrice,
tpurpoordentryf.FTAXAMOUNT as PurchaseOrderTax,tpurpoordentryf.FAMOUNT as PurchaseOrderAmount,tpurpoordentryf.FALLAMOUNT as PurchaseOrderTaxAmount,tpurpoordentryr.FRECEIVEQTY as PurchaseOrderCumulativeReceiptQty,
tpurpoordentryr.FREMAINRECEIVEQTY as PurchaseOrderRemainingReceiptQty,tpurpoordentryr.FSTOCKINQTY as PurchaseOrderCumulativeInventoyQty,tpurpoordentryr.FREMAINSTOCKINQTY as PurchaseOrderRemainingInventoryQty,
tpurpoordentryr.FMRBQTY as PurchaseOrderCumulativeReturnQty,tsubreqorder.FBILLNO as  OutsourcingOrderNumber,
case tsubreqorder.FDOCUMENTSTATUS WHEN 'A' THEN '创建'WHEN 'B' THEN '审核中'WHEN 'Z' THEN '暂存'WHEN 'C' THEN '已审核'WHEN 'D' THEN '重新审核'ELSE 'NULL'END as OutsourcingOrderReviewStatus,
tbdsupww.FNUMBER as OutsourcingOrderSupplierNumber,tbdsupwwl.FNAME as OutsourcingOrderSupplierName,tbdmatlscwwdd.FNUMBER as OutsourcingOrderItemNumber,tbdmatlscwwddl.FNAME as OutsourcingOrderItemName,
tsubreqorderentry.FQty as OutsourcedOrderOutsourcingQty,tsubreqorderentry.FSTOCKINQTY as OutesourcedOrderReceiptQty,tsubreqorderentry.FQty-tsubreqorderentry.FSTOCKINQTY  as OutsourcedOrderUnstockedQty,
tsubreqorderentry.FPlanStartDate as OutsourcedOrderPlanStartDate,tsubreqorderentry.FPlanFinishDate as OutsourcedOrderPlannedCompletionDate,
case tsubreqorderentrya.FPickMtrlStatus when '1' then '未领料'when '2' then '部分领料'when '3' then '全部领料'when '4' then '超额领料'else 'NULL'end as OutsourcingOrderPickingStatus,
case tsubreqorderentry.FStatus when '1' then '计划'when '2' then '需求确认'when '3' then '下达'when '5' then '完工'when '6' then '结案'when 'F' then '结算'else 'NULL'end as OutsourcedOrderBusinessStatus,
tsub_pic.FBILLNO as OutsourcedMaterialRequisitionNumber,
case tsub_pic.FDOCUMENTSTATUS WHEN 'A' THEN '创建'WHEN 'B' THEN '审核中'WHEN 'Z' THEN '暂存'WHEN 'C' THEN '已审核'WHEN 'D' THEN '重新审核'ELSE 'NULL'END as OutsourcedMaterialRequisitionReviewStatus,
tbdsupwwll.FNUMBER as OutsourcedPickingListSupplierNumber,tbdsupwwlll.FNAME as OutsourcedPickingListSupplierName,tbdmatlscwwll.FNUMBER as OutsourcedPickingListItemNumber,tbdmatlscwwlll.FNAME as OutsourcedPickingListItemName,
tsubpick.FAPPQTY as OutsourcedPickingListApplicationQty,tsubpick.FActualQty as QuantityOfOutsourcedMaterialRequisition,tsubpick.FSelPrcdReturnQty as QuantityOfMaterialReturnedFromSubcontractingPicking 
from T_SAL_ORDER tsorder  left join t_sal_orderentry  tsorderentry on tsorderentry.FID=tsorder.FID 
left join T_SAL_ORDERENTRY_F tsorderentryf on tsorderentry.FID=tsorderentryf.FID and tsorderentry.FENTRYID=tsorderentryf.FENTRYID and tsorder.FID=tsorderentryf.FID left join T_SAL_ORDERENTRY_R tsorderentryr on tsorderentry.FID=tsorderentryr.FID and tsorderentry.FENTRYID=tsorderentryr.FENTRYID and tsorder.FID=tsorderentryr.FID left join T_BD_CUSTOMER tbdcustom on tsorder.FCUSTID=tbdcustom.FCUSTID left join T_BD_CUSTOMER_L tbdcustoml on tbdcustom.FCUSTID=tbdcustoml.FCUSTID left join T_BD_MATERIAL tbdmat on tbdmat.FMATERIALID=tsorderentry.FMATERIALID left join T_BD_MATERIAL_L tbdmatl on tbdmat.FMATERIALID=tbdmatl.FMATERIALID left join T_PLN_PLANORDER_B tplnplanB on tplnplanB.FSALEORDERNO=tsorder.FBILLNO AND tplnplanB.FSALEORDERENTRYSEQ=tsorderentry.FSEQ and tplnplanB.FSALEORDERENTRYID=tsorderentry.FENTRYID and tplnplanB.FSALEORDERID=tsorder.FID left join T_PLN_PLANORDER tplnplan on tplnplanB.FID=tplnplan.FID left join T_BD_MATERIAL tbdmatjh on tbdmatjh.FMATERIALID=tplnplan.FMATERIALID left join T_BD_MATERIAL_L tbdmatljh on tbdmatljh.FMATERIALID=tbdmatjh.FMATERIALID left join T_ENG_BOM  tengbom on tplnplan.FBOMID=tengbom.fid left join T_PRD_MOENTRY tprdmo on tprdmo.FSRCBILLNO=tplnplan.FBILLNO and tprdmo.FSALEORDERID=tsorder.FID and tprdmo.FSALEORDERNO=tsorder.FBILLNO and tprdmo.FSALEORDERENTRYID=tsorderentry.FENTRYID and tprdmo.FSALEORDERENTRYSEQ=tsorderentry.FSEQ left join T_PRD_MO tprd on tprd.FID=tprdmo.FID left join T_BD_MATERIAL tbdmatsc on tprdmo.FMATERIALID=tbdmatsc.FMATERIALID left join T_BD_MATERIAL_L tbdmatlsc on tbdmatlsc.FMATERIALID=tbdmatjh.FMATERIALID left join T_PRD_MOENTRY_A tprdmoentrya on tprdmoentrya.FID=tprd.FID and tprdmoentrya.FENTRYID=tprdmo.FENTRYID and tprdmoentrya.FID=tprdmo.FID left join T_PRD_MOENTRY_Q tprdmoentryq on tprdmoentryq.FID=tprd.FID and tprdmoentryq.FENTRYID=tprdmo.FENTRYID and tprdmoentryq.FID=tprdmo.FID left join T_PRD_PICKMTRLDATA tprdpickdata on tprdpickdata.FMOBILLNO=tprd.FBILLNO and tprdpickdata.FMOID=tprd.FID and tprdpickdata.FMOENTRYID=tprdmo.FENTRYID and tprdpickdata.FMOENTRYSEQ=tprdmo.FSEQ  left join T_PRD_PICKMTRL tprdpick on tprdpickdata.FID=tprdpick.FID left join T_BD_MATERIAL tbdmatlll on tprdpickdata.FMATERIALID=tbdmatlll.FMATERIALID left join T_BD_MATERIAL_L tbdmatllll on tbdmatllll.FMATERIALID=tbdmatlll.FMATERIALID left join T_PRD_INSTOCKENTRY tprdinstock on tprdinstock.FMOBILLNO=tprd.FBILLNO and tprdinstock.FMOENTRYID=tprdmo.FENTRYID and tprdinstock.FMOID=tprd.FID and tprdinstock.FSRCENTRYSEQ=tprdmo.FSEQ left join T_PRD_INSTOCK tprdin on tprdin.FID=tprdinstock.FID left join T_BD_MATERIAL tbdmatlscrk on tprdinstock.FMATERIALID=tbdmatlscrk.FMATERIALID left join T_BD_MATERIAL_L tbdmatlscrkl on tbdmatlscrkl.FMATERIALID=tbdmatlscrk.FMATERIALID left join T_PRD_RESTOCKENTRY tprdrestockentry on tprdrestockentry.FMOBILLNO=tprd.FBILLNO and tprdrestockentry.FMOENTRYID=tprdmo.FENTRYID and tprdrestockentry.FMOID=tprd.FID and tprdrestockentry.FMOENTRYSEQ=tprdmo.FSEQ left join T_PRD_RESTOCK tprdrestock on tprdrestock.FID=tprdrestockentry.FID left join T_BD_MATERIAL tbdmatlsctk on tprdrestockentry.FMATERIALID=tbdmatlsctk.FMATERIALID left join T_BD_MATERIAL_L tbdmatlsctkl on tbdmatlsctk.FMATERIALID=tbdmatlsctkl.FMATERIALID left join T_PUR_REQENTRY_R tpurreq on tpurreq.FSRCBILLNO=tplnplan.FBILLNO left join T_PUR_Requisition tpurreqstion on tpurreq.FID=tpurreqstion.FID left join T_PUR_ReqEntry  tpurreqentry on tpurreqentry.FID=tpurreqstion.FID and tpurreq.FID=tpurreqentry.FID and tpurreq.FENTRYID=tpurreqentry.FENTRYID left join T_BD_MATERIAL tbdmatlscsq on tpurreqentry.FMATERIALID=tbdmatlscsq.FMATERIALID left join T_BD_MATERIAL_L tbdmatlscsql on tbdmatlscsq.FMATERIALID=tbdmatlscsql.FMATERIALID left join t_BD_Supplier tbdsup on tbdsup.FSUPPLIERID=tpurreqentry.FSuggestSupplierId left join T_BD_SUPPLIER_L tbdsupl on tbdsup.FSUPPLIERID=tbdsupl.FSUPPLIERID left join T_PUR_POORDERENTRY_LK tpurpoorderentrylk on tpurpoorderentrylk.FSBILLID=tpurreqstion.FID and tpurpoorderentrylk.FSID=tpurreqentry.FENTRYID and tpurpoorderentrylk.FSBILLID=tpurreqentry.FID and tpurpoorderentrylk.FFLOWID='' left join T_PUR_POORDERENTRY_R tpurpoordentryr on tpurpoorderentrylk.FENTRYID=tpurpoordentryr.FENTRYID and tpurpoordentryr.FSRCBILLNO=tpurreqstion.FBILLNO  left join T_PUR_POORDERENTRY tpurpoordentry on tpurpoordentryr.FENTRYID=tpurpoordentry.FENTRYID and tpurpoordentryr.FID=tpurpoordentry.FID left join T_PUR_POORDER tpurpoorder on tpurpoordentry.FID=tpurpoorder.FID and tpurpoordentryr.FID=tpurpoorder.FID  left join T_BD_MATERIAL tbdmatlsccgdd on tpurpoordentry.FMATERIALID=tbdmatlsccgdd.FMATERIALID left join T_BD_MATERIAL_L tbdmatlsccgddl  on tbdmatlsccgdd.FMATERIALID=tbdmatlsccgddl.FMATERIALID left join t_BD_Supplier tbdsupdd on tbdsupdd.FSUPPLIERID=tpurpoorder.FSUPPLIERID left join T_BD_SUPPLIER_L tbdsupddl on tbdsupdd.FSUPPLIERID=tbdsupddl.FSUPPLIERID left join T_PUR_POORDERENTRY_F tpurpoordentryf on tpurpoordentryr.FID=tpurpoordentryf.FID and tpurpoordentryr.FENTRYID=tpurpoordentryf.FENTRYID and tpurpoordentryr.FID=tpurpoorder.FID left join T_SUB_REQORDERENTRY_A tsubreqorderentrya on tsubreqorderentrya.FSRCBILLNO=tplnplan.FBILLNO left join T_SUB_REQORDERENTRY tsubreqorderentry on tsubreqorderentrya.FID=tsubreqorderentry.FID and tsubreqorderentry.FENTRYID=tsubreqorderentrya.FID left join T_SUB_REQORDERENTRY_L tsubreqorderentryl on tsubreqorderentrya.FENTRYID=tsubreqorderentrya.FENTRYID left join T_SUB_REQORDER tsubreqorder on tsubreqorder.fid=tsubreqorderentry.FID and tsubreqorder.fid=tsubreqorderentrya.FID left join T_BD_MATERIAL tbdmatlscwwdd on tbdmatlscwwdd.FMATERIALID=tsubreqorderentry.FMATERIALID left join T_BD_MATERIAL_L tbdmatlscwwddl on tbdmatlscwwddl.FMATERIALID=tbdmatlscwwdd.FMATERIALID left join T_BD_SUPPLIER  tbdsupww on tsubreqorderentry.FSUPPLIERID=tbdsupww.FSUPPLIERID left join T_BD_SUPPLIER_L tbdsupwwl on tbdsupww.FSUPPLIERID=tbdsupwwl.FSUPPLIERID  left join T_SUB_PICKMTRLDATA tsubpick on tsubpick.FSUBREQID=tsubreqorder.FID and tsubpick.FSUBREQBILLNO=tsubreqorder.FBILLNO and tsubpick.FSUBREQENTRYSEQ=tsubreqorderentry.FSEQ and tsubpick.FSUBREQENTRYID=tsubreqorderentry.FENTRYID left join T_SUB_PICKMTRL  tsub_pic on tsubpick.FID=tsub_pic.FID left join T_BD_MATERIAL tbdmatlscwwll on tbdmatlscwwll.FMATERIALID=tsubpick.FMATERIALID left join T_BD_MATERIAL_L tbdmatlscwwlll on tbdmatlscwwll.FMATERIALID=tbdmatlscwwlll.FMATERIALID left join T_BD_SUPPLIER tbdsupwwll on tsub_pic.FSUPPLIERID=tbdsupwwll.FSUPPLIERID  left join T_BD_SUPPLIER_L tbdsupwwlll on tbdsupwwll.FSUPPLIERID=tbdsupwwlll.FSUPPLIERID) t1
举报

相关推荐

0 条评论