2008年9月27日星期六

标准成本报表的程序贡献给大家

是在字符界面下的!结合快意的BISTART使用的!要是想不使用BI把EXPORT DELIMITER ";" 改成DISPLAY就可以了
输出
产品类代码
产品类说明
零件代码
单位
状态
零件说明
件号
成本集
物料成本
人工成本
附加成本
间接成本
转包成本
成本合计
成本更新日期几个字段
{mfdtitle.i "1.0 "}
define variable line like pt_prod_line.
define variable line1 like pt_prod_line.
define variable part like pt_part.
define variable part1 like pt_part.
define variable type like pt_part_type.
define variable type1 like pt_part_type.
define variable site like si_site.
define variable site1 like si_site.
define variable buyer like pt_buyer.
define variable buyer1 like pt_buyer.
define variable pldesc like pl_desc.
define variable first_flag as logical initial no.
define variable first_of_flag as logical initial no.
define variable desc1 like pt_desc1 format "x(80)" .
define variable desc2 like pt_desc2 format "x(80)" .
define variable mtltl like sct_mtl_tl.
define variable lbrtl like sct_lbr_tl.
define variable bdntl like sct_bdn_tl.
define variable ovhtl like sct_ovh_tl.
define variable subtl like sct_sub_tl.

form
line colon 15
line1 label {t001.i} colon 49 skip
part colon 15
part1 label {t001.i} colon 49 skip
type colon 15
type1 label {t001.i} colon 49 skip
site colon 15 site1 label {t001.i} colon 49 skip
buyer colon 15 buyer1 label {t001.i} colon 49 skip
with frame a side-labels width 80.
setFrameLabels(frame a:handle).
{wbrp01.i}
repeat:
if part1 = hi_char then part1 = "".
 if line1 = hi_char then line1 = "".
if type1 = hi_char then type1 = "".
if site1 = hi_char then site1 = "".
if buyer1 = hi_char then buyer1 = "".

if c-application-mode <> "WEB" then update line line1 part part1 type type1 site site1 buyer buyer1 with frame a. {wbrp06.i &command = update
&fields = " line line1 part part1 type type1 site site1 buyer buyer1"
&frm = "a"}

if (c-application-mode <> "WEB") or
(c-application-mode = "WEB" and
(c-web-request begins "DATA"))
then do: bcdparm = "". {mfquoter.i line } {mfquoter.i line1 } {mfquoter.i part } {mfquoter.i part1 } {mfquoter.i type } {mfquoter.i type1 } {mfquoter.i site } {mfquoter.i site1 } {mfquoter.i buyer } {mfquoter.i buyer1 }

if part1 = "" then part1 = hi_char.
if line1 = "" then line1 = hi_char.
if type1 = "" then type1 = hi_char.
if site1 = "" then site1 = hi_char.
if buyer1 = "" then buyer1 = hi_char.
end. {mfselbpr.i "printer" 132}

PUT UNFORMATTED "#def REPORTPATH=$/Minth/minthck" SKIP. PUT UNFORMATTED "#def :end" SKIP.
for each pt_mstr no-lock use-index pt_part where pt_mstr.pt_domain = global_domain and (pt_part >= part and pt_part <= part1) and (pt_prod_line >= line and pt_prod_line <= line1) and (pt_part_type >= type and pt_part_type <= type1), each sct_det no-lock use-index sct_part where sct_domain = global_domain and sct_part = pt_part and sct_sim matches "*STD", each pl_mstr no-lock use-index pl_prod_line where pl_domain = global_domain and pl_prod_line = pt_prod_line:

assign desc1 = pt_desc1 desc2 = pt_desc2 mtltl = sct_mtl_tl + sct_mtl_ll lbrtl = sct_lbr_tl + sct_lbr_ll bdntl = sct_bdn_tl + sct_bdn_ll ovhtl = sct_ovh_tl + sct_ovh_ll subtl = sct_sub_tl + sct_sub_ll.

EXPORT DELIMITER ";" pl_prod_line pl_desc pt_part pt_um pt_status desc1 desc2 sct_sim mtltl lbrtl bdntl ovhtl subtl sct_cst_tot sct_cst_date .
end.
/*{mfrpchk.i} */{mfreset.i}end. {wbrp04.i}

没有评论: