瀏覽代碼

2020110201備份

Signed-off-by: B70340 <b70340@gmail.com>
B70340 4 年之前
父節點
當前提交
86086127d7

二進制
.vs/YD-ERP-SYS/v16/.suo 查看文件


+ 13
- 0
YD-ERP-SYS/Module/SQL_業務系統管理.vb 查看文件

@@ -136,6 +136,19 @@
136 136
                 ORDER BY   銷售控制表.單號 DESC"
137 137
         CmdSet_For_DGV()
138 138
     End Sub
139
+    Friend Sub SQL_銷售分析表_稅金()
140
+        If 銷售分析表.依開單日期_ch.Checked = False Then
141
+            SQL2 = "(銷售控制表.交貨日期 BETWEEN '" & Format(銷售分析表.開始日期_dtp.Value, "yyyy/MM/dd") & "' AND '" & Format(銷售分析表.結束日期_dtp.Value, "yyyy/MM/dd") & "')"
142
+        ElseIf 銷售分析表.依開單日期_ch.Checked = True Then
143
+            SQL2 = "(銷售控制表.開單日期 BETWEEN '" & Format(銷售分析表.開始日期_dtp.Value, "yyyy/MM/dd") & "' AND '" & Format(銷售分析表.結束日期_dtp.Value, "yyyy/MM/dd") & "')"
144
+        End If
145
+        ConnOpen()
146
+        SQL1 = "SELECT     單號 AS 項次, 單號, 稅金
147
+                FROM       銷售控制表
148
+                WHERE     (單號 Not Like '4%') AND (單號 LIKE '" & PA19 & "%') AND (稅金 > 0) AND " & SQL2 & " 
149
+                ORDER BY   單號 DESC"
150
+        CmdSet_For_DGV()
151
+    End Sub
139 152
     Friend Sub SQL_銷售分析表_運費()
140 153
         If 銷售分析表.依開單日期_ch.Checked = False Then
141 154
             SQL2 = "(交貨日期 BETWEEN '" & Format(銷售分析表.開始日期_dtp.Value, "yyyy/MM/dd") & "' AND '" & Format(銷售分析表.結束日期_dtp.Value, "yyyy/MM/dd") & "')"

+ 7
- 2
YD-ERP-SYS/Module/SQL_跨介面共用.vb 查看文件

@@ -199,7 +199,7 @@
199 199
     End Sub
200 200
     Friend Sub SQL_銷售收款事項()
201 201
         ConnOpen()
202
-        SQL1 = "SELECT 資料流水號, 單號, 項次 AS 真項次, 項次, 內容, 金額 FROM 銷售收款事項 WHERE (單號 LIKE '" & PA2 & "') ORDER BY 項次 DESC"
202
+        SQL1 = "SELECT 資料流水號, 單號, 項次 AS 真項次, 項次, 內容, 金額 FROM 銷售收款事項 WHERE (單號 LIKE '" & PA2 & "') ORDER BY 項次 DESC, 內容 DESC"
203 203
         CmdSet_For_DGV()
204 204
     End Sub
205 205
     Friend Sub SQL_銷售控制表_刪除()
@@ -232,7 +232,7 @@
232 232
     Friend Sub SQL_銷售控制表_修改()
233 233
         ConnOpen()
234 234
         SQL1 = "UPDATE 銷售控制表 SET 單號 = N'" & PA2 & "', 開單日期 = N'" & DTP & "', 客戶編號 = N'" & PA3 & "', 交貨日期 = '" & DTP1 & "', 含稅 = '" & BL1 & "', 送貨地點 = N'" & PA5 & "', 
235
-                       運費 = N'" & NU1 & "', 管銷費用 = N'" & NU2 & "' 
235
+                       運費 = N'" & NU1 & "', 管銷費用 = N'" & NU2 & "' , 稅金 = N'" & NU3 & "' 
236 236
                 WHERE 流水號 LIKE '" & PA1 & "%'"
237 237
         CmdSet_For_dr()
238 238
     End Sub
@@ -286,6 +286,11 @@
286 286
         SQL1 = "INSERT INTO 銷售收款事項 (資料流水號, 單號, 項次, 內容, 金額) VALUES (N'" & PA1 & "', '" & PA & "', '" & PA2 & "', N'', N'0')"
287 287
         CmdSet_For_dr()
288 288
     End Sub
289
+    Friend Sub SQL_銷售收款事項_新增3()
290
+        ConnOpen()
291
+        SQL1 = "INSERT INTO 銷售收款事項 (資料流水號, 單號, 項次, 內容, 金額) VALUES (N'" & PA1 & "', '" & PA & "', '0', N'刷卡', N'0')"
292
+        CmdSet_For_dr()
293
+    End Sub
289 294
     Friend Sub SQL_銷售備註表_刪除()
290 295
         ConnOpen() : SQL1 = "DELETE 銷售備註表 WHERE 資料流水號 LIKE '" & PA & "'" : CmdSet_For_dr()
291 296
     End Sub

+ 1
- 1
YD-ERP-SYS/Module/全域變數.vb 查看文件

@@ -4,7 +4,7 @@
4 4
     Public 版本號 As String : Public Target As String : Public Target1 As String : Public Target2 As String : Public FTP帳號 As String : Public FTP密碼 As String : Public FTP物理位置 As String
5 5
     Public AA(99) As String : Public BB(99) As Boolean : Public CC(99) As Boolean : Public 登入判斷 As Boolean : Public 業務號碼 As String
6 6
     '----系統版本-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7
-    Public 版本 As String = "2020101402"
7
+    Public 版本 As String = "2020102601"
8 8
     '----系統用全域變數-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9 9
     Public 列印用SQL As String = "" : Public 列印用SQL2 As String : Public 公司編號 As String : Public 公司電話 As String : Public 公司統編 As String : Public 公司地址 As String
10 10
     Public 關鍵字編號 As String

二進制
YD-ERP-SYS/bin/Debug/YD-ERP-SYS.exe 查看文件


二進制
YD-ERP-SYS/bin/Debug/YD-ERP-SYS.pdb 查看文件


二進制
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.exe 查看文件


二進制
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.pdb 查看文件


二進制
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.vbproj.GenerateResource.cache 查看文件


二進制
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.vbprojAssemblyReference.cache 查看文件


+ 0
- 1
YD-ERP-SYS/採購系統管理/供應商資料表.Designer.vb 查看文件

@@ -529,7 +529,6 @@ Partial Class 供應商資料表
529 529
         '
530 530
         Me.結算日_nud.Location = New System.Drawing.Point(1073, 105)
531 531
         Me.結算日_nud.Maximum = New Decimal(New Integer() {31, 0, 0, 0})
532
-        Me.結算日_nud.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
533 532
         Me.結算日_nud.Name = "結算日_nud"
534 533
         Me.結算日_nud.Size = New System.Drawing.Size(40, 23)
535 534
         Me.結算日_nud.TabIndex = 1061

+ 10
- 7
YD-ERP-SYS/採購系統管理/供應商資料表.vb 查看文件

@@ -98,13 +98,16 @@ Public Class 供應商資料表
98 98
             狀態_lb.Text = "編輯狀態"
99 99
             供應商_dgv.Enabled = False : 查詢_tb.Enabled = False '--------------------關閉DGV與關鍵字查詢控件的點選控制功能
100 100
 
101
-            SQL_供應商資料表_編號_最後一筆資料()  '--------------------自動取得新編號
102
-            If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 4)) : Else : EDR = 0 : End If
103
-            conn.Close() : EDR += 1
104
-            If EDR < 10 Then : ESTR = 地區編碼_cb.Text & "00" & EDR
105
-            ElseIf EDR > 9 And EDR < 100 Then : ESTR = 地區編碼_cb.Text & "0" & EDR
106
-            ElseIf EDR > 99 And EDR < 1000 Then : ESTR = 地區編碼_cb.Text & EDR
107
-            End If : 編號_tb.Text = ESTR
101
+            'SQL_供應商資料表_編號_最後一筆資料()  '--------------------自動取得新編號
102
+            'If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 4)) : Else : EDR = 0 : End If
103
+            'conn.Close() : EDR += 1
104
+            'If EDR < 10 Then : ESTR = 地區編碼_cb.Text & "00" & EDR
105
+            'ElseIf EDR > 9 And EDR < 100 Then : ESTR = 地區編碼_cb.Text & "0" & EDR
106
+            'ElseIf EDR > 99 And EDR < 1000 Then : ESTR = 地區編碼_cb.Text & EDR
107
+            'End If : 編號_tb.Text = ESTR
108
+
109
+            PA = InputBox("過渡時期,手工請輸入供應商編號!")
110
+            編號_tb.Text = PA
108 111
 
109 112
             Set_日期格式轉換() '--------------------到職日期格式傳換
110 113
             SQL_供應商資料表_新增() '--------------------人事資料表中寫入一筆資料

+ 124
- 25
YD-ERP-SYS/業務系統管理/訂單控制表.Designer.vb 查看文件

@@ -55,6 +55,8 @@ Partial Class 訂單控制表
55 55
         Me.Label2 = New System.Windows.Forms.Label()
56 56
         Me.單號_tb = New System.Windows.Forms.TextBox()
57 57
         Me.Panel1 = New System.Windows.Forms.Panel()
58
+        Me.其他成本_tb = New System.Windows.Forms.TextBox()
59
+        Me.Label45 = New System.Windows.Forms.Label()
58 60
         Me.物料成本_tb = New System.Windows.Forms.TextBox()
59 61
         Me.Label43 = New System.Windows.Forms.Label()
60 62
         Me.預估利潤_tb = New System.Windows.Forms.TextBox()
@@ -115,8 +117,13 @@ Partial Class 訂單控制表
115 117
         Me.最低運費_cb = New System.Windows.Forms.ComboBox()
116 118
         Me.客戶1_tb = New System.Windows.Forms.TextBox()
117 119
         Me.Label12 = New System.Windows.Forms.Label()
118
-        Me.其他成本_tb = New System.Windows.Forms.TextBox()
119
-        Me.Label45 = New System.Windows.Forms.Label()
120
+        Me.刷卡總和_tb = New System.Windows.Forms.TextBox()
121
+        Me.刷卡稅金_tb = New System.Windows.Forms.TextBox()
122
+        Me.Label46 = New System.Windows.Forms.Label()
123
+        Me.Label47 = New System.Windows.Forms.Label()
124
+        Me.刷卡傭金_tb = New System.Windows.Forms.TextBox()
125
+        Me.Label48 = New System.Windows.Forms.Label()
126
+        Me.通知_lb = New System.Windows.Forms.Label()
120 127
         CType(Me.銷售單據_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
121 128
         Me.Panel1.SuspendLayout()
122 129
         CType(Me.客戶資料_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -343,6 +350,13 @@ Partial Class 訂單控制表
343 350
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
344 351
         Me.Panel1.AutoScroll = True
345 352
         Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
353
+        Me.Panel1.Controls.Add(Me.通知_lb)
354
+        Me.Panel1.Controls.Add(Me.刷卡總和_tb)
355
+        Me.Panel1.Controls.Add(Me.刷卡稅金_tb)
356
+        Me.Panel1.Controls.Add(Me.Label46)
357
+        Me.Panel1.Controls.Add(Me.Label47)
358
+        Me.Panel1.Controls.Add(Me.刷卡傭金_tb)
359
+        Me.Panel1.Controls.Add(Me.Label48)
346 360
         Me.Panel1.Controls.Add(Me.其他成本_tb)
347 361
         Me.Panel1.Controls.Add(Me.Label45)
348 362
         Me.Panel1.Controls.Add(Me.物料成本_tb)
@@ -397,6 +411,28 @@ Partial Class 訂單控制表
397 411
         Me.Panel1.Size = New System.Drawing.Size(638, 502)
398 412
         Me.Panel1.TabIndex = 1278
399 413
         '
414
+        '其他成本_tb
415
+        '
416
+        Me.其他成本_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
417
+        Me.其他成本_tb.ForeColor = System.Drawing.Color.Green
418
+        Me.其他成本_tb.Location = New System.Drawing.Point(534, 700)
419
+        Me.其他成本_tb.Name = "其他成本_tb"
420
+        Me.其他成本_tb.Size = New System.Drawing.Size(81, 23)
421
+        Me.其他成本_tb.TabIndex = 1337
422
+        Me.其他成本_tb.Text = "0"
423
+        Me.其他成本_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
424
+        '
425
+        'Label45
426
+        '
427
+        Me.Label45.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
428
+        Me.Label45.AutoSize = True
429
+        Me.Label45.ForeColor = System.Drawing.Color.Green
430
+        Me.Label45.Location = New System.Drawing.Point(452, 703)
431
+        Me.Label45.Name = "Label45"
432
+        Me.Label45.Size = New System.Drawing.Size(83, 16)
433
+        Me.Label45.TabIndex = 1336
434
+        Me.Label45.Text = "其   他   成   本"
435
+        '
400 436
         '物料成本_tb
401 437
         '
402 438
         Me.物料成本_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -515,6 +551,7 @@ Partial Class 訂單控制表
515 551
         Me.項次3_tb.Name = "項次3_tb"
516 552
         Me.項次3_tb.Size = New System.Drawing.Size(32, 23)
517 553
         Me.項次3_tb.TabIndex = 1290
554
+        Me.項次3_tb.Visible = False
518 555
         '
519 556
         '項次2_tb
520 557
         '
@@ -733,7 +770,7 @@ Partial Class 訂單控制表
733 770
         Me.客戶資料_dgv.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
734 771
         Me.客戶資料_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
735 772
         Me.客戶資料_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
736
-        Me.客戶資料_dgv.Location = New System.Drawing.Point(17, 7168)
773
+        Me.客戶資料_dgv.Location = New System.Drawing.Point(17, 7445)
737 774
         Me.客戶資料_dgv.Name = "客戶資料_dgv"
738 775
         Me.客戶資料_dgv.RowHeadersWidth = 5
739 776
         DataGridViewCellStyle4.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
@@ -877,7 +914,7 @@ Partial Class 訂單控制表
877 914
         DataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
878 915
         Me.收款事項_dgv.RowsDefaultCellStyle = DataGridViewCellStyle10
879 916
         Me.收款事項_dgv.RowTemplate.Height = 24
880
-        Me.收款事項_dgv.Size = New System.Drawing.Size(440, 118)
917
+        Me.收款事項_dgv.Size = New System.Drawing.Size(357, 118)
881 918
         Me.收款事項_dgv.TabIndex = 1282
882 919
         '
883 920
         'Label28
@@ -1048,27 +1085,82 @@ Partial Class 訂單控制表
1048 1085
         Me.Label12.TabIndex = 1306
1049 1086
         Me.Label12.Text = "客戶"
1050 1087
         '
1051
-        '其他成本_tb
1052
-        '
1053
-        Me.其他成本_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1054
-        Me.其他成本_tb.ForeColor = System.Drawing.Color.Green
1055
-        Me.其他成本_tb.Location = New System.Drawing.Point(534, 700)
1056
-        Me.其他成本_tb.Name = "其他成本_tb"
1057
-        Me.其他成本_tb.Size = New System.Drawing.Size(81, 23)
1058
-        Me.其他成本_tb.TabIndex = 1337
1059
-        Me.其他成本_tb.Text = "0"
1060
-        Me.其他成本_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1061
-        '
1062
-        'Label45
1063
-        '
1064
-        Me.Label45.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1065
-        Me.Label45.AutoSize = True
1066
-        Me.Label45.ForeColor = System.Drawing.Color.Green
1067
-        Me.Label45.Location = New System.Drawing.Point(452, 703)
1068
-        Me.Label45.Name = "Label45"
1069
-        Me.Label45.Size = New System.Drawing.Size(83, 16)
1070
-        Me.Label45.TabIndex = 1336
1071
-        Me.Label45.Text = "其   他   成   本"
1088
+        '刷卡總和_tb
1089
+        '
1090
+        Me.刷卡總和_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1091
+        Me.刷卡總和_tb.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1092
+        Me.刷卡總和_tb.Location = New System.Drawing.Point(365, 673)
1093
+        Me.刷卡總和_tb.Name = "刷卡總和_tb"
1094
+        Me.刷卡總和_tb.Size = New System.Drawing.Size(81, 23)
1095
+        Me.刷卡總和_tb.TabIndex = 1346
1096
+        Me.刷卡總和_tb.Text = "0"
1097
+        Me.刷卡總和_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1098
+        '
1099
+        '刷卡稅金_tb
1100
+        '
1101
+        Me.刷卡稅金_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1102
+        Me.刷卡稅金_tb.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1103
+        Me.刷卡稅金_tb.Location = New System.Drawing.Point(365, 713)
1104
+        Me.刷卡稅金_tb.Name = "刷卡稅金_tb"
1105
+        Me.刷卡稅金_tb.Size = New System.Drawing.Size(81, 23)
1106
+        Me.刷卡稅金_tb.TabIndex = 1348
1107
+        Me.刷卡稅金_tb.Text = "0"
1108
+        Me.刷卡稅金_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1109
+        '
1110
+        'Label46
1111
+        '
1112
+        Me.Label46.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1113
+        Me.Label46.AutoSize = True
1114
+        Me.Label46.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1115
+        Me.Label46.Location = New System.Drawing.Point(364, 697)
1116
+        Me.Label46.Name = "Label46"
1117
+        Me.Label46.Size = New System.Drawing.Size(83, 16)
1118
+        Me.Label46.TabIndex = 1347
1119
+        Me.Label46.Text = "刷   卡   稅   金"
1120
+        '
1121
+        'Label47
1122
+        '
1123
+        Me.Label47.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1124
+        Me.Label47.AutoSize = True
1125
+        Me.Label47.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1126
+        Me.Label47.Location = New System.Drawing.Point(364, 658)
1127
+        Me.Label47.Name = "Label47"
1128
+        Me.Label47.Size = New System.Drawing.Size(83, 16)
1129
+        Me.Label47.TabIndex = 1345
1130
+        Me.Label47.Text = "刷   卡   總   和"
1131
+        '
1132
+        '刷卡傭金_tb
1133
+        '
1134
+        Me.刷卡傭金_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1135
+        Me.刷卡傭金_tb.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1136
+        Me.刷卡傭金_tb.Location = New System.Drawing.Point(366, 752)
1137
+        Me.刷卡傭金_tb.Name = "刷卡傭金_tb"
1138
+        Me.刷卡傭金_tb.Size = New System.Drawing.Size(81, 23)
1139
+        Me.刷卡傭金_tb.TabIndex = 1344
1140
+        Me.刷卡傭金_tb.Text = "0"
1141
+        Me.刷卡傭金_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1142
+        '
1143
+        'Label48
1144
+        '
1145
+        Me.Label48.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1146
+        Me.Label48.AutoSize = True
1147
+        Me.Label48.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1148
+        Me.Label48.Location = New System.Drawing.Point(364, 737)
1149
+        Me.Label48.Name = "Label48"
1150
+        Me.Label48.Size = New System.Drawing.Size(83, 16)
1151
+        Me.Label48.TabIndex = 1343
1152
+        Me.Label48.Text = "刷   卡   傭   金"
1153
+        '
1154
+        '通知_lb
1155
+        '
1156
+        Me.通知_lb.AutoSize = True
1157
+        Me.通知_lb.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1158
+        Me.通知_lb.ForeColor = System.Drawing.Color.Red
1159
+        Me.通知_lb.Location = New System.Drawing.Point(120, 7)
1160
+        Me.通知_lb.Name = "通知_lb"
1161
+        Me.通知_lb.Size = New System.Drawing.Size(127, 15)
1162
+        Me.通知_lb.TabIndex = 1349
1163
+        Me.通知_lb.Text = "........................................"
1072 1164
         '
1073 1165
         '訂單控制表
1074 1166
         '
@@ -1213,4 +1305,11 @@ Partial Class 訂單控制表
1213 1305
     Friend WithEvents Label12 As Label
1214 1306
     Friend WithEvents 其他成本_tb As TextBox
1215 1307
     Friend WithEvents Label45 As Label
1308
+    Friend WithEvents 刷卡總和_tb As TextBox
1309
+    Friend WithEvents 刷卡稅金_tb As TextBox
1310
+    Friend WithEvents Label46 As Label
1311
+    Friend WithEvents Label47 As Label
1312
+    Friend WithEvents 刷卡傭金_tb As TextBox
1313
+    Friend WithEvents Label48 As Label
1314
+    Friend WithEvents 通知_lb As Label
1216 1315
 End Class

+ 34
- 13
YD-ERP-SYS/業務系統管理/訂單控制表.vb 查看文件

@@ -55,7 +55,7 @@ Public Class 訂單控制表
55 55
         銷售明細_dgv.Columns(13).ReadOnly = True
56 56
 
57 57
         銷售明細_dgv.Columns("數量").DefaultCellStyle.Format = "#,##0" : 銷售明細_dgv.Columns("成本").DefaultCellStyle.Format = "#,##0"
58
-        銷售明細_dgv.Columns("單價").DefaultCellStyle.Format = "#,##0" : 銷售明細_dgv.Columns("售價").DefaultCellStyle.Format = "#,##0"
58
+        銷售明細_dgv.Columns("單價").DefaultCellStyle.Format = "#,##0.0" : 銷售明細_dgv.Columns("售價").DefaultCellStyle.Format = "#,##0"
59 59
         銷售明細_dgv.Columns("數量").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
60 60
         銷售明細_dgv.Columns("數量").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
61 61
         銷售明細_dgv.Columns("成本").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
@@ -150,15 +150,23 @@ Public Class 訂單控制表
150 150
         DTP = Format(開單日期_dtp.Value, "yyyy/MM/dd") : DTP1 = Format(Today(), "yyyyMMdd")
151 151
     End Sub
152 152
     Private Sub Set_合記計算()
153
-        Dim 不含1類銷售小記 As Integer
153
+        Dim 不含1類銷售小記 As Integer : Dim 金額1 As Integer = 0
154 154
         售價小計_tb.Text = "0" : 稅金_tb.Text = "0" : 銷售合計_tb.Text = "0" : 收入小計_tb.Text = "0" : 支出小計_tb.Text = "0" : 額外收支_tb.Text = "0" : 物料成本_tb.Text = "0"
155
-        司機運費_tb.Text = "0" : 管銷費用_tb.Text = "0" : 其他成本_tb.Text = "0"
155
+        司機運費_tb.Text = "0" : 管銷費用_tb.Text = "0" : 其他成本_tb.Text = "0" : 刷卡總和_tb.Text = "0" : 刷卡稅金_tb.Text = "0" : 刷卡傭金_tb.Text = "0"
156
+        '-------001-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
157
+        For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
158
+            If 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
159
+                刷卡總和_tb.Text = Val(刷卡總和_tb.Text) + 收款事項_dgv("金額", i).Value
160
+            End If
161
+        Next
162
+        刷卡稅金_tb.Text = CInt(Val(Val(刷卡總和_tb.Text) * 0.05)) : 刷卡傭金_tb.Text = CInt(Val(Val(刷卡總和_tb.Text) * 0.02))
163
+        '-------002-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
156 164
         For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
157 165
             售價小計_tb.Text = Val(售價小計_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value)
158 166
 
159 167
             If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) <> 1 Then
160 168
                 物料成本_tb.Text = Val(物料成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
161
-                不含1類銷售小記 = 不含1類銷售小記 + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value)
169
+                不含1類銷售小記 = 不含1類銷售小記 + 銷售明細_dgv("售價", i).Value
162 170
             End If
163 171
             If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) = 1 Then
