ERP logistics

xiaoxiao2021-03-06  91

Declare @ 会 会 份 DateTime Declare @ 子公司 Number VARCHAR (6) DECLARE @ 品 品 号 VARCHAR (12)

SELECT @ subsidiary number = 'HF' SELECT @ Accounting Month = '2004/8/1'

/ * delete from logistics _ account _ warehouse receiving and survival _ monthly report WHERE subsidiary number = @ subsidiary number And accounting month = @ accountant month

INSERT INTO logistics _ bill _ warehouse receipt / monthly report (subsidiary number, accounting month, item number, batch number, number of quantities, quantity, number of warehousing, number of outlets, number of quantities 1, quantity 1,) The number 1, the number of outlets, the number 2, the quantity of the balance 2, the number of warehousing 2, the number of outlets, the number 3, the number of balances 3, the number of warents 3, the number of outlets, the number of outages, the quantity 4, the quantity number 4, the number of wares 4, the number of outlets 4)

SELECT subsidiary number, accounting month, item number, batch number,

SUM (basic number), 0, 0, sum (basic quantity), sum (basic number), 0, 0, sum (basic number), 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0

From hxerp_ien.dbo. Logistics _ inventory table _ with library batch number _ period WHERE subsidiary number = @ subsidiary number and accounting month = @ accountant month Group by subsidiary number, accounting month, item number, batch number * / / * insert INTO HXERP_IEN.DBO. Logistics _ account _ financial importance _ monthly report (subsidiary number, accounting month, item number, batch number, warehouse cost single price, outbound cost single price, number of periods, initial cost, final number, The cost, the number of stocks, the cost of the storage, the number of ware meters, the number of outbound gains, the production of the storage, the production of the storage cost, the number of foreign storage, the cost of the warehouse, other storage, other Inventory cost, sales of sales, sales outbound costs, quantity of production, production, cost, other outbound quantities, other outbound costs) * /

/ * SELECT

Sub-branch number, accounting month, item number, batch number, number of quantities, quantity, number of periods, number of periods 2, number 3, number 4, the number of warents 1, the number of warents 2 The number of libraries 4, the number of outlets, the number of outlets, the number of outlets, the number of outlets, the quantity of the balance, the number of balances, the amount of balance 4, the number of warents, the number of warents

From logistics _ account _ warehouse receipt / monthly report WHERE subsidiary number = @ subsidiary number and accounting month = @ accountant month And Item No. Not in (SELECT item number FROM logistics _ account _ financial importance _ monthly report WHERE

Subsidiary number = @ 子公 编 number And accounting month = @ 会计 月) * /

Update a set a. Quantity number = b. At the beginning quantity from logistics _ account _ financial importance _ monthly report A, logistics _ account _ warehouse receipt / monthly report B WHERE A. subsidiary number = b. subsidiary Number and a. Accounting month = b. Accounting month and a. Item number = b. Item number and a batch number = b. Batch number and a. Subsidiary number = @ subsidiary number and a. Accounting month = @ accountant month

转载请注明原文地址:https://www.9cbs.com/read-123228.html

New Post(0)