Dim
fs
As
String = e.Form.Controls("ComboBox1").Value
If
fs
= ""
Then
MessageBox.Show("The payment cannot be empty,please enter 支付方式不能为空,请输入!",
"错误提示")
Return
End
If
Dim
dr
As
Row = Tables("销售订单").Current
If
dr
IsNot
Nothing
AndAlso
dr.DataRow.RowState
= DataRowState.Added
Then
If
Tables("销售明细表").Current
Is
Nothing
Then
MessageBox.Show("No details cannot be saved 无订单明细,无法保存!",
"Error 错误提示")
dr.Delete
Else
dr("客户名称")
= e.Form.Controls("DropBox3").Text
dr("客户电话")
= e.Form.Controls("DropBox1").Text
dr("折扣")
= e.Form.Controls("TextBox3").Text
dr("备注")
=dr("备注")
&
vbcrlf
&
e.Form.Controls("TextBox4").Text
dr.Save
Tables("销售订单").AllowEdit = False
Tables("销售明细表").save
Tables("订单出库明细表").Save
End
If
End If
If User.Group <> "经理" Then
e.Form.Controls("textbox9").text = 0
End If
If e.Form.Controls("TextBox9").Value
<> 0 Then
Dim tbl As
Table = Tables("订单付款明细表")
Dim r As Row
= tbl.AddNew()
r("付款日期") =
e.Form.Controls("datetimepicker1").Text
r("订单号") = e.Form.Controls("TextBox2").Text
r("付款金额") = e.Form.Controls("TextBox9").Text
r("付款方式") = e.Form.Controls("ComboBox1").Text
If
tbl.Current IsNot Nothing Then
tbl.Current.Save()
End If
End If
Dim khmc As WinForm.DropDownBox = e.Form.Controls("DropBox3")
Dim khdh As WinForm.DropDownBox =
e.Form.Controls("DropBox1")
Dim zk As WinForm.TextBox =
e.Form.Controls("textbox3")
Dim cpxh As WinForm.DropDownBox =
e.Form.Controls("DropBox2")
Dim sl As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox2")
Dim dj As WinForm.TextBox =
e.Form.Controls("textbox5")
Dim sfje As WinForm.TextBox =
e.Form.Controls("textbox9")
Dim ytsl As WinForm.NumericComboBox =
e.Form.Controls("NumericComboBox1")
Dim bz As WinForm.TextBox = e.Form.Controls("textbox4")
Dim zffs As WinForm.ComboBox =
e.Form.Controls("ComboBox1")
khmc.Text = ""
khdh.Text = ""
cpxh.Text = ""
sl.Text = ""
dj.Text = ""
sfje.Text = ""
zk.Text = "0"
ytsl.Text = ""
bz.Text = ""
zffs.Text = "Cash"
Dim t As Table = Tables("销售主界面_Table2")
With Tables("销售订单")
If .Current
Is Nothing Then
t.Filter
= "False"
Else
t.Filter
= "订单号 = '" & .Current("订单号") & "'"
End If
End With
With Tables("销售明细表")
Tables("销售明细表").Filter =
"1=2"
.Cols("数量").GrandTotal = True
.Cols("金额").GrandTotal = True
.GrandTotal
= False
End With
Dim xzcp As WinForm.Button = e.Form.Controls("新增产品")
xzcp.Enabled = False
Dim bc As WinForm.Button = e.Form.Controls("保存")
bc.Enabled
= False
销售订单和销售明细表通过订单号关联,销售订单和订单付款明细通过订单号关联。