|
@@ -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
|