164 172
                 其他成本_tb.Text = Val(其他成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
@@ -171,21 +179,33 @@ Public Class 訂單控制表
171 179
         管銷費用_tb.Text = Val(物料成本_tb.Text) * 1.06 - Val(物料成本_tb.Text)
172 180
         銷售合計_tb.Text = Val(售價小計_tb.Text) + Val(稅金_tb.Text)
173 181
 
182
+        If Val(稅金_tb.Text) = 0 And Val(刷卡稅金_tb.Text) = 0 Then
183
+            通知_lb.Text = "無稅金"
184
+        ElseIf Val(稅金_tb.Text) = 0 And Val(刷卡稅金_tb.Text) <> 0 Then
185
+            通知_lb.Text = "應刷卡稅金小,有刷卡帶入的稅金,所以拆售價以未稅顯示" : 稅金_tb.Text = 刷卡稅金_tb.Text : 售價小計_tb.Text = Val(銷售合計_tb.Text) - Val(稅金_tb.Text)
186
+        ElseIf Val(稅金_tb.Text) <> 0 And Val(刷卡稅金_tb.Text) <> 0 And Val(稅金_tb.Text) > Val(刷卡稅金_tb.Text) Then
187
+            通知_lb.Text = "應所拆售價稅金大於刷卡稅金,計算正常,利潤中扣除刷卡傭金"
188
+        ElseIf Val(稅金_tb.Text) <> 0 And Val(刷卡稅金_tb.Text) <> 0 And Val(稅金_tb.Text) < Val(刷卡稅金_tb.Text) Then
189
+            通知_lb.Text = "刷卡稅金大於自動計算後的稅金,邏輯有誤,請從新拆售價。"
190
+        End If
191
+        '-------003-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
174 192
         For i As Integer = 0 To 銷售備註_dgv.Rows.Count - 1
175 193
             收入小計_tb.Text = Val(收入小計_tb.Text) + 銷售備註_dgv("收入", i).Value
176 194
             支出小計_tb.Text = Val(支出小計_tb.Text) + 銷售備註_dgv("支出", i).Value
177 195
         Next
178 196
         額外收支_tb.Text = Val(收入小計_tb.Text) - Val(支出小計_tb.Text)
179
-
197
+        '-------004-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
180 198
         Dim 金額 As Integer = 0
181 199
         For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
182
-            If 收款事項_dgv("真項次", i).Value.ToString <> "0" Then
200
+            If 收款事項_dgv("真項次", i).Value.ToString <> "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
183 201
                 金額 = 金額 + 收款事項_dgv("金額", i).Value
184
-            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" Then
202
+            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
203
+                金額 = 金額 + 收款事項_dgv("金額", i).Value
204
+            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString = "未收餘額" Then
185 205
                 收款事項_dgv("金額", i).Value = CInt(Val(銷售合計_tb.Text)) - 金額
186 206
             End If
187 207
         Next
188
-
208
+        '-------005-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
189 209
         If 送貨地點_cb.Text = "" Or 送貨地點_cb.Text = "自取" Or 最低運費_cb.Text = "" Or 最低售價_cb.Text = "" Then
190 210
             司機運費_tb.Text = "0"
191 211
         Else
@@ -193,19 +213,20 @@ Public Class 訂單控制表
193 213
                 If (不含1類銷售小記 - Val(其他成本_tb.Text)) <= Val(最低售價_cb.Text) Then
194 214
                     司機運費_tb.Text = 最低運費_cb.Text
195 215
                 ElseIf (不含1類銷售小記 - Val(其他成本_tb.Text)) > Val(最低售價_cb.Text) Then
196
-                    司機運費_tb.Text = (不含1類銷售小記 - Val(其他成本_tb.Text)) / 100 * 3
216
+                    司機運費_tb.Text = (不含1類銷售小記 - Val(稅金_tb.Text) - Val(刷卡傭金_tb.Text) - Val(其他成本_tb.Text)) / 100 * 3
197 217
                 End If
198 218
             Else
199 219
                 司機運費_tb.Text = 運費
200 220
             End If
201 221
         End If
202
-
203
-        預估利潤_tb.Text = Val(售價小計_tb.Text) + Val(額外收支_tb.Text) - Val(其他成本_tb.Text) - Val(物料成本_tb.Text) - Val(司機運費_tb.Text) - Val(管銷費用_tb.Text)
204
-
222
+        '-------006-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
223
+        預估利潤_tb.Text = Val(售價小計_tb.Text) + Val(額外收支_tb.Text) - Val(其他成本_tb.Text) - Val(物料成本_tb.Text) - Val(司機運費_tb.Text) - Val(管銷費用_tb.Text) - Val(刷卡傭金_tb.Text)
224
+        '-------007-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
205 225
         售價小計_tb.Text = Format(Val(售價小計_tb.Text), "#,##0") : 稅金_tb.Text = Format(Val(稅金_tb.Text), "#,##0") : 銷售合計_tb.Text = Format(Val(銷售合計_tb.Text), "#,##0")
206 226
         收入小計_tb.Text = Format(Val(收入小計_tb.Text), "#,##0") : 支出小計_tb.Text = Format(Val(支出小計_tb.Text), "#,##0") : 額外收支_tb.Text = Format(Val(額外收支_tb.Text), "#,##0")
207 227
         司機運費_tb.Text = Format(Val(司機運費_tb.Text), "#,##0") : 管銷費用_tb.Text = Format(Val(管銷費用_tb.Text), "#,##0") : 預估利潤_tb.Text = Format(Val(預估利潤_tb.Text), "#,##0")
208
-        物料成本_tb.Text = Format(Val(物料成本_tb.Text), "#,##0") : 其他成本_tb.Text = Format(Val(其他成本_tb.Text), "#,##0")
228
+        物料成本_tb.Text = Format(Val(物料成本_tb.Text), "#,##0") : 其他成本_tb.Text = Format(Val(其他成本_tb.Text), "#,##0") : 刷卡總和_tb.Text = Format(Val(刷卡總和_tb.Text), "#,##0")
229
+        刷卡稅金_tb.Text = Format(Val(刷卡稅金_tb.Text), "#,##0") : 刷卡傭金_tb.Text = Format(Val(刷卡傭金_tb.Text), "#,##0")
209 230
     End Sub
210 231
     Private Sub 訂單控制表_Load(sender As Object, e As EventArgs) Handles MyBase.Load
211 232
         Me.MdiParent = YD_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True

+ 25
- 1
YD-ERP-SYS/業務系統管理/銷售分析表.Designer.vb 查看文件

@@ -32,6 +32,8 @@ Partial Class 銷售分析表
32 32
         Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
33 33
         Dim DataGridViewCellStyle9 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
34 34
         Dim DataGridViewCellStyle10 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
35
+        Dim DataGridViewCellStyle11 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
36
+        Dim DataGridViewCellStyle12 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
35 37
         Me.中間日期_dtp = New System.Windows.Forms.DateTimePicker()
36 38
         Me.一般月_ch = New System.Windows.Forms.CheckBox()
37 39
         Me.會計月_ch = New System.Windows.Forms.CheckBox()
@@ -73,11 +75,13 @@ Partial Class 銷售分析表
73 75
         Me.Label30 = New System.Windows.Forms.Label()
74 76
         Me.Label1 = New System.Windows.Forms.Label()
75 77
         Me.Label2 = New System.Windows.Forms.Label()
78
+        Me.稅金_dgv = New System.Windows.Forms.DataGridView()
76 79
         CType(Me.銷售明細_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
77 80
         CType(Me.銷售它項_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
78 81
         CType(Me.銷售備註_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
79 82
         CType(Me.運費_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
80 83
         CType(Me.廠商彙總_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
84
+        CType(Me.稅金_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
81 85
         Me.SuspendLayout()
82 86
         '
83 87
         '中間日期_dtp
@@ -253,7 +257,7 @@ Partial Class 銷售分析表
253 257
         DataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
254 258
         Me.銷售備註_dgv.RowsDefaultCellStyle = DataGridViewCellStyle6
255 259
         Me.銷售備註_dgv.RowTemplate.Height = 24
256
-        Me.銷售備註_dgv.Size = New System.Drawing.Size(621, 165)
260
+        Me.銷售備註_dgv.Size = New System.Drawing.Size(329, 165)
257 261
         Me.銷售備註_dgv.TabIndex = 1262
258 262
         '
259 263
         '運費_dgv
@@ -532,11 +536,29 @@ Partial Class 銷售分析表
532 536
         Me.Label2.TabIndex = 1333
533 537
         Me.Label2.Text = "依業務與日期為主要查詢條件生成報表"
534 538
         '
539
+        '稅金_dgv
540
+        '
541
+        DataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
542
+        Me.稅金_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle11
543
+        Me.稅金_dgv.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
544
+        Me.稅金_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
545
+        Me.稅金_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
546
+        Me.稅金_dgv.Location = New System.Drawing.Point(339, 508)
547
+        Me.稅金_dgv.Name = "稅金_dgv"
548
+        Me.稅金_dgv.RowHeadersWidth = 5
549
+        DataGridViewCellStyle12.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
550
+        DataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
551
+        Me.稅金_dgv.RowsDefaultCellStyle = DataGridViewCellStyle12
552
+        Me.稅金_dgv.RowTemplate.Height = 24
553
+        Me.稅金_dgv.Size = New System.Drawing.Size(287, 165)
554
+        Me.稅金_dgv.TabIndex = 1334
555
+        '
535 556
         '銷售分析表
536 557
         '
537 558
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
538 559
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
539 560
         Me.ClientSize = New System.Drawing.Size(1344, 681)
561
+        Me.Controls.Add(Me.稅金_dgv)
540 562
         Me.Controls.Add(Me.Label2)
541 563
         Me.Controls.Add(Me.Label1)
542 564
         Me.Controls.Add(Me.其他成本_tb)
@@ -587,6 +609,7 @@ Partial Class 銷售分析表
587 609
         CType(Me.銷售備註_dgv, System.ComponentModel.ISupportInitialize).EndInit()
588 610
         CType(Me.運費_dgv, System.ComponentModel.ISupportInitialize).EndInit()
589 611
         CType(Me.廠商彙總_dgv, System.ComponentModel.ISupportInitialize).EndInit()
612
+        CType(Me.稅金_dgv, System.ComponentModel.ISupportInitialize).EndInit()
590 613
         Me.ResumeLayout(False)
591 614
         Me.PerformLayout()
592 615
 
@@ -633,4 +656,5 @@ Partial Class 銷售分析表
633 656
     Friend WithEvents Label30 As Label
634 657
     Friend WithEvents Label1 As Label
635 658
     Friend WithEvents Label2 As Label
659
+    Friend WithEvents 稅金_dgv As DataGridView
636 660
 End Class

+ 39
- 13
YD-ERP-SYS/業務系統管理/銷售分析表.vb 查看文件

@@ -1,6 +1,6 @@
1 1
 Option Strict Off
2 2
 Public Class 銷售分析表
3
-    ReadOnly ds1 As New DataSet : ReadOnly ds2 As New DataSet : ReadOnly ds3 As New DataSet : ReadOnly ds4 As New DataSet : ReadOnly ds5 As New DataSet
3
+    ReadOnly ds1 As New DataSet : ReadOnly ds2 As New DataSet : ReadOnly ds3 As New DataSet : ReadOnly ds4 As New DataSet : ReadOnly ds5 As New DataSet : ReadOnly ds6 As New DataSet
4 4
     Dim 首次開啟 As Boolean = False : Dim 比例 As Integer
5 5
     Private Sub Set_清單1()
6 6
         廠商彙總_dgv.DataSource = Nothing : ds1.Clear()
@@ -129,7 +129,7 @@ Public Class 銷售分析表
129 129
         For I As Integer = 0 To 14 : 銷售明細_dgv.Columns(I).ReadOnly = True : Next
130 130
 
131 131
         銷售明細_dgv.Columns("數量").DefaultCellStyle.Format = "#,##0" : 銷售明細_dgv.Columns("成本").DefaultCellStyle.Format = "#,##0"
132
-        銷售明細_dgv.Columns("單價").DefaultCellStyle.Format = "#,##0" : 銷售明細_dgv.Columns("售價").DefaultCellStyle.Format = "#,##0"
132
+        銷售明細_dgv.Columns("單價").DefaultCellStyle.Format = "#,##0.0" : 銷售明細_dgv.Columns("售價").DefaultCellStyle.Format = "#,##0"
133 133
         銷售明細_dgv.Columns("數量").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
134 134
         銷售明細_dgv.Columns("數量").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
135 135
         銷售明細_dgv.Columns("成本").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
@@ -173,7 +173,7 @@ Public Class 銷售分析表
173 173
         SQL_銷售分析表_銷售備註()
174 174
         da.Fill(ds5) : 銷售備註_dgv.DataSource = ds5.Tables(0) : conn.Close()
175 175
 
176
-        銷售備註_dgv.Columns(0).FillWeight = 80 : 銷售備註_dgv.Columns(1).FillWeight = 120 : 銷售備註_dgv.Columns(2).FillWeight = 910
176
+        銷售備註_dgv.Columns(0).FillWeight = 80 : 銷售備註_dgv.Columns(1).FillWeight = 120 : 銷售備註_dgv.Columns(2).FillWeight = 510
177 177
         銷售備註_dgv.Columns(3).FillWeight = 120
178 178
 
179 179
         For I As Integer = 0 To 3 : 銷售備註_dgv.Columns(I).ReadOnly = True : Next
@@ -192,6 +192,33 @@ Public Class 銷售分析表
192 192
             銷售備註_dgv("項次", i).Value = i + 1
193 193
         Next
194 194
     End Sub
195
+    Private Sub Set_清單6()
196
+        稅金_dgv.DataSource = Nothing : ds6.Clear()
197
+        稅金_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
198
+        稅金_dgv.ColumnHeadersHeight = 25
199
+        稅金_dgv.AllowUserToAddRows = False
200
+        稅金_dgv.RowTemplate.Height = 26
201
+
202
+        PA19 = 業務_cb.Text
203
+        SQL_銷售分析表_稅金()
204
+        da.Fill(ds6) : 稅金_dgv.DataSource = ds6.Tables(0) : conn.Close()
205
+
206
+        稅金_dgv.Columns(0).FillWeight = 80 : 稅金_dgv.Columns(1).FillWeight = 120 : 稅金_dgv.Columns(2).FillWeight = 100
207
+
208
+        For I As Integer = 0 To 2 : 稅金_dgv.Columns(I).ReadOnly = True : Next
209
+
210
+        稅金_dgv.Columns("稅金").DefaultCellStyle.Format = "#,##0"
211
+        稅金_dgv.Columns("稅金").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
212
+        稅金_dgv.Columns("稅金").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
213
+        稅金_dgv.Columns("項次").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
214
+        稅金_dgv.Columns("項次").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
215
+        稅金_dgv.Columns("單號").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
216
+        稅金_dgv.Columns("單號").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
217
+
218
+        For i As Integer = 0 To 稅金_dgv.Rows.Count - 1
219
+            稅金_dgv("項次", i).Value = i + 1
220
+        Next
221
+    End Sub
195 222
     Private Sub Set_合記計算()
196 223
         售價小計_tb.Text = "0" : 稅金_tb.Text = "0" : 銷售合計_tb.Text = "0" : 收入小計_tb.Text = "0" : 支出小計_tb.Text = "0" : 額外收支_tb.Text = "0" : 物料成本_tb.Text = "0"
197 224
         司機運費_tb.Text = "0" : 管銷費用_tb.Text = "0" : 其他成本_tb.Text = "0"
@@ -205,10 +232,9 @@ Public Class 銷售分析表
205 232
             If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) = 1 Then
206 233
                 其他成本_tb.Text = Val(其他成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
207 234
             End If
208
-
209
-            If 銷售明細_dgv("含稅", i).Value = True Then
210
-                稅金_tb.Text = Val(稅金_tb.Text) + ((銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value * 1.05) - (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value))
211
-            End If
235
+        Next
236
+        For i As Integer = 0 To 稅金_dgv.Rows.Count - 1
237
+            稅金_tb.Text = Val(稅金_tb.Text) + 稅金_dgv("稅金", i).Value
212 238
         Next
213 239
 
214 240
         管銷費用_tb.Text = Val(物料成本_tb.Text) * 1.06 - Val(物料成本_tb.Text)
@@ -301,7 +327,7 @@ Public Class 銷售分析表
301 327
     End Sub
302 328
     Private Sub 銷售分析表_SizeChanged(sender As Object, e As EventArgs) Handles MyBase.SizeChanged
303 329
         If 首次開啟 = True Then
304
-            Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_合記計算()
330
+            Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_清單6() : Set_合記計算()
305 331
         End If
306 332
     End Sub
307 333
     Private Sub 日期格式()
@@ -352,13 +378,13 @@ Public Class 銷售分析表
352 378
         會計月_ch.Checked = False : 一般月_ch.Checked = True : 日期格式()
353 379
     End Sub
354 380
     Private Sub 開始日期_dtp_ValueChanged(sender As Object, e As EventArgs) Handles 開始日期_dtp.ValueChanged
355
-        Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_合記計算()
381
+        Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_清單6() : Set_合記計算()
356 382
     End Sub
357 383
     Private Sub 結束日期_dtp_ValueChanged(sender As Object, e As EventArgs) Handles 結束日期_dtp.ValueChanged
358
-        Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_合記計算()
384
+        Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_清單6() : Set_合記計算()
359 385
     End Sub
360 386
     Private Sub 業務_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 業務_cb.SelectedIndexChanged
361
-        Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_合記計算()
387
+        Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_清單6() : Set_合記計算()
362 388
     End Sub
363 389
     Private Sub 銷售明細_dgv_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 銷售明細_dgv.RowPostPaint
364 390
         Dim linePen As New Pen(Color.Blue, 2)
@@ -371,9 +397,9 @@ Public Class 銷售分析表
371 397
         End If
372 398
     End Sub
373 399
     Private Sub 依開單日期_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 依開單日期_ch.Click
374
-        依開單日期_ch.Checked = True : 依交貨日期_ch.Checked = False : Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_合記計算()
400
+        依開單日期_ch.Checked = True : 依交貨日期_ch.Checked = False : Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_清單6() : Set_合記計算()
375 401
     End Sub
376 402
     Private Sub 依交貨日期_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 依交貨日期_ch.Click
377
-        依開單日期_ch.Checked = False : 依交貨日期_ch.Checked = True : Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_合記計算()
403
+        依開單日期_ch.Checked = False : 依交貨日期_ch.Checked = True : Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_清單6() : Set_合記計算()
378 404
     End Sub
379 405
 End Class

+ 146
- 33
YD-ERP-SYS/業務系統管理/銷售單審核.Designer.vb 查看文件

@@ -105,6 +105,8 @@ Partial Class 銷售單審核
105 105
         Me.單據核准_bt = New System.Windows.Forms.Button()
106 106
         Me.單據作廢_bt = New System.Windows.Forms.Button()
107 107
         Me.Panel1 = New System.Windows.Forms.Panel()
108
+        Me.其他成本_tb = New System.Windows.Forms.TextBox()
109
+        Me.Label45 = New System.Windows.Forms.Label()
108 110
         Me.Reset_bt = New System.Windows.Forms.Button()
109 111
         Me.讀取標準成本_bt = New System.Windows.Forms.Button()
110 112
         Me.物料成本_tb = New System.Windows.Forms.TextBox()
@@ -170,8 +172,14 @@ Partial Class 銷售單審核
170 172
         Me.物料圖1_pb = New System.Windows.Forms.PictureBox()
171 173
         Me.最低售價_cb = New System.Windows.Forms.ComboBox()
172 174
         Me.最低運費_cb = New System.Windows.Forms.ComboBox()
173
-        Me.其他成本_tb = New System.Windows.Forms.TextBox()
174
-        Me.Label45 = New System.Windows.Forms.Label()
175
+        Me.刷卡收款_bt = New System.Windows.Forms.Button()
176
+        Me.刷卡總和_tb = New System.Windows.Forms.TextBox()
177
+        Me.刷卡稅金_tb = New System.Windows.Forms.TextBox()
178
+        Me.Label46 = New System.Windows.Forms.Label()
179
+        Me.Label47 = New System.Windows.Forms.Label()
180
+        Me.刷卡傭金_tb = New System.Windows.Forms.TextBox()
181
+        Me.Label48 = New System.Windows.Forms.Label()
182
+        Me.通知_lb = New System.Windows.Forms.Label()
175 183
         CType(Me.售價_nud, System.ComponentModel.ISupportInitialize).BeginInit()
176 184
         CType(Me.區域庫存_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
177 185
         CType(Me.成本_nud, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -634,7 +642,7 @@ Partial Class 銷售單審核
634 642
         '
635 643
         Me.刪除單據上點選的資料_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
636 644
         Me.刪除單據上點選的資料_bt.ForeColor = System.Drawing.Color.Red
637
-        Me.刪除單據上點選的資料_bt.Location = New System.Drawing.Point(279, 3)
645
+        Me.刪除單據上點選的資料_bt.Location = New System.Drawing.Point(202, 3)
638 646
         Me.刪除單據上點選的資料_bt.Name = "刪除單據上點選的資料_bt"
639 647
         Me.刪除單據上點選的資料_bt.Size = New System.Drawing.Size(163, 23)
640 648
         Me.刪除單據上點選的資料_bt.TabIndex = 1281
@@ -890,6 +898,14 @@ Partial Class 銷售單審核
890 898
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
891 899
         Me.Panel1.AutoScroll = True
892 900
         Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
901
+        Me.Panel1.Controls.Add(Me.通知_lb)
902
+        Me.Panel1.Controls.Add(Me.刷卡總和_tb)
903
+        Me.Panel1.Controls.Add(Me.刷卡稅金_tb)
904
+        Me.Panel1.Controls.Add(Me.Label46)
905
+        Me.Panel1.Controls.Add(Me.Label47)
906
+        Me.Panel1.Controls.Add(Me.刷卡傭金_tb)
907
+        Me.Panel1.Controls.Add(Me.Label48)
908
+        Me.Panel1.Controls.Add(Me.刷卡收款_bt)
893 909
         Me.Panel1.Controls.Add(Me.其他成本_tb)
894 910
         Me.Panel1.Controls.Add(Me.Label45)
895 911
         Me.Panel1.Controls.Add(Me.Reset_bt)
@@ -951,6 +967,28 @@ Partial Class 銷售單審核
951 967
         Me.Panel1.Size = New System.Drawing.Size(731, 502)
952 968
         Me.Panel1.TabIndex = 1331
953 969
         '
970
+        '其他成本_tb
971
+        '
972
+        Me.其他成本_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
973
+        Me.其他成本_tb.ForeColor = System.Drawing.Color.Green
974
+        Me.其他成本_tb.Location = New System.Drawing.Point(622, 702)
975
+        Me.其他成本_tb.Name = "其他成本_tb"
976
+        Me.其他成本_tb.Size = New System.Drawing.Size(81, 23)
977
+        Me.其他成本_tb.TabIndex = 1335
978
+        Me.其他成本_tb.Text = "0"
979
+        Me.其他成本_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
980
+        '
981
+        'Label45
982
+        '
983
+        Me.Label45.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
984
+        Me.Label45.AutoSize = True
985
+        Me.Label45.ForeColor = System.Drawing.Color.Green
986
+        Me.Label45.Location = New System.Drawing.Point(540, 705)
987
+        Me.Label45.Name = "Label45"
988
+        Me.Label45.Size = New System.Drawing.Size(83, 16)
989
+        Me.Label45.TabIndex = 1334
990
+        Me.Label45.Text = "其   他   成   本"
991
+        '
954 992
         'Reset_bt
955 993
         '
956 994
         Me.Reset_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -967,9 +1005,9 @@ Partial Class 銷售單審核
967 1005
         '
968 1006
         Me.讀取標準成本_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
969 1007
         Me.讀取標準成本_bt.ForeColor = System.Drawing.Color.Green
970
-        Me.讀取標準成本_bt.Location = New System.Drawing.Point(496, 3)
1008
+        Me.讀取標準成本_bt.Location = New System.Drawing.Point(106, 3)
971 1009
         Me.讀取標準成本_bt.Name = "讀取標準成本_bt"
972
-        Me.讀取標準成本_bt.Size = New System.Drawing.Size(163, 23)
1010
+        Me.讀取標準成本_bt.Size = New System.Drawing.Size(95, 23)
973 1011
         Me.讀取標準成本_bt.TabIndex = 1332
974 1012
         Me.讀取標準成本_bt.Text = "讀取標準成本"
975 1013
         Me.讀取標準成本_bt.UseVisualStyleBackColor = True
@@ -1097,16 +1135,17 @@ Partial Class 銷售單審核
1097 1135
         '
1098 1136
         Me.項次3_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1099 1137
         Me.項次3_tb.Enabled = False
1100
-        Me.項次3_tb.Location = New System.Drawing.Point(486, 631)
1138
+        Me.項次3_tb.Location = New System.Drawing.Point(202, 331)
1101 1139
         Me.項次3_tb.Name = "項次3_tb"
1102 1140
         Me.項次3_tb.Size = New System.Drawing.Size(32, 23)
1103 1141
         Me.項次3_tb.TabIndex = 1290
1142
+        Me.項次3_tb.Visible = False
1104 1143
         '
1105 1144
         '刪除收款事項上點選的資料_bt
1106 1145
         '
1107 1146
         Me.刪除收款事項上點選的資料_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1108 1147
         Me.刪除收款事項上點選的資料_bt.ForeColor = System.Drawing.Color.Red
1109
-        Me.刪除收款事項上點選的資料_bt.Location = New System.Drawing.Point(279, 632)
1148
+        Me.刪除收款事項上點選的資料_bt.Location = New System.Drawing.Point(269, 632)
1110 1149
         Me.刪除收款事項上點選的資料_bt.Name = "刪除收款事項上點選的資料_bt"
1111 1150
         Me.刪除收款事項上點選的資料_bt.Size = New System.Drawing.Size(163, 23)
1112 1151
         Me.刪除收款事項上點選的資料_bt.TabIndex = 1287
@@ -1117,7 +1156,7 @@ Partial Class 銷售單審核
1117 1156
         '
1118 1157
         Me.新增一筆收款事項_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1119 1158
         Me.新增一筆收款事項_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
1120
-        Me.新增一筆收款事項_bt.Location = New System.Drawing.Point(110, 632)
1159
+        Me.新增一筆收款事項_bt.Location = New System.Drawing.Point(105, 632)
1121 1160
         Me.新增一筆收款事項_bt.Name = "新增一筆收款事項_bt"
1122 1161
         Me.新增一筆收款事項_bt.Size = New System.Drawing.Size(163, 23)
1123 1162
         Me.新增一筆收款事項_bt.TabIndex = 1286
@@ -1277,7 +1316,7 @@ Partial Class 銷售單審核
1277 1316
         '
1278 1317
         Me.刪除備註_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1279 1318
         Me.刪除備註_bt.ForeColor = System.Drawing.Color.Red
1280
-        Me.刪除備註_bt.Location = New System.Drawing.Point(279, 440)
1319
+        Me.刪除備註_bt.Location = New System.Drawing.Point(268, 440)
1281 1320
         Me.刪除備註_bt.Name = "刪除備註_bt"
1282 1321
         Me.刪除備註_bt.Size = New System.Drawing.Size(163, 23)
1283 1322
         Me.刪除備註_bt.TabIndex = 1256
@@ -1288,7 +1327,7 @@ Partial Class 銷售單審核
1288 1327
         '
1289 1328
         Me.銷售備註_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1290 1329
         Me.銷售備註_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
1291
-        Me.銷售備註_bt.Location = New System.Drawing.Point(110, 440)
1330
+        Me.銷售備註_bt.Location = New System.Drawing.Point(105, 440)
1292 1331
         Me.銷售備註_bt.Name = "銷售備註_bt"
1293 1332
         Me.銷售備註_bt.Size = New System.Drawing.Size(163, 23)
1294 1333
         Me.銷售備註_bt.TabIndex = 1261
@@ -1363,7 +1402,7 @@ Partial Class 銷售單審核
1363 1402
         Me.客戶資料_dgv.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
1364 1403
         Me.客戶資料_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
1365 1404
         Me.客戶資料_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
1366
-        Me.客戶資料_dgv.Location = New System.Drawing.Point(17, 7445)
1405
+        Me.客戶資料_dgv.Location = New System.Drawing.Point(17, 7722)
1367 1406
         Me.客戶資料_dgv.Name = "客戶資料_dgv"
1368 1407
         Me.客戶資料_dgv.RowHeadersWidth = 5
1369 1408
         DataGridViewCellStyle8.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
@@ -1507,7 +1546,7 @@ Partial Class 銷售單審核
1507 1546
         DataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
1508 1547
         Me.收款事項_dgv.RowsDefaultCellStyle = DataGridViewCellStyle14
1509 1548
         Me.收款事項_dgv.RowTemplate.Height = 24
1510
-        Me.收款事項_dgv.Size = New System.Drawing.Size(532, 118)
1549
+        Me.收款事項_dgv.Size = New System.Drawing.Size(445, 118)
1511 1550
         Me.收款事項_dgv.TabIndex = 1282
1512 1551
         '
1513 1552
         'Label28
@@ -1663,27 +1702,93 @@ Partial Class 銷售單審核
1663 1702
         Me.最低運費_cb.TabIndex = 1302
1664 1703
         Me.最低運費_cb.Visible = False
1665 1704
         '
1666
-        '其他成本_tb
1667
-        '
1668
-        Me.其他成本_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1669
-        Me.其他成本_tb.ForeColor = System.Drawing.Color.Green
1670
-        Me.其他成本_tb.Location = New System.Drawing.Point(622, 702)
1671
-        Me.其他成本_tb.Name = "其他成本_tb"
1672
-        Me.其他成本_tb.Size = New System.Drawing.Size(81, 23)
1673
-        Me.其他成本_tb.TabIndex = 1335
1674
-        Me.其他成本_tb.Text = "0"
1675
-        Me.其他成本_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1676
-        '
1677
-        'Label45
1678
-        '
1679
-        Me.Label45.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1680
-        Me.Label45.AutoSize = True
1681
-        Me.Label45.ForeColor = System.Drawing.Color.Green
1682
-        Me.Label45.Location = New System.Drawing.Point(540, 705)
1683
-        Me.Label45.Name = "Label45"
1684
-        Me.Label45.Size = New System.Drawing.Size(83, 16)
1685
-        Me.Label45.TabIndex = 1334
1686
-        Me.Label45.Text = "其   他   成   本"
1705
+        '刷卡收款_bt
1706
+        '
1707
+        Me.刷卡收款_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1708
+        Me.刷卡收款_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
1709
+        Me.刷卡收款_bt.Location = New System.Drawing.Point(433, 632)
1710
+        Me.刷卡收款_bt.Name = "刷卡收款_bt"
1711
+        Me.刷卡收款_bt.Size = New System.Drawing.Size(92, 23)
1712
+        Me.刷卡收款_bt.TabIndex = 1336
1713
+        Me.刷卡收款_bt.Text = "新增刷卡收款"
1714
+        Me.刷卡收款_bt.UseVisualStyleBackColor = True
1715
+        '
1716
+        '刷卡總和_tb
1717
+        '
1718
+        Me.刷卡總和_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1719
+        Me.刷卡總和_tb.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1720
+        Me.刷卡總和_tb.Location = New System.Drawing.Point(453, 673)
1721
+        Me.刷卡總和_tb.Name = "刷卡總和_tb"
1722
+        Me.刷卡總和_tb.Size = New System.Drawing.Size(81, 23)
1723
+        Me.刷卡總和_tb.TabIndex = 1340
1724
+        Me.刷卡總和_tb.Text = "0"
1725
+        Me.刷卡總和_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1726
+        '
1727
+        '刷卡稅金_tb
1728
+        '
1729
+        Me.刷卡稅金_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1730
+        Me.刷卡稅金_tb.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1731
+        Me.刷卡稅金_tb.Location = New System.Drawing.Point(453, 713)
1732
+        Me.刷卡稅金_tb.Name = "刷卡稅金_tb"
1733
+        Me.刷卡稅金_tb.Size = New System.Drawing.Size(81, 23)
1734
+        Me.刷卡稅金_tb.TabIndex = 1342
1735
+        Me.刷卡稅金_tb.Text = "0"
1736
+        Me.刷卡稅金_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1737
+        '
1738
+        'Label46
1739
+        '
1740
+        Me.Label46.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1741
+        Me.Label46.AutoSize = True
1742
+        Me.Label46.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1743
+        Me.Label46.Location = New System.Drawing.Point(452, 697)
1744
+        Me.Label46.Name = "Label46"
1745
+        Me.Label46.Size = New System.Drawing.Size(83, 16)
1746
+        Me.Label46.TabIndex = 1341
1747
+        Me.Label46.Text = "刷   卡   稅   金"
1748
+        '
1749
+        'Label47
1750
+        '
1751
+        Me.Label47.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1752
+        Me.Label47.AutoSize = True
1753
+        Me.Label47.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1754
+        Me.Label47.Location = New System.Drawing.Point(452, 658)
1755
+        Me.Label47.Name = "Label47"
1756
+        Me.Label47.Size = New System.Drawing.Size(83, 16)
1757
+        Me.Label47.TabIndex = 1339
1758
+        Me.Label47.Text = "刷   卡   總   和"
1759
+        '
1760
+        '刷卡傭金_tb
1761
+        '
1762
+        Me.刷卡傭金_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1763
+        Me.刷卡傭金_tb.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1764
+        Me.刷卡傭金_tb.Location = New System.Drawing.Point(454, 752)
1765
+        Me.刷卡傭金_tb.Name = "刷卡傭金_tb"
1766
+        Me.刷卡傭金_tb.Size = New System.Drawing.Size(81, 23)
1767
+        Me.刷卡傭金_tb.TabIndex = 1338
1768
+        Me.刷卡傭金_tb.Text = "0"
1769
+        Me.刷卡傭金_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1770
+        '
1771
+        'Label48
1772
+        '
1773
+        Me.Label48.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1774
+        Me.Label48.AutoSize = True
1775
+        Me.Label48.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1776
+        Me.Label48.Location = New System.Drawing.Point(452, 737)
1777
+        Me.Label48.Name = "Label48"
1778
+        Me.Label48.Size = New System.Drawing.Size(83, 16)
1779
+        Me.Label48.TabIndex = 1337
1780
+        Me.Label48.Text = "刷   卡   傭   金"
1781
+        '
1782
+        '通知_lb
1783
+        '
1784
+        Me.通知_lb.AutoSize = True
1785
+        Me.通知_lb.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1786
+        Me.通知_lb.ForeColor = System.Drawing.Color.Red
1787
+        Me.通知_lb.Location = New System.Drawing.Point(368, 7)
1788
+        Me.通知_lb.Name = "通知_lb"
1789
+        Me.通知_lb.Size = New System.Drawing.Size(127, 15)
1790
+        Me.通知_lb.TabIndex = 1343
1791
+        Me.通知_lb.Text = "........................................"
1687 1792
         '
1688 1793
         '銷售單審核
1689 1794
         '
@@ -1929,4 +2034,12 @@ Partial Class 銷售單審核
1929 2034
     Friend WithEvents Reset_bt As Button
1930 2035
     Friend WithEvents 其他成本_tb As TextBox
1931 2036
     Friend WithEvents Label45 As Label
2037
+    Friend WithEvents 刷卡收款_bt As Button
2038
+    Friend WithEvents 刷卡總和_tb As TextBox
2039
+    Friend WithEvents 刷卡稅金_tb As TextBox
2040
+    Friend WithEvents Label46 As Label
2041
+    Friend WithEvents Label47 As Label
2042
+    Friend WithEvents 刷卡傭金_tb As TextBox
2043
+    Friend WithEvents Label48 As Label
2044
+    Friend WithEvents 通知_lb As Label
1932 2045
 End Class

+ 181
- 96
YD-ERP-SYS/業務系統管理/銷售單審核.vb 查看文件

@@ -3,7 +3,7 @@ Public Class 銷售單審核
3 3
     ReadOnly ds As New DataSet : ReadOnly ds1 As New DataSet : ReadOnly ds2 As New DataSet : ReadOnly ds3 As New DataSet : ReadOnly ds4 As New DataSet
4 4
     ReadOnly ds5 As New DataSet : ReadOnly ds6 As New DataSet
5 5
     Dim 首次開啟 As Boolean = False : Dim EDR As Integer = 0 : Dim ESTR As String : Dim EDR1 As Integer = 0 : Dim ESTR1 As String : Dim NUM1 As Integer
6
-    Dim 運費 As Integer
6
+    Dim 運費 As Integer : Dim 刷卡控制 As Boolean = False
7 7
     Private Sub Set_清單()
8 8
         物料清單_dgv.DataSource = Nothing : ds.Clear()
9 9
         物料清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
@@ -121,10 +121,10 @@ Public Class 銷售單審核
121 121
         銷售明細_dgv.Columns(20).Visible = False
122 122
 
123 123
         銷售明細_dgv.Columns(1).ReadOnly = True : 銷售明細_dgv.Columns(2).ReadOnly = True : 銷售明細_dgv.Columns(3).ReadOnly = True : 銷售明細_dgv.Columns(4).ReadOnly = True
124
-        銷售明細_dgv.Columns(11).ReadOnly = True : 銷售明細_dgv.Columns(15).ReadOnly = True : 銷售明細_dgv.Columns(16).ReadOnly = True
124
+        銷售明細_dgv.Columns(11).ReadOnly = True : 銷售明細_dgv.Columns(13).ReadOnly = True : 銷售明細_dgv.Columns(16).ReadOnly = True
125 125
 
126 126
         銷售明細_dgv.Columns("數量").DefaultCellStyle.Format = "#,##0" : 銷售明細_dgv.Columns("成本").DefaultCellStyle.Format = "#,##0"
127
-        銷售明細_dgv.Columns("單價").DefaultCellStyle.Format = "#,##0" : 銷售明細_dgv.Columns("售價").DefaultCellStyle.Format = "#,##0"
127
+        銷售明細_dgv.Columns("單價").DefaultCellStyle.Format = "#,##0.0" : 銷售明細_dgv.Columns("售價").DefaultCellStyle.Format = "#,##0"
128 128
         銷售明細_dgv.Columns("數量").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
129 129
         銷售明細_dgv.Columns("數量").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
130 130
         銷售明細_dgv.Columns("成本").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
@@ -272,15 +272,23 @@ Public Class 銷售單審核
272 272
         DTP = Format(Today(), "yyyy/MM/dd") : DTP1 = Format(Today(), "yyyyMMdd")
273 273
     End Sub
274 274
     Private Sub Set_合記計算()
275
-        Dim 不含1類銷售小記 As Integer
275
+        Dim 不含1類銷售小記 As Integer : Dim 金額1 As Integer = 0
276 276
         售價小計_tb.Text = "0" : 稅金_tb.Text = "0" : 銷售合計_tb.Text = "0" : 收入小計_tb.Text = "0" : 支出小計_tb.Text = "0" : 額外收支_tb.Text = "0" : 物料成本_tb.Text = "0"
277
-        司機運費_tb.Text = "0" : 管銷費用_tb.Text = "0" : 其他成本_tb.Text = "0"
277
+        司機運費_tb.Text = "0" : 管銷費用_tb.Text = "0" : 其他成本_tb.Text = "0" : 刷卡總和_tb.Text = "0" : 刷卡稅金_tb.Text = "0" : 刷卡傭金_tb.Text = "0"
278
+        '-------001-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
279
+        For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
280
+            If 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
281
+                刷卡總和_tb.Text = Val(刷卡總和_tb.Text) + 收款事項_dgv("金額", i).Value
282
+            End If
283
+        Next
284
+        刷卡稅金_tb.Text = CInt(Val(Val(刷卡總和_tb.Text) * 0.05)) : 刷卡傭金_tb.Text = CInt(Val(Val(刷卡總和_tb.Text) * 0.02))
285
+        '-------002-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
278 286
         For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
279 287
             售價小計_tb.Text = Val(售價小計_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value)
280 288
 
281 289
             If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) <> 1 Then
282 290
                 物料成本_tb.Text = Val(物料成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
283
-                不含1類銷售小記 = 不含1類銷售小記 + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value)
291
+                不含1類銷售小記 = 不含1類銷售小記 + 銷售明細_dgv("售價", i).Value
284 292
             End If
285 293
             If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) = 1 Then
286 294
                 其他成本_tb.Text = Val(其他成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
@@ -293,21 +301,33 @@ Public Class 銷售單審核
293 301
         管銷費用_tb.Text = Val(物料成本_tb.Text) * 1.06 - Val(物料成本_tb.Text)
294 302
         銷售合計_tb.Text = Val(售價小計_tb.Text) + Val(稅金_tb.Text)
295 303
 
304
+        If Val(稅金_tb.Text) = 0 And Val(刷卡稅金_tb.Text) = 0 Then
305
+            通知_lb.Text = "無稅金"
306
+        ElseIf Val(稅金_tb.Text) = 0 And Val(刷卡稅金_tb.Text) <> 0 Then
307
+            通知_lb.Text = "應刷卡稅金小,有刷卡帶入的稅金,所以拆售價以未稅顯示" : 稅金_tb.Text = 刷卡稅金_tb.Text : 售價小計_tb.Text = Val(銷售合計_tb.Text) - Val(稅金_tb.Text)
308
+        ElseIf Val(稅金_tb.Text) <> 0 And Val(刷卡稅金_tb.Text) <> 0 And Val(稅金_tb.Text) > Val(刷卡稅金_tb.Text) Then
309
+            通知_lb.Text = "應所拆售價稅金大於刷卡稅金,計算正常,利潤中扣除刷卡傭金"
310
+        ElseIf Val(稅金_tb.Text) <> 0 And Val(刷卡稅金_tb.Text) <> 0 And Val(稅金_tb.Text) < Val(刷卡稅金_tb.Text) Then
311
+            通知_lb.Text = "刷卡稅金大於自動計算後的稅金,邏輯有誤,請從新拆售價。"
312
+        End If
313
+        '-------003-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
296 314
         For i As Integer = 0 To 銷售備註_dgv.Rows.Count - 1
297 315
             收入小計_tb.Text = Val(收入小計_tb.Text) + 銷售備註_dgv("收入", i).Value
298 316
             支出小計_tb.Text = Val(支出小計_tb.Text) + 銷售備註_dgv("支出", i).Value
299 317
         Next
300 318
         額外收支_tb.Text = Val(收入小計_tb.Text) - Val(支出小計_tb.Text)
301
-
319
+        '-------004-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
302 320
         Dim 金額 As Integer = 0
303 321
         For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
304
-            If 收款事項_dgv("真項次", i).Value.ToString <> "0" Then
322
+            If 收款事項_dgv("真項次", i).Value.ToString <> "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
305 323
                 金額 = 金額 + 收款事項_dgv("金額", i).Value
306
-            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" Then
324
+            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
325
+                金額 = 金額 + 收款事項_dgv("金額", i).Value
326
+            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString = "未收餘額" Then
307 327
                 收款事項_dgv("金額", i).Value = CInt(Val(銷售合計_tb.Text)) - 金額
308 328
             End If
309 329
         Next
310
-
330
+        '-------005-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
311 331
         If 送貨地點_cb.Text = "" Or 送貨地點_cb.Text = "自取" Or 最低運費_cb.Text = "" Or 最低售價_cb.Text = "" Then
312 332
             司機運費_tb.Text = "0"
313 333
         Else
@@ -315,20 +335,22 @@ Public Class 銷售單審核
315 335
                 If (不含1類銷售小記 - Val(其他成本_tb.Text)) <= Val(最低售價_cb.Text) Then
316 336
                     司機運費_tb.Text = 最低運費_cb.Text
317 337
                 ElseIf (不含1類銷售小記 - Val(其他成本_tb.Text)) > Val(最低售價_cb.Text) Then
318
-                    司機運費_tb.Text = (不含1類銷售小記 - Val(其他成本_tb.Text)) / 100 * 3
338
+                    司機運費_tb.Text = (不含1類銷售小記 - Val(稅金_tb.Text) - Val(刷卡傭金_tb.Text) - Val(其他成本_tb.Text)) / 100 * 3
319 339
                 End If
320 340
             Else
321 341
                 司機運費_tb.Text = 運費
322 342
             End If
323 343
         End If
324
-
325
-        預估利潤_tb.Text = Val(售價小計_tb.Text) + Val(額外收支_tb.Text) - Val(其他成本_tb.Text) - Val(物料成本_tb.Text) - Val(司機運費_tb.Text) - Val(管銷費用_tb.Text)
326
-
344
+        '-------006-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
345
+        預估利潤_tb.Text = Val(售價小計_tb.Text) + Val(額外收支_tb.Text) - Val(其他成本_tb.Text) - Val(物料成本_tb.Text) - Val(司機運費_tb.Text) - Val(管銷費用_tb.Text) - Val(刷卡傭金_tb.Text)
346
+        '-------007-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
327 347
         售價小計_tb.Text = Format(Val(售價小計_tb.Text), "#,##0") : 稅金_tb.Text = Format(Val(稅金_tb.Text), "#,##0") : 銷售合計_tb.Text = Format(Val(銷售合計_tb.Text), "#,##0")
328 348
         收入小計_tb.Text = Format(Val(收入小計_tb.Text), "#,##0") : 支出小計_tb.Text = Format(Val(支出小計_tb.Text), "#,##0") : 額外收支_tb.Text = Format(Val(額外收支_tb.Text), "#,##0")
329 349
         司機運費_tb.Text = Format(Val(司機運費_tb.Text), "#,##0") : 管銷費用_tb.Text = Format(Val(管銷費用_tb.Text), "#,##0") : 預估利潤_tb.Text = Format(Val(預估利潤_tb.Text), "#,##0")
330
-        物料成本_tb.Text = Format(Val(物料成本_tb.Text), "#,##0") : 其他成本_tb.Text = Format(Val(其他成本_tb.Text), "#,##0")
350
+        物料成本_tb.Text = Format(Val(物料成本_tb.Text), "#,##0") : 其他成本_tb.Text = Format(Val(其他成本_tb.Text), "#,##0") : 刷卡總和_tb.Text = Format(Val(刷卡總和_tb.Text), "#,##0")
351
+        刷卡稅金_tb.Text = Format(Val(刷卡稅金_tb.Text), "#,##0") : 刷卡傭金_tb.Text = Format(Val(刷卡傭金_tb.Text), "#,##0")
331 352
     End Sub
353
+
332 354
     Private Sub 指定倉庫_cb_下拉表單資料載入()
333 355
         If 需要全部庫存區域清單_ch.Checked = True Then
334 356
             SQL_倉名_下拉清單()
@@ -387,9 +409,9 @@ Public Class 銷售單審核
387 409
     Private Sub 銷售明細_dgv_CellEndEdit(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 銷售明細_dgv.CellEndEdit
388 410
         For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
389 411
             If 銷售明細_dgv("含稅", i).Value = False Then
390
-                銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value
412
+                銷售明細_dgv("單價", i).Value = 銷售明細_dgv("售價", i).Value / 銷售明細_dgv("數量", i).Value
391 413
             ElseIf 銷售明細_dgv("含稅", i).Value = True Then
392
-                銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value * 1.05
414
+                銷售明細_dgv("單價", i).Value = (銷售明細_dgv("售價", i).Value / 1.05) / 銷售明細_dgv("數量", i).Value
393 415
             End If
394 416
 
395 417
             If 銷售明細_dgv("倉儲情況", i).Value <> "已有貨" Then
@@ -583,17 +605,19 @@ Public Class 銷售單審核
583 605
         送貨地點_cb.SelectedIndex = 最低售價_cb.SelectedIndex : 最低運費_cb.SelectedIndex = 最低售價_cb.SelectedIndex
584 606
     End Sub
585 607
     Private Sub 含稅_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 含稅_ch.CheckedChanged
586
-        For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
587
-            If 含稅_ch.Checked = False Then : 銷售明細_dgv("含稅", i).Value = False
588
-            ElseIf 含稅_ch.Checked = True Then : 銷售明細_dgv("含稅", i).Value = True
589
-            End If
590
-            If 銷售明細_dgv("含稅", i).Value = False Then
591
-                銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value
592
-            ElseIf 銷售明細_dgv("含稅", i).Value = True Then
593
-                銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value * 1.05
594
-            End If
595
-        Next
596
-        Set_合記計算()
608
+        If 刷卡控制 = False Then
609
+            For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
610
+                If 含稅_ch.Checked = False Then : 銷售明細_dgv("含稅", i).Value = False
611
+                ElseIf 含稅_ch.Checked = True Then : 銷售明細_dgv("含稅", i).Value = True
612
+                End If
613
+                If 銷售明細_dgv("含稅", i).Value = False Then
614
+                    銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value
615
+                ElseIf 銷售明細_dgv("含稅", i).Value = True Then
616
+                    銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value * 1.05
617
+                End If
618
+            Next
619
+            Set_合記計算()
620
+        End If
597 621
     End Sub
598 622
     Private Sub 客戶編號_tb_TextChanged(sender As Object, e As EventArgs) Handles 客戶編號_tb.TextChanged
599 623
         PA15 = 客戶編號_tb.Text
@@ -672,6 +696,7 @@ Public Class 銷售單審核
672 696
 
673 697
                 DTP = Format(開單日期_dtp.Value, "yyyy/MM/dd") : DTP1 = Format(交貨日期_dtp.Value, "yyyy/MM/dd") : BL1 = 含稅_ch.Checked : 運費 = 司機運費_tb.Text
674 698
                 PA1 = 流水號_tb.Text : PA2 = 單號_tb.Text : PA3 = 客戶編號_tb.Text : PA4 = 流水號_tb.Text : PA5 = 送貨地點_cb.Text : NU1 = 司機運費_tb.Text : NU2 = 管銷費用_tb.Text
699
+                NU3 = 稅金_tb.Text
675 700
                 SQL_銷售控制表_修改() '--------------------資料修改
676 701
 
677 702
                 For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
@@ -761,6 +786,7 @@ Public Class 銷售單審核
761 786
 
762 787
                 DTP = Format(開單日期_dtp.Value, "yyyy/MM/dd") : DTP1 = Format(交貨日期_dtp.Value, "yyyy/MM/dd") : BL1 = 含稅_ch.Checked : 運費 = 司機運費_tb.Text
763 788
                 PA1 = 流水號_tb.Text : PA2 = 單號_tb.Text : PA3 = 客戶編號_tb.Text : PA4 = 流水號_tb.Text : PA5 = 送貨地點_cb.Text : NU1 = 司機運費_tb.Text : NU2 = 管銷費用_tb.Text
789
+                NU3 = 稅金_tb.Text
764 790
                 SQL_銷售控制表_修改() '--------------------資料修改
765 791
 
766 792
                 For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
@@ -815,66 +841,66 @@ Public Class 銷售單審核
815 841
                                 PA1 = 單號_tb.Text : PA2 = 料號_tb.Text : PA3 = 倉庫編號_tb.Text
816 842
                                 SQL_銷售明細表_確認單據是否申請()
817 843
                                 If dr.Read() Then
818
-                                    conn.Close() : MsgBox("該料號已經在本單據中申請過了,如要修改,請直接到單據中尋找並修改。")
844
+                                    conn.Close() : MsgBox("該料號已經在本單據中申請過了,如果是標準規格品,請不要重複開兩次。。")
819 845
                                 Else
820
-                                    SQL_銷售明細表_最後一筆資料()
846
+                                End If
847
+                                SQL_銷售明細表_最後一筆資料()
848
+                                If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("資料流水號").ToString, 9)) : Else : EDR = 0 : End If
849
+                                conn.Close() : EDR += 1
850
+                                If EDR < 10 Then : ESTR = "SA" & "00000000" & EDR
851
+                                ElseIf EDR > 9 And EDR < 100 Then : ESTR = "SA" & "0000000" & EDR
852
+                                ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "SA" & "000000" & EDR
853
+                                ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "SA" & "00000" & EDR
854
+                                ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "SA" & "0000" & EDR
855
+                                ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "SA" & "000" & EDR
856
+                                ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "SA" & "00" & EDR
857
+                                ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "SA" & "0" & EDR
858
+                                ElseIf EDR > 99999999 Then : ESTR = "SA" & EDR : End If
859
+
860
+                                Set_日期格式轉換()
861
+                                PA3 = ESTR : PA4 = 單號_tb.Text : PA5 = 倉庫級別_tb.Text : PA6 = 倉庫編號_tb.Text : NU1 = 訂購數量_nud.Value : NU2 = 成本_nud.Value : NU3 = 售價_nud.Value
862
+                                PA7 = 儲態編號_cb.Text : PA8 = 訂製編碼_cb.Text : BL2 = 含稅_ch.Checked
863
+                                If Val(可申請_tb.Text) > 0 Then
864
+                                    PA9 = "已有貨"
865
+                                    SQL_銷售單申請_銷售明細表_新增()
866
+
867
+                                    If 調庫單號_tb.Text = "" Then
868
+                                        Set_日期格式轉換()
869
+                                        For i As Integer = 1 To 999
870
+                                            NUM1 = 0 + i
871
+                                            If NUM1 < 10 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-00" & NUM1
872
+                                            ElseIf NUM1 > 9 And NUM1 < 100 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-0" & NUM1
873
+                                            ElseIf NUM1 > 99 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-" & NUM1
874
+                                            End If
875
+                                            PA1 = 調庫單號_tb.Text
876
+                                            SQL_倉儲明細執行單號_執行單號驗證()
877
+                                            If dr.Read() Then : Else : i = 999 : conn.Close() : End If : conn.Close()
878
+                                        Next
879
+                                        SQL_倉儲明細執行單號_新增() : conn.Close()
880
+                                    End If
881
+
882
+                                    SQL_倉儲明細表_最後一筆資料()
821 883
                                     If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("資料流水號").ToString, 9)) : Else : EDR = 0 : End If
822 884
                                     conn.Close() : EDR += 1
823
-                                    If EDR < 10 Then : ESTR = "SA" & "00000000" & EDR
824
-                                    ElseIf EDR > 9 And EDR < 100 Then : ESTR = "SA" & "0000000" & EDR
825
-                                    ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "SA" & "000000" & EDR
826
-                                    ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "SA" & "00000" & EDR
827
-                                    ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "SA" & "0000" & EDR
828
-                                    ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "SA" & "000" & EDR
829
-                                    ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "SA" & "00" & EDR
830
-                                    ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "SA" & "0" & EDR
831
-                                    ElseIf EDR > 99999999 Then : ESTR = "SA" & EDR : End If
832
-
833
-                                    Set_日期格式轉換()
834
-                                    PA3 = ESTR : PA4 = 單號_tb.Text : PA5 = 倉庫級別_tb.Text : PA6 = 倉庫編號_tb.Text : NU1 = 訂購數量_nud.Value : NU2 = 成本_nud.Value : NU3 = 售價_nud.Value
835
-                                    PA7 = 儲態編號_cb.Text : PA8 = 訂製編碼_cb.Text : BL2 = 含稅_ch.Checked
836
-                                    If Val(可申請_tb.Text) > 0 Then
837
-                                        PA9 = "已有貨"
838
-                                        SQL_銷售單申請_銷售明細表_新增()
839
-
840
-                                        If 調庫單號_tb.Text = "" Then
841
-                                            Set_日期格式轉換()
842
-                                            For i As Integer = 1 To 999
843
-                                                NUM1 = 0 + i
844
-                                                If NUM1 < 10 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-00" & NUM1
845
-                                                ElseIf NUM1 > 9 And NUM1 < 100 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-0" & NUM1
846
-                                                ElseIf NUM1 > 99 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-" & NUM1
847
-                                                End If
848
-                                                PA1 = 調庫單號_tb.Text
849
-                                                SQL_倉儲明細執行單號_執行單號驗證()
850
-                                                If dr.Read() Then : Else : i = 999 : conn.Close() : End If : conn.Close()
851
-                                            Next
852
-                                            SQL_倉儲明細執行單號_新增() : conn.Close()
853
-                                        End If
854
-
855
-                                        SQL_倉儲明細表_最後一筆資料()
856
-                                        If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("資料流水號").ToString, 9)) : Else : EDR = 0 : End If
857
-                                        conn.Close() : EDR += 1
858
-                                        If EDR < 10 Then : ESTR = "WH" & "00000000" & EDR
859
-                                        ElseIf EDR > 9 And EDR < 100 Then : ESTR = "WH" & "0000000" & EDR
860
-                                        ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "WH" & "000000" & EDR
861
-                                        ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "WH" & "00000" & EDR
862
-                                        ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "WH" & "0000" & EDR
863
-                                        ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "WH" & "000" & EDR
864
-                                        ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "WH" & "00" & EDR
865
-                                        ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "WH" & "0" & EDR
866
-                                        ElseIf EDR > 99999999 Then : ESTR = "WH" & EDR : End If
867
-
868
-                                        PA3 = ESTR : PA4 = 調庫單號_tb.Text : PA5 = 倉庫級別_tb.Text : PA6 = 倉庫編號_tb.Text : PA9 = 單號_tb.Text
869
-                                        SQL_銷售單申請_倉儲明細表_銷售出庫()
870
-                                        Set_清單4()
871
-                                    ElseIf Val(可申請_tb.Text) = 0 Then
872
-                                        PA9 = "未有貨"
873
-                                        SQL_銷售單申請_銷售明細表_新增()
874
-                                        Set_清單4()
875
-                                    End If : conn.Close()
876
-                                    Set_清單()
877
-                                End If
885
+                                    If EDR < 10 Then : ESTR = "WH" & "00000000" & EDR
886
+                                    ElseIf EDR > 9 And EDR < 100 Then : ESTR = "WH" & "0000000" & EDR
887
+                                    ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "WH" & "000000" & EDR
888
+                                    ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "WH" & "00000" & EDR
889
+                                    ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "WH" & "0000" & EDR
890
+                                    ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "WH" & "000" & EDR
891
+                                    ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "WH" & "00" & EDR
892
+                                    ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "WH" & "0" & EDR
893
+                                    ElseIf EDR > 99999999 Then : ESTR = "WH" & EDR : End If
894
+
895
+                                    PA3 = ESTR : PA4 = 調庫單號_tb.Text : PA5 = 倉庫級別_tb.Text : PA6 = 倉庫編號_tb.Text : PA9 = 單號_tb.Text
896
+                                    SQL_銷售單申請_倉儲明細表_銷售出庫()
897
+                                    Set_清單4()
898
+                                ElseIf Val(可申請_tb.Text) = 0 Then
899
+                                    PA9 = "未有貨"
900
+                                    SQL_銷售單申請_銷售明細表_新增()
901
+                                    Set_清單4()
902
+                                End If : conn.Close()
903
+                                Set_清單()
878 904
                             End If
879 905
                         End If
880 906
                     End If
@@ -1062,15 +1088,23 @@ Public Class 銷售單審核
1062 1088
         Next : YD_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
1063 1089
     End Sub
1064 1090
     Private Sub Reset_bt_Click(sender As Object, e As EventArgs) Handles Reset_bt.Click
1065
-        Dim 不含1類銷售小記 As Integer
1091
+        Dim 不含1類銷售小記 As Integer : Dim 金額1 As Integer = 0
1066 1092
         售價小計_tb.Text = "0" : 稅金_tb.Text = "0" : 銷售合計_tb.Text = "0" : 收入小計_tb.Text = "0" : 支出小計_tb.Text = "0" : 額外收支_tb.Text = "0" : 物料成本_tb.Text = "0"
1067 1093
         司機運費_tb.Text = "0" : 管銷費用_tb.Text = "0" : 其他成本_tb.Text = "0"
1094
+        '-------001-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1095
+        For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
1096
+            If 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
1097
+                刷卡總和_tb.Text = Val(刷卡總和_tb.Text) + 收款事項_dgv("金額", i).Value
1098
+            End If
1099
+        Next
1100
+        刷卡稅金_tb.Text = CInt(Val(Val(刷卡總和_tb.Text) * 0.05)) : 刷卡傭金_tb.Text = CInt(Val(Val(刷卡總和_tb.Text) * 0.02))
1101
+        '-------002-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1068 1102
         For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
1069 1103
             售價小計_tb.Text = Val(售價小計_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value)
1070 1104
 
1071 1105
             If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) <> 1 Then
1072 1106
                 物料成本_tb.Text = Val(物料成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
1073
-                不含1類銷售小記 = 不含1類銷售小記 + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value)
1107
+                不含1類銷售小記 = 不含1類銷售小記 + 銷售明細_dgv("售價", i).Value
1074 1108
             End If
1075 1109
             If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) = 1 Then
1076 1110
                 其他成本_tb.Text = Val(其他成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
@@ -1083,42 +1117,93 @@ Public Class 銷售單審核
1083 1117
         管銷費用_tb.Text = Val(物料成本_tb.Text) * 1.06 - Val(物料成本_tb.Text)
1084 1118
         銷售合計_tb.Text = Val(售價小計_tb.Text) + Val(稅金_tb.Text)
1085 1119
 
1120
+        If Val(稅金_tb.Text) = 0 And Val(刷卡稅金_tb.Text) = 0 Then
1121
+            通知_lb.Text = "無稅金"
1122
+        ElseIf Val(稅金_tb.Text) = 0 And Val(刷卡稅金_tb.Text) <> 0 Then
1123
+            通知_lb.Text = "應刷卡稅金小,有刷卡帶入的稅金,所以拆售價以未稅顯示" : 稅金_tb.Text = 刷卡稅金_tb.Text : 售價小計_tb.Text = Val(銷售合計_tb.Text) - Val(稅金_tb.Text)
1124
+        ElseIf Val(稅金_tb.Text) <> 0 And Val(刷卡稅金_tb.Text) <> 0 And Val(稅金_tb.Text) > Val(刷卡稅金_tb.Text) Then
1125
+            通知_lb.Text = "應所拆售價稅金大於刷卡稅金,計算正常,利潤中扣除刷卡傭金"
1126
+        ElseIf Val(稅金_tb.Text) <> 0 And Val(刷卡稅金_tb.Text) <> 0 And Val(稅金_tb.Text) < Val(刷卡稅金_tb.Text) Then
1127
+            通知_lb.Text = "刷卡稅金大於自動計算後的稅金,邏輯有誤,請從新拆售價。"
1128
+        End If
1129
+        '-------003-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1086 1130
         For i As Integer = 0 To 銷售備註_dgv.Rows.Count - 1
1087 1131
             收入小計_tb.Text = Val(收入小計_tb.Text) + 銷售備註_dgv("收入", i).Value
1088 1132
             支出小計_tb.Text = Val(支出小計_tb.Text) + 銷售備註_dgv("支出", i).Value
1089 1133
         Next
1090 1134
         額外收支_tb.Text = Val(收入小計_tb.Text) - Val(支出小計_tb.Text)
1091
-
1135
+        '-------004-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1092 1136
         Dim 金額 As Integer = 0
1093 1137
         For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
1094
-            If 收款事項_dgv("真項次", i).Value.ToString <> "0" Then
1138
+            If 收款事項_dgv("真項次", i).Value.ToString <> "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
1139
+                金額 = 金額 + 收款事項_dgv("金額", i).Value
1140
+            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
1095 1141
                 金額 = 金額 + 收款事項_dgv("金額", i).Value
1096
-            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" Then
1142
+            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString = "未收餘額" Then
1097 1143
                 收款事項_dgv("金額", i).Value = CInt(Val(銷售合計_tb.Text)) - 金額
1098 1144
             End If
1099 1145
         Next
1100
-
1146
+        '-------005-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1101 1147
         If 送貨地點_cb.Text = "" Or 送貨地點_cb.Text = "自取" Or 最低運費_cb.Text = "" Or 最低售價_cb.Text = "" Then
1102 1148
             司機運費_tb.Text = "0"
1103 1149
         Else
1104 1150
             If (不含1類銷售小記 - Val(其他成本_tb.Text)) <= Val(最低售價_cb.Text) Then
1105 1151
                 司機運費_tb.Text = 最低運費_cb.Text
1106 1152
             ElseIf (不含1類銷售小記 - Val(其他成本_tb.Text)) > Val(最低售價_cb.Text) Then
1107
-                司機運費_tb.Text = (不含1類銷售小記 - Val(其他成本_tb.Text)) / 100 * 3
1153
+                司機運費_tb.Text = (不含1類銷售小記 - Val(稅金_tb.Text) - Val(刷卡傭金_tb.Text) - Val(其他成本_tb.Text)) / 100 * 3
1108 1154
             End If
1109 1155
         End If
1110 1156
         存檔1()
1111
-
1112
-        預估利潤_tb.Text = Val(售價小計_tb.Text) + Val(額外收支_tb.Text) - Val(其他成本_tb.Text) - Val(物料成本_tb.Text) - Val(司機運費_tb.Text) - Val(管銷費用_tb.Text)
1113
-
1157
+        '-------004-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1158
+        預估利潤_tb.Text = Val(售價小計_tb.Text) + Val(額外收支_tb.Text) - Val(其他成本_tb.Text) - Val(物料成本_tb.Text) - Val(司機運費_tb.Text) - Val(管銷費用_tb.Text) - Val(刷卡傭金_tb.Text)
1159
+        '-------004-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1114 1160
         售價小計_tb.Text = Format(Val(售價小計_tb.Text), "#,##0") : 稅金_tb.Text = Format(Val(稅金_tb.Text), "#,##0") : 銷售合計_tb.Text = Format(Val(銷售合計_tb.Text), "#,##0")
1115 1161
         收入小計_tb.Text = Format(Val(收入小計_tb.Text), "#,##0") : 支出小計_tb.Text = Format(Val(支出小計_tb.Text), "#,##0") : 額外收支_tb.Text = Format(Val(額外收支_tb.Text), "#,##0")
1116 1162
         司機運費_tb.Text = Format(Val(司機運費_tb.Text), "#,##0") : 管銷費用_tb.Text = Format(Val(管銷費用_tb.Text), "#,##0") : 預估利潤_tb.Text = Format(Val(預估利潤_tb.Text), "#,##0")
1117
-        物料成本_tb.Text = Format(Val(物料成本_tb.Text), "#,##0") : 其他成本_tb.Text = Format(Val(其他成本_tb.Text), "#,##0")
1163
+        物料成本_tb.Text = Format(Val(物料成本_tb.Text), "#,##0") : 其他成本_tb.Text = Format(Val(其他成本_tb.Text), "#,##0") : 刷卡總和_tb.Text = Format(Val(刷卡總和_tb.Text), "#,##0")
1164
+        刷卡稅金_tb.Text = Format(Val(刷卡稅金_tb.Text), "#,##0") : 刷卡傭金_tb.Text = Format(Val(刷卡傭金_tb.Text), "#,##0")
1118 1165
     End Sub
1119 1166
     Private Sub 司機運費_tb_TextChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles 司機運費_tb.KeyPress
1120 1167
         If e.KeyChar = Chr(13) Then
1121 1168
             運費 = 司機運費_tb.Text : 存檔1() : Set_合記計算()
1122 1169
         End If
1123 1170
     End Sub
1171
+    Private Sub 刷卡收款_bt_Click(sender As Object, e As EventArgs) Handles 刷卡收款_bt.Click
1172
+        If 流水號_tb.Text = "" Then
1173
+            MsgBox("沒有銷售單號,無法作業。")
1174
+        Else
1175
+            SQL_銷售收款事項_最後一筆資料()
1176
+            If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("資料流水號").ToString, 9)) : Else : EDR = 0 : End If
1177
+            conn.Close() : EDR += 1
1178
+            If EDR < 10 Then : ESTR = "ST" & "00000000" & EDR
1179
+            ElseIf EDR > 9 And EDR < 100 Then : ESTR = "ST" & "0000000" & EDR
1180
+            ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "ST" & "000000" & EDR
1181
+            ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "ST" & "00000" & EDR
1182
+            ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "ST" & "0000" & EDR
1183
+            ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "ST" & "000" & EDR
1184
+            ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "ST" & "00" & EDR
1185
+            ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "ST" & "0" & EDR
1186
+            ElseIf EDR > 99999999 Then : ESTR = "ST" & EDR : End If
1187
+            PA1 = ESTR
1188
+
1189
+            SQL_銷售收款事項_最後一筆項次()
1190
+            If dr.Read() Then : EDR = dr("項次").ToString : Else : EDR = 0 : End If
1191
+            conn.Close() : EDR += 1
1192
+            If EDR < 10 Then : ESTR = EDR
1193
+            ElseIf EDR > 9 And EDR < 100 Then : ESTR = EDR : End If
1194
+            PA2 = ESTR : PA = 單號_tb.Text
1195
+            SQL_銷售收款事項_新增3()
1196
+
1197
+            For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
1198
+                資料數 = 收款事項_dgv.Rows.Count : MyModule1.進度條()
1199
+                PA10 = 收款事項_dgv.Rows(i).Cells("內容").Value : PA11 = 收款事項_dgv.Rows(i).Cells("資料流水號").Value
1200
+                NU1 = 收款事項_dgv.Rows(i).Cells("金額").Value
1201
+                SQL_銷售收款事項_修改() : conn.Close()
1202
+            Next : YD_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
1203
+
1204
+            Set_清單6()
1205
+
1206
+            刷卡控制 = True : 含稅_ch.Checked = True : 刷卡控制 = False
1207
+        End If
1208
+    End Sub
1124 1209
 End Class

