[Main] dbuse(true) initparam(printMode,reportId,dt_fr,dt_to,uri_no,tokui_cd,syohin_nm,title,dst_filename,seikyu_s_id,option1,option2,group_no,option3,option4,option5,option6,option7) #フォーマット指定 case($formatmode1,$option1,,1,1,1,0) case($formatmode2,$option1,2,1,0) case($formatmode3,$option1,3,1,0) #case($formatmode1,$option1,1,1,0) deforgpage(blank) defheadarea(hed) defbodyarea(mei) #iterate(DefMode1,$formatmode1) #iterate(DefMode2,$formatmode2) #iterate(DefMode3,$formatmode3) #ここでやらなkey2終了してしまう setdouble($row_page,1) subroutine(SelectRecords_Jisya) subroutine(SelectRecords) subroutine(SelectRecords_Image) loop(PrintNormal,@rs1,Key0,Key1,Key2) printreport($printMode,true) #ここの分岐の意味ないですが一応残しとく [DefMode1] deforgpage(blank) defheadarea(hed) defbodyarea(mei) [DefMode2] deforgpage(blank) defheadarea(hed) defbodyarea(mei) [DefMode3] deforgpage(blank) defheadarea(hed) defbodyarea(mei) #------------------------------------------------- # SQL実行_自社 #------------------------------------------------- [SelectRecords_Jisya] new($param) addparam($param,$uri_no)#1 addparam($param,$option4)#2 dbselect(SelectRecords_Jisya,@rs0,$param) #------------------------------------------------- # SQL実行 #------------------------------------------------- [SelectRecords] new($param) addparam($param,$dt_fr)#1 addparam($param,$dt_to)#2 addparam($param,$uri_no)#3 addparam($param,$tokui_cd)#4 addparam($param,$syohin_nm)#5 addparam($param,$title)#6 addparam($param,$dst_filename) #7 addparam($param,$seikyu_s_id)#8 addparam($param,$option1)#9 addparam($param,$option2)#10 addparam($param,$group_no)#11 addparam($param,$option3)#12 addparam($param,$option4)#13 addparam($param,$option5)#14 addparam($param,$option6)#15 addparam($param,$option7)#16 addparam($param,@rs0.midasi_FLG)#17 dbselect(SelectRecords,@rs1,$param) #担当者印イメージコード生成 concatenate($tantoin,inkan_,@rs1.tan_cd) #------------------------------------------------- # SQL実行_画像 #------------------------------------------------- [SelectRecords_Image] dbselect(SelectLogo,@rs_logo,$param) case($logo_flg,@rs_logo.image_cd,,0,1) iterate(LoadLogoImage,$logo_flg) dbselect(SelectKakuin,@rs_kaku,$param) case($kaku_flg,@rs_kaku.image_cd,,0,1) iterate(LoadKakuImage,$kaku_flg) dbselect(SelectTanto,@rs_tan,$param) case($tan_flg,@rs_tan.image_cd,,0,1) iterate(LoadTanImage,$tan_flg) dbselect(SelectSyaban,@rs_syab,$param) case($syab_flg,@rs_syab.image_cd,,0,1) iterate(LoadSyabanImage,$syab_flg) [LoadLogoImage] new($param) addparam($param,@rs_logo.image_cd) dbselect(SelectImage,@rs_img,$param) tempimage(logo,@rs_img.file_image) [LoadKakuImage] new($param) addparam($param,@rs_kaku.image_cd) dbselect(SelectImage,@rs_img_kaku,$param) tempimage(kakuin,@rs_img_kaku.file_image) [LoadTanImage] # new($param) addparam($param,$tantoin) #addparam($param,@rs_tan.image_cd) dbselect(SelectImage,@rs_img_tan,$param) #tempimage(inkan_waku,@rs_img_tan.file_image) tempimage(inkan,@rs_img_tan.file_image) [LoadSyabanImage] new($param) addparam($param,@rs_syab.image_cd) dbselect(SelectImage,@rs_img_syab,$param) tempimage(syaban,@rs_img_syab.file_image) #------------------------------------------------- # ヘッダ作成 #------------------------------------------------- [CreateHedder] formatspecialrow($_row,0,1,22) #ヘッダ印字内容 #1行目-------------------- putline(,) #2行目-------------------- #右部_見積番号 case($den_no_lbl,@rs1.mitsumori_flg,1,見積番号:,受注番号:) case($mitsumori_no,@rs1.mitsumori_flg,1,@rs1.mitsumori_no,@rs1.uri_no) concatenate($mitsumori_no,$den_no_lbl,$mitsumori_no) putcell($_row,27,$mitsumori_no) putline(,) #3行目-------------------- #タイトル #subroutine(GetTitle) putcell($_row,12,@rs0.title1) #日付 putcell($_row,27,@rs1.u_ymd) putline(,) #4行目-------------------- putline(,) #5行目-------------------- #得意先区分 putcell($_row,2,@rs1.tok_nm) putcell($_row,17,@rs1.keisyo1_ex) putline(,) #6行目-------------------- #得意先区分 putcell($_row,2,@rs1.tok_tan) putcell($_row,17,@rs1.keisyo2_ex) putline(,) #7行目-------------------- #右側_自社区分 putcell($_row,25,@rs0.koumoku1) putline(,) #8行目-------------------- #右側_自社区分 putcell($_row,25,@rs0.koumoku2) putline(,) #9行目-------------------- #税額表示 putcell($_row,2,税抜合計金額) putcell($_row,6,@rs1.zn_gaku) #右側_自社区分 putcell($_row,25,@rs0.koumoku3) putline(,) #10行目-------------------- #税額表示 putcell($_row,2,消費税) putcell($_row,6,@rs1.z_gaku) #ロゴ表示 putimage($_row,23,0,0,0,0,logo) #右側_自社区分 putcell($_row,25,@rs0.koumoku4) putline(,) #11行目-------------------- #合計金額 putcell($_row,2,合計金額) putcell($_row,6,@rs1.zi_gaku) #右側_自社区分 putcell($_row,25,@rs0.j_nm) putline(,) #12行目-------------------- #右側_自社区分 putcell($_row,25,@rs0.j_post_s) putline(,) #13行目-------------------- #右側_自社区分 putcell($_row,25,@rs0.j_address) putline(,) #14行目-------------------- putcell($_row,2,見積名称) putcell($_row,7,@rs1.title1) #右側_自社区分 putcell($_row,25,@rs0.j_address2) putline(,) #15行目-------------------- putline(,) #16行目-------------------- putcell($_row,2,納入場所) putcell($_row,7,@rs1.nonyu_nm) #右側_自社区分 putcell($_row,25,@rs0.j_tel_s) putcell($_row,31,@rs0.j_fax_s) putline(,) #17行目-------------------- putcell($_row,2,納入期日) putcell($_row,7,@rs1.nonyu_ymd_str) #右側_自社区分 putcell($_row,25,@rs0.j_url_s) putline(,) #18行目-------------------- putcell($_row,2,見積有効期限) case($mitsu_kigen_mongon,@rs1.mitsu_kigen_mongon,,御見積より1カ月,@rs1.mitsu_kigen_mongon) #putcell($_row,7,@rs1.mitsu_kigen_mongon) putcell($_row,7,$mitsu_kigen_mongon) #右側_自社区分 putcell($_row,25,@rs0.j_email_s) putline(,) #19行目-------------------- putcell($_row,2,支払条件) putcell($_row,7,@rs1.payment_term) #担当者印表示 #putimage($_row,33,0,0,0,0,inkan_waku) putimage($_row,33,0,0,0,0,inkan) #putcell($_row,33,$tantoin) # 確認用 #putcell($_row,33,@rs1.tan_nm) putline(,) #20行目-------------------- putline(,) #21行目-------------------- putcell($_row,2,@rs0.mongon1) putline(,) #22行目-------------------- putcell($_row,2,@rs0.mongon2) putline(,) iterate(PutSyaban,$syab_flg) [PutSyaban] setdouble($put_img_row,0) #TODO #sum($put_img_row,$_row) sum($put_img_row,@rs_syab.img_row) putimage($put_img_row,@rs_syab.img_col,0,0,0,0,syaban) [GetTitle] case($title_s,$title,納品書,納品書,物品受領書,物品受領書,見積書,御見積書,御見積書) #case($title_s,$title,1,納品書,$title,2,物品受領書,$title,3,御見積書,御見積書) case($title_m,@rs1.mitsumori_flg,1,御見積書) case($title_k,@rs1.mitsumori_flg,1,$title_m,$title_s) #------------------------------------------------- # 見出し作成 #------------------------------------------------- [CreateMidashi] #23行目移行を2ページ目以降から描写 formatspecialrow($_row,0,23,2) putcell($_row,2,@rs0.mongon3) putline(,) putcell($_row,2,@rs0.mongon4) putline(,) #指定見出しの変更 iterate(MidashiMode1,$formatmode1) iterate(MidashiMode2,$formatmode2) iterate(MidashiMode3,$formatmode3) [MidashiMode1] #基本仕様(定価有) formatspecialrow($_row,0,27,2) #明細ラベル1行目 putline(,) #明細ラベル2行目 putcell($_row,2,NO.) putcell($_row,4,名          称) putcell($_row,15,数量) putcell($_row,17,定  価) putcell($_row,21,単  価) putcell($_row,25,金  額) putcell($_row,29,明細備考) putline(,) [MidashiMode2] #基本仕様(定価非表示) formatspecialrow($_row,0,37,2) #明細ラベル1行目 putline(,) #明細ラベル2行目 putcell($_row,2,NO.) putcell($_row,4,名          称) putcell($_row,19,数量) putcell($_row,21,単  価) putcell($_row,25,金  額) putcell($_row,29,明細備考) putline(,) [MidashiMode3] #基本仕様(定価無し・単位・得意先発注番号表示有) formatspecialrow($_row,0,45,2) #明細ラベル1行目 putcell($_row,28,明細備考) putline(,) #明細ラベル2行目 putcell($_row,2,NO.) putcell($_row,4,名          称) putcell($_row,16,数量) putcell($_row,18,単位) putcell($_row,20,単  価) putcell($_row,24,金  額) putcell($_row,28,図面番号) putline(,) #------------------------------------------------- # フッタ備考作成 #------------------------------------------------- [biko_output] formatspecialrow($_row,0,33,2) putcell($_row,2,備考欄) putline(,) putcell($_row,2,@rs1.biko1) putline(,) #------------------------------------------------- # Key0設定ルーチン #------------------------------------------------- [KeyInfo_Key0] keyvalue(dummy) keybreakproc(GroupBegin_Key0,GroupEnd_Key0) #------------------------------------------------- # Key0開始時 #------------------------------------------------- [GroupBegin_Key0] pageopen(true,false) #指定フォーマットの変更 deforgpage(formats) #iterate(FormatMode1,$formatmode1) #iterate(FormatMode2,$formatmode2) #iterate(FormatMode3,$formatmode3) #ヘッダ開始位置_初期 setdouble($header_stt,1) #明細位置_納品書_初期 setdouble($cow_stt,12) #改ページ位置_初期 setdouble($page,58) #ページ番号用_初期 setdouble($page_row,1) #2ページ目以降の改行処理テスト setdouble($test,0) setdouble($row_page,1) setdouble($row_page_c,0) setdouble($row_c,0) setdouble($max_row_c,15) #HPAGEBREAK回避用のflg setdouble($page_flg,1) resetorg() #ヘッダ作成 subroutine(CreateHedder) #ここの分岐の意味ないですが一応残しとく [FormatMode1] deforgpage(formats) [FormatMode2] deforgpage(formats) [FormatMode3] deforgpage(formats) #------------------------------------------------- # Key0終了時 #------------------------------------------------- [GroupEnd_Key0] #フッタ備考作成 subroutine(biko_output) pageclose(false) #------------------------------------------------- # Key1設定ルーチン #------------------------------------------------- [KeyInfo_key1] #keyvalue(@rs1.uri_no) keyvalue(@rs1.uri_no,$row_page) keybreakproc(GroupBegin_key1,GroupEnd_key1) #------------------------------------------------- # Key1開始時 #------------------------------------------------- [GroupBegin_key1] #------------------------------------------------- # Key1終了時 #------------------------------------------------- [GroupEnd_key1] #合計欄作成 #------------------------------------------------- # Key2設定ルーチン #------------------------------------------------- [KeyInfo_key2] keyvalue(@rs1.uri_no,$row_page) keybreakproc(GroupBegin_key2,GroupEnd_key2) #------------------------------------------------- # Key2開始時 #------------------------------------------------- [GroupBegin_key2] subroutine(CreateMidashi) #帳票名_初期値 setdouble($title,1) #明細開始位置_代入 setdouble($cow,$cow_stt) setdouble($cow2,$cow2_stt) #合計額_保存 setdouble($zn_gaku,@rs1.zn_gaku) setdouble($z_gaku,@rs1.z_gaku) setdouble($zi_gaku,@rs1.zi_gaku) #合計額_保存_請求時一括なら表示しない case($z_gaku,@rs1.zei_calc_kbn,1,,$z_gaku) case($page_flg,@rs1.max_row_no,$max_row_c,0,1) iterate(pBreak,$page_flg) #2ページ目か3ページ目以降か case($first_sum,$max_row_c,15,1,0) case($from_sum,$max_row_c,15,0,1) iterate(FirstSum,$first_sum) iterate(FromSum,$from_sum) [FirstSum] concatenate($page_n,$row_page,/,@rs1.max_page) putcell($page_row,35,$page_n) sum($page_row,57) [FromSum] concatenate($page_n,$row_page,/,@rs1.max_page) putcell($page_row,35,$page_n) sum($page_row,55) [pBreak] HPAGEBREAK($page) sum($page,55) #------------------------------------------------- # Key2終了時 #------------------------------------------------- [GroupEnd_key2] putline(,) #------------------------------------------------- # 明細表示処理 #------------------------------------------------- [PrintNormal] #指定フォーマットにて明細描写 iterate(PrintMode1,$formatmode1) iterate(PrintMode2,$formatmode2) iterate(PrintMode3,$formatmode3) sum($row_page_c,1) case($row_page_f,$row_page_c,$max_row_c,1,0) iterate(CountRow,$row_page_f) [PrintMode1] formatspecialrow($_row,0,31,2) putcell($_row,4,@rs1.hin_cd) putline() putcell($_row,4,@rs1.hin_nm) putline(,@rs1.row_no#,,,,,,,,,,,,,@rs1.jucyu_su#,,@rs1.htanka#,,,,@rs1.uri_t#,,,,@rs1.uri_g#,,,,@rs1.meisai_biko#) [PrintMode2] formatspecialrow($_row,0,41,2) putcell($_row,4,@rs1.hin_cd) putline() putcell($_row,4,@rs1.hin_nm) putline(,@rs1.row_no#,,,,,,,,,,,,,,,,,@rs1.jucyu_su#,,@rs1.uri_t#,,,,@rs1.uri_g#,,,,@rs1.meisai_biko#) [PrintMode3] # formatspecialrow($_row,0,49,2) putcell($_row,4,@rs1.hin_nm1) putcell($_row,28,@rs1.meisai_biko) putline() putcell($_row,4,@rs1.hin_nm2) #concatenate($row_page_s,$max_row_c,with,@rs1.row_no) putline(,@rs1.row_no#,,,,,,,,,,,,,,@rs1.jucyu_su#,,@rs1.tani#,,@rs1.uri_t#,,,,@rs1.uri_g#,,,,@rs1.tok_hacyu_no#) [CountRow] sum($max_row_c,25) sum($row_page,1)