找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 314|回复: 0

销售出库销售订单 取值核算毛利

[复制链接] IP属地:北京市

42

主题

0

回帖

245

积分

管理员

积分
245
QQ
发表于 2024-7-9 14:12:29 | 显示全部楼层 |阅读模式
  1. SELECT T3.FNAME AS 客户,T3.FBILLNO AS 订单编码,T2.FNAME AS 产品名称,T1.FTAXPRICE AS 单价,FPRICEBASEQTY AS 数量,FAMOUNT AS 金额,T4.FCOSTAMOUNT AS 成本,T1.FAMOUNT -T4.FCOSTAMOUNT AS 毛利
  2. FROM T_SAL_ORDERENTRY_F T1
  3. INNER JOIN
  4. (SELECT FNAME,FID FROM T_SAL_ORDERENTRY A1
  5. LEFT JOIN T_BD_MATERIAL_L A2
  6. ON A1.FMATERIALID=A2.FMATERIALID) T2
  7. ON T1.FID=T2.FID
  8. INNER JOIN(SELECT FNAME,FID,FBILLNO FROM T_SAL_ORDER A1
  9. LEFT JOIN
  10. T_BD_CUSTOMER_L A2
  11. ON A1.FCUSTID=A2.FCUSTID) T3
  12. ON T1.FID=T3.FID
  13. LEFT JOIN
  14. (SELECT FCOSTAMOUNT, FSBILLID FROM T_SAL_OUTSTOCKENTRY_LK A1
  15.    INNER JOIN T_SAL_OUTSTOCKENTRY_F A2
  16.    ON A1.FENTRYID=A2.FENTRYID
  17.    WHERE FSTABLENAME = 'T_SAL_ORDERENTRY')T4
  18.    ON T4.FSBILLID=T1.FID
复制代码

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表