+ 209
- 96
YD-ERP-SYS/業務系統管理/銷售單申請.Designer.vb 查看文件

@@ -22,20 +22,20 @@ Partial Class 銷售單申請
22 22
     '請勿使用程式碼編輯器進行修改。
23 23
     <System.Diagnostics.DebuggerStepThrough()>
24 24
     Private Sub InitializeComponent()
25
-        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
-        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
-        Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28
-        Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29
-        Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
30
-        Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
31
-        Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
32
-        Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
33
-        Dim DataGridViewCellStyle9 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
34
-        Dim DataGridViewCellStyle10 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
35
-        Dim DataGridViewCellStyle11 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
36
-        Dim DataGridViewCellStyle12 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
37
-        Dim DataGridViewCellStyle13 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
38
-        Dim DataGridViewCellStyle14 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
25
+        Dim DataGridViewCellStyle15 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
+        Dim DataGridViewCellStyle16 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
+        Dim DataGridViewCellStyle17 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28
+        Dim DataGridViewCellStyle18 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29
+        Dim DataGridViewCellStyle19 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
30
+        Dim DataGridViewCellStyle20 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
31
+        Dim DataGridViewCellStyle21 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
32
+        Dim DataGridViewCellStyle22 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
33
+        Dim DataGridViewCellStyle23 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
34
+        Dim DataGridViewCellStyle24 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
35
+        Dim DataGridViewCellStyle25 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
36
+        Dim DataGridViewCellStyle26 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
37
+        Dim DataGridViewCellStyle27 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
38
+        Dim DataGridViewCellStyle28 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
39 39
         Me.銷售單據_dgv = New System.Windows.Forms.DataGridView()
