提交
This commit is contained in:
1 parent
2df2ef0808
commit
683f14828f
388 files changed
+2738488
-81306
No files matched your search
@@ -0,0 +1,19 @@
|
||||
-- 报价单/合同增加桶押金字段;合同从关联报价回填(仅 barrel_deposit=0 且有 quote_id)
|
||||
|
||||
ALTER TABLE `crm_quote`
|
||||
ADD COLUMN `barrel_deposit` decimal(18,2) NOT NULL DEFAULT 0.00 COMMENT '桶押金'
|
||||
AFTER `freight`;
|
||||
|
||||
ALTER TABLE `crm_contract`
|
||||
ADD COLUMN `barrel_deposit` decimal(18,2) NOT NULL DEFAULT 0.00 COMMENT '桶押金'
|
||||
AFTER `freight`;
|
||||
|
||||
UPDATE `crm_contract` c
|
||||
INNER JOIN `crm_quote` q
|
||||
ON q.id = c.quote_id
|
||||
AND q.tenant_no = c.tenant_no
|
||||
AND q.del_flag = 0
|
||||
SET c.barrel_deposit = IFNULL(q.barrel_deposit, 0)
|
||||
WHERE c.del_flag = 0
|
||||
AND c.quote_id IS NOT NULL
|
||||
AND IFNULL(c.barrel_deposit, 0) = 0;
|
||||
@@ -0,0 +1,15 @@
|
||||
-- 合同主表增加运费字段,并从关联报价单回填历史数据(仅 freight=0 且有 quote_id)
|
||||
|
||||
ALTER TABLE `crm_contract`
|
||||
ADD COLUMN `freight` decimal(18,2) NOT NULL DEFAULT 0.00 COMMENT '运费'
|
||||
AFTER `amount_with_tax`;
|
||||
|
||||
UPDATE `crm_contract` c
|
||||
INNER JOIN `crm_quote` q
|
||||
ON q.id = c.quote_id
|
||||
AND q.tenant_no = c.tenant_no
|
||||
AND q.del_flag = 0
|
||||
SET c.freight = IFNULL(q.freight, 0)
|
||||
WHERE c.del_flag = 0
|
||||
AND c.quote_id IS NOT NULL
|
||||
AND IFNULL(c.freight, 0) = 0;
|
||||
Reference in new issue
Block a user