浏览代码

20210218

修正unit cmparison因客戶交期資料錯誤造成的計算問提。
修正成本利潤表中表頭 PG/MOQ 。
B70340 4 年前
父节点
当前提交
89587980e2

二进制
.vs/TENDEN-MES-SYS/v16/.suo 查看文件


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

@@ -4,7 +4,7 @@
4 4
     Public Target As String : Public Target1 As String : Public Target2 As String : Public FTP帳號 As String : Public FTP密碼 As String : Public 登入人IP As String
5 5
     Public CC(99) As Boolean : Public AA(99) As String : Public 登入判斷 As Boolean
6 6
     '----系統版本-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7
-    Public 版本 As String = "2021012901"
7
+    Public 版本 As String = "2021021801"
8 8
     '----系統用全域變數-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9 9
     Public 匯率 As Double
10 10
 

二进制
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.exe 查看文件


二进制
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.pdb 查看文件


二进制
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.exe 查看文件


二进制
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.pdb 查看文件


二进制
TENDEN-MES-SYS/obj/Debug/天盾系統.vbproj.GenerateResource.cache 查看文件


二进制
TENDEN-MES-SYS/obj/Debug/天盾系統.vbprojAssemblyReference.cache 查看文件


+ 1
- 1
TENDEN-MES-SYS/成本系統管理/列印_訂單價格利潤表.vb 查看文件

@@ -106,7 +106,7 @@ Public Class 列印_訂單價格利潤表
106 106
         xlSheet.Cells(3, 17) = "Commission Tendenza"
107 107
         xlSheet.Cells(3, 18) = "%"
108 108
         xlSheet.Cells(3, 19) = "Basic Price(+)"
109
-        xlSheet.Cells(3, 20) = "Polybag (+)"
109
+        xlSheet.Cells(3, 20) = "PG/MOQ (+)"
110 110
         xlSheet.Cells(3, 21) = "Foot form/ PET form(+)"
111 111
         xlSheet.Cells(3, 22) = "Tooling (+)"
112 112
         xlSheet.Cells(3, 23) = "Rubber Band(+)"

+ 16
- 16
TENDEN-MES-SYS/成本系統管理/訂單價格利潤明細表.Designer.vb 查看文件

@@ -27,7 +27,7 @@ Partial Class 訂單價格利潤明細表
27 27
         Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28 28
         Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29 29
         Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
30
-        Me.DataGridView1 = New System.Windows.Forms.DataGridView()
30
+        Me.利潤表_dgv = New System.Windows.Forms.DataGridView()
31 31
         Me.Button35 = New System.Windows.Forms.Button()
32 32
         Me.Button34 = New System.Windows.Forms.Button()
33 33
         Me.DataGridView2 = New System.Windows.Forms.DataGridView()
@@ -95,32 +95,32 @@ Partial Class 訂單價格利潤明細表
95 95
         Me.資料庫選擇1_bt = New System.Windows.Forms.Button()
96 96
         Me.Label20 = New System.Windows.Forms.Label()
97 97
         Me.GroupBox3 = New System.Windows.Forms.GroupBox()
98
-        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
98
+        CType(Me.利潤表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
99 99
         CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit()
100 100
         Me.GroupBox1.SuspendLayout()
101 101
         Me.GroupBox2.SuspendLayout()
102 102
         Me.GroupBox3.SuspendLayout()
103 103
         Me.SuspendLayout()
104 104
         '
105
-        'DataGridView1
105
+        '利潤表_dgv
106 106
         '
107
-        Me.DataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
107
+        Me.利潤表_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
108 108
         DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control
109 109
         DataGridViewCellStyle1.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
110 110
         DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText
111 111
         DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight
112 112
         DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText
113 113
         DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
114
-        Me.DataGridView1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1
115
-        Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
116
-        Me.DataGridView1.Location = New System.Drawing.Point(114, 164)
117
-        Me.DataGridView1.Name = "DataGridView1"
118
-        Me.DataGridView1.RowHeadersWidth = 5
114
+        Me.利潤表_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1
115
+        Me.利潤表_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
116
+        Me.利潤表_dgv.Location = New System.Drawing.Point(114, 164)
117
+        Me.利潤表_dgv.Name = "利潤表_dgv"
118
+        Me.利潤表_dgv.RowHeadersWidth = 5
119 119
         DataGridViewCellStyle2.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
120
-        Me.DataGridView1.RowsDefaultCellStyle = DataGridViewCellStyle2
121
-        Me.DataGridView1.RowTemplate.Height = 24
122
-        Me.DataGridView1.Size = New System.Drawing.Size(1792, 820)
123
-        Me.DataGridView1.TabIndex = 2
120
+        Me.利潤表_dgv.RowsDefaultCellStyle = DataGridViewCellStyle2
121
+        Me.利潤表_dgv.RowTemplate.Height = 24
122
+        Me.利潤表_dgv.Size = New System.Drawing.Size(1792, 820)
123
+        Me.利潤表_dgv.TabIndex = 2
124 124
         '
125 125
         'Button35
126 126
         '
@@ -800,7 +800,7 @@ Partial Class 訂單價格利潤明細表
800 800
         Me.Controls.Add(Me.TextBox2)
801 801
         Me.Controls.Add(Me.Label1)
802 802
         Me.Controls.Add(Me.DataGridView2)
803
-        Me.Controls.Add(Me.DataGridView1)
803
+        Me.Controls.Add(Me.利潤表_dgv)
804 804
         Me.Controls.Add(Me.Label11)
805 805
         Me.Controls.Add(Me.Label10)
806 806
         Me.Controls.Add(Me.Label9)
@@ -808,7 +808,7 @@ Partial Class 訂單價格利潤明細表
808 808
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
809 809
         Me.Name = "訂單價格利潤明細表"
810 810
         Me.Text = "訂單價格利潤明細表"
811
-        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
811
+        CType(Me.利潤表_dgv, System.ComponentModel.ISupportInitialize).EndInit()
812 812
         CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).EndInit()
813 813
         Me.GroupBox1.ResumeLayout(False)
814 814
         Me.GroupBox1.PerformLayout()
@@ -821,7 +821,7 @@ Partial Class 訂單價格利潤明細表
821 821
 
822 822
     End Sub
823 823
 
824
-    Friend WithEvents DataGridView1 As DataGridView
824
+    Friend WithEvents 利潤表_dgv As DataGridView
825 825
     Friend WithEvents Button35 As Button
826 826
     Friend WithEvents Button34 As Button
827 827
     Friend WithEvents DataGridView2 As DataGridView

+ 178
- 178
TENDEN-MES-SYS/成本系統管理/訂單價格利潤明細表.vb 查看文件

@@ -3,14 +3,14 @@ Public Class 訂單價格利潤明細表
3 3
     ReadOnly ds As New DataSet : ReadOnly ds1 As New DataSet
4 4
     ReadOnly BB(3) As Boolean : Dim WW As String : Public 平均數 As Integer : Public 最終數 As Integer = 0 : Public 資料數 As Integer = 0
5 5
     Private Sub Set_DGV1載入前設定()
6
-        DataGridView1.DataSource = Nothing : ds.Clear()
7
-        DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
8
-        DataGridView1.ColumnHeadersHeight = 25
9
-        DataGridView1.AllowUserToAddRows = False
6
+        利潤表_dgv.DataSource = Nothing : ds.Clear()
7
+        利潤表_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
8
+        利潤表_dgv.ColumnHeadersHeight = 25
9
+        利潤表_dgv.AllowUserToAddRows = False
10 10
         ConnOpen()
11 11
     End Sub
12 12
     Private Sub Set_DGV1載入後設定()
13
-        CmdSet_For_DGV() : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
13
+        CmdSet_For_DGV() : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : 利潤表_dgv.DataSource = ds.Tables(0) : conn.Close()
14 14
     End Sub
15 15
     Private Sub Set_訂單清單()
16 16
         Set_DGV1載入前設定()
@@ -24,7 +24,7 @@ Public Class 訂單價格利潤明細表
24 24
                                " & 訂單資料表(7) & ".Currency, " & 訂單資料表(7) & ".Exchange, " & 訂單資料表(7) & ".FTYPrice, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * 
25 25
                                " & 訂單資料表(7) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * " & 訂單資料表(7) & ".Quantity / 2 AS CommissionDarren, 
26 26
                               (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * " & 訂單資料表(7) & ".Quantity / 2 AS CommissionTendenza, (" & 訂單資料表(1) & ".單價 - 
27
-                               " & 訂單資料表(7) & ".FTYPrice) AS Percentage, " & 訂單資料表(7) & ".BasicPrice, " & 訂單資料表(7) & ".Polybag, " & 訂單資料表(7) & ".FOOTformOrPETform AS FOOTorPET, 
27
+                               " & 訂單資料表(7) & ".FTYPrice) AS Percentage, " & 訂單資料表(7) & ".BasicPrice, " & 訂單資料表(7) & ".Polybag AS [PG/MOQ], " & 訂單資料表(7) & ".FOOTformOrPETform AS FOOTorPET, 
28 28
                                " & 訂單資料表(7) & ".Tooling, " & 訂單資料表(7) & ".RubberBand, " & 訂單資料表(7) & ".JHOOK, " & 訂單資料表(7) & ".WaterResistant, " & 訂單資料表(7) & ".P16VAT, 
29 29
                                " & 訂單資料表(7) & ".EXWsaving, " & 訂單資料表(7) & ".Quantity * " & 訂單資料表(7) & ".Tooling AS CollectedToolng, " & 訂單資料表(7) & ".年份, 
30 30
                                " & 訂單資料表(7) & ".利潤表流水號, " & 訂單資料表(1) & ".訂單數量 - " & 訂單資料表(7) & ".Quantity AS 驗證, STYLELIST.ItemNumber, " & 訂單資料表(7) & ".審核, 
@@ -44,7 +44,7 @@ Public Class 訂單價格利潤明細表
44 44
                                " & 訂單資料表(7) & ".Currency, " & 訂單資料表(7) & ".Exchange, " & 訂單資料表(7) & ".FTYPrice, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * 
45 45
                                " & 訂單資料表(7) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * " & 訂單資料表(7) & ".Quantity / 2 AS CommissionDarren, 