40 40
         Me.未審核_lb = New System.Windows.Forms.Label()
41 41
         Me.開立庫存調整單_bt = New System.Windows.Forms.Button()
@@ -111,6 +111,17 @@ Partial Class 銷售單申請
111 111
         Me.售價_nud = New System.Windows.Forms.NumericUpDown()
112 112
         Me.Label22 = New System.Windows.Forms.Label()
113 113
         Me.Panel1 = New System.Windows.Forms.Panel()
114
+        Me.通知_lb = New System.Windows.Forms.Label()
115
+        Me.刷卡總和_tb = New System.Windows.Forms.TextBox()
116
+        Me.刷卡稅金_tb = New System.Windows.Forms.TextBox()
117
+        Me.Label46 = New System.Windows.Forms.Label()
118
+        Me.Label47 = New System.Windows.Forms.Label()
119
+        Me.刷卡傭金_tb = New System.Windows.Forms.TextBox()
120
+        Me.Label48 = New System.Windows.Forms.Label()
121
+        Me.刷卡收款_bt = New System.Windows.Forms.Button()
122
+        Me.其他成本_tb = New System.Windows.Forms.TextBox()
123
+        Me.Label45 = New System.Windows.Forms.Label()
124
+        Me.Label44 = New System.Windows.Forms.Label()
114 125
         Me.Reset_bt = New System.Windows.Forms.Button()
