|
@@ -28,7 +28,7 @@ Public Class 營運成本收支單一覽表
|
28
|
28
|
If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
|
29
|
29
|
SQL1 = "SELECT 支付單號 AS 收支單號, 申請人, 申請日期, 審核人, 審核日期, 核准圖檔, 簽名編碼 FROM 公帳控制表
|
30
|
30
|
WHERE (審核人 NOT LIKE '') AND (審核人 NOT LIKE '作廢%') AND
|
31
|
|
- 審核日期 BETWEEN '" & Strings.Format(DateTimePicker4.Value, "yyyy/MM/dd") & "' AND '" & Strings.Format(DateTimePicker3.Value, "yyyy/MM/dd") & "'
|
|
31
|
+ 審核日期 BETWEEN '" & Strings.Format(開始日期_dtp.Value, "yyyy/MM/dd") & "' AND '" & Strings.Format(結束日期_dtp.Value, "yyyy/MM/dd") & "'
|
32
|
32
|
ORDER BY 審核日期 DESC"
|
33
|
33
|
cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds1) : DataGridView4.DataSource = ds1.Tables(0) : conn.Close()
|
34
|
34
|
|
|
@@ -47,7 +47,7 @@ Public Class 營運成本收支單一覽表
|
47
|
47
|
FROM 公帳控制表 RIGHT OUTER JOIN
|
48
|
48
|
公帳流水帳 ON 公帳控制表.支付單號 = 公帳流水帳.支付單號 RIGHT OUTER JOIN
|
49
|
49
|
會計科目 ON 公帳流水帳.類別 = 會計科目.編號
|
50
|
|
- WHERE (公帳控制表.審核日期 BETWEEN '" & Strings.Format(DateTimePicker4.Value, "yyyy/MM/dd") & "' AND '" & Strings.Format(DateTimePicker3.Value, "yyyy/MM/dd") & "')
|
|
50
|
+ WHERE (公帳控制表.審核日期 BETWEEN '" & Strings.Format(開始日期_dtp.Value, "yyyy/MM/dd") & "' AND '" & Strings.Format(結束日期_dtp.Value, "yyyy/MM/dd") & "')
|
51
|
51
|
GROUP BY 會計科目.第一階, 會計科目.第二階, 會計科目.會計科目, LEFT(會計科目.編號, 7),
|
52
|
52
|
LEFT(公帳控制表.審核日期, 7), 公帳流水帳.銀行, 公帳流水帳.匯率
|
53
|
53
|
ORDER BY 幣別, LEFT(公帳控制表.審核日期, 7), LEFT(會計科目.編號, 7)"
|
|
@@ -69,53 +69,54 @@ Public Class 營運成本收支單一覽表
|
69
|
69
|
DataGridView2.Columns(4).ReadOnly = True : DataGridView2.Columns(5).ReadOnly = True : DataGridView2.Columns(6).ReadOnly = True : DataGridView2.Columns(7).ReadOnly = True
|
70
|
70
|
End Sub
|
71
|
71
|
Private Sub Set_費用清單()
|
72
|
|
- DataGridView1.DataSource = Nothing : ds.Clear()
|
73
|
|
- DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
|
74
|
|
- DataGridView1.ColumnHeadersHeight = 25
|
75
|
|
- DataGridView1.AllowUserToAddRows = False
|
76
|
|
- DataGridView1.RowTemplate.Height = 35
|
|
72
|
+ 明細_dgv.DataSource = Nothing : ds.Clear()
|
|
73
|
+ 明細_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
|
|
74
|
+ 明細_dgv.ColumnHeadersHeight = 25
|
|
75
|
+ 明細_dgv.AllowUserToAddRows = False
|
|
76
|
+ 明細_dgv.RowTemplate.Height = 35
|
77
|
77
|
If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
|
78
|
78
|
SQL1 = "SELECT 公帳流水帳.支付單號, 公帳流水帳.項次, 會計科目.會計科目, 公帳流水帳.明細 AS 用途,
|
79
|
|
- 公帳流水帳.零用金, 公帳流水帳.支票數 AS 支票, 公帳流水帳.收入 AS 現金,
|
80
|
|
- 公帳流水帳.支出, 公帳流水帳.備註 AS 票期, 公帳流水帳.匯率, 公帳流水帳.銀行 AS 幣別, 公帳流水帳.類別, 公帳流水帳.流水號
|
|
79
|
+ Cast(公帳流水帳.零用金 AS money) AS 零用金, Cast(公帳流水帳.支票數 AS money) AS 支票, Cast(公帳流水帳.收入 AS money) AS 現金,
|
|
80
|
+ Cast(公帳流水帳.支出 AS money) AS 支出, 公帳流水帳.備註 AS 票期, 公帳流水帳.匯率, 公帳流水帳.銀行 AS 幣別, 公帳流水帳.類別, 公帳流水帳.流水號
|
81
|
81
|
FROM 公帳流水帳 INNER JOIN
|
82
|
82
|
會計科目 ON 公帳流水帳.類別 = 會計科目.編號
|
83
|
83
|
WHERE (公帳流水帳.支付單號 LIKE '" & TextBox1.Text & "')
|
84
|
84
|
ORDER BY 公帳流水帳.項次"
|
85
|
|
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
|
|
85
|
+ cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds) : 明細_dgv.DataSource = ds.Tables(0) : conn.Close()
|
86
|
86
|
|
87
|
|
- DataGridView1.Columns(0).Visible = False : DataGridView1.Columns(1).FillWeight = 80 : DataGridView1.Columns(2).FillWeight = 300 : DataGridView1.Columns(3).FillWeight = 500
|
88
|
|
- DataGridView1.Columns(4).FillWeight = 140 : DataGridView1.Columns(5).FillWeight = 140 : DataGridView1.Columns(6).FillWeight = 140 : DataGridView1.Columns(7).FillWeight = 140
|
89
|
|
- DataGridView1.Columns(8).FillWeight = 140 : DataGridView1.Columns(9).FillWeight = 140 : DataGridView1.Columns(10).FillWeight = 140 : DataGridView1.Columns(11).Visible = False
|
90
|
|
- DataGridView1.Columns(12).Visible = False
|
|
87
|
+ 明細_dgv.Columns(0).Visible = False : 明細_dgv.Columns(1).FillWeight = 80 : 明細_dgv.Columns(2).FillWeight = 300 : 明細_dgv.Columns(3).FillWeight = 500
|
|
88
|
+ 明細_dgv.Columns(4).FillWeight = 140 : 明細_dgv.Columns(5).FillWeight = 140 : 明細_dgv.Columns(6).FillWeight = 140 : 明細_dgv.Columns(7).FillWeight = 140
|
|
89
|
+ 明細_dgv.Columns(8).FillWeight = 140 : 明細_dgv.Columns(9).FillWeight = 140 : 明細_dgv.Columns(10).FillWeight = 140 : 明細_dgv.Columns(11).Visible = False
|
|
90
|
+ 明細_dgv.Columns(12).Visible = False
|
91
|
91
|
|
92
|
|
- DataGridView1.Columns(1).ReadOnly = True : DataGridView1.Columns(2).ReadOnly = True : DataGridView1.Columns(9).ReadOnly = True : DataGridView1.Columns(10).ReadOnly = True
|
|
92
|
+ 明細_dgv.Columns(1).ReadOnly = True : 明細_dgv.Columns(2).ReadOnly = True : 明細_dgv.Columns(9).ReadOnly = True : 明細_dgv.Columns(10).ReadOnly = True
|
93
|
93
|
|
94
|
|
- DataGridView1.Columns(4).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(5).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(6).DefaultCellStyle.Format = "#,##0.00"
|
95
|
|
- DataGridView1.Columns(7).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(8).DefaultCellStyle.Format = "#,##0.00"
|
96
|
|
- DataGridView1.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
|
97
|
|
- DataGridView1.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
|
98
|
|
- DataGridView1.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
|
99
|
|
- DataGridView1.Columns(7).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(7).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
|
100
|
|
- DataGridView1.Columns(9).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(9).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
|
101
|
|
- DataGridView1.Columns(10).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(10).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
|
102
|
|
- DataGridView1.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
|
103
|
|
- DataGridView1.EditMode = DataGridViewEditMode.EditOnEnter
|
|
94
|
+ 明細_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 明細_dgv.Columns(5).DefaultCellStyle.Format = "#,##0.00" : 明細_dgv.Columns(6).DefaultCellStyle.Format = "#,##0.00"
|
|
95
|
+ 明細_dgv.Columns(7).DefaultCellStyle.Format = "#,##0.00"
|
|
96
|
+ 明細_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 明細_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
|
|
97
|
+ 明細_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 明細_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
|
|
98
|
+ 明細_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 明細_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
|
|
99
|
+ 明細_dgv.Columns(7).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 明細_dgv.Columns(7).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
|
|
100
|
+ 明細_dgv.Columns(9).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : 明細_dgv.Columns(9).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
|
|
101
|
+ 明細_dgv.Columns(10).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : 明細_dgv.Columns(10).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
|
|
102
|
+ 明細_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : 明細_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
|
|
103
|
+ 明細_dgv.EditMode = DataGridViewEditMode.EditOnEnter
|
104
|
104
|
|
105
|
|
- TextBox5.Text = "0.00.00" : TextBox7.Text = "0.00.00" : TextBox6.Text = "0.00" : TextBox10.Text = "0.00" : TextBox11.Text = "0.00"
|
106
|
|
- TextBox2.Text = "0.00.00" : TextBox8.Text = "0.00.00" : TextBox15.Text = "0.00" : TextBox12.Text = "0.00" : TextBox9.Text = "0.00"
|
107
|
|
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
|
108
|
|
- If DataGridView1.Rows(i).Cells("幣別").Value = "台幣現金" Then
|
109
|
|
- TextBox5.Text = Val(TextBox5.Text) + DataGridView1.Rows(i).Cells("現金").Value
|
110
|
|
- TextBox7.Text = Val(TextBox7.Text) + DataGridView1.Rows(i).Cells("支出").Value
|
111
|
|
- TextBox10.Text = Val(TextBox10.Text) + DataGridView1.Rows(i).Cells("零用金").Value
|
112
|
|
- TextBox11.Text = Val(TextBox11.Text) + DataGridView1.Rows(i).Cells("支票").Value
|
|
105
|
+ TextBox5.Text = "0.00" : TextBox7.Text = "0.00" : TextBox6.Text = "0.00" : TextBox10.Text = "0.00" : TextBox11.Text = "0.00"
|
|
106
|
+ TextBox2.Text = "0.00" : TextBox8.Text = "0.00" : TextBox15.Text = "0.00" : TextBox12.Text = "0.00" : TextBox9.Text = "0.00"
|
|
107
|
+ For i As Integer = 0 To 明細_dgv.Rows.Count - 1
|
|
108
|
+ If 明細_dgv.Rows(i).Cells("幣別").Value = "台幣現金" Then
|
|
109
|
+ TextBox5.Text = Val(TextBox5.Text) + 明細_dgv.Rows(i).Cells("現金").Value
|
|
110
|
+ TextBox7.Text = Val(TextBox7.Text) + 明細_dgv.Rows(i).Cells("支出").Value
|
|
111
|
+ TextBox10.Text = Val(TextBox10.Text) + 明細_dgv.Rows(i).Cells("零用金").Value
|
|
112
|
+ TextBox11.Text = Val(TextBox11.Text) + 明細_dgv.Rows(i).Cells("支票").Value
|
113
|
113
|
End If
|
114
|
|
- If DataGridView1.Rows(i).Cells("幣別").Value = "人民幣現金" Then
|
115
|
|
- TextBox15.Text = Val(TextBox15.Text) + DataGridView1.Rows(i).Cells("現金").Value
|
116
|
|
- TextBox12.Text = Val(TextBox12.Text) + DataGridView1.Rows(i).Cells("支出").Value
|
117
|
|
- TextBox2.Text = Val(TextBox2.Text) + DataGridView1.Rows(i).Cells("零用金").Value
|
118
|
|
- TextBox8.Text = Val(TextBox8.Text) + DataGridView1.Rows(i).Cells("支票").Value
|
|
114
|
+ If 明細_dgv.Rows(i).Cells("幣別").Value = "人民幣現金" Then
|
|
115
|
+ TextBox15.Text = Val(TextBox15.Text) + 明細_dgv.Rows(i).Cells("現金").Value
|
|
116
|
+ TextBox12.Text = Val(TextBox12.Text) + 明細_dgv.Rows(i).Cells("支出").Value
|
|
117
|
+
|
|
118
|
+ TextBox2.Text = Val(TextBox2.Text) + 明細_dgv.Rows(i).Cells("零用金").Value
|
|
119
|
+ TextBox8.Text = Val(TextBox8.Text) + 明細_dgv.Rows(i).Cells("支票").Value
|
119
|
120
|
End If
|
120
|
121
|
Next i
|
121
|
122
|
TextBox6.Text = Val(TextBox10.Text) + Val(TextBox5.Text) - Val(TextBox7.Text) : TextBox9.Text = Val(TextBox2.Text) + Val(TextBox15.Text) - Val(TextBox12.Text)
|
|
@@ -126,11 +127,28 @@ Public Class 營運成本收支單一覽表
|
126
|
127
|
TextBox2.Text = Strings.Format(Val(TextBox2.Text), "#,##0.00") : TextBox8.Text = Strings.Format(Val(TextBox8.Text), "#,##0.00") : TextBox15.Text = Strings.Format(Val(TextBox15.Text), "#,##0.00")
|
127
|
128
|
TextBox12.Text = Strings.Format(Val(TextBox12.Text), "#,##0.00") : TextBox9.Text = Strings.Format(Val(TextBox9.Text), "#,##0.00")
|
128
|
129
|
End Sub
|
|
130
|
+ Private Sub 日期格式()
|
|
131
|
+ If 會計月_ch.Checked = True Then
|
|
132
|
+ '-------------日期一----------------------------------------------------------------------------------------
|
|
133
|
+ DTP = Strings.Left(Strings.Format(開始日期_dtp.Value, "yyyy/MM/dd"), 8) & "01" : 開始日期_dtp.Value = DTP
|
|
134
|
+ 開始日期_dtp.Value = 開始日期_dtp.Value.AddMonths(-1)
|
|
135
|
+ DTP = Strings.Left(Strings.Format(開始日期_dtp.Value, "yyyy/MM/dd"), 8) & "26" : 開始日期_dtp.Value = DTP
|
|
136
|
+ '-------------日期二----------------------------------------------------------------------------------------
|
|
137
|
+ DTP = Strings.Left(Strings.Format(結束日期_dtp.Value, "yyyy/MM/dd"), 8) & "25" : 結束日期_dtp.Value = DTP
|
|
138
|
+ Else
|
|
139
|
+ '-------------日期一----------------------------------------------------------------------------------------
|
|
140
|
+ 開始日期_dtp.Value = 開始日期_dtp.Value.AddMonths(1)
|
|
141
|
+ DTP = Strings.Left(Strings.Format(開始日期_dtp.Value, "yyyy/MM/dd"), 8) & "01" : 開始日期_dtp.Value = DTP
|
|
142
|
+ '-------------日期二----------------------------------------------------------------------------------------
|
|
143
|
+ DTP = Strings.Left(Strings.Format(結束日期_dtp.Value, "yyyy/MM/dd"), 8) & "01" : 結束日期_dtp.Value = DTP
|
|
144
|
+ 結束日期_dtp.Value = 結束日期_dtp.Value.AddMonths(1) : 結束日期_dtp.Value = 結束日期_dtp.Value.AddDays(-1)
|
|
145
|
+ End If
|
|
146
|
+ End Sub
|
129
|
147
|
Private Sub 營運費用支付單一覽表_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
130
|
148
|
Me.MdiParent = GCM_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
|
131
|
149
|
DTP = Strings.Left(Strings.Format(Today(), "yyyy/MM/dd"), 8) & "01"
|
132
|
|
- DateTimePicker4.Value = DTP : DateTimePicker3.Value = Today()
|
133
|
|
- DataGridView2.Visible = False : RadioButton1.Checked = True
|
|
150
|
+ 開始日期_dtp.Value = DTP : 結束日期_dtp.Value = Today()
|
|
151
|
+ 日期格式() : DataGridView2.Visible = False : RadioButton1.Checked = True
|
134
|
152
|
End Sub
|
135
|
153
|
Private Sub DataGridView4_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView4.CellClick
|
136
|
154
|
If e.RowIndex = -1 Then : Else
|
|
@@ -171,11 +189,11 @@ Public Class 營運成本收支單一覽表
|
171
|
189
|
End Sub
|
172
|
190
|
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
173
|
191
|
DTP = Strings.Format(Today(), "yyyy/MM/dd")
|
174
|
|
- DateTimePicker4.Value = DTP : DateTimePicker3.Value = DTP
|
|
192
|
+ 開始日期_dtp.Value = DTP : 結束日期_dtp.Value = DTP
|
175
|
193
|
End Sub
|
176
|
194
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
177
|
195
|
DTP = Strings.Left(Strings.Format(Today(), "yyyy/MM/dd"), 8) & "01"
|
178
|
|
- DateTimePicker4.Value = DTP : DateTimePicker3.Value = Today()
|
|
196
|
+ 開始日期_dtp.Value = DTP : 結束日期_dtp.Value = Today()
|
179
|
197
|
End Sub
|
180
|
198
|
Private Sub 彙總計算()
|
181
|
199
|
If RadioButton1.Checked = False And RadioButton2.Checked = True Then
|
|
@@ -189,10 +207,12 @@ Public Class 營運成本收支單一覽表
|
189
|
207
|
TextBox11.Text = Val(TextBox11.Text) + DataGridView2.Rows(i).Cells("支票").Value
|
190
|
208
|
End If
|
191
|
209
|
If DataGridView2.Rows(i).Cells("幣別").Value = "人民幣現金" Then
|
192
|
|
- TextBox15.Text = Val(TextBox15.Text) + DataGridView2.Rows(i).Cells("現金").Value
|
193
|
|
- TextBox12.Text = Val(TextBox12.Text) + DataGridView2.Rows(i).Cells("支出").Value
|
194
|
|
- TextBox2.Text = Val(TextBox2.Text) + DataGridView2.Rows(i).Cells("零用金").Value
|
195
|
|
- TextBox8.Text = Val(TextBox8.Text) + DataGridView2.Rows(i).Cells("支票").Value
|
|
210
|
+ If DataGridView2.Rows(i).Cells("主項").Value <> "上月結存" Then
|
|
211
|
+ TextBox15.Text = Val(TextBox15.Text) + DataGridView2.Rows(i).Cells("現金").Value
|
|
212
|
+ TextBox12.Text = Val(TextBox12.Text) + DataGridView2.Rows(i).Cells("支出").Value
|
|
213
|
+ TextBox2.Text = Val(TextBox2.Text) + DataGridView2.Rows(i).Cells("零用金").Value
|
|
214
|
+ TextBox8.Text = Val(TextBox8.Text) + DataGridView2.Rows(i).Cells("支票").Value
|
|
215
|
+ End If
|
196
|
216
|
End If
|
197
|
217
|
Next i
|
198
|
218
|
TextBox6.Text = Val(TextBox10.Text) + Val(TextBox5.Text) - Val(TextBox7.Text) : TextBox9.Text = Val(TextBox2.Text) + Val(TextBox15.Text) - Val(TextBox12.Text)
|
|
@@ -204,19 +224,49 @@ Public Class 營運成本收支單一覽表
|
204
|
224
|
TextBox12.Text = Strings.Format(Val(TextBox12.Text), "#,##0.00") : TextBox9.Text = Strings.Format(Val(TextBox9.Text), "#,##0.00")
|
205
|
225
|
End If
|
206
|
226
|
End Sub
|
207
|
|
- Private Sub DateTimePicker4_ValueChanged(sender As Object, e As EventArgs) Handles DateTimePicker4.ValueChanged
|
|
227
|
+ Private Sub 上個月_bt_Click(sender As Object, e As EventArgs) Handles 上個月_bt.Click
|
|
228
|
+ If 會計月_ch.Checked = True Then
|
|
229
|
+ 中間日期_dtp.Value = 中間日期_dtp.Value.AddMonths(-1)
|
|
230
|
+ 開始日期_dtp.Value = 中間日期_dtp.Value
|
|
231
|
+ 結束日期_dtp.Value = 中間日期_dtp.Value
|
|
232
|
+ Else
|
|
233
|
+ 中間日期_dtp.Value = 中間日期_dtp.Value.AddMonths(-1)
|
|
234
|
+ 開始日期_dtp.Value = 中間日期_dtp.Value.AddMonths(-1)
|
|
235
|
+ 結束日期_dtp.Value = 中間日期_dtp.Value
|
|
236
|
+ End If
|
|
237
|
+ 日期格式()
|
|
238
|
+ End Sub
|
|
239
|
+ Private Sub 下個月_bt_Click(sender As Object, e As EventArgs) Handles 下個月_bt.Click
|
|
240
|
+ If 會計月_ch.Checked = True Then
|
|
241
|
+ 中間日期_dtp.Value = 中間日期_dtp.Value.AddMonths(1)
|
|
242
|
+ 開始日期_dtp.Value = 中間日期_dtp.Value
|
|
243
|
+ 結束日期_dtp.Value = 中間日期_dtp.Value
|
|
244
|
+ Else
|
|
245
|
+ 中間日期_dtp.Value = 中間日期_dtp.Value.AddMonths(1)
|
|
246
|
+ 開始日期_dtp.Value = 中間日期_dtp.Value.AddMonths(-1)
|
|
247
|
+ 結束日期_dtp.Value = 中間日期_dtp.Value
|
|
248
|
+ End If
|
|
249
|
+ 日期格式()
|
|
250
|
+ End Sub
|
|
251
|
+ Private Sub DateTimePicker4_ValueChanged(sender As Object, e As EventArgs) Handles 開始日期_dtp.ValueChanged
|
208
|
252
|
Set_清單1() : Set_清單2() : 彙總計算()
|
209
|
253
|
End Sub
|
210
|
|
- Private Sub DateTimePicker3_ValueChanged(sender As Object, e As EventArgs) Handles DateTimePicker3.ValueChanged
|
|
254
|
+ Private Sub DateTimePicker3_ValueChanged(sender As Object, e As EventArgs) Handles 結束日期_dtp.ValueChanged
|
211
|
255
|
Set_清單1() : Set_清單2() : 彙總計算()
|
212
|
256
|
End Sub
|
|
257
|
+ Private Sub 會計月_CheckedChanged(sender As Object, e As EventArgs) Handles 會計月_ch.Click
|
|
258
|
+ 會計月_ch.Checked = True : 一般月_ch.Checked = False : 日期格式()
|
|
259
|
+ End Sub
|
|
260
|
+ Private Sub 一般月_CheckedChanged(sender As Object, e As EventArgs) Handles 一般月_ch.Click
|
|
261
|
+ 會計月_ch.Checked = False : 一般月_ch.Checked = True : 日期格式()
|
|
262
|
+ End Sub
|
213
|
263
|
Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.Click
|
214
|
|
- DataGridView1.Visible = True : DataGridView2.Visible = False : RadioButton1.Checked = True : RadioButton2.Checked = False
|
|
264
|
+ 明細_dgv.Visible = True : DataGridView2.Visible = False : RadioButton1.Checked = True : RadioButton2.Checked = False
|
215
|
265
|
TextBox5.Text = "0.00" : TextBox7.Text = "0.00" : TextBox6.Text = "0.00" : TextBox10.Text = "0.00" : TextBox11.Text = "0.00" : DataGridView4.Enabled = True
|
216
|
266
|
End Sub
|
217
|
267
|
Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.Click
|
218
|
|
- DataGridView1.Visible = False : DataGridView2.Visible = True : RadioButton1.Checked = False : RadioButton2.Checked = True
|
219
|
|
- TextBox1.Text = "" : TextBox3.Text = "" : TextBox4.Text = "" : DataGridView1.DataSource = Nothing : ds.Clear() : DataGridView4.Enabled = False
|
|
268
|
+ 明細_dgv.Visible = False : DataGridView2.Visible = True : RadioButton1.Checked = False : RadioButton2.Checked = True
|
|
269
|
+ TextBox1.Text = "" : TextBox3.Text = "" : TextBox4.Text = "" : 明細_dgv.DataSource = Nothing : ds.Clear() : DataGridView4.Enabled = False
|
220
|
270
|
彙總計算()
|
221
|
271
|
End Sub
|
222
|
272
|
Private Sub TextBox14_TextChanged(sender As Object, e As EventArgs) Handles TextBox14.TextChanged
|
|
@@ -248,11 +298,11 @@ Public Class 營運成本收支單一覽表
|
248
|
298
|
xlSheet.Cells(2, 1) = "收款日期" : xlSheet.Cells(2, 2) = "會計科目" : xlSheet.Cells(2, 3) = "客戶或用途"
|
249
|
299
|
xlSheet.Cells(2, 4) = "零用金" : xlSheet.Cells(2, 5) = "支票" : xlSheet.Cells(2, 6) = "現金" : xlSheet.Cells(2, 7) = "支出" : xlSheet.Cells(2, 8) = "現金餘額" : xlSheet.Cells(2, 9) = "票期"
|
250
|
300
|
|
251
|
|
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
|
252
|
|
- xlSheet.Cells(i + 3, 1) = DateTimePicker1.Value : xlSheet.Cells(i + 3, 2) = DataGridView1.Rows(i).Cells("會計科目").Value
|
253
|
|
- xlSheet.Cells(i + 3, 3) = DataGridView1.Rows(i).Cells("用途").Value : xlSheet.Cells(i + 3, 4) = DataGridView1.Rows(i).Cells("零用金").Value
|
254
|
|
- xlSheet.Cells(i + 3, 5) = DataGridView1.Rows(i).Cells("支票").Value : xlSheet.Cells(i + 3, 6) = DataGridView1.Rows(i).Cells("現金").Value
|
255
|
|
- xlSheet.Cells(i + 3, 7) = DataGridView1.Rows(i).Cells("支出").Value : xlSheet.Cells(i + 3, 9) = DataGridView1.Rows(i).Cells("票期").Value
|
|
301
|
+ For i As Integer = 0 To 明細_dgv.Rows.Count - 1
|
|
302
|
+ xlSheet.Cells(i + 3, 1) = DateTimePicker1.Value : xlSheet.Cells(i + 3, 2) = 明細_dgv.Rows(i).Cells("會計科目").Value
|
|
303
|
+ xlSheet.Cells(i + 3, 3) = 明細_dgv.Rows(i).Cells("用途").Value : xlSheet.Cells(i + 3, 4) = 明細_dgv.Rows(i).Cells("零用金").Value
|
|
304
|
+ xlSheet.Cells(i + 3, 5) = 明細_dgv.Rows(i).Cells("支票").Value : xlSheet.Cells(i + 3, 6) = 明細_dgv.Rows(i).Cells("現金").Value
|
|
305
|
+ xlSheet.Cells(i + 3, 7) = 明細_dgv.Rows(i).Cells("支出").Value : xlSheet.Cells(i + 3, 9) = 明細_dgv.Rows(i).Cells("票期").Value
|
256
|
306
|
If i = 0 Then
|
257
|
307
|
xlSheet.Cells(i + 3, 8) = "=D3+F3-G3"
|
258
|
308
|
Else
|