46 46
                               (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * " & 訂單資料表(7) & ".Quantity / 2 AS CommissionTendenza, (" & 訂單資料表(1) & ".單價 - 
47
-                               " & 訂單資料表(7) & ".FTYPrice) AS Percentage, " & 訂單資料表(7) & ".BasicPrice, " & 訂單資料表(7) & ".Polybag, " & 訂單資料表(7) & ".FOOTformOrPETform AS FOOTorPET, 
47
+                               " & 訂單資料表(7) & ".FTYPrice) AS Percentage, " & 訂單資料表(7) & ".BasicPrice, " & 訂單資料表(7) & ".Polybag AS [PG/MOQ], " & 訂單資料表(7) & ".FOOTformOrPETform AS FOOTorPET, 
48 48
                                " & 訂單資料表(7) & ".Tooling, " & 訂單資料表(7) & ".RubberBand, " & 訂單資料表(7) & ".JHOOK, " & 訂單資料表(7) & ".WaterResistant, " & 訂單資料表(7) & ".P16VAT, 
49 49
                                " & 訂單資料表(7) & ".EXWsaving, " & 訂單資料表(7) & ".Quantity * " & 訂單資料表(7) & ".Tooling AS CollectedToolng, " & 訂單資料表(7) & ".年份, 
50 50
                                " & 訂單資料表(7) & ".利潤表流水號, " & 訂單資料表(1) & ".訂單數量 - " & 訂單資料表(7) & ".Quantity AS 驗證, STYLELIST.ItemNumber, " & 訂單資料表(7) & ".審核, 
@@ -67,7 +67,7 @@ Public Class 訂單價格利潤明細表
67 67
                                " & 訂單資料表(7) & ".Currency, " & 訂單資料表(7) & ".Exchange, " & 訂單資料表(7) & ".FTYPrice, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * 
68 68
                                " & 訂單資料表(7) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * " & 訂單資料表(7) & ".Quantity / 2 AS CommissionDarren, 
69 69
                               (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * " & 訂單資料表(7) & ".Quantity / 2 AS CommissionTendenza, (" & 訂單資料表(1) & ".單價 - 
70
-                               " & 訂單資料表(7) & ".FTYPrice) AS Percentage, " & 訂單資料表(7) & ".BasicPrice, " & 訂單資料表(7) & ".Polybag, " & 訂單資料表(7) & ".FOOTformOrPETform AS FOOTorPET, 
70
+                               " & 訂單資料表(7) & ".FTYPrice) AS Percentage, " & 訂單資料表(7) & ".BasicPrice, " & 訂單資料表(7) & ".Polybag AS [PG/MOQ], " & 訂單資料表(7) & ".FOOTformOrPETform AS FOOTorPET, 
71 71
                                " & 訂單資料表(7) & ".Tooling, " & 訂單資料表(7) & ".RubberBand, " & 訂單資料表(7) & ".JHOOK, " & 訂單資料表(7) & ".WaterResistant, " & 訂單資料表(7) & ".P16VAT, 
72 72
                                " & 訂單資料表(7) & ".EXWsaving, " & 訂單資料表(7) & ".Quantity * " & 訂單資料表(7) & ".Tooling AS CollectedToolng, " & 訂單資料表(7) & ".年份, 
73 73
                                " & 訂單資料表(7) & ".利潤表流水號, " & 訂單資料表(1) & ".訂單數量 - " & 訂單資料表(7) & ".Quantity AS 驗證, STYLELIST.ItemNumber, " & 訂單資料表(7) & ".審核, 
@@ -90,7 +90,7 @@ Public Class 訂單價格利潤明細表
90 90
                                " & 訂單資料表(7) & ".Currency, " & 訂單資料表(7) & ".Exchange, " & 訂單資料表(7) & ".FTYPrice, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * 
91 91
                                " & 訂單資料表(7) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * " & 訂單資料表(7) & ".Quantity / 2 AS CommissionDarren, 
92 92
                               (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * " & 訂單資料表(7) & ".Quantity / 2 AS CommissionTendenza, (" & 訂單資料表(1) & ".單價 - 
93
-                               " & 訂單資料表(7) & ".FTYPrice) AS Percentage, " & 訂單資料表(7) & ".BasicPrice, " & 訂單資料表(7) & ".Polybag, " & 訂單資料表(7) & ".FOOTformOrPETform AS FOOTorPET, 
93
+                               " & 訂單資料表(7) & ".FTYPrice) AS Percentage, " & 訂單資料表(7) & ".BasicPrice, " & 訂單資料表(7) & ".Polybag AS [PG/MOQ], " & 訂單資料表(7) & ".FOOTformOrPETform AS FOOTorPET, 
94 94
                                " & 訂單資料表(7) & ".Tooling, " & 訂單資料表(7) & ".RubberBand, " & 訂單資料表(7) & ".JHOOK, " & 訂單資料表(7) & ".WaterResistant, " & 訂單資料表(7) & ".P16VAT, 
95 95
                                " & 訂單資料表(7) & ".EXWsaving, " & 訂單資料表(7) & ".Quantity * " & 訂單資料表(7) & ".Tooling AS CollectedToolng, " & 訂單資料表(7) & ".年份, 
96 96
                                " & 訂單資料表(7) & ".利潤表流水號, " & 訂單資料表(1) & ".訂單數量 - " & 訂單資料表(7) & ".Quantity AS 驗證, STYLELIST.ItemNumber, " & 訂單資料表(7) & ".審核, 
@@ -101,7 +101,7 @@ Public Class 訂單價格利潤明細表
101 101
             End If
102 102
             Set_DGV1載入後設定()
103 103
         End If
104
-        TextBox18.Text = Format(DataGridView1.Rows.Count, "#,##0")
104
+        TextBox18.Text = Format(利潤表_dgv.Rows.Count, "#,##0")
105 105
     End Sub
106 106
     Private Sub Set_編輯清單()
107 107
         Set_DGV1載入前設定()
@@ -111,7 +111,7 @@ Public Class 訂單價格利潤明細表
111 111
                        " & 訂單資料表(7) & ".Currency, " & 訂單資料表(7) & ".Exchange, " & 訂單資料表(7) & ".FTYPrice, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * 
112 112
                        " & 訂單資料表(7) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * " & 訂單資料表(7) & ".Quantity / 2 AS CommissionDarren, 