115 126
         Me.讀取標準成本_bt = New System.Windows.Forms.Button()
116 127
         Me.物料成本_tb = New System.Windows.Forms.TextBox()
@@ -169,9 +180,6 @@ Partial Class 銷售單申請
169 180
         Me.業務_cb = New System.Windows.Forms.ComboBox()
170 181
         Me.物料圖_pb = New System.Windows.Forms.PictureBox()
171 182
         Me.物料圖1_pb = New System.Windows.Forms.PictureBox()
172
-        Me.Label44 = New System.Windows.Forms.Label()
173
-        Me.其他成本_tb = New System.Windows.Forms.TextBox()
174
-        Me.Label45 = New System.Windows.Forms.Label()
175 183
         CType(Me.銷售單據_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
176 184
         CType(Me.銷售明細_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
177 185
         CType(Me.區域庫存_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -189,16 +197,16 @@ Partial Class 銷售單申請
189 197
         '
190 198
         '銷售單據_dgv
191 199
         '
192
-        DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
193
-        Me.銷售單據_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
200
+        DataGridViewCellStyle15.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
201
+        Me.銷售單據_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle15
194 202
         Me.銷售單據_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
195 203
         Me.銷售單據_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
196 204
         Me.銷售單據_dgv.Location = New System.Drawing.Point(609, 29)
197 205
         Me.銷售單據_dgv.Name = "銷售單據_dgv"
198 206
         Me.銷售單據_dgv.RowHeadersWidth = 5
199
-        DataGridViewCellStyle2.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
200
-        DataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
201
-        Me.銷售單據_dgv.RowsDefaultCellStyle = DataGridViewCellStyle2
207
+        DataGridViewCellStyle16.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
208
+        DataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
209
+        Me.銷售單據_dgv.RowsDefaultCellStyle = DataGridViewCellStyle16
202 210
         Me.銷售單據_dgv.RowTemplate.Height = 24
203 211
         Me.銷售單據_dgv.Size = New System.Drawing.Size(146, 141)
204 212
         Me.銷售單據_dgv.TabIndex = 1154
@@ -437,8 +445,8 @@ Partial Class 銷售單申請
437 445
         '
438 446
         '銷售明細_dgv
439 447
         '
440
-        DataGridViewCellStyle3.BackColor = System.Drawing.Color.White
441
-        Me.銷售明細_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
448
+        DataGridViewCellStyle17.BackColor = System.Drawing.Color.White
449
+        Me.銷售明細_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle17
442 450
         Me.銷售明細_dgv.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
443 451
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
444 452
         Me.銷售明細_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
@@ -446,9 +454,9 @@ Partial Class 銷售單申請
446 454
         Me.銷售明細_dgv.Location = New System.Drawing.Point(3, 29)
447 455
         Me.銷售明細_dgv.Name = "銷售明細_dgv"
448 456
         Me.銷售明細_dgv.RowHeadersWidth = 5
449
-        DataGridViewCellStyle4.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
450
-        DataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
451
-        Me.銷售明細_dgv.RowsDefaultCellStyle = DataGridViewCellStyle4
457
+        DataGridViewCellStyle18.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
458
+        DataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
459
+        Me.銷售明細_dgv.RowsDefaultCellStyle = DataGridViewCellStyle18
452 460
         Me.銷售明細_dgv.RowTemplate.Height = 24
453 461
         Me.銷售明細_dgv.Size = New System.Drawing.Size(721, 409)
454 462
         Me.銷售明細_dgv.TabIndex = 1199
@@ -478,7 +486,7 @@ Partial Class 銷售單申請
478 486
         '
479 487
         Me.刪除單據上點選的資料_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
480 488
         Me.刪除單據上點選的資料_bt.ForeColor = System.Drawing.Color.Red
481
-        Me.刪除單據上點選的資料_bt.Location = New System.Drawing.Point(279, 3)
489
+        Me.刪除單據上點選的資料_bt.Location = New System.Drawing.Point(198, 3)
482 490
         Me.刪除單據上點選的資料_bt.Name = "刪除單據上點選的資料_bt"
483 491
         Me.刪除單據上點選的資料_bt.Size = New System.Drawing.Size(163, 23)
484 492
         Me.刪除單據上點選的資料_bt.TabIndex = 1203
@@ -498,17 +506,17 @@ Partial Class 銷售單申請
498 506
         '
499 507
         '區域庫存_dgv
500 508
         '
501
-        DataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
502
-        Me.區域庫存_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle5
509
+        DataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
510
+        Me.區域庫存_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle19
503 511
         Me.區域庫存_dgv.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
504 512
         Me.區域庫存_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
505 513
         Me.區域庫存_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
506 514
         Me.區域庫存_dgv.Location = New System.Drawing.Point(414, 318)
507 515
         Me.區域庫存_dgv.Name = "區域庫存_dgv"
508 516
         Me.區域庫存_dgv.RowHeadersWidth = 5
509
-        DataGridViewCellStyle6.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
510
-        DataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
511
-        Me.區域庫存_dgv.RowsDefaultCellStyle = DataGridViewCellStyle6
517
+        DataGridViewCellStyle20.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
518
+        DataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
519
+        Me.區域庫存_dgv.RowsDefaultCellStyle = DataGridViewCellStyle20
512 520
         Me.區域庫存_dgv.RowTemplate.Height = 24
513 521
         Me.區域庫存_dgv.Size = New System.Drawing.Size(191, 92)
514 522
         Me.區域庫存_dgv.TabIndex = 1245
@@ -862,8 +870,8 @@ Partial Class 銷售單申請
862 870
         '
863 871
         '物料清單_dgv
864 872
         '
865
-        DataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
866
-        Me.物料清單_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle7
873
+        DataGridViewCellStyle21.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
874
+        Me.物料清單_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle21
867 875
         Me.物料清單_dgv.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
868 876
             Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
869 877
         Me.物料清單_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
@@ -871,9 +879,9 @@ Partial Class 銷售單申請
871 879
         Me.物料清單_dgv.Location = New System.Drawing.Point(3, 80)
872 880
         Me.物料清單_dgv.Name = "物料清單_dgv"
873 881
         Me.物料清單_dgv.RowHeadersWidth = 5
874
-        DataGridViewCellStyle8.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
875
-        DataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
876
-        Me.物料清單_dgv.RowsDefaultCellStyle = DataGridViewCellStyle8
882
+        DataGridViewCellStyle22.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
883
+        DataGridViewCellStyle22.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
884
+        Me.物料清單_dgv.RowsDefaultCellStyle = DataGridViewCellStyle22
877 885
         Me.物料清單_dgv.RowTemplate.Height = 24
878 886
         Me.物料清單_dgv.Size = New System.Drawing.Size(602, 235)
879 887
         Me.物料清單_dgv.TabIndex = 1205
@@ -961,6 +969,14 @@ Partial Class 銷售單申請
961 969
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
962 970
         Me.Panel1.AutoScroll = True
963 971
         Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
972
+        Me.Panel1.Controls.Add(Me.通知_lb)
973
+        Me.Panel1.Controls.Add(Me.刷卡總和_tb)
974
+        Me.Panel1.Controls.Add(Me.刷卡稅金_tb)
975
+        Me.Panel1.Controls.Add(Me.Label46)
976
+        Me.Panel1.Controls.Add(Me.Label47)
977
+        Me.Panel1.Controls.Add(Me.刷卡傭金_tb)
978
+        Me.Panel1.Controls.Add(Me.Label48)
979
+        Me.Panel1.Controls.Add(Me.刷卡收款_bt)
964 980
         Me.Panel1.Controls.Add(Me.其他成本_tb)
965 981
         Me.Panel1.Controls.Add(Me.Label45)
966 982
         Me.Panel1.Controls.Add(Me.Label44)
@@ -1020,6 +1036,126 @@ Partial Class 銷售單申請
1020 1036
         Me.Panel1.Size = New System.Drawing.Size(731, 502)
1021 1037
         Me.Panel1.TabIndex = 1252
1022 1038
         '
1039
+        '通知_lb
1040
+        '
1041
+        Me.通知_lb.AutoSize = True
1042
+        Me.通知_lb.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1043
+        Me.通知_lb.ForeColor = System.Drawing.Color.Red
1044
+        Me.通知_lb.Location = New System.Drawing.Point(361, 8)
1045
+        Me.通知_lb.Name = "通知_lb"
1046
+        Me.通知_lb.Size = New System.Drawing.Size(127, 15)
1047
+        Me.通知_lb.TabIndex = 1317
1048
+        Me.通知_lb.Text = "........................................"
1049
+        '
1050
+        '刷卡總和_tb
1051
+        '
1052
+        Me.刷卡總和_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1053
+        Me.刷卡總和_tb.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1054
+        Me.刷卡總和_tb.Location = New System.Drawing.Point(455, 671)
1055
+        Me.刷卡總和_tb.Name = "刷卡總和_tb"
1056
+        Me.刷卡總和_tb.Size = New System.Drawing.Size(81, 23)
1057
+        Me.刷卡總和_tb.TabIndex = 1314
1058
+        Me.刷卡總和_tb.Text = "0"
1059
+        Me.刷卡總和_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1060
+        '
1061
+        '刷卡稅金_tb
1062
+        '
1063
+        Me.刷卡稅金_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1064
+        Me.刷卡稅金_tb.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1065
+        Me.刷卡稅金_tb.Location = New System.Drawing.Point(455, 711)
1066
+        Me.刷卡稅金_tb.Name = "刷卡稅金_tb"
1067
+        Me.刷卡稅金_tb.Size = New System.Drawing.Size(81, 23)
1068
+        Me.刷卡稅金_tb.TabIndex = 1316
1069
+        Me.刷卡稅金_tb.Text = "0"
1070
+        Me.刷卡稅金_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1071
+        '
1072
+        'Label46
1073
+        '
1074
+        Me.Label46.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1075
+        Me.Label46.AutoSize = True
1076
+        Me.Label46.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1077
+        Me.Label46.Location = New System.Drawing.Point(454, 695)
1078
+        Me.Label46.Name = "Label46"
1079
+        Me.Label46.Size = New System.Drawing.Size(83, 16)
1080
+        Me.Label46.TabIndex = 1315
1081
+        Me.Label46.Text = "刷   卡   稅   金"
1082
+        '
1083
+        'Label47
1084
+        '
1085
+        Me.Label47.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1086
+        Me.Label47.AutoSize = True
1087
+        Me.Label47.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1088
+        Me.Label47.Location = New System.Drawing.Point(454, 656)
1089
+        Me.Label47.Name = "Label47"
1090
+        Me.Label47.Size = New System.Drawing.Size(83, 16)
1091
+        Me.Label47.TabIndex = 1313
1092
+        Me.Label47.Text = "刷   卡   總   和"
1093
+        '
1094
+        '刷卡傭金_tb
1095
+        '
1096
+        Me.刷卡傭金_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1097
+        Me.刷卡傭金_tb.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1098
+        Me.刷卡傭金_tb.Location = New System.Drawing.Point(456, 750)
1099
+        Me.刷卡傭金_tb.Name = "刷卡傭金_tb"
1100
+        Me.刷卡傭金_tb.Size = New System.Drawing.Size(81, 23)
1101
+        Me.刷卡傭金_tb.TabIndex = 1312
1102
+        Me.刷卡傭金_tb.Text = "0"
1103
+        Me.刷卡傭金_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1104
+        '
1105
+        'Label48
1106
+        '
1107
+        Me.Label48.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1108
+        Me.Label48.AutoSize = True
1109
+        Me.Label48.ForeColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer))
1110
+        Me.Label48.Location = New System.Drawing.Point(454, 735)
1111
+        Me.Label48.Name = "Label48"
1112
+        Me.Label48.Size = New System.Drawing.Size(83, 16)
1113
+        Me.Label48.TabIndex = 1311
1114
+        Me.Label48.Text = "刷   卡   傭   金"
1115
+        '
1116
+        '刷卡收款_bt
1117
+        '
1118
+        Me.刷卡收款_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1119
+        Me.刷卡收款_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
1120
+        Me.刷卡收款_bt.Location = New System.Drawing.Point(429, 632)
1121
+        Me.刷卡收款_bt.Name = "刷卡收款_bt"
1122
+        Me.刷卡收款_bt.Size = New System.Drawing.Size(92, 23)
1123
+        Me.刷卡收款_bt.TabIndex = 1310
1124
+        Me.刷卡收款_bt.Text = "新增刷卡收款"
1125
+        Me.刷卡收款_bt.UseVisualStyleBackColor = True
1126
+        '
1127
+        '其他成本_tb
1128
+        '
1129
+        Me.其他成本_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1130
+        Me.其他成本_tb.ForeColor = System.Drawing.Color.Green
1131
+        Me.其他成本_tb.Location = New System.Drawing.Point(624, 700)
1132
+        Me.其他成本_tb.Name = "其他成本_tb"
1133
+        Me.其他成本_tb.Size = New System.Drawing.Size(81, 23)
1134
+        Me.其他成本_tb.TabIndex = 1309
1135
+        Me.其他成本_tb.Text = "0"
1136
+        Me.其他成本_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1137
+        '
1138
+        'Label45
1139
+        '
1140
+        Me.Label45.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1141
+        Me.Label45.AutoSize = True
1142
+        Me.Label45.ForeColor = System.Drawing.Color.Green
1143
+        Me.Label45.Location = New System.Drawing.Point(542, 703)
1144
+        Me.Label45.Name = "Label45"
1145
+        Me.Label45.Size = New System.Drawing.Size(83, 16)
1146
+        Me.Label45.TabIndex = 1308
1147
+        Me.Label45.Text = "其   他   成   本"
1148
+        '
1149
+        'Label44
1150
+        '
1151
+        Me.Label44.AutoSize = True
1152
+        Me.Label44.Location = New System.Drawing.Point(39, 363)
1153
+        Me.Label44.Name = "Label44"
1154
+        Me.Label44.Size = New System.Drawing.Size(68, 16)
1155
+        Me.Label44.TabIndex = 1307
1156
+        Me.Label44.Text = "客戶流水號"
1157
+        Me.Label44.Visible = False
1158
+        '
1023 1159
         'Reset_bt
1024 1160
         '
1025 1161
         Me.Reset_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -1036,9 +1172,9 @@ Partial Class 銷售單申請
1036 1172
         '
1037 1173
         Me.讀取標準成本_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1038 1174
         Me.讀取標準成本_bt.ForeColor = System.Drawing.Color.Green
1039
-        Me.讀取標準成本_bt.Location = New System.Drawing.Point(498, 3)
1175
+        Me.讀取標準成本_bt.Location = New System.Drawing.Point(107, 3)
1040 1176
         Me.讀取標準成本_bt.Name = "讀取標準成本_bt"
1041
-        Me.讀取標準成本_bt.Size = New System.Drawing.Size(163, 23)
1177
+        Me.讀取標準成本_bt.Size = New System.Drawing.Size(90, 23)
1042 1178
         Me.讀取標準成本_bt.TabIndex = 1305
1043 1179
         Me.讀取標準成本_bt.Text = "讀取標準成本"
1044 1180
         Me.讀取標準成本_bt.UseVisualStyleBackColor = True
@@ -1146,16 +1282,17 @@ Partial Class 銷售單申請
1146 1282
         '
1147 1283
         Me.項次3_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1148 1284
         Me.項次3_tb.Enabled = False
1149
-        Me.項次3_tb.Location = New System.Drawing.Point(503, 631)
1285
+        Me.項次3_tb.Location = New System.Drawing.Point(502, 440)
1150 1286
         Me.項次3_tb.Name = "項次3_tb"
1151 1287
         Me.項次3_tb.Size = New System.Drawing.Size(32, 23)
1152 1288
         Me.項次3_tb.TabIndex = 1290
1289
+        Me.項次3_tb.Visible = False
1153 1290
         '
1154 1291
         '刪除收款事項上點選的資料_bt
1155 1292
         '
1156 1293
         Me.刪除收款事項上點選的資料_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1157 1294
         Me.刪除收款事項上點選的資料_bt.ForeColor = System.Drawing.Color.Red
1158
-        Me.刪除收款事項上點選的資料_bt.Location = New System.Drawing.Point(279, 632)
1295
+        Me.刪除收款事項上點選的資料_bt.Location = New System.Drawing.Point(266, 632)
1159 1296
         Me.刪除收款事項上點選的資料_bt.Name = "刪除收款事項上點選的資料_bt"
1160 1297
         Me.刪除收款事項上點選的資料_bt.Size = New System.Drawing.Size(163, 23)
1161 1298
         Me.刪除收款事項上點選的資料_bt.TabIndex = 1287
@@ -1166,7 +1303,7 @@ Partial Class 銷售單申請
1166 1303
         '
1167 1304
         Me.新增一筆收款事項_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1168 1305
         Me.新增一筆收款事項_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
1169
-        Me.新增一筆收款事項_bt.Location = New System.Drawing.Point(110, 632)
1306
+        Me.新增一筆收款事項_bt.Location = New System.Drawing.Point(102, 632)
1170 1307
         Me.新增一筆收款事項_bt.Name = "新增一筆收款事項_bt"
1171 1308
         Me.新增一筆收款事項_bt.Size = New System.Drawing.Size(163, 23)
1172 1309
         Me.新增一筆收款事項_bt.TabIndex = 1286
@@ -1176,7 +1313,7 @@ Partial Class 銷售單申請
1176 1313
         '項次2_tb
1177 1314
         '
1178 1315
         Me.項次2_tb.Enabled = False
1179
-        Me.項次2_tb.Location = New System.Drawing.Point(36, 632)
1316
+        Me.項次2_tb.Location = New System.Drawing.Point(33, 632)
1180 1317
         Me.項次2_tb.Name = "項次2_tb"
1181 1318
         Me.項次2_tb.Size = New System.Drawing.Size(68, 23)
1182 1319
         Me.項次2_tb.TabIndex = 1284
@@ -1326,7 +1463,7 @@ Partial Class 銷售單申請
1326 1463
         '
1327 1464
         Me.刪除備註_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1328 1465
         Me.刪除備註_bt.ForeColor = System.Drawing.Color.Red
1329
-        Me.刪除備註_bt.Location = New System.Drawing.Point(279, 440)
1466
+        Me.刪除備註_bt.Location = New System.Drawing.Point(268, 440)
1330 1467
         Me.刪除備註_bt.Name = "刪除備註_bt"
1331 1468
         Me.刪除備註_bt.Size = New System.Drawing.Size(163, 23)
1332 1469
         Me.刪除備註_bt.TabIndex = 1256
@@ -1337,7 +1474,7 @@ Partial Class 銷售單申請
1337 1474
         '
1338 1475
         Me.銷售備註_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1339 1476
         Me.銷售備註_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
1340
-        Me.銷售備註_bt.Location = New System.Drawing.Point(110, 440)
1477
+        Me.銷售備註_bt.Location = New System.Drawing.Point(103, 440)
1341 1478
         Me.銷售備註_bt.Name = "銷售備註_bt"
1342 1479
         Me.銷售備註_bt.Size = New System.Drawing.Size(163, 23)
1343 1480
         Me.銷售備註_bt.TabIndex = 1261
@@ -1347,7 +1484,7 @@ Partial Class 銷售單申請
1347 1484
         '項次1_tb
1348 1485
         '
1349 1486
         Me.項次1_tb.Enabled = False
1350
-        Me.項次1_tb.Location = New System.Drawing.Point(36, 440)
1487
+        Me.項次1_tb.Location = New System.Drawing.Point(33, 440)
1351 1488
         Me.項次1_tb.Name = "項次1_tb"
1352 1489
         Me.項次1_tb.Size = New System.Drawing.Size(68, 23)
1353 1490
         Me.項次1_tb.TabIndex = 1264
@@ -1407,17 +1544,17 @@ Partial Class 銷售單申請
1407 1544
         '
1408 1545
         '客戶資料_dgv
1409 1546
         '
1410
-        DataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
1411
-        Me.客戶資料_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle9
1547
+        DataGridViewCellStyle23.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
1548
+        Me.客戶資料_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle23
1412 1549
         Me.客戶資料_dgv.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
1413 1550
         Me.客戶資料_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
1414 1551
         Me.客戶資料_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
1415
-        Me.客戶資料_dgv.Location = New System.Drawing.Point(17, 6614)
1552
+        Me.客戶資料_dgv.Location = New System.Drawing.Point(17, 7445)
1416 1553
         Me.客戶資料_dgv.Name = "客戶資料_dgv"
1417 1554
         Me.客戶資料_dgv.RowHeadersWidth = 5
1418
-        DataGridViewCellStyle10.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1419
-        DataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
1420
-        Me.客戶資料_dgv.RowsDefaultCellStyle = DataGridViewCellStyle10
1555
+        DataGridViewCellStyle24.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1556
+        DataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
1557
+        Me.客戶資料_dgv.RowsDefaultCellStyle = DataGridViewCellStyle24
1421 1558
         Me.客戶資料_dgv.RowTemplate.Height = 24
1422 1559
         Me.客戶資料_dgv.Size = New System.Drawing.Size(191, 92)
1423 1560
         Me.客戶資料_dgv.TabIndex = 1254
@@ -1425,8 +1562,8 @@ Partial Class 銷售單申請
1425 1562
         '
1426 1563
         '收款事項_dgv
1427 1564
         '
1428
-        DataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
1429
-        Me.收款事項_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle11
1565
+        DataGridViewCellStyle25.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
1566
+        Me.收款事項_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle25
1430 1567
         Me.收款事項_dgv.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
1431 1568
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1432 1569
         Me.收款事項_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
@@ -1434,11 +1571,11 @@ Partial Class 銷售單申請
1434 1571
         Me.收款事項_dgv.Location = New System.Drawing.Point(3, 657)
1435 1572
         Me.收款事項_dgv.Name = "收款事項_dgv"
1436 1573
         Me.收款事項_dgv.RowHeadersWidth = 5
1437
-        DataGridViewCellStyle12.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1438
-        DataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
1439
-        Me.收款事項_dgv.RowsDefaultCellStyle = DataGridViewCellStyle12
1574
+        DataGridViewCellStyle26.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1575
+        DataGridViewCellStyle26.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
1576
+        Me.收款事項_dgv.RowsDefaultCellStyle = DataGridViewCellStyle26
1440 1577
         Me.收款事項_dgv.RowTemplate.Height = 24
1441
-        Me.收款事項_dgv.Size = New System.Drawing.Size(532, 118)
1578
+        Me.收款事項_dgv.Size = New System.Drawing.Size(447, 118)
1442 1579
         Me.收款事項_dgv.TabIndex = 1282
1443 1580
         '
1444 1581
         'Label28
@@ -1483,8 +1620,8 @@ Partial Class 銷售單申請
1483 1620
         '
1484 1621
         '銷售備註_dgv
1485 1622
         '
1486
-        DataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
1487
-        Me.銷售備註_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle13
1623
+        DataGridViewCellStyle27.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
1624
+        Me.銷售備註_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle27
1488 1625
         Me.銷售備註_dgv.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
1489 1626
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1490 1627
         Me.銷售備註_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
@@ -1492,9 +1629,9 @@ Partial Class 銷售單申請
1492 1629
         Me.銷售備註_dgv.Location = New System.Drawing.Point(3, 465)
1493 1630
         Me.銷售備註_dgv.Name = "銷售備註_dgv"
1494 1631
         Me.銷售備註_dgv.RowHeadersWidth = 5
1495
-        DataGridViewCellStyle14.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1496
-        DataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
1497
-        Me.銷售備註_dgv.RowsDefaultCellStyle = DataGridViewCellStyle14
1632
+        DataGridViewCellStyle28.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1633
+        DataGridViewCellStyle28.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
1634
+        Me.銷售備註_dgv.RowsDefaultCellStyle = DataGridViewCellStyle28
1498 1635
         Me.銷售備註_dgv.RowTemplate.Height = 24
1499 1636
         Me.銷售備註_dgv.Size = New System.Drawing.Size(532, 165)
1500 1637
         Me.銷售備註_dgv.TabIndex = 1250
@@ -1653,38 +1790,6 @@ Partial Class 銷售單申請
1653 1790
         Me.物料圖1_pb.TabIndex = 1201
1654 1791
         Me.物料圖1_pb.TabStop = False
1655 1792
         '
1656
-        'Label44
1657
-        '
1658
-        Me.Label44.AutoSize = True
1659
-        Me.Label44.Location = New System.Drawing.Point(39, 363)
1660
-        Me.Label44.Name = "Label44"
1661
-        Me.Label44.Size = New System.Drawing.Size(68, 16)
1662
-        Me.Label44.TabIndex = 1307
1663
-        Me.Label44.Text = "客戶流水號"
1664
-        Me.Label44.Visible = False
1665
-        '
1666
-        '其他成本_tb
1667
-        '
1668
-        Me.其他成本_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1669
-        Me.其他成本_tb.ForeColor = System.Drawing.Color.Green
1670
-        Me.其他成本_tb.Location = New System.Drawing.Point(624, 700)
1671
-        Me.其他成本_tb.Name = "其他成本_tb"
1672
-        Me.其他成本_tb.Size = New System.Drawing.Size(81, 23)
1673
-        Me.其他成本_tb.TabIndex = 1309
1674
-        Me.其他成本_tb.Text = "0"
1675
-        Me.其他成本_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1676
-        '
1677
-        'Label45
1678
-        '
1679
-        Me.Label45.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
1680
-        Me.Label45.AutoSize = True
1681
-        Me.Label45.ForeColor = System.Drawing.Color.Green
1682
-        Me.Label45.Location = New System.Drawing.Point(542, 703)
1683
-        Me.Label45.Name = "Label45"
1684
-        Me.Label45.Size = New System.Drawing.Size(83, 16)
1685
-        Me.Label45.TabIndex = 1308
1686
-        Me.Label45.Text = "其   他   成   本"
1687
-        '
1688 1793
         '銷售單申請
1689 1794
         '
1690 1795
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
@@ -1931,4 +2036,12 @@ Partial Class 銷售單申請
1931 2036
     Friend WithEvents Label44 As Label
1932 2037
     Friend WithEvents 其他成本_tb As TextBox
1933 2038
     Friend WithEvents Label45 As Label
2039
+    Friend WithEvents 刷卡收款_bt As Button
2040
+    Friend WithEvents 刷卡總和_tb As TextBox
2041
+    Friend WithEvents 刷卡稅金_tb As TextBox
2042
+    Friend WithEvents Label46 As Label
2043
+    Friend WithEvents Label47 As Label
2044
+    Friend WithEvents 刷卡傭金_tb As TextBox
2045
+    Friend WithEvents Label48 As Label
2046
+    Friend WithEvents 通知_lb As Label
1934 2047
 End Class

+ 185
- 100
YD-ERP-SYS/業務系統管理/銷售單申請.vb 查看文件

@@ -3,7 +3,7 @@ Public Class 銷售單申請
3 3
     ReadOnly ds As New DataSet : ReadOnly ds1 As New DataSet : ReadOnly ds2 As New DataSet : ReadOnly ds3 As New DataSet : ReadOnly ds4 As New DataSet
4 4
     ReadOnly ds5 As New DataSet : ReadOnly ds6 As New DataSet
5 5
     Dim 首次開啟 As Boolean = False : Dim EDR As Integer = 0 : Dim ESTR As String : Dim EDR1 As Integer = 0 : Dim ESTR1 As String : Dim NUM1 As Integer
6
-    Dim 運費 As Integer
6
+    Dim 運費 As Integer : Dim 刷卡控制 As Boolean = False
7 7
     Private Sub Set_清單()
8 8
         物料清單_dgv.DataSource = Nothing : ds.Clear()
9 9
         物料清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
@@ -121,10 +121,10 @@ Public Class 銷售單申請
121 121
         銷售明細_dgv.Columns(20).Visible = False
122 122
 
123 123
         銷售明細_dgv.Columns(1).ReadOnly = True : 銷售明細_dgv.Columns(2).ReadOnly = True : 銷售明細_dgv.Columns(3).ReadOnly = True : 銷售明細_dgv.Columns(4).ReadOnly = True
124
-        銷售明細_dgv.Columns(11).ReadOnly = True : 銷售明細_dgv.Columns(15).ReadOnly = True : 銷售明細_dgv.Columns(16).ReadOnly = True
124
+        銷售明細_dgv.Columns(11).ReadOnly = True : 銷售明細_dgv.Columns(13).ReadOnly = True : 銷售明細_dgv.Columns(16).ReadOnly = True
125 125
 
126 126
         銷售明細_dgv.Columns("數量").DefaultCellStyle.Format = "#,##0" : 銷售明細_dgv.Columns("成本").DefaultCellStyle.Format = "#,##0"
127
-        銷售明細_dgv.Columns("單價").DefaultCellStyle.Format = "#,##0" : 銷售明細_dgv.Columns("售價").DefaultCellStyle.Format = "#,##0"
127
+        銷售明細_dgv.Columns("單價").DefaultCellStyle.Format = "#,##0.0" : 銷售明細_dgv.Columns("售價").DefaultCellStyle.Format = "#,##0"
128 128
         銷售明細_dgv.Columns("數量").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
129 129
         銷售明細_dgv.Columns("數量").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
130 130
         銷售明細_dgv.Columns("成本").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
@@ -272,17 +272,25 @@ Public Class 銷售單申請
272 272
         DTP = Format(開單日期_dtp.Value, "yyyy/MM/dd") : DTP2 = Format(交貨日期_dtp.Value, "yyyy/MM/dd") : DTP1 = Format(Today(), "yyyyMMdd")
273 273
     End Sub
274 274
     Private Sub Set_合記計算()
275
-        Dim 不含1類銷售小記 As Integer
275
+        Dim 不含1類銷售小記 As Integer : Dim 金額1 As Integer = 0
276 276
         售價小計_tb.Text = "0" : 稅金_tb.Text = "0" : 銷售合計_tb.Text = "0" : 收入小計_tb.Text = "0" : 支出小計_tb.Text = "0" : 額外收支_tb.Text = "0" : 物料成本_tb.Text = "0"
277
-        司機運費_tb.Text = "0" : 管銷費用_tb.Text = "0" : 其他成本_tb.Text = "0"
277
+        司機運費_tb.Text = "0" : 管銷費用_tb.Text = "0" : 其他成本_tb.Text = "0" : 刷卡總和_tb.Text = "0" : 刷卡稅金_tb.Text = "0" : 刷卡傭金_tb.Text = "0"
278
+        '-------001-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
279
+        For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
280
+            If 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
281
+                刷卡總和_tb.Text = Val(刷卡總和_tb.Text) + 收款事項_dgv("金額", i).Value
282
+            End If
283
+        Next
284
+        刷卡稅金_tb.Text = CInt(Val(Val(刷卡總和_tb.Text) * 0.05)) : 刷卡傭金_tb.Text = CInt(Val(Val(刷卡總和_tb.Text) * 0.02))
285
+        '-------002-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
278 286
         For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
279 287
             售價小計_tb.Text = Val(售價小計_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value)
280 288
 
281
-            If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) <> 1 Then
289
+            If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) <> "1" Then
282 290
                 物料成本_tb.Text = Val(物料成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
283
-                不含1類銷售小記 = 不含1類銷售小記 + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value)
291
+                不含1類銷售小記 = 不含1類銷售小記 + 銷售明細_dgv("售價", i).Value
284 292
             End If
