[loadOriginal] select fnc_load_basv0212(:s_id, :den_no) [updateOriginal] select fnc_update_basv0212(:s_id) [make_basr0320] select fnc_report_basr0320(:s_id, :den_no, :num_line); [make_basr0310] select fnc_report_basr0310( :s_id, :den_no, ':p_op_0', --':p_op_0' = 見積日, ':p_op_1', --':p_op_1' = 得意先名, ':p_op_2', --':p_op_2' = 合計金額, ':p_tax' --':p_tax' = 消費税 ); [make_basr0311] select fnc_report_basr0311( :s_id, :den_no, ':p_op_0', --':p_op_0' = 見積日, ':p_op_1', --':p_op_1' = 得意先名, ':p_op_2', --':p_op_2' = 合計金額, ':p_tax' --':p_tax' = 消費税 ); select fnc_report_basr0320(:s_id, :den_no, :num_line); [deleteOriginal] delete from w_basv0210 where s_id = :s_id; delete from w_basv0210_m where s_id = :s_id; delete from w_basv0213_m where s_id = :s_id; [doDelete] select fnc_delete_basv0210(:den_no, ':login_id') [getOtherId] select other_id as w_other_id from m_hin where hin_cd = ':w_hin_cd' [getMaxDenNo] select (select coalesce(max(den_no),0) + 1 from m_saiban where saiban_kbn = 11) as new_no ; [getNonyu] select nonyu_no as w_nonyu_no from m_nonyu where tok_cd = ':tok_cd' order by nonyu_no limit 1 [loadNewKey] select den_no as w_new_den_no --, uri_no as w_new_uri_no from w_basv0210 where s_id = :s_id ; [loadSir] insert into w_basv0210_m ( s_id , row_no , hin_cd , hin_nm , suryo , tanka , kingaku , zaiko_flg , now_stock , now_ztanka , del_flg , cre_id , cre_time , upd_id , upd_time ) select :s_id , sm.row_no , sm.hin_cd , mh.hin_rnm , sm.suryo --, mh.tanka --, sm.suryo * mh.tanka --kingaku , 0 --tanka , 0 --kingaku , 1 --zaiko_flg , mh.now_stock , mh.now_ztanka , 0 --del_flg , ':login_id' --cre_id , now() --cre_time , ':login_id' --upd_id , now() --upd_time from t_sir_m sm inner join v_m_hin mh on (mh.hin_cd = sm.hin_cd) where sm.den_no = :sir_no order by sm.row_no ; [chkWorkNo] select den_no from w_basv0210 where s_id = :s_id and upper(mitsumori_no) = upper(':mitsumori_no') --and mitsumori_no = ':mitsumori_no' --and del_flg = 0 ; [chkRecord] select den_no as upd_den_no from t_uri where upper(mitsumori_no) = upper(':mitsumori_no') --and den_no != :den_no and del_flg = 0 ; [setDenNoClear] update w_basv0210 set den_no = null, mitsumori_no = ':mitsumori_no' where s_id = :s_id; --update w_basv0210_m set mitsumori_no = ':mitsumori_no' where s_id = :s_id; --update w_basv0213_m set mitsumori_no = ':mitsumori_no' where s_id = :s_id; [setNewDenNo] --既存伝票の論理削除 update t_uri set del_flg = 1 where den_no = :upd_den_no; update t_uri_m set del_flg = 1 where den_no = :upd_den_no; update w_basv0210 set den_no = null,mitsumori_no = ':mitsumori_no' where s_id = :s_id; --update w_basv0210_m set mitsumori_no = ':mitsumori_no' where s_id = :s_id; --update w_basv0213_m set mitsumori_no = ':mitsumori_no' where s_id = :s_id; [deleteRecord] delete from w_basv0210_m where s_id = :s_id [insertRecord] insert into w_basv0210_m ( s_id , row_no , hin_cd , suryo , del_flg , cre_id , cre_time , upd_id , upd_time ) values ( :s_id , :w_row_no , ':w_hin_cd' , :w_suryo , 0 --del_flg , ':login_id' --cre_id , now() --cre_time , ':login_id' --upd_id , now() --upd_time ); update w_basv0210_m w set hin_nm = m1.hin_nm from m_hin m1 where w.s_id = :s_id and w.row_no = :w_row_no and m1.hin_cd = w.hin_cd ; update w_basv0210_m w set now_ztanka = st.now_ztanka , now_stock = st.now_stock from m_stock st where w.s_id = :s_id and w.row_no = :w_row_no and st.hin_cd = w.hin_cd ; [getDiscTanka] select coalesce(max(disc_per), 0) as disc_per from m_tok_disc where tok_cd = ':tok_cd' and cat_cd = ':orow_no' ---1407ADD [get_ban] select han_cd,han_name from m_hanyo where msv_kbn = '41' ; [get_mitsumori] select den_no from t_uri where upper(mitsumori_no) = upper(':mitsumori_no') and del_flg = 0 and mitsumori_flg = 1 ; [get_meisai_info] select coalesce(sum(genka_gaku * jucyu_su),0) as genka, coalesce(sum(tanka * jucyu_su), 0) as tanka from w_basv0213_m where s_id = :s_id and orow_no = :orow_no ; [updateSeq_up] update w_basv0213_m set orow_no = orow_no + 1 where s_id = :s_id and orow_no >= :_seq ; [updateSeq_down] delete from w_basv0213_m where s_id = :s_id and orow_no = :_seq --and link_no = :_seq ; --update w_basv0213_m set orow_no = orow_no - 1 --where s_id = :s_id --and orow_no > :_seq --; [updateRowCopy] select fnc_copy_basv0213(:s_id, :_seq_tmp, :_seq_new); [getDenCopyDetail] select * from t_uri_m w where den_no = :_den_no and row_no = :_row_no [updateDenCopy] select fnc_den_copy_basv0212(:s_id, :_den_no, :_row_no, :_link_no) ; [updateDenCopy___] --select fnc_den_copy_basv0212(:s_id, :_den_no, :_row_no); [getDen_no] select den_no From t_uri where mitsumori_flg = 1 and del_flg = 0 and upper(mitsumori_no) = upper(':_mitsumori_no') --and mitsumori_no = ':_mitsumori_no' ; [getDocs] select document from w_document where s_id = :s_id and row_no = :_row_no ; [deleteDocRow] delete from w_document where s_id = :s_id and row_no = :d_row_no; [doc_sort] select fnc_update_document_sort(:s_id); [getGenkaM] select sum(w1.kousu) as w_kousu from w_basv0210_genka_m w1 where w1.s_id = :s_id and w1.link_no = :link_no [copyGenka] insert into w_basv0210_genka ( s_id , link_no , input_ymd , suryo , sekkei_biko , unchin , del_flg , cre_id , cre_time , upd_id , upd_time ) select :s_id , :_link_no , sh.input_ymd , sh.suryo , sh.sekkei_biko , sh.unchin , sh.del_flg , sh.cre_id , sh.cre_time , sh.upd_id , sh.upd_time from t_uri_m t inner join t_seizou sh on (sh.jucyu_no = t.den_no and sh.jucyu_row_no = t.row_no) where t.den_no = :_den_no and t.row_no = :_row_no ; insert into w_basv0210_genka_m ( s_id , link_no , koutei_no , koutei_cd , koutei_nm , kousu , seizou_tan_cd , seizou_biko , zairyo_no , suryo , seizou_tan_cnt , tanka , kingaku , seizou_hosoku , fixed_cost , del_flg , cre_id , cre_time , upd_id , upd_time ) select :s_id , :_link_no , sm.koutei_no , sm.koutei_cd , sm.koutei_nm , sm.kousu , sm.seizou_tan_cd , sm.seizou_biko , sm.zairyo_no , sm.suryo , sm.seizou_tan_cnt , sm.tanka , sm.kingaku , sm.seizou_hosoku , sm.fixed_cost , sm.del_flg , sm.cre_id , sm.cre_time , sm.upd_id , sm.upd_time from t_uri_m t inner join t_seizou sh on (sh.jucyu_no = t.den_no and sh.jucyu_row_no = t.row_no) inner join t_seizou_m sm on (sm.shiji_no = sh.shiji_no) where t.den_no = :_den_no and t.row_no = :_row_no ; insert into w_basv0210_genka_z ( s_id , link_no , row_no , hin_cd , hin_nm , suryo , tanka , kingaku , sir_cd , sir_nm , hacyu_irai_su , hacyu_irai_ymd , hacyu_no , hacyu_row_no , size_l , size_w , size_h , meisai_biko , sp_hacyu_flg , size_lw , weight , renryo , wtanka , calc_su , yobi_su , hacyu_leadtime , del_flg , cre_id , cre_time , upd_id , upd_time ) select :s_id , :_link_no , sm.row_no , sm.hin_cd , sm.hin_nm , sm.suryo , sm.tanka , sm.kingaku , sm.sir_cd , sm.sir_nm , sm.hacyu_irai_su , sm.hacyu_irai_ymd , sm.hacyu_no , sm.hacyu_row_no , sm.size_l , sm.size_w , sm.size_h , sm.meisai_biko , sm.sp_hacyu_flg , sm.size_lw , sm.weight , sm.renryo , sm.wtanka , sm.calc_su , sm.yobi_su , sm.hacyu_leadtime , sm.del_flg , sm.cre_id , sm.cre_time , sm.upd_id , sm.upd_time from t_uri_m t inner join t_seizou sh on (sh.jucyu_no = t.den_no and sh.jucyu_row_no = t.row_no) inner join t_shiyou_zairyo sm on (sm.shiji_no = sh.shiji_no) where t.den_no = :_den_no and t.row_no = :_row_no and sm.shiyou_zairyo_kbn = 0 ; insert into w_basv0210_genka_g ( s_id , link_no , row_no , hin_cd , hin_nm , suryo , tanka , kingaku , sir_cd , sir_nm , hacyu_irai_su , hacyu_irai_ymd , hacyu_no , hacyu_row_no , meisai_biko , hacyu_leadtime , sir_tan , zairyo_no , del_flg , cre_id , cre_time , upd_id , upd_time ) select :s_id , :_link_no , (sm.row_no - 100) , sm.hin_cd , sm.hin_nm , sm.suryo , sm.tanka , sm.kingaku , sm.sir_cd , sm.sir_nm , sm.hacyu_irai_su , sm.hacyu_irai_ymd , sm.hacyu_no , sm.hacyu_row_no , sm.meisai_biko , sm.hacyu_leadtime , sm.sir_tan , sm.zairyo_no , sm.del_flg , sm.cre_id , sm.cre_time , sm.upd_id , sm.upd_time from t_uri_m t inner join t_seizou sh on (sh.jucyu_no = t.den_no and sh.jucyu_row_no = t.row_no) inner join t_shiyou_zairyo sm on (sm.shiji_no = sh.shiji_no) where t.den_no = :_den_no and t.row_no = :_row_no and sm.shiyou_zairyo_kbn = 1 ; insert into w_basv0210_genka_mock ( s_id , link_no , row_no , mock_no , mock_info , del_flg , cre_id , cre_time , upd_id , upd_time ) select :s_id , :_link_no , sm.row_no , sm.mock_no , sm.mock_info , sm.del_flg , sm.cre_id , sm.cre_time , sm.upd_id , sm.upd_time from t_uri_m t inner join t_seizou sh on (sh.jucyu_no = t.den_no and sh.jucyu_row_no = t.row_no) inner join t_seizou_mock sm on (sm.shiji_no = sh.shiji_no) where t.den_no = :_den_no and t.row_no = :_row_no ; [loadExclusiveTime] select to_char(upd_time,'yyyymmddhh24miss') as w_exclusive_time from w_basv0210 where s_id = :s_id [getExclusiveNowTime] select to_char(upd_time,'yyyymmddhh24miss') as w_exclusive_time from t_uri where den_no = :den_no