113 113
                       (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(7) & ".FTYPrice) * " & 訂單資料表(7) & ".Quantity / 2 AS CommissionTendenza, " & 訂單資料表(1) & ".單價 - 
114
-                       " & 訂單資料表(7) & ".FTYPrice AS Percentage, " & 訂單資料表(7) & ".BasicPrice, " & 訂單資料表(7) & ".Polybag, " & 訂單資料表(7) & ".FOOTformOrPETform AS FOOTorPET, 
114
+                       " & 訂單資料表(7) & ".FTYPrice AS Percentage, " & 訂單資料表(7) & ".BasicPrice, " & 訂單資料表(7) & ".Polybag AS [PG/MOQ], " & 訂單資料表(7) & ".FOOTformOrPETform AS FOOTorPET, 
115 115
                        " & 訂單資料表(7) & ".Tooling, " & 訂單資料表(7) & ".RubberBand, " & 訂單資料表(7) & ".JHOOK, " & 訂單資料表(7) & ".WaterResistant, " & 訂單資料表(7) & ".P16VAT, 
116 116
                        " & 訂單資料表(7) & ".EXWsaving, " & 訂單資料表(7) & ".Quantity * " & 訂單資料表(7) & ".Tooling AS CollectedToolng, " & 訂單資料表(7) & ".年份, 
117 117
                        訂單價格利潤表暫存檔.利潤表流水號, " & 訂單資料表(1) & ".訂單數量 - " & 訂單資料表(7) & ".Quantity AS 驗證, STYLELIST.ItemNumber, " & 訂單資料表(7) & ".審核, 
@@ -132,7 +132,7 @@ Public Class 訂單價格利潤明細表
132 132
         CmdSet_For_dr()
133 133
         If dr.Read() Then : NUM2 = Strings.Right(dr("利潤表流水號").ToString, 8) : End If
134 134
         conn.Close()
135
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
135
+        For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
136 136
             NUM2 += 1
137 137
             If NUM2 < 10 Then : WW = "PR" & "0000000" & NUM2
138 138
             ElseIf NUM2 > 9 And NUM2 < 100 Then : WW = "PR" & "000000" & NUM2
@@ -145,7 +145,7 @@ Public Class 訂單價格利潤明細表
145 145
             End If
146 146
             ConnOpen()
147 147
             SQL1 = "INSERT INTO 訂單價格利潤表暫存檔 (資料流水號, 利潤表流水號, 訂單流水號) " &
148
-                   "VALUES ('" & DataGridView1.Rows(i).Cells("資料流水號").Value & "','" & WW & "', '" & DataGridView1.Rows(i).Cells("訂單流水號").Value & "')"
148
+                   "VALUES ('" & 利潤表_dgv.Rows(i).Cells("資料流水號").Value & "','" & WW & "', '" & 利潤表_dgv.Rows(i).Cells("訂單流水號").Value & "')"
149 149
             CmdSet_For_dr() : conn.Close()
150 150
         Next i
151 151
     End Sub
@@ -167,162 +167,162 @@ Public Class 訂單價格利潤明細表
167 167
         CmdSet_For_DGV() : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
168 168
     End Sub
169 169
     Private Sub Set_grid()
170
-        DataGridView1.Columns(0).FillWeight = 85 : DataGridView1.Columns(1).Visible = False
171
-        DataGridView1.Columns(2).FillWeight = 55 : DataGridView1.Columns(3).FillWeight = 110 : DataGridView1.Columns(4).FillWeight = 90
172
-        DataGridView1.Columns(5).FillWeight = 70 : DataGridView1.Columns(6).FillWeight = 45 : DataGridView1.Columns(7).FillWeight = 45
173
-        DataGridView1.Columns(7).DefaultCellStyle.Format = "#,##0"
174
-        DataGridView1.Columns(7).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
175
-        DataGridView1.Columns(8).FillWeight = 75 : DataGridView1.Columns(9).FillWeight = 45 : DataGridView1.Columns(10).FillWeight = 75
170
+        利潤表_dgv.Columns(0).FillWeight = 85 : 利潤表_dgv.Columns(1).Visible = False
171
+        利潤表_dgv.Columns(2).FillWeight = 55 : 利潤表_dgv.Columns(3).FillWeight = 110 : 利潤表_dgv.Columns(4).FillWeight = 90
172
+        利潤表_dgv.Columns(5).FillWeight = 70 : 利潤表_dgv.Columns(6).FillWeight = 45 : 利潤表_dgv.Columns(7).FillWeight = 45
173
+        利潤表_dgv.Columns(7).DefaultCellStyle.Format = "#,##0"
174
+        利潤表_dgv.Columns(7).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
175
+        利潤表_dgv.Columns(8).FillWeight = 75 : 利潤表_dgv.Columns(9).FillWeight = 45 : 利潤表_dgv.Columns(10).FillWeight = 75
176 176
 
177
-        DataGridView1.Columns(9).DefaultCellStyle.Format = "#,##0.00"
178
-        DataGridView1.Columns(10).DefaultCellStyle.Format = "#,##0.00"
179
-        DataGridView1.Columns(9).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(10).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
177
+        利潤表_dgv.Columns(9).DefaultCellStyle.Format = "#,##0.00"
178
+        利潤表_dgv.Columns(10).DefaultCellStyle.Format = "#,##0.00"
179
+        利潤表_dgv.Columns(9).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(10).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
180 180
 
181
-        DataGridView1.Columns(11).FillWeight = 80 : DataGridView1.Columns(12).FillWeight = 40 : DataGridView1.Columns(13).FillWeight = 65
182
-        DataGridView1.Columns(12).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(7).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
183
-        DataGridView1.Columns(9).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(10).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
181
+        利潤表_dgv.Columns(11).FillWeight = 80 : 利潤表_dgv.Columns(12).FillWeight = 40 : 利潤表_dgv.Columns(13).FillWeight = 65
182
+        利潤表_dgv.Columns(12).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : 利潤表_dgv.Columns(7).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
183
+        利潤表_dgv.Columns(9).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(10).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
184 184
 
185
-        DataGridView1.Columns(14).FillWeight = 65 : DataGridView1.Columns(15).FillWeight = 65 : DataGridView1.Columns(16).FillWeight = 70
186
-        DataGridView1.Columns(14).DefaultCellStyle.Format = "#,##0"
187
-        DataGridView1.Columns(16).DefaultCellStyle.Format = "#,##0.0000"
188
-        DataGridView1.Columns(14).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(15).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
189
-        DataGridView1.Columns(16).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
190
-        DataGridView1.Columns(14).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(15).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
191
-        DataGridView1.Columns(16).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
185
+        利潤表_dgv.Columns(14).FillWeight = 65 : 利潤表_dgv.Columns(15).FillWeight = 65 : 利潤表_dgv.Columns(16).FillWeight = 70
186
+        利潤表_dgv.Columns(14).DefaultCellStyle.Format = "#,##0"
187
+        利潤表_dgv.Columns(16).DefaultCellStyle.Format = "#,##0.0000"
188
+        利潤表_dgv.Columns(14).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(15).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
189
+        利潤表_dgv.Columns(16).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
190
+        利潤表_dgv.Columns(14).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(15).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
191
+        利潤表_dgv.Columns(16).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
192 192
 
193
-        DataGridView1.Columns(17).FillWeight = 115 : DataGridView1.Columns(18).FillWeight = 150
194
-        DataGridView1.Columns(19).FillWeight = 179 : DataGridView1.Columns(20).FillWeight = 179
195
-        DataGridView1.Columns(21).FillWeight = 120
196
-        DataGridView1.Columns(17).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(18).DefaultCellStyle.Format = "#,##0.00"
197
-        DataGridView1.Columns(19).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(20).DefaultCellStyle.Format = "#,##0.00"
198
-        DataGridView1.Columns(21).DefaultCellStyle.Format = "#,##0.00%"
199
-        DataGridView1.Columns(17).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(18).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
200
-        DataGridView1.Columns(19).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(20).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
201
-        DataGridView1.Columns(21).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
202
-        DataGridView1.Columns(17).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(18).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
203
-        DataGridView1.Columns(19).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(20).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
204
-        DataGridView1.Columns(21).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
193
+        利潤表_dgv.Columns(17).FillWeight = 115 : 利潤表_dgv.Columns(18).FillWeight = 150
194
+        利潤表_dgv.Columns(19).FillWeight = 179 : 利潤表_dgv.Columns(20).FillWeight = 179
195
+        利潤表_dgv.Columns(21).FillWeight = 120
196
+        利潤表_dgv.Columns(17).DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns(18).DefaultCellStyle.Format = "#,##0.00"
197
+        利潤表_dgv.Columns(19).DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns(20).DefaultCellStyle.Format = "#,##0.00"
198
+        利潤表_dgv.Columns(21).DefaultCellStyle.Format = "#,##0.00%"
199
+        利潤表_dgv.Columns(17).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(18).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
200
+        利潤表_dgv.Columns(19).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(20).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
201
+        利潤表_dgv.Columns(21).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
202
+        利潤表_dgv.Columns(17).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(18).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
203
+        利潤表_dgv.Columns(19).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(20).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
204
+        利潤表_dgv.Columns(21).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
205 205
 
206
-        DataGridView1.Columns(22).FillWeight = 70 : DataGridView1.Columns(23).FillWeight = 60 : DataGridView1.Columns(24).FillWeight = 78 : DataGridView1.Columns(25).FillWeight = 58
207
-        DataGridView1.Columns(26).FillWeight = 83 : DataGridView1.Columns(27).FillWeight = 58 : DataGridView1.Columns(28).FillWeight = 95 : DataGridView1.Columns(29).FillWeight = 60
208
-        DataGridView1.Columns(30).FillWeight = 75 : DataGridView1.Columns(31).FillWeight = 110
209
-        DataGridView1.Columns(22).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(23).DefaultCellStyle.Format = "#,##0.00"
210
-        DataGridView1.Columns(24).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(25).DefaultCellStyle.Format = "#,##0.00"
211
-        DataGridView1.Columns(26).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(27).DefaultCellStyle.Format = "#,##0.00"
212
-        DataGridView1.Columns(28).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(29).DefaultCellStyle.Format = "#,##0.00"
213
-        DataGridView1.Columns(30).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(31).DefaultCellStyle.Format = "#,##0.00"
214
-        DataGridView1.Columns(22).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(23).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
215
-        DataGridView1.Columns(24).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(25).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
216
-        DataGridView1.Columns(26).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(27).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
217
-        DataGridView1.Columns(28).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(29).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
218
-        DataGridView1.Columns(30).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(31).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
219
-        DataGridView1.Columns(32).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
206
+        利潤表_dgv.Columns(22).FillWeight = 70 : 利潤表_dgv.Columns(23).FillWeight = 60 : 利潤表_dgv.Columns(24).FillWeight = 78 : 利潤表_dgv.Columns(25).FillWeight = 58
207
+        利潤表_dgv.Columns(26).FillWeight = 83 : 利潤表_dgv.Columns(27).FillWeight = 58 : 利潤表_dgv.Columns(28).FillWeight = 95 : 利潤表_dgv.Columns(29).FillWeight = 60
208
+        利潤表_dgv.Columns(30).FillWeight = 75 : 利潤表_dgv.Columns(31).FillWeight = 110
209
+        利潤表_dgv.Columns(22).DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns(23).DefaultCellStyle.Format = "#,##0.00"
210
+        利潤表_dgv.Columns(24).DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns(25).DefaultCellStyle.Format = "#,##0.00"
211
+        利潤表_dgv.Columns(26).DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns(27).DefaultCellStyle.Format = "#,##0.00"
212
+        利潤表_dgv.Columns(28).DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns(29).DefaultCellStyle.Format = "#,##0.00"
213
+        利潤表_dgv.Columns(30).DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns(31).DefaultCellStyle.Format = "#,##0.00"
214
+        利潤表_dgv.Columns(22).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(23).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
215
+        利潤表_dgv.Columns(24).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(25).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
216
+        利潤表_dgv.Columns(26).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(27).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
217
+        利潤表_dgv.Columns(28).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(29).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
218
+        利潤表_dgv.Columns(30).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 利潤表_dgv.Columns(31).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
219
+        利潤表_dgv.Columns(32).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
220 220
 
221
-        DataGridView1.Columns(33).Visible = False
221
+        利潤表_dgv.Columns(33).Visible = False
222 222
         If BB(0) = True And BB(1) = False And BB(2) = False And BB(3) = False Then
223
-            DataGridView1.Columns(17).Visible = True : DataGridView1.Columns(18).Visible = True : DataGridView1.Columns(19).Visible = True : DataGridView1.Columns(20).Visible = True
224
-            DataGridView1.Columns(21).Visible = True
223
+            利潤表_dgv.Columns(17).Visible = True : 利潤表_dgv.Columns(18).Visible = True : 利潤表_dgv.Columns(19).Visible = True : 利潤表_dgv.Columns(20).Visible = True
224
+            利潤表_dgv.Columns(21).Visible = True
225 225
 
226
-            DataGridView1.Columns(22).Visible = False : DataGridView1.Columns(23).Visible = False : DataGridView1.Columns(24).Visible = False
227
-            DataGridView1.Columns(25).Visible = False : DataGridView1.Columns(26).Visible = False : DataGridView1.Columns(27).Visible = False : DataGridView1.Columns(28).Visible = False
228
-            DataGridView1.Columns(29).Visible = False : DataGridView1.Columns(30).Visible = False : DataGridView1.Columns(31).Visible = False : DataGridView1.Columns(34).Visible = False
229
-            DataGridView1.Columns(35).Visible = False : DataGridView1.Columns(36).Visible = False : DataGridView1.Columns(37).Visible = False
226
+            利潤表_dgv.Columns(22).Visible = False : 利潤表_dgv.Columns(23).Visible = False : 利潤表_dgv.Columns(24).Visible = False
227
+            利潤表_dgv.Columns(25).Visible = False : 利潤表_dgv.Columns(26).Visible = False : 利潤表_dgv.Columns(27).Visible = False : 利潤表_dgv.Columns(28).Visible = False
228
+            利潤表_dgv.Columns(29).Visible = False : 利潤表_dgv.Columns(30).Visible = False : 利潤表_dgv.Columns(31).Visible = False : 利潤表_dgv.Columns(34).Visible = False
229
+            利潤表_dgv.Columns(35).Visible = False : 利潤表_dgv.Columns(36).Visible = False : 利潤表_dgv.Columns(37).Visible = False
230 230
         ElseIf BB(0) = False And BB(1) = True And BB(2) = False And BB(3) = False Then
231
-            DataGridView1.Columns(17).Visible = False : DataGridView1.Columns(18).Visible = False : DataGridView1.Columns(19).Visible = False : DataGridView1.Columns(20).Visible = False
232
-            DataGridView1.Columns(21).Visible = False
231
+            利潤表_dgv.Columns(17).Visible = False : 利潤表_dgv.Columns(18).Visible = False : 利潤表_dgv.Columns(19).Visible = False : 利潤表_dgv.Columns(20).Visible = False
232
+            利潤表_dgv.Columns(21).Visible = False
233 233
 
234
-            DataGridView1.Columns(22).Visible = True : DataGridView1.Columns(23).Visible = True : DataGridView1.Columns(24).Visible = True
235
-            DataGridView1.Columns(25).Visible = True : DataGridView1.Columns(26).Visible = True : DataGridView1.Columns(27).Visible = True : DataGridView1.Columns(28).Visible = True
236
-            DataGridView1.Columns(29).Visible = True : DataGridView1.Columns(30).Visible = True : DataGridView1.Columns(31).Visible = True : DataGridView1.Columns(34).Visible = False
237
-            DataGridView1.Columns(35).Visible = False : DataGridView1.Columns(36).Visible = False : DataGridView1.Columns(37).Visible = False
234
+            利潤表_dgv.Columns(22).Visible = True : 利潤表_dgv.Columns(23).Visible = True : 利潤表_dgv.Columns(24).Visible = True
235
+            利潤表_dgv.Columns(25).Visible = True : 利潤表_dgv.Columns(26).Visible = True : 利潤表_dgv.Columns(27).Visible = True : 利潤表_dgv.Columns(28).Visible = True
236
+            利潤表_dgv.Columns(29).Visible = True : 利潤表_dgv.Columns(30).Visible = True : 利潤表_dgv.Columns(31).Visible = True : 利潤表_dgv.Columns(34).Visible = False
237
+            利潤表_dgv.Columns(35).Visible = False : 利潤表_dgv.Columns(36).Visible = False : 利潤表_dgv.Columns(37).Visible = False
238 238
         ElseIf BB(0) = False And BB(1) = False And BB(2) = True And BB(3) = False Then
239
-            DataGridView1.Columns(31).Visible = True : DataGridView1.Columns(18).Visible = True : DataGridView1.Columns(19).Visible = True : DataGridView1.Columns(20).Visible = True
240
-            DataGridView1.Columns(21).Visible = True
239
+            利潤表_dgv.Columns(31).Visible = True : 利潤表_dgv.Columns(18).Visible = True : 利潤表_dgv.Columns(19).Visible = True : 利潤表_dgv.Columns(20).Visible = True
240
+            利潤表_dgv.Columns(21).Visible = True
241 241
 
242
-            DataGridView1.Columns(22).Visible = False : DataGridView1.Columns(23).Visible = False : DataGridView1.Columns(24).Visible = False
243
-            DataGridView1.Columns(25).Visible = False : DataGridView1.Columns(26).Visible = False : DataGridView1.Columns(27).Visible = False : DataGridView1.Columns(28).Visible = False
244
-            DataGridView1.Columns(29).Visible = False : DataGridView1.Columns(30).Visible = False : DataGridView1.Columns(17).Visible = False : DataGridView1.Columns(34).Visible = False
245
-            DataGridView1.Columns(35).Visible = False : DataGridView1.Columns(36).Visible = False : DataGridView1.Columns(37).Visible = False
242
+            利潤表_dgv.Columns(22).Visible = False : 利潤表_dgv.Columns(23).Visible = False : 利潤表_dgv.Columns(24).Visible = False
243
+            利潤表_dgv.Columns(25).Visible = False : 利潤表_dgv.Columns(26).Visible = False : 利潤表_dgv.Columns(27).Visible = False : 利潤表_dgv.Columns(28).Visible = False
244
+            利潤表_dgv.Columns(29).Visible = False : 利潤表_dgv.Columns(30).Visible = False : 利潤表_dgv.Columns(17).Visible = False : 利潤表_dgv.Columns(34).Visible = False
245
+            利潤表_dgv.Columns(35).Visible = False : 利潤表_dgv.Columns(36).Visible = False : 利潤表_dgv.Columns(37).Visible = False
246 246
         ElseIf BB(0) = False And BB(1) = False And BB(2) = False And BB(3) = True Then
247
-            DataGridView1.Columns(31).Visible = False : DataGridView1.Columns(18).Visible = False : DataGridView1.Columns(19).Visible = False : DataGridView1.Columns(20).Visible = False
248
-            DataGridView1.Columns(21).Visible = False
247
+            利潤表_dgv.Columns(31).Visible = False : 利潤表_dgv.Columns(18).Visible = False : 利潤表_dgv.Columns(19).Visible = False : 利潤表_dgv.Columns(20).Visible = False
248
+            利潤表_dgv.Columns(21).Visible = False
249 249
 
250
-            DataGridView1.Columns(22).Visible = False : DataGridView1.Columns(23).Visible = False : DataGridView1.Columns(24).Visible = False
251
-            DataGridView1.Columns(25).Visible = False : DataGridView1.Columns(26).Visible = False : DataGridView1.Columns(27).Visible = False : DataGridView1.Columns(28).Visible = False
252
-            DataGridView1.Columns(29).Visible = False : DataGridView1.Columns(30).Visible = False : DataGridView1.Columns(17).Visible = False
250
+            利潤表_dgv.Columns(22).Visible = False : 利潤表_dgv.Columns(23).Visible = False : 利潤表_dgv.Columns(24).Visible = False
251
+            利潤表_dgv.Columns(25).Visible = False : 利潤表_dgv.Columns(26).Visible = False : 利潤表_dgv.Columns(27).Visible = False : 利潤表_dgv.Columns(28).Visible = False
252
+            利潤表_dgv.Columns(29).Visible = False : 利潤表_dgv.Columns(30).Visible = False : 利潤表_dgv.Columns(17).Visible = False
253 253
 
254
-            DataGridView1.Columns(34).Visible = True : DataGridView1.Columns(35).Visible = True : DataGridView1.Columns(36).Visible = True : DataGridView1.Columns(37).Visible = True
254
+            利潤表_dgv.Columns(34).Visible = True : 利潤表_dgv.Columns(35).Visible = True : 利潤表_dgv.Columns(36).Visible = True : 利潤表_dgv.Columns(37).Visible = True
255 255
         End If
256
-        DataGridView1.Columns(32).FillWeight = 50 : DataGridView1.Columns(34).FillWeight = 50 : DataGridView1.Columns(36).FillWeight = 50
257
-        DataGridView1.Columns(14).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView1.Columns(17).DefaultCellStyle.BackColor = Color.MistyRose
258
-        DataGridView1.Columns(22).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView1.Columns(23).DefaultCellStyle.BackColor = Color.MistyRose
259
-        DataGridView1.Columns(24).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView1.Columns(25).DefaultCellStyle.BackColor = Color.MistyRose
260
-        DataGridView1.Columns(26).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView1.Columns(27).DefaultCellStyle.BackColor = Color.MistyRose
261
-        DataGridView1.Columns(28).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView1.Columns(29).DefaultCellStyle.BackColor = Color.MistyRose
262
-        DataGridView1.Columns(30).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView1.Columns(16).DefaultCellStyle.BackColor = Color.MistyRose
263
-        DataGridView1.EditMode = DataGridViewEditMode.EditOnEnter
256
+        利潤表_dgv.Columns(32).FillWeight = 50 : 利潤表_dgv.Columns(34).FillWeight = 50 : 利潤表_dgv.Columns(36).FillWeight = 50
257
+        利潤表_dgv.Columns(14).DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns(17).DefaultCellStyle.BackColor = Color.MistyRose
258
+        利潤表_dgv.Columns(22).DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns(23).DefaultCellStyle.BackColor = Color.MistyRose
259
+        利潤表_dgv.Columns(24).DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns(25).DefaultCellStyle.BackColor = Color.MistyRose
260
+        利潤表_dgv.Columns(26).DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns(27).DefaultCellStyle.BackColor = Color.MistyRose
261
+        利潤表_dgv.Columns(28).DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns(29).DefaultCellStyle.BackColor = Color.MistyRose
262
+        利潤表_dgv.Columns(30).DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns(16).DefaultCellStyle.BackColor = Color.MistyRose
263
+        利潤表_dgv.EditMode = DataGridViewEditMode.EditOnEnter
264 264
 
265
-        DataGridView1.Columns(9).DefaultCellStyle.ForeColor = Color.Red : DataGridView1.Columns(10).DefaultCellStyle.ForeColor = Color.Red
266
-        DataGridView1.Columns(18).DefaultCellStyle.ForeColor = Color.Red : DataGridView1.Columns(19).DefaultCellStyle.ForeColor = Color.Red
267
-        DataGridView1.Columns(20).DefaultCellStyle.ForeColor = Color.Red : DataGridView1.Columns(21).DefaultCellStyle.ForeColor = Color.Red
268
-        DataGridView1.Columns(31).DefaultCellStyle.ForeColor = Color.Red : DataGridView1.Columns(32).DefaultCellStyle.ForeColor = Color.Red
265
+        利潤表_dgv.Columns(9).DefaultCellStyle.ForeColor = Color.Red : 利潤表_dgv.Columns(10).DefaultCellStyle.ForeColor = Color.Red
266
+        利潤表_dgv.Columns(18).DefaultCellStyle.ForeColor = Color.Red : 利潤表_dgv.Columns(19).DefaultCellStyle.ForeColor = Color.Red
267
+        利潤表_dgv.Columns(20).DefaultCellStyle.ForeColor = Color.Red : 利潤表_dgv.Columns(21).DefaultCellStyle.ForeColor = Color.Red
268
+        利潤表_dgv.Columns(31).DefaultCellStyle.ForeColor = Color.Red : 利潤表_dgv.Columns(32).DefaultCellStyle.ForeColor = Color.Red
269 269
     End Sub
270 270
     Private Sub Set_grid1()
271 271
         DataGridView2.Columns(0).FillWeight = 90
272 272
     End Sub
273 273
     Private Sub Set_自動彙總1()
274 274
         Dim 金額加總(9) As Double : Dim EU(11) As Double
275
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
276
-            If DataGridView1(22, i).Value.ToString = "" Then : EU(0) = 0 : Else : EU(0) = Double.Parse(DataGridView1(22, i).Value.ToString) : End If
277
-            If DataGridView1(23, i).Value.ToString = "" Then : EU(1) = 0 : Else : EU(1) = Double.Parse(DataGridView1(23, i).Value.ToString) : End If
278
-            If DataGridView1(24, i).Value.ToString = "" Then : EU(2) = 0 : Else : EU(2) = Double.Parse(DataGridView1(24, i).Value.ToString) : End If
279
-            If DataGridView1(25, i).Value.ToString = "" Then : EU(3) = 0 : Else : EU(3) = Double.Parse(DataGridView1(25, i).Value.ToString) : End If
280
-            If DataGridView1(26, i).Value.ToString = "" Then : EU(4) = 0 : Else : EU(4) = Double.Parse(DataGridView1(26, i).Value.ToString) : End If
281
-            If DataGridView1(27, i).Value.ToString = "" Then : EU(5) = 0 : Else : EU(5) = Double.Parse(DataGridView1(27, i).Value.ToString) : End If
282
-            If DataGridView1(28, i).Value.ToString = "" Then : EU(6) = 0 : Else : EU(6) = Double.Parse(DataGridView1(28, i).Value.ToString) : End If
283
-            If DataGridView1(29, i).Value.ToString = "" Then : EU(7) = 0 : Else : EU(7) = Double.Parse(DataGridView1(29, i).Value.ToString) : End If
284
-            If DataGridView1(30, i).Value.ToString = "" Then : EU(8) = 0 : Else : EU(8) = Double.Parse(DataGridView1(30, i).Value.ToString) : End If
285
-            If DataGridView1(14, i).Value.ToString = "" Then : EU(9) = 0 : Else : EU(9) = Double.Parse(DataGridView1(14, i).Value.ToString) : End If
286
-            If DataGridView1(17, i).Value.ToString = "" Then : EU(10) = 0 : Else : EU(10) = Double.Parse(DataGridView1(17, i).Value.ToString) : End If
287
-            If DataGridView1(16, i).Value.ToString = "" Then : EU(11) = 1 : Else : EU(11) = Double.Parse(DataGridView1(16, i).Value.ToString) : End If
288
-            DataGridView1.Rows(i).Cells(9).Value = EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)
289
-            DataGridView1.Rows(i).Cells(31).Value = EU(9) * EU(3)
290
-            DataGridView1.Rows(i).Cells(18).Value = ((EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) - EU(10)) * EU(9)
291
-            DataGridView1.Rows(i).Cells(19).Value = ((EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) - EU(10)) * EU(9) / 2
292
-            DataGridView1.Rows(i).Cells(20).Value = ((EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) - EU(10)) * EU(9) / 2
275
+        For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
276
+            If 利潤表_dgv(22, i).Value.ToString = "" Then : EU(0) = 0 : Else : EU(0) = Double.Parse(利潤表_dgv(22, i).Value.ToString) : End If
277
+            If 利潤表_dgv(23, i).Value.ToString = "" Then : EU(1) = 0 : Else : EU(1) = Double.Parse(利潤表_dgv(23, i).Value.ToString) : End If
278
+            If 利潤表_dgv(24, i).Value.ToString = "" Then : EU(2) = 0 : Else : EU(2) = Double.Parse(利潤表_dgv(24, i).Value.ToString) : End If
279
+            If 利潤表_dgv(25, i).Value.ToString = "" Then : EU(3) = 0 : Else : EU(3) = Double.Parse(利潤表_dgv(25, i).Value.ToString) : End If
280
+            If 利潤表_dgv(26, i).Value.ToString = "" Then : EU(4) = 0 : Else : EU(4) = Double.Parse(利潤表_dgv(26, i).Value.ToString) : End If
281
+            If 利潤表_dgv(27, i).Value.ToString = "" Then : EU(5) = 0 : Else : EU(5) = Double.Parse(利潤表_dgv(27, i).Value.ToString) : End If
282
+            If 利潤表_dgv(28, i).Value.ToString = "" Then : EU(6) = 0 : Else : EU(6) = Double.Parse(利潤表_dgv(28, i).Value.ToString) : End If
283
+            If 利潤表_dgv(29, i).Value.ToString = "" Then : EU(7) = 0 : Else : EU(7) = Double.Parse(利潤表_dgv(29, i).Value.ToString) : End If
284
+            If 利潤表_dgv(30, i).Value.ToString = "" Then : EU(8) = 0 : Else : EU(8) = Double.Parse(利潤表_dgv(30, i).Value.ToString) : End If
285
+            If 利潤表_dgv(14, i).Value.ToString = "" Then : EU(9) = 0 : Else : EU(9) = Double.Parse(利潤表_dgv(14, i).Value.ToString) : End If
286
+            If 利潤表_dgv(17, i).Value.ToString = "" Then : EU(10) = 0 : Else : EU(10) = Double.Parse(利潤表_dgv(17, i).Value.ToString) : End If
287
+            If 利潤表_dgv(16, i).Value.ToString = "" Then : EU(11) = 1 : Else : EU(11) = Double.Parse(利潤表_dgv(16, i).Value.ToString) : End If
288
+            利潤表_dgv.Rows(i).Cells(9).Value = EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)
289
+            利潤表_dgv.Rows(i).Cells(31).Value = EU(9) * EU(3)
290
+            利潤表_dgv.Rows(i).Cells(18).Value = ((EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) - EU(10)) * EU(9)
291
+            利潤表_dgv.Rows(i).Cells(19).Value = ((EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) - EU(10)) * EU(9) / 2
292
+            利潤表_dgv.Rows(i).Cells(20).Value = ((EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) - EU(10)) * EU(9) / 2
293 293
             If (EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) - EU(8)) = 0 Or EU(9) = 0 Then