285
-            If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) = 1 Then
293
+            If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) = "1" Then
286 294
                 其他成本_tb.Text = Val(其他成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
287 295
             End If
288 296
 
@@ -293,21 +301,33 @@ Public Class 銷售單申請
293 301
         管銷費用_tb.Text = Val(物料成本_tb.Text) * 1.06 - Val(物料成本_tb.Text)
294 302
         銷售合計_tb.Text = Val(售價小計_tb.Text) + Val(稅金_tb.Text)
295 303
 
304
+        If Val(稅金_tb.Text) = 0 And Val(刷卡稅金_tb.Text) = 0 Then
305
+            通知_lb.Text = "無稅金"
306
+        ElseIf Val(稅金_tb.Text) = 0 And Val(刷卡稅金_tb.Text) <> 0 Then
307
+            通知_lb.Text = "應刷卡稅金小,有刷卡帶入的稅金,所以拆售價以未稅顯示" : 稅金_tb.Text = 刷卡稅金_tb.Text : 售價小計_tb.Text = Val(銷售合計_tb.Text) - Val(稅金_tb.Text)
308
+        ElseIf Val(稅金_tb.Text) <> 0 And Val(刷卡稅金_tb.Text) <> 0 And Val(稅金_tb.Text) > Val(刷卡稅金_tb.Text) Then
309
+            通知_lb.Text = "應所拆售價稅金大於刷卡稅金,計算正常,利潤中扣除刷卡傭金"
310
+        ElseIf Val(稅金_tb.Text) <> 0 And Val(刷卡稅金_tb.Text) <> 0 And Val(稅金_tb.Text) < Val(刷卡稅金_tb.Text) Then
311
+            通知_lb.Text = "刷卡稅金大於自動計算後的稅金,邏輯有誤,請從新拆售價。"
312
+        End If
313
+        '-------003-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
296 314
         For i As Integer = 0 To 銷售備註_dgv.Rows.Count - 1
297 315
             收入小計_tb.Text = Val(收入小計_tb.Text) + 銷售備註_dgv("收入", i).Value
298 316
             支出小計_tb.Text = Val(支出小計_tb.Text) + 銷售備註_dgv("支出", i).Value
299 317
         Next
300 318
         額外收支_tb.Text = Val(收入小計_tb.Text) - Val(支出小計_tb.Text)
301
-
319
+        '-------004-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
302 320
         Dim 金額 As Integer = 0
303 321
         For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
304
-            If 收款事項_dgv("真項次", i).Value.ToString <> "0" Then
322
+            If 收款事項_dgv("真項次", i).Value.ToString <> "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
305 323
                 金額 = 金額 + 收款事項_dgv("金額", i).Value
306
-            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" Then
324
+            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
325
+                金額 = 金額 + 收款事項_dgv("金額", i).Value
326
+            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString = "未收餘額" Then
307 327
                 收款事項_dgv("金額", i).Value = CInt(Val(銷售合計_tb.Text)) - 金額
308 328
             End If
309 329
         Next
310
-
330
+        '-------005-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
311 331
         If 送貨地點_cb.Text = "" Or 送貨地點_cb.Text = "自取" Or 最低運費_cb.Text = "" Or 最低售價_cb.Text = "" Then
312 332
             司機運費_tb.Text = "0"
313 333
         Else
@@ -315,19 +335,20 @@ Public Class 銷售單申請
315 335
                 If (不含1類銷售小記 - Val(其他成本_tb.Text)) <= Val(最低售價_cb.Text) Then
316 336
                     司機運費_tb.Text = 最低運費_cb.Text
317 337
                 ElseIf (不含1類銷售小記 - Val(其他成本_tb.Text)) > Val(最低售價_cb.Text) Then
318
-                    司機運費_tb.Text = (不含1類銷售小記 - Val(其他成本_tb.Text)) / 100 * 3
338
+                    司機運費_tb.Text = (不含1類銷售小記 - Val(稅金_tb.Text) - Val(刷卡傭金_tb.Text) - Val(其他成本_tb.Text)) / 100 * 3
319 339
                 End If
320 340
             Else
321 341
                 司機運費_tb.Text = 運費
322 342
             End If
323 343
         End If
324
-
325
-        預估利潤_tb.Text = Val(售價小計_tb.Text) + Val(額外收支_tb.Text) - Val(其他成本_tb.Text) - Val(物料成本_tb.Text) - Val(司機運費_tb.Text) - Val(管銷費用_tb.Text)
326
-
344
+        '-------006-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
345
+        預估利潤_tb.Text = Val(售價小計_tb.Text) + Val(額外收支_tb.Text) - Val(其他成本_tb.Text) - Val(物料成本_tb.Text) - Val(司機運費_tb.Text) - Val(管銷費用_tb.Text) - Val(刷卡傭金_tb.Text)
346
+        '-------007-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
327 347
         售價小計_tb.Text = Format(Val(售價小計_tb.Text), "#,##0") : 稅金_tb.Text = Format(Val(稅金_tb.Text), "#,##0") : 銷售合計_tb.Text = Format(Val(銷售合計_tb.Text), "#,##0")
328 348
         收入小計_tb.Text = Format(Val(收入小計_tb.Text), "#,##0") : 支出小計_tb.Text = Format(Val(支出小計_tb.Text), "#,##0") : 額外收支_tb.Text = Format(Val(額外收支_tb.Text), "#,##0")
329 349
         司機運費_tb.Text = Format(Val(司機運費_tb.Text), "#,##0") : 管銷費用_tb.Text = Format(Val(管銷費用_tb.Text), "#,##0") : 預估利潤_tb.Text = Format(Val(預估利潤_tb.Text), "#,##0")
330
-        物料成本_tb.Text = Format(Val(物料成本_tb.Text), "#,##0") : 其他成本_tb.Text = Format(Val(其他成本_tb.Text), "#,##0")
350
+        物料成本_tb.Text = Format(Val(物料成本_tb.Text), "#,##0") : 其他成本_tb.Text = Format(Val(其他成本_tb.Text), "#,##0") : 刷卡總和_tb.Text = Format(Val(刷卡總和_tb.Text), "#,##0")
351
+        刷卡稅金_tb.Text = Format(Val(刷卡稅金_tb.Text), "#,##0") : 刷卡傭金_tb.Text = Format(Val(刷卡傭金_tb.Text), "#,##0")
331 352
     End Sub
332 353
     Private Sub 指定倉庫_cb_下拉表單資料載入()
333 354
         If 需要全部庫存區域清單_ch.Checked = True Then
@@ -395,9 +416,9 @@ Public Class 銷售單申請
395 416
         If e.RowIndex = -1 Then : Else
396 417
             For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
397 418
                 If 銷售明細_dgv("含稅", i).Value = False Then
398
-                    銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value
419
+                    銷售明細_dgv("單價", i).Value = 銷售明細_dgv("售價", i).Value / 銷售明細_dgv("數量", i).Value
399 420
                 ElseIf 銷售明細_dgv("含稅", i).Value = True Then
400
-                    銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value * 1.05
421
+                    銷售明細_dgv("單價", i).Value = (銷售明細_dgv("售價", i).Value / 1.05) / 銷售明細_dgv("數量", i).Value
401 422
                 End If
402 423
 
403 424
                 If 銷售明細_dgv("倉儲情況", i).Value <> "已有貨" Then
@@ -593,17 +614,19 @@ Public Class 銷售單申請
593 614
         送貨地點_cb.SelectedIndex = 最低售價_cb.SelectedIndex : 最低運費_cb.SelectedIndex = 最低售價_cb.SelectedIndex
594 615
     End Sub
595 616
     Private Sub 含稅_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 含稅_ch.CheckedChanged
596
-        For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
597
-            If 含稅_ch.Checked = False Then : 銷售明細_dgv("含稅", i).Value = False
598
-            ElseIf 含稅_ch.Checked = True Then : 銷售明細_dgv("含稅", i).Value = True
599
-            End If
600
-            If 銷售明細_dgv("含稅", i).Value = False Then
601
-                銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value
602
-            ElseIf 銷售明細_dgv("含稅", i).Value = True Then
603
-                銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value * 1.05
604
-            End If
605
-        Next
606
-        Set_合記計算()
617
+        If 刷卡控制 = False Then
618
+            For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
619
+                If 含稅_ch.Checked = False Then : 銷售明細_dgv("含稅", i).Value = False
620
+                ElseIf 含稅_ch.Checked = True Then : 銷售明細_dgv("含稅", i).Value = True
621
+                End If
622
+                If 銷售明細_dgv("含稅", i).Value = False Then
623
+                    銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value
624
+                ElseIf 銷售明細_dgv("含稅", i).Value = True Then
625
+                    銷售明細_dgv("售價", i).Value = 銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value * 1.05
626
+                End If
627
+            Next
628
+            Set_合記計算()
629
+        End If
607 630
     End Sub
608 631
     Private Sub 客戶編號_tb_TextChanged(sender As Object, e As EventArgs) Handles 客戶編號_tb.TextChanged
609 632
         PA15 = 客戶編號_tb.Text
@@ -741,6 +764,7 @@ Public Class 銷售單申請
741 764
 
742 765
                 DTP = Format(開單日期_dtp.Value, "yyyy/MM/dd") : DTP1 = Format(交貨日期_dtp.Value, "yyyy/MM/dd") : BL1 = 含稅_ch.Checked : 運費 = 司機運費_tb.Text
743 766
                 PA1 = 流水號_tb.Text : PA2 = 單號_tb.Text : PA3 = 客戶編號_tb.Text : PA4 = 流水號_tb.Text : PA5 = 送貨地點_cb.Text : NU1 = 司機運費_tb.Text : NU2 = 管銷費用_tb.Text
767
+                NU3 = 稅金_tb.Text
744 768
                 SQL_銷售控制表_修改() '--------------------資料修改
745 769
 
746 770
                 For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
@@ -829,6 +853,7 @@ Public Class 銷售單申請
829 853
 
830 854
                 DTP = Format(開單日期_dtp.Value, "yyyy/MM/dd") : DTP1 = Format(交貨日期_dtp.Value, "yyyy/MM/dd") : BL1 = 含稅_ch.Checked : 運費 = 司機運費_tb.Text
831 855
                 PA1 = 流水號_tb.Text : PA2 = 單號_tb.Text : PA3 = 客戶編號_tb.Text : PA4 = 流水號_tb.Text : PA5 = 送貨地點_cb.Text : NU1 = 司機運費_tb.Text : NU2 = 管銷費用_tb.Text
856
+                NU3 = 稅金_tb.Text
832 857
                 SQL_銷售控制表_修改() '--------------------資料修改
833 858
 
834 859
                 For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
@@ -883,66 +908,67 @@ Public Class 銷售單申請
883 908
                             PA1 = 單號_tb.Text : PA2 = 料號_tb.Text : PA3 = 倉庫編號_tb.Text
884 909
                             SQL_銷售明細表_確認單據是否申請()
885 910
                             If dr.Read() Then
886
-                                conn.Close() : MsgBox("該料號已經在本單據中申請過了,如要修改,請直接到單據中尋找並修改。")
911
+                                conn.Close() : MsgBox("該料號已經在本單據中申請過了,如果是標準規格品,請不要重複開兩次。")
887 912
                             Else
888
-                                SQL_銷售明細表_最後一筆資料()
913
+                            End If
914
+
915
+                            SQL_銷售明細表_最後一筆資料()
916
+                            If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("資料流水號").ToString, 9)) : Else : EDR = 0 : End If
917
+                            conn.Close() : EDR += 1
918
+                            If EDR < 10 Then : ESTR = "SA" & "00000000" & EDR
919
+                            ElseIf EDR > 9 And EDR < 100 Then : ESTR = "SA" & "0000000" & EDR
920
+                            ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "SA" & "000000" & EDR
921
+                            ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "SA" & "00000" & EDR
922
+                            ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "SA" & "0000" & EDR
923
+                            ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "SA" & "000" & EDR
924
+                            ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "SA" & "00" & EDR
925
+                            ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "SA" & "0" & EDR
926
+                            ElseIf EDR > 99999999 Then : ESTR = "SA" & EDR : End If
927
+
928
+                            Set_日期格式轉換()
929
+                            PA3 = ESTR : PA4 = 單號_tb.Text : PA5 = 倉庫級別_tb.Text : PA6 = 倉庫編號_tb.Text : NU1 = 訂購數量_nud.Value : NU2 = 成本_nud.Value : NU3 = 售價_nud.Value
930
+                            PA7 = 儲態編號_cb.Text : PA8 = 訂製編碼_cb.Text : BL2 = 含稅_ch.Checked : PA10 = 倉庫編號_tb.Text
931
+                            If Val(可申請_tb.Text) > 0 Then
932
+                                PA9 = "已有貨"
933
+                                SQL_銷售單申請_銷售明細表_新增()
934
+
935
+                                If 調庫單號_tb.Text = "" Then
936
+                                    Set_日期格式轉換()
937
+                                    For i As Integer = 1 To 999
938
+                                        NUM1 = 0 + i
939
+                                        If NUM1 < 10 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-00" & NUM1
940
+                                        ElseIf NUM1 > 9 And NUM1 < 100 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-0" & NUM1
941
+                                        ElseIf NUM1 > 99 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-" & NUM1
942
+                                        End If
943
+                                        PA1 = 調庫單號_tb.Text
944
+                                        SQL_倉儲明細執行單號_執行單號驗證()
945
+                                        If dr.Read() Then : Else : i = 999 : conn.Close() : End If : conn.Close()
946
+                                    Next
947
+                                    SQL_倉儲明細執行單號_新增() : conn.Close()
948
+                                End If
949
+
950
+                                SQL_倉儲明細表_最後一筆資料()
889 951
                                 If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("資料流水號").ToString, 9)) : Else : EDR = 0 : End If
