123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541 |
- $PBExportHeader$w_reissue_cus_ljfieb_edit.srw
- forward
- global type w_reissue_cus_ljfieb_edit from w_publ_base
- end type
- type cb_save from uo_imflatbutton within w_reissue_cus_ljfieb_edit
- end type
- type dw_uc from datawindow within w_reissue_cus_ljfieb_edit
- end type
- type dw_child from datawindow within w_reissue_cus_ljfieb_edit
- end type
- type st_1 from statictext within w_reissue_cus_ljfieb_edit
- end type
- type ln_bar from line within w_reissue_cus_ljfieb_edit
- end type
- type ln_bar2 from line within w_reissue_cus_ljfieb_edit
- end type
- type r_bar from rectangle within w_reissue_cus_ljfieb_edit
- end type
- end forward
- global type w_reissue_cus_ljfieb_edit from w_publ_base
- integer width = 3611
- integer height = 2380
- string title = "费用单信息匹配"
- boolean minbox = false
- windowtype windowtype = response!
- cb_save cb_save
- dw_uc dw_uc
- dw_child dw_child
- st_1 st_1
- ln_bar ln_bar
- ln_bar2 ln_bar2
- r_bar r_bar
- end type
- global w_reissue_cus_ljfieb_edit w_reissue_cus_ljfieb_edit
- type variables
- Transaction tr_eb_sqlca
- s_packet_ljfieb s_inscust
- string ins_sn
- long ins_cusid,ins_scid,ins_billtype
- string ins_reissuecode
- uo_reissue uo_ware
- end variables
- on w_reissue_cus_ljfieb_edit.create
- int iCurrent
- call super::create
- this.cb_save=create cb_save
- this.dw_uc=create dw_uc
- this.dw_child=create dw_child
- this.st_1=create st_1
- this.ln_bar=create ln_bar
- this.ln_bar2=create ln_bar2
- this.r_bar=create r_bar
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_save
- this.Control[iCurrent+2]=this.dw_uc
- this.Control[iCurrent+3]=this.dw_child
- this.Control[iCurrent+4]=this.st_1
- this.Control[iCurrent+5]=this.ln_bar
- this.Control[iCurrent+6]=this.ln_bar2
- this.Control[iCurrent+7]=this.r_bar
- end on
- on w_reissue_cus_ljfieb_edit.destroy
- call super::destroy
- destroy(this.cb_save)
- destroy(this.dw_uc)
- destroy(this.dw_child)
- destroy(this.st_1)
- destroy(this.ln_bar)
- destroy(this.ln_bar2)
- destroy(this.r_bar)
- end on
- event open;call super::open;tr_eb_sqlca = sys_email_sqlca // 电子商务连接
- If sys_email_sqlca.DBHandle() = 0 Then
- MessageBox('Error','电子商务数据库连接失败,请检查')
- Return
- End If
- uo_ware = Create uo_reissue
- uo_ware.commit_transaction = sqlca
- s_inscust = Message.PowerObjectParm
- ins_sn = s_inscust.serialnum
- ins_cusid = s_inscust.cusid
- ins_scid = s_inscust.scid
- ins_billtype = s_inscust.billtype
- If ins_billtype = 1 Then
- dw_uc.Modify("banktypeid.dddw.Name='ddd_banktypename'")
-
- Else
- dw_uc.Modify("banktypeid.dddw.Name='ddd_buy_taketype'")
-
- End If
- dw_uc.SetTransObject(tr_eb_sqlca)
- dw_child.SetTransObject(tr_eb_sqlca)
- datawindowchild childdwmx
- dw_uc.GetChild("banktypeid",childdwmx)
- childdwmx.SetTransObject (sqlca)
- If childdwmx.Retrieve() = 0 Then
- childdwmx.InsertRow(0)
- End If
- datawindowchild childdwmx_2
- dw_uc.GetChild("moneyid",childdwmx_2)
- childdwmx_2.SetTransObject (sqlca)
- If childdwmx_2.Retrieve() = 0 Then
- childdwmx_2.InsertRow(0)
- End If
- dw_uc.Retrieve(ins_sn)
- dw_child.Retrieve(ins_sn)
- //自动匹配信息
- Long ll_ucrow,ll_i
- String ls_moneyname,ls_banktypename
- Long ll_moneyid,ll_banktypeid
- Long ll_itemid
- String ls_itemcode,ls_itemname
- ll_ucrow = dw_uc.GetRow()
- dw_uc.accepttext()
- dw_child.accepttext()
- dw_uc.setredraw(false)
- dw_child.setredraw(false)
- If ll_ucrow > 0 Then
- ls_moneyname = dw_uc.Object.moneyname[ll_ucrow]
-
- Select moneyid Into :ll_moneyid
- From cw_currency
- Where Name = :ls_moneyname Using sqlca;
- If sqlca.SQLCode = 0 Then
- dw_uc.Object.moneyid[ll_ucrow] = ll_moneyid
- End If
-
- ls_banktypename = dw_uc.Object.banktypename[ll_ucrow]
-
- If ins_billtype = 1 Then
- Select banktypeid
- Into :ll_banktypeid
- From cw_banktype
- Where inuse = 1 And banktype = 0 And banktypename = :ls_banktypename Using sqlca;
- If sqlca.SQLCode = 0 Then
- dw_uc.Object.banktypeid[ll_ucrow] = ll_banktypeid
- End If
-
- Else
- Select banktypeid
- Into :ll_banktypeid
- From cw_banktype
- Where inuse = 1 And banktype = 1 And banktypename = :ls_banktypename Using sqlca;
- If sqlca.SQLCode = 0 Then
- dw_uc.Object.banktypeid[ll_ucrow] = ll_banktypeid
- End If
-
- End If
-
- ls_itemname = dw_uc.Object.itemname[ll_ucrow]
- Select u_itemdef.itemid,
- u_itemdef.itemcode
- Into :ll_itemid,
- :ls_itemcode
- From u_itemdef
- Where u_itemdef.itemname = :ls_itemname Using sqlca;
- If sqlca.SQLCode = 0 Then
- dw_uc.Object.itemid[ll_ucrow] = ll_itemid
- dw_uc.Object.itemcode_self[ll_ucrow] = ls_itemcode
- dw_uc.Object.itemname_self[ll_ucrow] = ls_itemname
- End If
-
- End If
- For ll_i = 1 To dw_child.RowCount()
- ls_itemname = dw_child.Object.expensesname[ll_i]
-
- If ins_billtype = 1 Then
- Select U_Expenses.ExpensesID,
- U_Expenses.ExpensesCode
- Into :ll_itemid,
- :ls_itemcode
- From U_Expenses
- Where U_Expenses.ExpensesName = :ls_itemname
- And Expensestype = 0 Using sqlca;
- If sqlca.SQLCode = 0 Then
- dw_child.Object.itemid[ll_i] = ll_itemid
- dw_child.Object.itemcode_self[ll_i] = ls_itemcode
- dw_child.Object.itemname_self[ll_i] = ls_itemname
- End If
- Else
- Select U_Expenses.ExpensesID,
- U_Expenses.ExpensesCode
- Into :ll_itemid,
- :ls_itemcode
- From U_Expenses
- Where U_Expenses.ExpensesName = :ls_itemname
- And Expensestype = 1 Using sqlca;
- If sqlca.SQLCode = 0 Then
- dw_child.Object.itemid[ll_i] = ll_itemid
- dw_child.Object.itemcode_self[ll_i] = ls_itemcode
- dw_child.Object.itemname_self[ll_i] = ls_itemname
- End If
- End If
-
- Next
- dw_uc.setredraw(true)
- dw_child.setredraw(true)
- end event
- event close;call super::close;closewithreturn(this,ins_reissuecode)
- end event
- event resize;call super::resize;ln_bar.endx = this.width
- ln_bar2.endx = this.width
- r_bar.width = this.width
- end event
- type cb_func from w_publ_base`cb_func within w_reissue_cus_ljfieb_edit
- boolean visible = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_reissue_cus_ljfieb_edit
- integer x = 302
- integer width = 187
- integer height = 164
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- type cb_save from uo_imflatbutton within w_reissue_cus_ljfieb_edit
- integer height = 164
- integer taborder = 30
- boolean bringtotop = true
- string text = "生成单据"
- string normalpicname = "save.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;Long uc_row,i
- String arg_msg
- String ls_reissuecode
- uc_row = dw_uc.GetRow()
- If uc_row <= 0 Then
- MessageBox('系统提示','没有可保存的内容')
- Return
- End If
- dw_uc.AcceptText()
- dw_child.AcceptText()
- If dw_uc.Object.banktypeid[uc_row] = 0 Then
- MessageBox('系统提示','请选择结算方式')
- dw_uc.SetFocus()
- dw_uc.SetColumn("banktypeid")
- Return
- End If
- If dw_uc.Object.moneyid[uc_row] = 0 Then
- MessageBox('系统提示','请选择币种')
- dw_uc.SetFocus()
- dw_uc.SetColumn("moneyid")
- Return
- End If
- If dw_uc.Object.itemid[uc_row] = 0 Then
- MessageBox('系统提示','请选择本厂项目')
- dw_uc.SetFocus()
- Return
- End If
- If uo_ware.newbegin(ins_scid,arg_msg) = 0 Then
- MessageBox('Error!',arg_msg)
- Return
- End If
- uo_ware.reissuedate = dw_uc.Object.reissuedate[uc_row]
- uo_ware.dscrp = dw_uc.Object.dscrp[uc_row]
- uo_ware.cusid = ins_cusid
- uo_ware.relcode = dw_uc.Object.relcode[uc_row]
- uo_ware.r_type = ins_billtype
- uo_ware.relid = dw_uc.Object.banktypeid[uc_row]
- uo_ware.moneyid = dw_uc.Object.moneyid[uc_row]
- uo_ware.reissueemp = dw_uc.Object.reissueemp[uc_row]
- uo_ware.itemid = dw_uc.Object.itemid[uc_row]
- For i = 1 To dw_child.RowCount()
- If dw_child.Object.itemid[i] = 0 Then
- MessageBox('系统提示','第'+String(i)+'行明细,请先选择本厂项目')
- Return
- End If
-
- If uo_ware.acceptmx( dw_child.Object.qty[i],&
- 0 - dw_child.Object.price[i],&
- 0 - dw_child.Object.amt[i],&
- dw_child.Object.dscrp[i],&
- i,&
- arg_msg,&
- dw_child.Object.itemid[i],&
- dw_child.object.itemname_self[i]) = 0 Then
- MessageBox('Error!',arg_msg)
- Return
- End If
- Next
- If uo_ware.Save(True,arg_msg) = 0 Then
- MessageBox('Error!',arg_msg)
- Return
- End If
- ins_reissuecode = uo_ware.reissuecode
- Update LJFIEB_reissue
- Set relreissuecode = :ins_reissuecode,
- flag = 1,
- ConfirmTime = getdate(),
- ConfirmUser = :publ_operator
- Where SerialNum = :ins_sn Using tr_eb_sqlca;
- If tr_eb_sqlca.SQLCode <> 0 Then
- Rollback Using tr_eb_sqlca;
- MessageBox('Error','更新客户费用申请单相关单号失败,'+tr_eb_sqlca.SQLErrText)
- Return
- End If
- //更新本地通信记录
- Update LJFIEB_packet
- Set status = 6,
- Complete = 1,
- ConfirmTime = getdate(),
- ConfirmUser = :publ_operator
- Where SerialNum = :ins_sn Using tr_eb_sqlca;
- If tr_eb_sqlca.SQLCode <> 0 Then
- Rollback Using tr_eb_sqlca;
- MessageBox('Error','更新本地通信记录失败,'+tr_eb_sqlca.SQLErrText)
- Return
- End If
- Close(Parent)
- end event
- type dw_uc from datawindow within w_reissue_cus_ljfieb_edit
- integer y = 188
- integer width = 3579
- integer height = 400
- integer taborder = 20
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_reissue_cus_ljfieb_edit"
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- event buttonclicked;If dwo.Name = 'b_ch' Then
-
- Long uc_row
- String ls_itemcode
- uc_row = dw_uc.GetRow()
-
- If uc_row = 0 Then
- MessageBox('系统提示','请选定单据!')
- Return
- End If
- ls_itemcode = Trim(dw_uc.Object.itemcode_self[uc_row])
- dw_uc.AcceptText()
- If Not IsValid(w_itemdef) Then
- s_edit_index_tran s_ch_tran //传递参数使用
- s_ch_tran.if_retrieve_all = local_retrieve_all //是否一次retrieve所有行
- s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
- s_ch_tran.arg_pkid = 0 //目标定位pkid (备用)
- s_ch_tran.arg_string_code = ls_itemcode //查询列(物料编码)部分内容,用于初步筛选
- s_ch_tran.if_retrieve_all = True
-
- OpenWithParm(w_itemdef,s_ch_tran) //调用
-
- s_itemdef s_item_ch
- s_item_ch = Message.PowerObjectParm //接受返回结构
-
- If s_item_ch.itemid > 0 Then //正常返回值则可以取以下值
- dw_uc.SetRedraw(False)
- dw_uc.Object.itemid[uc_row] = s_item_ch.itemid
- dw_uc.Object.itemcode_self[uc_row] = s_item_ch.itemcode
- dw_uc.Object.itemname_self[uc_row] = s_item_ch.itemname
- dw_uc.SetRedraw(True)
- End If
- End If
-
- End If
- end event
- type dw_child from datawindow within w_reissue_cus_ljfieb_edit
- integer y = 672
- integer width = 3589
- integer height = 1588
- integer taborder = 30
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_reissue_mx_ljfieb_edit"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- event doubleclicked;
- Long child_row
- child_row = dw_child.GetRow()
- If child_row <= 0 Then
- MessageBox('系统提示','请先选中明细行')
- Return
- End If
- If Not ((IsValid(w_expensesdef) And ins_billtype = 1 ) Or (IsValid(w_expensesdef_spt) And ins_billtype = 2 )) Then
- s_edit_index_tran s_ch_tran //传递参数使用
- s_ch_tran.if_retrieve_all = False //是否一次RETRIEVE所有行
- s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
- s_ch_tran.arg_pkid = 0 //目标定位PKID (备用)
- s_ch_tran.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
- s_ch_tran.if_select_all = False
- s_ch_tran.b_long = -1
-
- Long chc = 1,ls_j
- dw_child.AcceptText()
- If dw_child.GetRow() > 0 Then s_ch_tran.arg_string_code = Trim(dw_child.Object.itemcode_self[dw_child.GetRow()])
-
- If ins_billtype = 1 Then
- OpenWithParm(w_expensesdef,s_ch_tran)
- Else
- OpenWithParm(w_expensesdef_spt,s_ch_tran)
- End If
-
-
- s_mtrldef_array S_item_ch
- S_item_ch = Message.PowerObjectParm
- For ls_j = 1 To UpperBound(S_item_ch.mtrlid)
- If S_item_ch.mtrlid[ls_j] > 0 Then
- // IF dw_child.GetRow() > 0 THEN
- // IF dw_child.Object.itemid[child_row] <> 0 THEN
- // child_row = dw_child.InsertRow (0)
- // ELSE
- // child_row = dw_child.GetRow()
- // END IF
- // ELSE
- // child_row = dw_child.InsertRow (0)
- // END IF
- dw_child.Object.itemid[child_row] = S_item_ch.mtrlid[ls_j]
- dw_child.Object.itemcode_self[child_row] = S_item_ch.mtrlcode[ls_j]
- dw_child.Object.itemname_self[child_row] = S_item_ch.mtrlname[ls_j]
- End If
- Next
- dw_child.SetFocus()
- End If
- end event
- type st_1 from statictext within w_reissue_cus_ljfieb_edit
- integer x = 27
- integer y = 608
- integer width = 453
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "双击选择本厂项目"
- boolean focusrectangle = false
- end type
- type ln_bar from line within w_reissue_cus_ljfieb_edit
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 172
- integer endx = 3200
- integer endy = 172
- end type
- type ln_bar2 from line within w_reissue_cus_ljfieb_edit
- long linecolor = 16777215
- integer linethickness = 4
- integer beginx = 9
- integer beginy = 176
- integer endx = 3273
- integer endy = 176
- end type
- type r_bar from rectangle within w_reissue_cus_ljfieb_edit
- long linecolor = 16777215
- integer linethickness = 4
- long fillcolor = 1073741824
- integer x = 3351
- integer width = 87
- integer height = 68
- end type
- event constructor;this.fillcolor = 14215660
- this.linecolor = 14215660
- this.x = -1
- this.y = -1
- this.height = ln_bar.beginy - 5
- end event
|