294
-                DataGridView1.Rows(i).Cells(21).Value = 0
294
+                利潤表_dgv.Rows(i).Cells(21).Value = 0
295 295
             Else
296
-                DataGridView1.Rows(i).Cells(21).Value = ((EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) * EU(9) - EU(10) * EU(9)) /
296
+                利潤表_dgv.Rows(i).Cells(21).Value = ((EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) * EU(9) - EU(10) * EU(9)) /
297 297
                                                         ((EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) * EU(9))
298 298
             End If
299
-            DataGridView1.Rows(i).Cells(10).Value = (EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) * EU(9)
300
-            If DataGridView1.RowCount = 0 Then : 金額加總(0) = "0.00" : Else : 金額加總(0) += DataGridView1.Rows(i).Cells("總金額").Value : End If
301
-            If DataGridView1.RowCount = 0 Then
299
+            利潤表_dgv.Rows(i).Cells(10).Value = (EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)) * EU(9)
300
+            If 利潤表_dgv.RowCount = 0 Then : 金額加總(0) = "0.00" : Else : 金額加總(0) += 利潤表_dgv.Rows(i).Cells("總金額").Value : End If
301
+            If 利潤表_dgv.RowCount = 0 Then
302 302
                 金額加總(1) = "0.00"
303 303
             Else