890 952
                                 conn.Close() : EDR += 1
891
-                                If EDR < 10 Then : ESTR = "SA" & "00000000" & EDR
892
-                                ElseIf EDR > 9 And EDR < 100 Then : ESTR = "SA" & "0000000" & EDR
893
-                                ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "SA" & "000000" & EDR
894
-                                ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "SA" & "00000" & EDR
895
-                                ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "SA" & "0000" & EDR
896
-                                ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "SA" & "000" & EDR
897
-                                ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "SA" & "00" & EDR
898
-                                ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "SA" & "0" & EDR
899
-                                ElseIf EDR > 99999999 Then : ESTR = "SA" & EDR : End If
900
-
901
-                                Set_日期格式轉換()
902
-                                PA3 = ESTR : PA4 = 單號_tb.Text : PA5 = 倉庫級別_tb.Text : PA6 = 倉庫編號_tb.Text : NU1 = 訂購數量_nud.Value : NU2 = 成本_nud.Value : NU3 = 售價_nud.Value
903
-                                PA7 = 儲態編號_cb.Text : PA8 = 訂製編碼_cb.Text : BL2 = 含稅_ch.Checked : PA10 = 倉庫編號_tb.Text
904
-                                If Val(可申請_tb.Text) > 0 Then
905
-                                    PA9 = "已有貨"
906
-                                    SQL_銷售單申請_銷售明細表_新增()
907
-
908
-                                    If 調庫單號_tb.Text = "" Then
909
-                                        Set_日期格式轉換()
910
-                                        For i As Integer = 1 To 999
911
-                                            NUM1 = 0 + i
912
-                                            If NUM1 < 10 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-00" & NUM1
913
-                                            ElseIf NUM1 > 9 And NUM1 < 100 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-0" & NUM1
914
-                                            ElseIf NUM1 > 99 Then : 調庫單號_tb.Text = "WH-" & DTP1 & "-" & NUM1
915
-                                            End If
916
-                                            PA1 = 調庫單號_tb.Text
917
-                                            SQL_倉儲明細執行單號_執行單號驗證()
918
-                                            If dr.Read() Then : Else : i = 999 : conn.Close() : End If : conn.Close()
919
-                                        Next
920
-                                        SQL_倉儲明細執行單號_新增() : conn.Close()
921
-                                    End If
922
-
923
-                                    SQL_倉儲明細表_最後一筆資料()
924
-                                    If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("資料流水號").ToString, 9)) : Else : EDR = 0 : End If
925
-                                    conn.Close() : EDR += 1
926
-                                    If EDR < 10 Then : ESTR = "WH" & "00000000" & EDR
927
-                                    ElseIf EDR > 9 And EDR < 100 Then : ESTR = "WH" & "0000000" & EDR
928
-                                    ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "WH" & "000000" & EDR
929
-                                    ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "WH" & "00000" & EDR
930
-                                    ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "WH" & "0000" & EDR
931
-                                    ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "WH" & "000" & EDR
932
-                                    ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "WH" & "00" & EDR
933
-                                    ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "WH" & "0" & EDR
934
-                                    ElseIf EDR > 99999999 Then : ESTR = "WH" & EDR : End If
935
-
936
-                                    PA3 = ESTR : PA4 = 調庫單號_tb.Text : PA5 = 倉庫級別_tb.Text : PA6 = 倉庫編號_tb.Text : PA9 = 單號_tb.Text
937
-                                    SQL_銷售單申請_倉儲明細表_銷售出庫()
938
-                                    Set_清單4()
939
-                                ElseIf Val(可申請_tb.Text) = 0 Then
940
-                                    PA9 = "未有貨"
941
-                                    SQL_銷售單申請_銷售明細表_新增()
942
-                                    Set_清單4()
943
-                                End If : conn.Close()
944
-                                Set_清單()
945
-                            End If
953
+                                If EDR < 10 Then : ESTR = "WH" & "00000000" & EDR
954
+                                ElseIf EDR > 9 And EDR < 100 Then : ESTR = "WH" & "0000000" & EDR
955
+                                ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "WH" & "000000" & EDR
956
+                                ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "WH" & "00000" & EDR
957
+                                ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "WH" & "0000" & EDR
958
+                                ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "WH" & "000" & EDR
959
+                                ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "WH" & "00" & EDR
960
+                                ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "WH" & "0" & EDR
961
+                                ElseIf EDR > 99999999 Then : ESTR = "WH" & EDR : End If
962
+
963
+                                PA3 = ESTR : PA4 = 調庫單號_tb.Text : PA5 = 倉庫級別_tb.Text : PA6 = 倉庫編號_tb.Text : PA9 = 單號_tb.Text
964
+                                SQL_銷售單申請_倉儲明細表_銷售出庫()
965
+                                Set_清單4()
966
+                            ElseIf Val(可申請_tb.Text) = 0 Then
967
+                                PA9 = "未有貨"
968
+                                SQL_銷售單申請_銷售明細表_新增()
969
+                                Set_清單4()
970
+                            End If : conn.Close()
971
+                            Set_清單()
946 972
                         End If
