" INNER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" ) temp1\n"+
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.SAP编码 = temp2.MaterialCode";
;
" temp1.交货日期,\n"+
" temp1.手工或自动,\n"+
" '' 订单日期,\n"+
" temp1.[收货仓库],\n"+
" temp1.[收货仓库描述],\n"+
" temp1.[订货看板号],\n"+
" temp1.[订货零件号],\n"+
" temp1.[SAP编码],\n"+
" temp1.[发货零件号],\n"+
" temp1.[物料组],\n"+
" temp1.[物料描述],\n"+
" temp1.[发货数量],\n"+
" ISNULL( TEMP2.Price, 0 ) AS 发货定价,\n"+
" temp1.[发货总金额],\n"+
" temp1.[发货状态],\n"+
" temp1.[结算验收单],\n"+
" temp1.[结算零件号],\n"+
" temp1.[结算数量],\n"+
" temp1.[结算单价],\n"+
" temp1.[结算金额],\n"+
" temp1.[发货数量] - temp1.[结算数量] AS 数量差异,\n"+
" temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n"+
" ( SELECT Price, SUM ( Qty ) Qty, MaterialCode, Version FROM Set_BT_Car_Platform GROUP BY MaterialCode, price, Version ) A\n"+
" INNER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" WHERE\n"+
" A.Version= '{0}' \n"+
" ) temp1\n"+
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.SAP编码 = temp2.MaterialCode";
// " INNER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
// " ) temp1\n" +
// " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.SAP编码 = temp2.MaterialCode";