304
-                TextBox6.Text = DataGridView1(18, i).Value.ToString
305
-                If TextBox6.Text = "" Then : 金額加總(1) += 0 : Else : 金額加總(1) += DataGridView1.Rows(i).Cells("CommissionTTL").Value : End If
304
+                TextBox6.Text = 利潤表_dgv(18, i).Value.ToString
305
+                If TextBox6.Text = "" Then : 金額加總(1) += 0 : Else : 金額加總(1) += 利潤表_dgv.Rows(i).Cells("CommissionTTL").Value : End If
306 306
             End If
307
-            If DataGridView1.RowCount = 0 Then
307
+            If 利潤表_dgv.RowCount = 0 Then
308 308
                 金額加總(2) = "0.00"
309 309
             Else
310
-                TextBox7.Text = DataGridView1(19, i).Value.ToString
311
-                If TextBox7.Text = "" Then : 金額加總(2) += 0 : Else : 金額加總(2) += DataGridView1.Rows(i).Cells("CommissionDarren").Value : End If
310
+                TextBox7.Text = 利潤表_dgv(19, i).Value.ToString
311
+                If TextBox7.Text = "" Then : 金額加總(2) += 0 : Else : 金額加總(2) += 利潤表_dgv.Rows(i).Cells("CommissionDarren").Value : End If
312 312
             End If
313
-            If DataGridView1.RowCount = 0 Then
313
+            If 利潤表_dgv.RowCount = 0 Then
314 314
                 金額加總(3) = "0.00"
315 315
             Else
316
-                TextBox8.Text = DataGridView1(20, i).Value.ToString
317
-                If TextBox8.Text = "" Then : 金額加總(3) += 0 : Else : 金額加總(3) += DataGridView1.Rows(i).Cells("CommissionTendenza").Value : End If
316
+                TextBox8.Text = 利潤表_dgv(20, i).Value.ToString
317
+                If TextBox8.Text = "" Then : 金額加總(3) += 0 : Else : 金額加總(3) += 利潤表_dgv.Rows(i).Cells("CommissionTendenza").Value : End If
318 318
             End If
319
-            If DataGridView1.RowCount = 0 Then
319
+            If 利潤表_dgv.RowCount = 0 Then
320 320
                 金額加總(4) = "0.00"
321 321
             Else
322
-                TextBox10.Text = DataGridView1(20, i).Value.ToString
323
-                If TextBox10.Text = "" Then : 金額加總(4) += 0 : Else : 金額加總(4) += DataGridView1.Rows(i).Cells("CollectedToolng").Value : End If
322
+                TextBox10.Text = 利潤表_dgv(20, i).Value.ToString
323
+                If TextBox10.Text = "" Then : 金額加總(4) += 0 : Else : 金額加總(4) += 利潤表_dgv.Rows(i).Cells("CollectedToolng").Value : End If
324 324
             End If
