子系統(tǒng)名稱:WZ
一、 計(jì)劃管理
1、 采購(gòu)計(jì)劃
表wz_in_plan
2、 請(qǐng)領(lǐng)計(jì)劃
表wz_in_plan
Chis.ini[other]中comm_apply=0[;公共申領(lǐng)端 1:公共申領(lǐng)端;0:非公共申領(lǐng)端]
如果wz_dict中的trust_flag=’1’ [物資項(xiàng)目維護(hù)中的托管標(biāo)記](méi),則wz_in_plan.in_out_plan=’IN’
如果是trust_flag=’0’ 則wz_in_plan.in_out_plan=’OUT’
入庫(kù)管理
1、 采購(gòu)入庫(kù)
1)入庫(kù)單錄入
A、入庫(kù)類型:select * from wz_zd_in_out_type where in_out_flag=‘IN’and kind=‘1’;保存時(shí)寫入wz_in_detl [物資入庫(kù)明細(xì)表],對(duì)應(yīng)字段in_type
B、供應(yīng)商:TagSql=417 ,表:wz_zd_supplyer,綁定的庫(kù)帳號(hào) wz_zd_kzh,相關(guān)的庫(kù)房帳號(hào)wz_zd_group;保存對(duì)應(yīng)wz_in_detl的字段supplyer_code、kzh_no、group_no_in
C、采購(gòu)人:TagSql=8 ,表:a_employee_mi [人事字典表]
D、支付方式來(lái)自表:select * from zd_cheque_type
E、物資名稱:TagSql=416 ,相關(guān)聯(lián)的表:wz_dict [物資字典表]、wz_base [庫(kù)存表]、wz_zd_unit [單位]、wz_zd_class [物資分類]、wz_zd_group[庫(kù)房帳號(hào)]、wz_zd_manufacture[生產(chǎn)廠家];因?yàn)閣z_dict中不同與yp_dict,其沒(méi)有價(jià)格,所以第一次入庫(kù),采購(gòu)價(jià)為空,如果第二次入庫(kù),默認(rèn)取上一次的價(jià)格wz_in_detl中的buy_price
保存數(shù)據(jù)寫入:wz_in_detl. 入庫(kù)序號(hào)取自wz_configure的in_seri,對(duì)應(yīng)wz_in_detl.in_seri
單據(jù)號(hào)取自wz_configure的in_pageno,對(duì)應(yīng)wz_in_detl.in_docu_no
第一次Current_stock_amount = buy_amount
如果入庫(kù)類型為:專購(gòu)入庫(kù),則窗口左下方的內(nèi)部帳號(hào)、請(qǐng)領(lǐng)人激活,系統(tǒng)自動(dòng)將入庫(kù)單轉(zhuǎn)換為出庫(kù)單,寫入wz_in_detl 同時(shí)寫入wz_out_detl [出庫(kù)明細(xì)表]
2)退貨單錄入
同入庫(kù)單寫入wz_in_detl表中,buy_amount、buy_value為負(fù)數(shù);in_type=12 ;out_date=原入庫(kù)記錄的in_date,out_seri=原入庫(kù)記錄的in_seri
2、 入庫(kù)審核
1)入庫(kù)單據(jù)審核
A、審核保存時(shí)update wz_in_detl set check_flag = ''1'',check_oper = ''00000'',stock_amount = (select stock_amount from wz_base where material_code = ''000156'' and group_no = ''10''),stock_value = (select stock_value from wz_base where material_code = ''000156'' and group_no = ''10'') where in_date = ''2007-11-11 10:32:36'' and in_seri = 17
更改wz_in_detl中的審核標(biāo)記、審核人、入庫(kù)前的庫(kù)存量
B、update wz_base set stock_amount = stock_amount + 100, stock_value = stock_value + 250000 where material_code = '000156' and group_no = '10'
更改物資庫(kù)存表的庫(kù)存數(shù)量stock_amount、庫(kù)存金額stock_value
2)退貨單據(jù)審核
A、更改wz_in_detl中的審核標(biāo)記check_flag、審核人check_oper、退貨前的庫(kù)存量stock_amount
B、update wz_in_detl set current_stock_amount = current_stock_amount + -100, current_stock_value = current_stock_value + -100 * 2500 where in_date = '2007-11-11 10:32:36' and in_seri = 17
更改wz_in_detl的原入庫(kù)記錄的當(dāng)前庫(kù)存量current_stock_amount,當(dāng)前庫(kù)存金額current_stock_value [此入庫(kù)批次]
C、更改物資庫(kù)存表的庫(kù)存數(shù)量stock_amount、庫(kù)存金額stock_value
二、 出庫(kù)管理
1、 物資出庫(kù)
1)出庫(kù)單錄入
A、 出庫(kù)類型:select * from wz_zd_in_out_type where kind = '2' and code not in ('29','30') and deleted_flag = '0'
B、 申請(qǐng)科室:TagSql=415 相關(guān)表:wz_zd_inner_acct_no [內(nèi)部帳號(hào)] 與 wz_zd_acct_property[帳號(hào)屬性]
C、 可以選擇申請(qǐng)科室的請(qǐng)領(lǐng)單號(hào),數(shù)據(jù)來(lái)自wz_in_plan中的accept_flag = '0' and send_flag='1'
D、保存數(shù)據(jù)寫入:wz_out_detl. 出庫(kù)序號(hào)取自wz_configure的out_seri,對(duì)應(yīng)wz_out_detl.out_seri
單據(jù)號(hào)取自wz_configure的out_pageno,對(duì)應(yīng)wz_out_detl.draw_no
E、update wz_in_detl set current_stock_amount = current_stock_amount - 5, current_stock_value = current_stock_value - 3.851 * 5 where in_date = '2007-01-08 18:34:14' and in_seri = 925
更改原入庫(kù)記錄的庫(kù)存量、庫(kù)存金額[批次]
F、更改物資庫(kù)存表的庫(kù)存數(shù)量stock_amount、庫(kù)存金額stock_value
2)退庫(kù)單錄入
A、update wz_in_detl set current_stock_amount = current_stock_amount - -3, current_stock_value = current_stock_value - 3.851 * -3 where in_date = '2007-01-08 18:34:14' and in_seri = 925
更改原入庫(kù)記錄的庫(kù)存量、庫(kù)存金額[批次]
B、update wz_base set stock_amount = stock_amount - -3, stock_value = stock_value - 3.851 * -3 where material_code = '000531' and group_no = '10'
更改物資庫(kù)存表的庫(kù)存數(shù)量stock_amount、庫(kù)存金額stock_value
C、寫入wz_out_detl表中issue_amount 為負(fù)數(shù),out_type=’22’
2、 耐用品登記
A、 登記類型:SELECT * FROM wz_zd_in_out_type where kind = '3'
B、 寫入wz_durable_register 表中,分登記和報(bào)廢,對(duì)應(yīng)out_type為31和32
三、 庫(kù)存管理
1、 物資盤點(diǎn)
A、 盤贏 wz_out_detl中out_type=’41’ ,issue_amount是負(fù)數(shù)
B、 盤虧wz_out_detl中out_type=’42’ ,issue_amount是正數(shù)
2、 物資報(bào)損
Wz_out_detl中out_type=’44’ ,issue_amount是正數(shù)
四、 財(cái)務(wù)
1、 供應(yīng)商結(jié)款
Update wz_in_detl set pay_type='1',acct_oper='00000',acct_date='2007-11-11 16:49:39',acct_pageno=1,invoice_no='12' where in_date='2007-11-11 10:32:36' and in_seri=17
更改wz_in_detl的pay_type[付款類型]、acct_oper[結(jié)算員]、acct_date[結(jié)算日期]、acct_pageno[結(jié)算單據(jù)號(hào),來(lái)自wz_configure.acct_pageno]、invoice_no[發(fā)票號(hào)]
2、 月報(bào)
Report_code=’4301’,調(diào)用存儲(chǔ)過(guò)程wz_month_report,結(jié)帳時(shí)update了wz_in_detl、wz_out_detl中的report_date,同時(shí)將匯總結(jié)果寫入wz_report表中。
3、 發(fā)票查詢
略
4、 庫(kù)存明細(xì)帳
略
五、 查詢統(tǒng)計(jì)
略
六、 數(shù)據(jù)維護(hù)
1、 物資項(xiàng)目維護(hù) –》wz_dict
2、 庫(kù)存物資維護(hù) –》wz_base
3、 供應(yīng)商字典 -》wz_zd_supplyer
|
|