947 973
                     End If
948 974
                 End If
@@ -1042,7 +1068,7 @@ Public Class 銷售單申請
1042 1068
                     MsgBox("沒有選擇收款事項,無法作業。")
1043 1069
                 Else
1044 1070
                     If 項次3_tb.Text = "0" Then
1045
-                        MsgBox("不能刪除 [未收餘額] 選項!!")
1071
+                        MsgBox("不能刪除 [未收餘額] 或 [刷卡] 選項!!")
1046 1072
                     Else
1047 1073
                         Dim aa1 As MsgBoxResult = MsgBox("你確定要刪除這筆資料?", MsgBoxStyle.OkCancel)
1048 1074
                         If aa1 = MsgBoxResult.Ok Then
@@ -1054,6 +1080,44 @@ Public Class 銷售單申請
1054 1080
             End If
1055 1081
         End If
1056 1082
     End Sub
1083
+    Private Sub 刷卡收款_bt_Click(sender As Object, e As EventArgs) Handles 刷卡收款_bt.Click
1084
+        If 流水號_tb.Text = "" Then
1085
+            MsgBox("沒有銷售單號,無法作業。")
1086
+        Else
1087
+            SQL_銷售收款事項_最後一筆資料()
1088
+            If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("資料流水號").ToString, 9)) : Else : EDR = 0 : End If
1089
+            conn.Close() : EDR += 1
1090
+            If EDR < 10 Then : ESTR = "ST" & "00000000" & EDR
1091
+            ElseIf EDR > 9 And EDR < 100 Then : ESTR = "ST" & "0000000" & EDR
1092
+            ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "ST" & "000000" & EDR
1093
+            ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "ST" & "00000" & EDR
1094
+            ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "ST" & "0000" & EDR
1095
+            ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "ST" & "000" & EDR
1096
+            ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "ST" & "00" & EDR
1097
+            ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "ST" & "0" & EDR
1098
+            ElseIf EDR > 99999999 Then : ESTR = "ST" & EDR : End If
1099
+            PA1 = ESTR
1100
+
1101
+            SQL_銷售收款事項_最後一筆項次()
1102
+            If dr.Read() Then : EDR = dr("項次").ToString : Else : EDR = 0 : End If
1103
+            conn.Close() : EDR += 1
1104
+            If EDR < 10 Then : ESTR = EDR
1105
+            ElseIf EDR > 9 And EDR < 100 Then : ESTR = EDR : End If
1106
+            PA2 = ESTR : PA = 單號_tb.Text
1107
+            SQL_銷售收款事項_新增3()
1108
+
1109
+            For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
1110
+                資料數 = 收款事項_dgv.Rows.Count : MyModule1.進度條()
1111
+                PA10 = 收款事項_dgv.Rows(i).Cells("內容").Value : PA11 = 收款事項_dgv.Rows(i).Cells("資料流水號").Value
1112
+                NU1 = 收款事項_dgv.Rows(i).Cells("金額").Value
1113
+                SQL_銷售收款事項_修改() : conn.Close()
1114
+            Next : YD_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
1115
+
1116
+            Set_清單6()
1117
+
1118
+            刷卡控制 = True : 含稅_ch.Checked = True : 刷卡控制 = False
1119
+        End If
1120
+    End Sub
1057 1121
     Private Sub 新增一筆收款事項_bt_Click(sender As Object, e As EventArgs) Handles 新增一筆收款事項_bt.Click
1058 1122
         If 流水號_tb.Text = "" Then
1059 1123
             MsgBox("沒有銷售單號,無法作業。")
@@ -1105,15 +1169,23 @@ Public Class 銷售單申請
1105 1169
         Next : YD_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
1106 1170
     End Sub
1107 1171
     Private Sub Reset_bt_Click(sender As Object, e As EventArgs) Handles Reset_bt.Click
1108
-        Dim 不含1類銷售小記 As Integer
1172
+        Dim 不含1類銷售小記 As Integer : Dim 金額1 As Integer = 0
1109 1173
         售價小計_tb.Text = "0" : 稅金_tb.Text = "0" : 銷售合計_tb.Text = "0" : 收入小計_tb.Text = "0" : 支出小計_tb.Text = "0" : 額外收支_tb.Text = "0" : 物料成本_tb.Text = "0"
1110
-        司機運費_tb.Text = "0" : 管銷費用_tb.Text = "0" : 其他成本_tb.Text = "0"
1174
+        司機運費_tb.Text = "0" : 管銷費用_tb.Text = "0" : 其他成本_tb.Text = "0" : 刷卡總和_tb.Text = "0" : 刷卡稅金_tb.Text = "0" : 刷卡傭金_tb.Text = "0"
1175
+        '-------001-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1176
+        For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
1177
+            If 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
1178
+                刷卡總和_tb.Text = Val(刷卡總和_tb.Text) + 收款事項_dgv("金額", i).Value
1179
+            End If
1180
+        Next
1181
+        刷卡稅金_tb.Text = CInt(Val(Val(刷卡總和_tb.Text) * 0.05)) : 刷卡傭金_tb.Text = CInt(Val(Val(刷卡總和_tb.Text) * 0.02))
1182
+        '-------002-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1111 1183
         For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
1112 1184
             售價小計_tb.Text = Val(售價小計_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value)
1113 1185
 
1114 1186
             If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) <> 1 Then
1115 1187
                 物料成本_tb.Text = Val(物料成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
1116
-                不含1類銷售小記 = 不含1類銷售小記 + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("單價", i).Value)
1188
+                不含1類銷售小記 = 不含1類銷售小記 + 銷售明細_dgv("售價", i).Value
1117 1189
             End If
1118 1190
             If Strings.Left(銷售明細_dgv("料號", i).Value.ToString, 1) = 1 Then
1119 1191
                 其他成本_tb.Text = Val(其他成本_tb.Text) + (銷售明細_dgv("數量", i).Value * 銷售明細_dgv("成本", i).Value)
@@ -1126,38 +1198,51 @@ Public Class 銷售單申請
1126 1198
         管銷費用_tb.Text = Val(物料成本_tb.Text) * 1.06 - Val(物料成本_tb.Text)
1127 1199
         銷售合計_tb.Text = Val(售價小計_tb.Text) + Val(稅金_tb.Text)
1128 1200
 
1201
+        If Val(稅金_tb.Text) = 0 And Val(刷卡稅金_tb.Text) = 0 Then
1202
+            通知_lb.Text = "無稅金"
1203
+        ElseIf Val(稅金_tb.Text) = 0 And Val(刷卡稅金_tb.Text) <> 0 Then
1204
+            通知_lb.Text = "應刷卡稅金小,有刷卡帶入的稅金,所以拆售價以未稅顯示" : 稅金_tb.Text = 刷卡稅金_tb.Text : 售價小計_tb.Text = Val(銷售合計_tb.Text) - Val(稅金_tb.Text)
1205
+        ElseIf Val(稅金_tb.Text) <> 0 And Val(刷卡稅金_tb.Text) <> 0 And Val(稅金_tb.Text) > Val(刷卡稅金_tb.Text) Then
1206
+            通知_lb.Text = "應所拆售價稅金大於刷卡稅金,計算正常,利潤中扣除刷卡傭金"
1207
+        ElseIf Val(稅金_tb.Text) <> 0 And Val(刷卡稅金_tb.Text) <> 0 And Val(稅金_tb.Text) < Val(刷卡稅金_tb.Text) Then
1208
+            通知_lb.Text = "刷卡稅金大於自動計算後的稅金,邏輯有誤,請從新拆售價。"
1209
+        End If
1210
+        '-------003-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1129 1211
         For i As Integer = 0 To 銷售備註_dgv.Rows.Count - 1
1130 1212
             收入小計_tb.Text = Val(收入小計_tb.Text) + 銷售備註_dgv("收入", i).Value
1131 1213
             支出小計_tb.Text = Val(支出小計_tb.Text) + 銷售備註_dgv("支出", i).Value
1132 1214
         Next
1133 1215
         額外收支_tb.Text = Val(收入小計_tb.Text) - Val(支出小計_tb.Text)
1134
-
1216
+        '-------004-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1135 1217
         Dim 金額 As Integer = 0
1136 1218
         For i As Integer = 0 To 收款事項_dgv.Rows.Count - 1
1137
-            If 收款事項_dgv("真項次", i).Value.ToString <> "0" Then
1219
+            If 收款事項_dgv("真項次", i).Value.ToString <> "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
1220
+                金額 = 金額 + 收款事項_dgv("金額", i).Value
1221
+            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString <> "未收餘額" Then
1138 1222
                 金額 = 金額 + 收款事項_dgv("金額", i).Value
1139
-            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" Then
1223
+            ElseIf 收款事項_dgv("真項次", i).Value.ToString = "0" And 收款事項_dgv("內容", i).Value.ToString = "未收餘額" Then
1140 1224
                 收款事項_dgv("金額", i).Value = CInt(Val(銷售合計_tb.Text)) - 金額
1141 1225
             End If
1142 1226
         Next
1143
-
1227
+        '-------005-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1144 1228
         If 送貨地點_cb.Text = "" Or 送貨地點_cb.Text = "自取" Or 最低運費_cb.Text = "" Or 最低售價_cb.Text = "" Then
1145 1229
             司機運費_tb.Text = "0"
1146 1230
         Else
1147 1231
             If (不含1類銷售小記 - Val(其他成本_tb.Text)) <= Val(最低售價_cb.Text) Then
1148 1232
                 司機運費_tb.Text = 最低運費_cb.Text
1149 1233
             ElseIf (不含1類銷售小記 - Val(其他成本_tb.Text)) > Val(最低售價_cb.Text) Then
1150
-                司機運費_tb.Text = (不含1類銷售小記 - Val(其他成本_tb.Text)) / 100 * 3
1234
+                司機運費_tb.Text = (不含1類銷售小記 - Val(稅金_tb.Text) - Val(刷卡傭金_tb.Text) - Val(其他成本_tb.Text)) / 100 * 3
1151 1235
             End If
1152 1236
         End If
1153 1237
         存檔1()
1154
-
1155
-        預估利潤_tb.Text = Val(售價小計_tb.Text) + Val(額外收支_tb.Text) - Val(其他成本_tb.Text) - Val(物料成本_tb.Text) - Val(司機運費_tb.Text) - Val(管銷費用_tb.Text)
1156
-
1238
+        '-------006-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1239
+        預估利潤_tb.Text = Val(售價小計_tb.Text) + Val(額外收支_tb.Text) - Val(其他成本_tb.Text) - Val(物料成本_tb.Text) - Val(司機運費_tb.Text) - Val(管銷費用_tb.Text) - Val(刷卡傭金_tb.Text)
1240
+        '-------007-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1157 1241
         售價小計_tb.Text = Format(Val(售價小計_tb.Text), "#,##0") : 稅金_tb.Text = Format(Val(稅金_tb.Text), "#,##0") : 銷售合計_tb.Text = Format(Val(銷售合計_tb.Text), "#,##0")
1158 1242
         收入小計_tb.Text = Format(Val(收入小計_tb.Text), "#,##0") : 支出小計_tb.Text = Format(Val(支出小計_tb.Text), "#,##0") : 額外收支_tb.Text = Format(Val(額外收支_tb.Text), "#,##0")
1159 1243
         司機運費_tb.Text = Format(Val(司機運費_tb.Text), "#,##0") : 管銷費用_tb.Text = Format(Val(管銷費用_tb.Text), "#,##0") : 預估利潤_tb.Text = Format(Val(預估利潤_tb.Text), "#,##0")
1160
-        物料成本_tb.Text = Format(Val(物料成本_tb.Text), "#,##0") : 其他成本_tb.Text = Format(Val(其他成本_tb.Text), "#,##0")
1244
+        物料成本_tb.Text = Format(Val(物料成本_tb.Text), "#,##0") : 其他成本_tb.Text = Format(Val(其他成本_tb.Text), "#,##0") : 刷卡總和_tb.Text = Format(Val(刷卡總和_tb.Text), "#,##0")
1245
+        刷卡稅金_tb.Text = Format(Val(刷卡稅金_tb.Text), "#,##0") : 刷卡傭金_tb.Text = Format(Val(刷卡傭金_tb.Text), "#,##0")
1161 1246
     End Sub
1162 1247
     Private Sub 司機運費_tb_TextChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles 司機運費_tb.KeyPress
1163 1248
         If e.KeyChar = Chr(13) Then

Loading…
取消
儲存