325
-            DataGridView1.Rows(i).Cells(32).Value = Strings.Left(DataGridView1(8, i).Value.ToString, 4)
325
+            利潤表_dgv.Rows(i).Cells(32).Value = Strings.Left(利潤表_dgv(8, i).Value.ToString, 4)
326 326
         Next i
327 327
         TextBox2.Text = Format(Val(金額加總(0)), "#,##0.00") : TextBox3.Text = Format(Val(金額加總(1)), "#,##0.00")
328 328
         TextBox4.Text = Format(Val(金額加總(2)), "#,##0.00") : TextBox5.Text = Format(Val(金額加總(3)), "#,##0.00")
@@ -349,16 +349,16 @@ Public Class 訂單價格利潤明細表
349 349
     Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
350 350
         If Label47.Visible = True Then : Label47.Visible = False : Else : Label47.Visible = True : End If
351 351
     End Sub
352
-    Private Sub DataGridView1_CellEndEdit(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit
352
+    Private Sub DataGridView1_CellEndEdit(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles 利潤表_dgv.CellEndEdit
353 353
         Set_自動彙總1()
354 354
     End Sub
355
-    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
355
+    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles 利潤表_dgv.CellClick
356 356
         If e.RowIndex = -1 Then : Else
357
-            TextBox1.Text = DataGridView1(0, e.RowIndex).Value.ToString : TextBox12.Text = DataGridView1(3, e.RowIndex).Value.ToString
358
-            TextBox13.Text = DataGridView1(4, e.RowIndex).Value.ToString : TextBox14.Text = DataGridView1(5, e.RowIndex).Value.ToString
359
-            TextBox15.Text = DataGridView1(6, e.RowIndex).Value.ToString : TextBox16.Text = DataGridView1(1, e.RowIndex).Value.ToString
360
-            ComboBox1.Text = DataGridView1(32, e.RowIndex).Value.ToString : ComboBox2.Text = DataGridView1(15, e.RowIndex).Value.ToString
361
-            TextBox17.Text = DataGridView1(33, e.RowIndex).Value.ToString
357
+            TextBox1.Text = 利潤表_dgv(0, e.RowIndex).Value.ToString : TextBox12.Text = 利潤表_dgv(3, e.RowIndex).Value.ToString
358
+            TextBox13.Text = 利潤表_dgv(4, e.RowIndex).Value.ToString : TextBox14.Text = 利潤表_dgv(5, e.RowIndex).Value.ToString
359
+            TextBox15.Text = 利潤表_dgv(6, e.RowIndex).Value.ToString : TextBox16.Text = 利潤表_dgv(1, e.RowIndex).Value.ToString
360
+            ComboBox1.Text = 利潤表_dgv(32, e.RowIndex).Value.ToString : ComboBox2.Text = 利潤表_dgv(15, e.RowIndex).Value.ToString
361
+            TextBox17.Text = 利潤表_dgv(33, e.RowIndex).Value.ToString
362 362
         End If
363 363
     End Sub
364 364
     Private Sub DataGridView2_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView2.CellClick
@@ -435,15 +435,15 @@ Public Class 訂單價格利潤明細表
435 435
             Set_訂單清單() : Set_grid() : Set_自動彙總1()
436 436
         End If
437 437
     End Sub
438
-    Private Sub DataGridView1_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView1.RowPostPaint
438
+    Private Sub DataGridView1_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 利潤表_dgv.RowPostPaint
439 439
         Dim linePen As New Pen(Color.Blue, 2)
440
-        If e.RowIndex = DataGridView1.Rows.Count - 1 Then
440
+        If e.RowIndex = 利潤表_dgv.Rows.Count - 1 Then
441 441
             Exit Sub
442 442
         Else
443
-            If DataGridView1(0, e.RowIndex).Value.ToString <> DataGridView1(0, e.RowIndex + 1).Value.ToString Then
444
-                Dim startX As Integer = IIf(DataGridView1.RowHeadersVisible, DataGridView1.RowHeadersWidth, 0)
443
+            If 利潤表_dgv(0, e.RowIndex).Value.ToString <> 利潤表_dgv(0, e.RowIndex + 1).Value.ToString Then
444
+                Dim startX As Integer = IIf(利潤表_dgv.RowHeadersVisible, 利潤表_dgv.RowHeadersWidth, 0)
445 445
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
446
-                Dim endX As Integer = startX + DataGridView1.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView1.HorizontalScrollingOffset
446
+                Dim endX As Integer = startX + 利潤表_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 利潤表_dgv.HorizontalScrollingOffset
447 447
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
448 448
                 Exit Sub
449 449
             End If
@@ -510,41 +510,41 @@ Public Class 訂單價格利潤明細表
510 510
         If ComboBox1.Text = "" Or ComboBox2.Text = "" Then
511 511
             MsgBox("年份或幣別沒有選擇")
512 512
         Else
513
-            For i As Integer = 0 To DataGridView1.Rows.Count - 1
513
+            For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
514 514
                 ConnOpen()
515
-                SQL1 = "SELECT 利潤表流水號 FROM " & 訂單資料表(7) & " WHERE (資料流水號 LIKE '" & DataGridView1.Rows(i).Cells("資料流水號").Value & "')"
515
+                SQL1 = "SELECT 利潤表流水號 FROM " & 訂單資料表(7) & " WHERE (資料流水號 LIKE '" & 利潤表_dgv.Rows(i).Cells("資料流水號").Value & "')"
516 516
                 CmdSet_For_dr()
517 517
                 If dr.Read() Then
518 518
                     conn.Close()
519 519
                 Else
520 520
                     conn.Close()
521 521
                     ConnOpen()
522
-                    SQL1 = "SELECT TOP (1) 編輯次數 FROM 訂單控制表修改紀錄 WHERE (流水號 LIKE '" & DataGridView1.Rows(i).Cells("資料流水號").Value & "') ORDER BY 編輯次數 DESC"
522
+                    SQL1 = "SELECT TOP (1) 編輯次數 FROM 訂單控制表修改紀錄 WHERE (流水號 LIKE '" & 利潤表_dgv.Rows(i).Cells("資料流水號").Value & "') ORDER BY 編輯次數 DESC"
523 523
                     CmdSet_For_dr()
524 524
                     If dr.Read() Then : NUM2 = dr("編輯次數").ToString : End If
525 525
                     conn.Close()
526 526
                     NUM2 += 1
527 527
                     ConnOpen()
528 528
                     SQL1 = "INSERT INTO 訂單控制表修改紀錄 (流水號, 編輯者, 編輯時間, 編輯次數) " &
529
-                       "VALUES ('" & DataGridView1.Rows(i).Cells("資料流水號").Value & "','" & gUserName & "','" & Format(Today, "yyyy/MM/dd") & "','" & NUM2 & "')"
529
+                       "VALUES ('" & 利潤表_dgv.Rows(i).Cells("資料流水號").Value & "','" & gUserName & "','" & Format(Today, "yyyy/MM/dd") & "','" & NUM2 & "')"
530 530
                     CmdSet_For_dr() : conn.Close()
531 531
 
532 532
                     ConnOpen()
533
-                    SQL1 = "UPDATE " & 訂單資料表(1) & " SET  單價 = '" & DataGridView1.Rows(i).Cells("單價").Value & "', 總金額 = '" & DataGridView1.Rows(i).Cells("總金額").Value & "' " &
534
-                       "WHERE (資料流水號 LIKE '" & DataGridView1.Rows(i).Cells("資料流水號").Value & "')"
533
+                    SQL1 = "UPDATE " & 訂單資料表(1) & " SET  單價 = '" & 利潤表_dgv.Rows(i).Cells("單價").Value & "', 總金額 = '" & 利潤表_dgv.Rows(i).Cells("總金額").Value & "' " &
534
+                       "WHERE (資料流水號 LIKE '" & 利潤表_dgv.Rows(i).Cells("資料流水號").Value & "')"
535 535
                     CmdSet_For_dr() : conn.Close()
536 536
                     ConnOpen()
537 537
                     SQL1 = "INSERT INTO " & 訂單資料表(7) & " (資料流水號, 天盾訂單號, 客戶流水號, FTYPrice, BasicPrice, Polybag, FOOTformOrPETform, Tooling, RubberBand, JHOOK, WaterResistant, 
538 538
                                                                P16VAT, EXWsaving, Currency, Exchange, 年份, Quantity, 利潤表流水號, 審核) 
539
-                            VALUES ('" & DataGridView1.Rows(i).Cells("資料流水號").Value & "', '" & DataGridView1.Rows(i).Cells("訂單流水號").Value & "', 
540
-                                    '" & DataGridView1.Rows(i).Cells("客戶訂單號").Value & "', '" & DataGridView1.Rows(i).Cells("FTYPrice").Value & "', 
541
-                                    '" & DataGridView1.Rows(i).Cells("BasicPrice").Value & "', '" & DataGridView1.Rows(i).Cells("Polybag").Value & "', 
542
-                                    '" & DataGridView1.Rows(i).Cells("FOOTorPET").Value & "', '" & DataGridView1.Rows(i).Cells("Tooling").Value & "', 
543
-                                    '" & DataGridView1.Rows(i).Cells("RubberBand").Value & "', '" & DataGridView1.Rows(i).Cells("JHOOK").Value & "', 
544
-                                    '" & DataGridView1.Rows(i).Cells("WaterResistant").Value & "', '" & DataGridView1.Rows(i).Cells("P16VAT").Value & "', 
545
-                                    '" & DataGridView1.Rows(i).Cells("EXWsaving").Value & "', '" & ComboBox2.Text & "', '" & DataGridView1.Rows(i).Cells("Exchange").Value & "', 
546
-                                    '" & DataGridView1.Rows(i).Cells("年份").Value & "', '" & DataGridView1.Rows(i).Cells("Quantity").Value & "', 
547
-                                    '" & DataGridView1.Rows(i).Cells("利潤表流水號").Value & "', '" & DataGridView1.Rows(i).Cells("審核").Value & "')"
539
+                            VALUES ('" & 利潤表_dgv.Rows(i).Cells("資料流水號").Value & "', '" & 利潤表_dgv.Rows(i).Cells("訂單流水號").Value & "', 
540
+                                    '" & 利潤表_dgv.Rows(i).Cells("客戶訂單號").Value & "', '" & 利潤表_dgv.Rows(i).Cells("FTYPrice").Value & "', 
541
+                                    '" & 利潤表_dgv.Rows(i).Cells("BasicPrice").Value & "', '" & 利潤表_dgv.Rows(i).Cells("PG/MOQ").Value & "', 
542
+                                    '" & 利潤表_dgv.Rows(i).Cells("FOOTorPET").Value & "', '" & 利潤表_dgv.Rows(i).Cells("Tooling").Value & "', 
543
+                                    '" & 利潤表_dgv.Rows(i).Cells("RubberBand").Value & "', '" & 利潤表_dgv.Rows(i).Cells("JHOOK").Value & "', 
544
+                                    '" & 利潤表_dgv.Rows(i).Cells("WaterResistant").Value & "', '" & 利潤表_dgv.Rows(i).Cells("P16VAT").Value & "', 
545
+                                    '" & 利潤表_dgv.Rows(i).Cells("EXWsaving").Value & "', '" & ComboBox2.Text & "', '" & 利潤表_dgv.Rows(i).Cells("Exchange").Value & "', 
546
+                                    '" & 利潤表_dgv.Rows(i).Cells("年份").Value & "', '" & 利潤表_dgv.Rows(i).Cells("Quantity").Value & "', 
547
+                                    '" & 利潤表_dgv.Rows(i).Cells("利潤表流水號").Value & "', '" & 利潤表_dgv.Rows(i).Cells("審核").Value & "')"
548 548
                     CmdSet_For_dr() : conn.Close()
549 549
                 End If
550 550
             Next i
@@ -564,33 +564,33 @@ Public Class 訂單價格利潤明細表
564 564
         If ComboBox1.Text = "" Or ComboBox2.Text = "" Then
565 565
             MsgBox("年份或幣別沒有選擇")
566 566
         Else
567
-            For i As Integer = 0 To DataGridView1.Rows.Count - 1
568
-                資料數 = DataGridView1.Rows.Count : 進度條()
567
+            For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
568
+                資料數 = 利潤表_dgv.Rows.Count : 進度條()
569 569
                 ConnOpen()
570
-                SQL1 = "SELECT TOP (1) 編輯次數 FROM 訂單控制表修改紀錄 WHERE (流水號 LIKE '" & DataGridView1.Rows(i).Cells("資料流水號").Value & "') ORDER BY 編輯次數 DESC"
570
+                SQL1 = "SELECT TOP (1) 編輯次數 FROM 訂單控制表修改紀錄 WHERE (流水號 LIKE '" & 利潤表_dgv.Rows(i).Cells("資料流水號").Value & "') ORDER BY 編輯次數 DESC"
571 571
                 CmdSet_For_dr()
572 572
                 If dr.Read() Then : NUM2 = dr("編輯次數").ToString : End If
573 573
                 conn.Close()
574 574
                 NUM2 += 1
575 575
                 ConnOpen()
576 576
                 SQL1 = "INSERT INTO 訂單控制表修改紀錄 (流水號, 編輯者, 編輯時間, 編輯次數) " &
577
-                       "VALUES ('" & DataGridView1.Rows(i).Cells("資料流水號").Value & "','" & gUserName & "','" & Format(Today, "yyyy/MM/dd") & "','" & NUM2 & "')"
577
+                       "VALUES ('" & 利潤表_dgv.Rows(i).Cells("資料流水號").Value & "','" & gUserName & "','" & Format(Today, "yyyy/MM/dd") & "','" & NUM2 & "')"
578 578
                 CmdSet_For_dr() : conn.Close()
579 579
 
580 580
                 ConnOpen()
581
-                SQL1 = "UPDATE " & 訂單資料表(1) & " SET  單價 = '" & DataGridView1.Rows(i).Cells("單價").Value & "', 總金額 = '" & DataGridView1.Rows(i).Cells("總金額").Value & "' " &
582
-                       "WHERE (資料流水號 LIKE '" & DataGridView1.Rows(i).Cells("資料流水號").Value & "')"
581
+                SQL1 = "UPDATE " & 訂單資料表(1) & " SET  單價 = '" & 利潤表_dgv.Rows(i).Cells("單價").Value & "', 總金額 = '" & 利潤表_dgv.Rows(i).Cells("總金額").Value & "' " &
582
+                       "WHERE (資料流水號 LIKE '" & 利潤表_dgv.Rows(i).Cells("資料流水號").Value & "')"
583 583
                 CmdSet_For_dr() : conn.Close()
584 584
                 ConnOpen()
585
-                SQL1 = "UPDATE " & 訂單資料表(7) & " SET  FTYPrice = '" & DataGridView1.Rows(i).Cells("FTYPrice").Value & "', BasicPrice = '" & DataGridView1.Rows(i).Cells("BasicPrice").Value & "', " &
586
-                                                      "Polybag = '" & DataGridView1.Rows(i).Cells("Polybag").Value & "', FOOTformOrPETform = '" & DataGridView1.Rows(i).Cells("FOOTorPET").Value & "', " &
587
-                                                      "Tooling = '" & DataGridView1.Rows(i).Cells("Tooling").Value & "', RubberBand = '" & DataGridView1.Rows(i).Cells("RubberBand").Value & "', " &
588
-                                                      "JHOOK = '" & DataGridView1.Rows(i).Cells("JHOOK").Value & "', WaterResistant = '" & DataGridView1.Rows(i).Cells("WaterResistant").Value & "', " &
589
-                                                      "P16VAT = '" & DataGridView1.Rows(i).Cells("P16VAT").Value & "', EXWsaving = '" & DataGridView1.Rows(i).Cells("EXWsaving").Value & "', " &
590
-                                                      "Currency = '" & ComboBox2.Text & "', Exchange = '" & DataGridView1.Rows(i).Cells("Exchange").Value & "', " &
591
-                                                      "年份 = '" & DataGridView1.Rows(i).Cells("年份").Value & "', Quantity = '" & DataGridView1.Rows(i).Cells("Quantity").Value & "', " &
592
-                                                      "審核 = '" & DataGridView1.Rows(i).Cells("審核").Value & "' " &
593
-                       "WHERE (利潤表流水號 LIKE '" & DataGridView1.Rows(i).Cells("利潤表流水號").Value & "')"
585
+                SQL1 = "UPDATE " & 訂單資料表(7) & " SET  FTYPrice = '" & 利潤表_dgv.Rows(i).Cells("FTYPrice").Value & "', BasicPrice = '" & 利潤表_dgv.Rows(i).Cells("BasicPrice").Value & "', " &
586
+                                                      "Polybag = '" & 利潤表_dgv.Rows(i).Cells("PG/MOQ").Value & "', FOOTformOrPETform = '" & 利潤表_dgv.Rows(i).Cells("FOOTorPET").Value & "', " &
587
+                                                      "Tooling = '" & 利潤表_dgv.Rows(i).Cells("Tooling").Value & "', RubberBand = '" & 利潤表_dgv.Rows(i).Cells("RubberBand").Value & "', " &
588
+                                                      "JHOOK = '" & 利潤表_dgv.Rows(i).Cells("JHOOK").Value & "', WaterResistant = '" & 利潤表_dgv.Rows(i).Cells("WaterResistant").Value & "', " &
589
+                                                      "P16VAT = '" & 利潤表_dgv.Rows(i).Cells("P16VAT").Value & "', EXWsaving = '" & 利潤表_dgv.Rows(i).Cells("EXWsaving").Value & "', " &
590
+                                                      "Currency = '" & ComboBox2.Text & "', Exchange = '" & 利潤表_dgv.Rows(i).Cells("Exchange").Value & "', " &
591
+                                                      "年份 = '" & 利潤表_dgv.Rows(i).Cells("年份").Value & "', Quantity = '" & 利潤表_dgv.Rows(i).Cells("Quantity").Value & "', " &
592
+                                                      "審核 = '" & 利潤表_dgv.Rows(i).Cells("審核").Value & "' " &
593
+                       "WHERE (利潤表流水號 LIKE '" & 利潤表_dgv.Rows(i).Cells("利潤表流水號").Value & "')"
594 594
                 CmdSet_For_dr() : conn.Close()
595 595
             Next i : ProgressBar1.Value = 0 : 最終數 = 0
596 596
             MsgBox("修改完成")
@@ -621,18 +621,18 @@ Public Class 訂單價格利潤明細表
621 621
         If 列印用SQL = "" Then : MsgBox("請先搜尋資料後再行列印") : Else : 列印_訂單價格利潤表.Show() : End If
622 622
     End Sub
623 623
     Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
624
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
625
-            DataGridView1.Rows(i).Cells(14).Value = 0
624
+        For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
625
+            利潤表_dgv.Rows(i).Cells(14).Value = 0
626 626
         Next i
627 627
     End Sub
628 628
     Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
629
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
630
-            DataGridView1.Rows(i).Cells(14).Value = DataGridView1.Rows(i).Cells(7).Value
629
+        For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
630
+            利潤表_dgv.Rows(i).Cells(14).Value = 利潤表_dgv.Rows(i).Cells(7).Value
631 631
         Next i
632 632
     End Sub
633 633
     Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
634
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
635
-            DataGridView1.Rows(i).Cells(16).Value = 1
634
+        For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
635
+            利潤表_dgv.Rows(i).Cells(16).Value = 1
636 636
         Next i
637 637
     End Sub
638 638
     Private Sub 資料庫選擇1_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇1_bt.Click

+ 25
- 6
TENDEN-MES-SYS/量產訂單管理/訂單控制表.Designer.vb 查看文件

@@ -28,6 +28,7 @@ Partial Class 訂單控制表
28 28
         Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29 29
         Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
30 30
         Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
31
+        Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
31 32
         Me.控制表_dgv = New System.Windows.Forms.DataGridView()
32 33
         Me.Label5 = New System.Windows.Forms.Label()
33 34
         Me.客戶訂單號_tb = New System.Windows.Forms.TextBox()
@@ -182,6 +183,7 @@ Partial Class 訂單控制表
182 183
         Me.AA8_lb = New System.Windows.Forms.Label()
183 184
         Me.Brand_tb = New System.Windows.Forms.TextBox()
184 185
         Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
186
+        Me.除錯_dgv = New System.Windows.Forms.DataGridView()
185 187
         Me.資訊_gb = New System.Windows.Forms.GroupBox()
186 188
         Me.TT23_lb = New System.Windows.Forms.TextBox()
187 189
         Me.Label49 = New System.Windows.Forms.Label()
@@ -251,6 +253,7 @@ Partial Class 訂單控制表
251 253
         Me.SplitContainer1.Panel1.SuspendLayout()
252 254
         Me.SplitContainer1.Panel2.SuspendLayout()
253 255
         Me.SplitContainer1.SuspendLayout()
256
+        CType(Me.除錯_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
254 257
         Me.資訊_gb.SuspendLayout()
255 258
         CType(Me.裝箱控制表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
256 259
         CType(Me.明細表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -1683,6 +1686,7 @@ Partial Class 訂單控制表
1683 1686
         'SplitContainer1.Panel1
1684 1687
         '
1685 1688
         Me.SplitContainer1.Panel1.AutoScroll = True
1689
+        Me.SplitContainer1.Panel1.Controls.Add(Me.除錯_dgv)
1686 1690
         Me.SplitContainer1.Panel1.Controls.Add(Me.控制表_dgv)
1687 1691
         '
1688 1692
         'SplitContainer1.Panel2
@@ -1696,6 +1700,19 @@ Partial Class 訂單控制表
1696 1700
         Me.SplitContainer1.SplitterDistance = 454
1697 1701
         Me.SplitContainer1.TabIndex = 753
1698 1702
         '
1703
+        '除錯_dgv
1704
+        '
1705
+        DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
1706
+        Me.除錯_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
1707
+        Me.除錯_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
1708
+        Me.除錯_dgv.Location = New System.Drawing.Point(48, 36)
1709
+        Me.除錯_dgv.Name = "除錯_dgv"
1710
+        Me.除錯_dgv.RowHeadersWidth = 5
1711
+        Me.除錯_dgv.RowTemplate.Height = 24
1712
+        Me.除錯_dgv.Size = New System.Drawing.Size(306, 274)
1713
+        Me.除錯_dgv.TabIndex = 757
1714
+        Me.除錯_dgv.Visible = False
1715
+        '
1699 1716
         '資訊_gb
1700 1717
         '
1701 1718
         Me.資訊_gb.Controls.Add(Me.TT23_lb)
@@ -2223,8 +2240,8 @@ Partial Class 訂單控制表
2223 2240
         '
2224 2241
         '裝箱控制表_dgv
2225 2242
         '
2226
-        DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
2227
-        Me.裝箱控制表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
2243
+        DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
2244
+        Me.裝箱控制表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4
2228 2245
         Me.裝箱控制表_dgv.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
2229 2246
             Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
2230 2247
         Me.裝箱控制表_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
@@ -2238,8 +2255,8 @@ Partial Class 訂單控制表
2238 2255
         '
2239 2256
         '明細表_dgv
2240 2257
         '
2241
-        DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
2242
-        Me.明細表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4
2258
+        DataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
2259
+        Me.明細表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle5
2243 2260
         Me.明細表_dgv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
2244 2261
             Or System.Windows.Forms.AnchorStyles.Left) _
2245 2262
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -2254,8 +2271,8 @@ Partial Class 訂單控制表
2254 2271
         '
2255 2272
         '裝箱明細_dgv
2256 2273
         '
2257
-        DataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
2258
-        Me.裝箱明細_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle5
2274
+        DataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
2275
+        Me.裝箱明細_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle6
2259 2276
         Me.裝箱明細_dgv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
2260 2277
             Or System.Windows.Forms.AnchorStyles.Left) _
2261 2278
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -2464,6 +2481,7 @@ Partial Class 訂單控制表
2464 2481
         Me.SplitContainer1.Panel2.ResumeLayout(False)
2465 2482
         CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit()
2466 2483
         Me.SplitContainer1.ResumeLayout(False)
2484
+        CType(Me.除錯_dgv, System.ComponentModel.ISupportInitialize).EndInit()
2467 2485
         Me.資訊_gb.ResumeLayout(False)
2468 2486
         Me.資訊_gb.PerformLayout()
2469 2487
         CType(Me.裝箱控制表_dgv, System.ComponentModel.ISupportInitialize).EndInit()
@@ -2687,5 +2705,6 @@ Partial Class 訂單控制表
2687 2705
     Friend WithEvents TT22_lb As TextBox
2688 2706
     Friend WithEvents TT23_lb As TextBox
2689 2707
     Friend WithEvents Label49 As Label
2708
+    Friend WithEvents 除錯_dgv As DataGridView
2690 2709
 End Class
2691 2710
 

+ 32
- 2
TENDEN-MES-SYS/量產訂單管理/訂單控制表.vb 查看文件

@@ -1,7 +1,7 @@
1 1
 Option Strict Off
2 2
 Imports System.IO
3 3
 Public Class 訂單控制表
4
-    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
+    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 : ReadOnly ds5 As New DataSet
5 5
     Dim 訂單數量 As Double : Dim 單價 As Double : Dim 總金額 As Double
6 6
     '-----------------------------------------0-----------------------1-------------------------2------------------3-----------------4----------------------5-------------------------6
7 7
     '                                訂單流水號,               年份季度,               客戶訂單號,            形體號,             顏色,                  楦型,                 訂單數量
@@ -847,6 +847,17 @@ Public Class 訂單控制表
847 847
         裝箱明細_dgv.Columns(19).DefaultCellStyle.Format = "#,##0" : 裝箱明細_dgv.Columns(20).DefaultCellStyle.Format = "#,##0" : 裝箱明細_dgv.Columns(21).DefaultCellStyle.Format = "#,##0"
848 848
         裝箱明細_dgv.Columns(22).DefaultCellStyle.Format = "#,##0" : 裝箱明細_dgv.Columns(23).DefaultCellStyle.Format = "#,##0"
849 849
     End Sub
850
+    Private Sub Set_客戶交期除錯()
851
+        除錯_dgv.DataSource = Nothing : ds5.Clear()
852
+        除錯_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
853
+        除錯_dgv.ColumnHeadersHeight = 25
854
+        除錯_dgv.AllowUserToAddRows = False
855
+        ConnOpen()
856
+        SQL1 = "SELECT          LEFT(客戶交期, 4) AS 前段, SUBSTRING(客戶交期, 6, 10) AS 後段, 資料流水號, 客戶交期
857
+                FROM            訂單控制表
858
+                WHERE          (LEN(客戶交期) < 10)"
859
+        CmdSet_For_DGV() : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5) : 除錯_dgv.DataSource = ds5.Tables(0) : conn.Close()
860
+    End Sub
850 861
     Private Sub ComboBox1下拉表單資料載入()
851 862
         conn1.Close()
852 863
         If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
@@ -992,8 +1003,27 @@ Public Class 訂單控制表
992 1003
             Button28.Enabled = False
993 1004
         End If
994 1005
         Set_格式設定() : Set_訂單清單() : Set_自動彙總1() : Set_grid()
995
-
996 1006
         ComboBox1下拉表單資料載入() : ComboBox2下拉表單資料載入() : ComboBox3下拉表單資料載入() : ComboBox4下拉表單資料載入() : ComboBox5下拉表單資料載入() : ComboBox6下拉表單資料載入()
1007
+
1008
+        Set_客戶交期除錯()
1009
+        If 除錯_dgv.Rows.Count > 0 Then
1010
+            For I As Integer = 0 To 除錯_dgv.Rows.Count - 1
1011
+                If IsNumeric(Strings.Left(除錯_dgv("後段", I).Value.ToString, 2)) = False And IsNumeric(Strings.Right(除錯_dgv("後段", I).Value.ToString, 2)) = False Then
1012
+                    除錯_dgv("後段", I).Value = 除錯_dgv("前段", I).Value.ToString & "/" & "0" & Strings.Left(除錯_dgv("後段", I).Value.ToString, 1) & "/0" &
1013
+                        Strings.Right(除錯_dgv("後段", I).Value.ToString, 1)
1014
+                ElseIf IsNumeric(Strings.Left(除錯_dgv("後段", I).Value.ToString, 2)) = True And IsNumeric(Strings.Right(除錯_dgv("後段", I).Value.ToString, 2)) = False Then
1015
+                    除錯_dgv("後段", I).Value = 除錯_dgv("前段", I).Value.ToString & "/" & Strings.Left(除錯_dgv("後段", I).Value.ToString, 2) & "/0" &
1016
+                        Strings.Right(除錯_dgv("後段", I).Value.ToString, 1)
1017
+                    除錯_dgv("後段", I).Value = "2021/" & Strings.Left(除錯_dgv("前段", I).Value.ToString, 2) & "/0" & Strings.Right(除錯_dgv("前段", I).Value.ToString, 1)
1018
+                ElseIf IsNumeric(Strings.Left(除錯_dgv("後段", I).Value.ToString, 2)) = False And IsNumeric(Strings.Right(除錯_dgv("後段", I).Value.ToString, 2)) = True Then
1019
+                    除錯_dgv("後段", I).Value = 除錯_dgv("前段", I).Value.ToString & "/" & "0" & Strings.Left(除錯_dgv("後段", I).Value.ToString, 1) & "/" &
1020
+                        Strings.Right(除錯_dgv("後段", I).Value.ToString, 2)
1021
+                End If
1022
+                ConnOpen()
1023
+                SQL1 = "UPDATE 訂單控制表 SET 客戶交期 = '" & 除錯_dgv("後段", I).Value.ToString & "' WHERE (資料流水號 = '" & 除錯_dgv("資料流水號", I).Value.ToString & "')"
1024
+                CmdSet_For_dr() : conn.Close()
1025
+            Next
1026
+        End If
997 1027
     End Sub
998 1028
     Private Sub 訂單控制表_Unload(sender As Object, e As EventArgs) Handles MyBase.Closing
999 1029
         frmOpenFlag = False

正在加载...
取消
保存