Imports System.Windows.Forms.DataVisualization.Charting

Public Class 財務報表1
    Private Sub Set_實際人工()
        Dim ds1 As New DataSet
        實際人工_dgv.DataSource = Nothing : ds1.Clear()
        實際人工_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        實際人工_dgv.ColumnHeadersHeight = 25 : 實際人工_dgv.AllowUserToAddRows = False : 實際人工_dgv.RowTemplate.Height = 25
        PA30 = "0" : SQL_工人薪資彙總報表_查詢1()
        da.Fill(ds1) : 實際人工_dgv.DataSource = ds1.Tables(0) : conn.Close()
        For i As Integer = 0 To 實際人工_dgv.Rows.Count - 1 : 實際人工_dgv.Rows(i).Cells(0).Value = "1" : Next
    End Sub
    Private Sub Set_虛擬人工()
        Dim ds1 As New DataSet
        虛擬人工_dgv.DataSource = Nothing : ds1.Clear()
        虛擬人工_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        虛擬人工_dgv.ColumnHeadersHeight = 25 : 虛擬人工_dgv.AllowUserToAddRows = False : 虛擬人工_dgv.RowTemplate.Height = 25
        PA30 = "1" : SQL_工人薪資彙總報表_查詢1()
        da.Fill(ds1) : 虛擬人工_dgv.DataSource = ds1.Tables(0) : conn.Close()
        For i As Integer = 0 To 虛擬人工_dgv.Rows.Count - 1 : 虛擬人工_dgv.Rows(i).Cells(0).Value = "1" : Next
    End Sub
    Private Sub Set_實際工資()
        Dim ds1 As New DataSet
        實際工資_dgv.DataSource = Nothing : ds1.Clear()
        實際工資_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        實際工資_dgv.ColumnHeadersHeight = 25 : 實際工資_dgv.AllowUserToAddRows = False : 實際工資_dgv.RowTemplate.Height = 25
        PA30 = "0" : SQL_工人薪資彙總報表_查詢2()
        da.Fill(ds1) : 實際工資_dgv.DataSource = ds1.Tables(0) : conn.Close()
        Dim 週數, 人數 As Integer : 週數 = 0 : 人數 = 0
        For i As Integer = 0 To 實際工資_dgv.Rows.Count - 1
            If IsDBNull(實際工資_dgv.Rows(i).Cells(2).Value) Then
                實際工資_dgv.Rows(i).Cells(2).Value = 0 : 實際工資_dgv.Rows(i).Cells(3).Value = 0
                實際工資_dgv.Rows(i).Cells(4).Value = 0 : 實際工資_dgv.Rows(i).Cells(5).Value = 0
            End If
            For II As Integer = 0 To 實際人工_dgv.Rows.Count - 1
                If 實際人工_dgv.Rows(II).Cells(2).Value.ToString = 實際工資_dgv.Rows(i).Cells(1).Value.ToString Then
                    週數 += CInt(實際人工_dgv.Rows(II).Cells(0).Value.ToString) : 人數 += CInt(實際人工_dgv.Rows(II).Cells(4).Value.ToString)
                End If
            Next : 實際工資_dgv.Rows(i).Cells(2).Value = Strings.Format(人數 / 週數, "#,##0")
        Next
        實際工資_dgv.Columns(3).FillWeight = 140 : 實際工資_dgv.Columns(4).Visible = False : 實際工資_dgv.Columns(5).Visible = False
        實際工資_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
        實際工資_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
    End Sub
    Private Sub Set_虛擬工資()
        Dim ds1 As New DataSet
        沖帳工資_dgv.DataSource = Nothing : ds1.Clear()
        沖帳工資_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        沖帳工資_dgv.ColumnHeadersHeight = 25 : 沖帳工資_dgv.AllowUserToAddRows = False : 沖帳工資_dgv.RowTemplate.Height = 25
        PA30 = "1" : SQL_工人薪資彙總報表_查詢2()
        da.Fill(ds1) : 沖帳工資_dgv.DataSource = ds1.Tables(0) : conn.Close()
        Dim 週數, 人數 As Integer : 週數 = 0 : 人數 = 0
        For i As Integer = 0 To 沖帳工資_dgv.Rows.Count - 1
            If IsDBNull(虛擬人工_dgv.Rows(i).Cells(2).Value) Then
                虛擬人工_dgv.Rows(i).Cells(2).Value = 0 : 虛擬人工_dgv.Rows(i).Cells(3).Value = 0
                虛擬人工_dgv.Rows(i).Cells(4).Value = 0 : 虛擬人工_dgv.Rows(i).Cells(5).Value = 0
            End If
            For II As Integer = 0 To 虛擬人工_dgv.Rows.Count - 1
                If 虛擬人工_dgv.Rows(II).Cells(2).Value.ToString = 沖帳工資_dgv.Rows(i).Cells(1).Value.ToString Then
                    週數 += CInt(虛擬人工_dgv.Rows(II).Cells(0).Value.ToString) : 人數 += CInt(虛擬人工_dgv.Rows(II).Cells(4).Value.ToString)
                End If
            Next : 沖帳工資_dgv.Rows(i).Cells(2).Value = Strings.Format(人數 / 週數, "#,##0")
        Next
        沖帳工資_dgv.Columns(3).FillWeight = 140 : 沖帳工資_dgv.Columns(4).Visible = False : 沖帳工資_dgv.Columns(5).Visible = False
        沖帳工資_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
        沖帳工資_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
    End Sub
    Private Sub Set_實際採購()
        Dim ds1 As New DataSet
        實際採購_dgv.DataSource = Nothing : ds1.Clear()
        實際採購_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        實際採購_dgv.ColumnHeadersHeight = 25 : 實際採購_dgv.AllowUserToAddRows = False : 實際採購_dgv.RowTemplate.Height = 25
        SQL_採購總額彙總報表_查詢1()
        da.Fill(ds1) : 實際採購_dgv.DataSource = ds1.Tables(0) : conn.Close()
        For i As Integer = 0 To 實際採購_dgv.Rows.Count - 1
            If IsDBNull(實際採購_dgv.Rows(i).Cells(2).Value) Then
                實際採購_dgv.Rows(i).Cells(2).Value = 0 : 實際採購_dgv.Rows(i).Cells(3).Value = 0
                實際採購_dgv.Rows(i).Cells(4).Value = 0 : 實際採購_dgv.Rows(i).Cells(5).Value = 0
            End If
        Next
        實際採購_dgv.Columns(3).FillWeight = 140 : 實際採購_dgv.Columns(4).Visible = False : 實際採購_dgv.Columns(5).Visible = False
        實際採購_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
        實際採購_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
    End Sub
    Private Sub Set_沖帳採購()
        Dim ds1 As New DataSet
        沖帳採購_dgv.DataSource = Nothing : ds1.Clear()
        沖帳採購_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        沖帳採購_dgv.ColumnHeadersHeight = 25 : 沖帳採購_dgv.AllowUserToAddRows = False : 沖帳採購_dgv.RowTemplate.Height = 25
        SQL_採購總額彙總報表_查詢2()
        da.Fill(ds1) : 沖帳採購_dgv.DataSource = ds1.Tables(0) : conn.Close()
        For i As Integer = 0 To 沖帳採購_dgv.Rows.Count - 1
            If IsDBNull(沖帳採購_dgv.Rows(i).Cells(2).Value) Then
                沖帳採購_dgv.Rows(i).Cells(2).Value = 0 : 沖帳採購_dgv.Rows(i).Cells(3).Value = 0
                沖帳採購_dgv.Rows(i).Cells(4).Value = 0 : 沖帳採購_dgv.Rows(i).Cells(5).Value = 0
            End If
        Next
        沖帳採購_dgv.Columns(3).FillWeight = 140 : 沖帳採購_dgv.Columns(4).Visible = False : 沖帳採購_dgv.Columns(5).Visible = False
        沖帳採購_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
        沖帳採購_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
    End Sub
    Private Sub Set_計算()
        Set_實際工資() : Set_虛擬工資() : Set_實際採購() : Set_沖帳採購() : 合計1_tb.Text = "0" : 合計2_tb.Text = "0" : 合計4_tb.Text = "0" : 合計5_tb.Text = "0"
        For i As Integer = 0 To 實際工資_dgv.Rows.Count - 1 : 實際工資_dgv.Rows(i).Cells(5).Value = 0
            合計1_tb.Text = CLng(合計1_tb.Text) + 實際工資_dgv.Rows(i).Cells(3).Value
            For II As Integer = 0 To 沖帳工資_dgv.Rows.Count - 1
                If 沖帳工資_dgv.Rows(II).Cells(1).Value.ToString = 實際工資_dgv.Rows(i).Cells(1).Value.ToString Then
                    實際工資_dgv.Rows(i).Cells(4).Value = 實際工資_dgv.Rows(i).Cells(3).Value + 沖帳工資_dgv.Rows(i).Cells(3).Value
                    If 實際工資_dgv.Rows(i).Cells(4).Value > 0 Then
                        實際工資_dgv.Rows(i).Cells(5).Value = CInt((實際工資_dgv.Rows(i).Cells(3).Value / 實際工資_dgv.Rows(i).Cells(4).Value) * 100)
                    End If
                End If
            Next
        Next
        For i As Integer = 0 To 沖帳工資_dgv.Rows.Count - 1 : 沖帳工資_dgv.Rows(i).Cells(5).Value = 0
            合計2_tb.Text = CLng(合計2_tb.Text) + 沖帳工資_dgv.Rows(i).Cells(3).Value
            For II As Integer = 0 To 實際工資_dgv.Rows.Count - 1
                If 實際工資_dgv.Rows(II).Cells(1).Value.ToString = 沖帳工資_dgv.Rows(i).Cells(1).Value.ToString Then
                    沖帳工資_dgv.Rows(i).Cells(4).Value = 沖帳工資_dgv.Rows(i).Cells(3).Value + 實際工資_dgv.Rows(i).Cells(3).Value
                    If 沖帳工資_dgv.Rows(i).Cells(4).Value > 0 Then
                        沖帳工資_dgv.Rows(i).Cells(5).Value = CInt((沖帳工資_dgv.Rows(i).Cells(3).Value / 沖帳工資_dgv.Rows(i).Cells(4).Value) * 100)
                    End If
                End If
            Next
        Next
        For i As Integer = 0 To 實際採購_dgv.Rows.Count - 1
            合計4_tb.Text = CLng(合計4_tb.Text) + 實際採購_dgv.Rows(i).Cells(3).Value
            For II As Integer = 0 To 沖帳採購_dgv.Rows.Count - 1
                If 沖帳採購_dgv.Rows(II).Cells(1).Value.ToString = 實際採購_dgv.Rows(i).Cells(1).Value.ToString Then
                    實際採購_dgv.Rows(i).Cells(4).Value = 實際採購_dgv.Rows(i).Cells(3).Value + 沖帳採購_dgv.Rows(i).Cells(3).Value
                    If 實際採購_dgv.Rows(i).Cells(4).Value > 0 Then
                        實際採購_dgv.Rows(i).Cells(5).Value = CInt((實際採購_dgv.Rows(i).Cells(3).Value / 實際採購_dgv.Rows(i).Cells(4).Value) * 100)
                    End If
                End If
            Next
        Next
        For i As Integer = 0 To 沖帳採購_dgv.Rows.Count - 1
            合計5_tb.Text = CLng(合計5_tb.Text) + 沖帳採購_dgv.Rows(i).Cells(3).Value
            For II As Integer = 0 To 實際採購_dgv.Rows.Count - 1
                If 實際採購_dgv.Rows(II).Cells(1).Value.ToString = 沖帳採購_dgv.Rows(i).Cells(1).Value.ToString Then
                    沖帳採購_dgv.Rows(i).Cells(4).Value = 沖帳採購_dgv.Rows(i).Cells(3).Value + 實際採購_dgv.Rows(i).Cells(3).Value
                    If 沖帳採購_dgv.Rows(i).Cells(4).Value > 0 Then
                        沖帳採購_dgv.Rows(i).Cells(5).Value = CInt((沖帳採購_dgv.Rows(i).Cells(3).Value / 沖帳採購_dgv.Rows(i).Cells(4).Value) * 100)
                    End If
                End If
            Next
        Next
        Set_進度條顯示1() : Set_進度條顯示2() : Set_進度條顯示3() : Set_進度條顯示4()
        比例1_tb.Text = CLng(合計1_tb.Text) / (CLng(合計1_tb.Text) + CLng(合計2_tb.Text)) * 100
        比例2_tb.Text = CLng(合計2_tb.Text) / (CLng(合計1_tb.Text) + CLng(合計2_tb.Text)) * 100
        比例4_tb.Text = CLng(合計4_tb.Text) / (CLng(合計4_tb.Text) + CLng(合計5_tb.Text)) * 100
        比例5_tb.Text = CLng(合計5_tb.Text) / (CLng(合計4_tb.Text) + CLng(合計5_tb.Text)) * 100
        比例3_tb.Text = CLng(比例1_tb.Text) + CLng(比例2_tb.Text) : 合計3_tb.Text = CLng(合計1_tb.Text) + CLng(合計2_tb.Text)
        比例6_tb.Text = CLng(比例4_tb.Text) + CLng(比例5_tb.Text) : 合計6_tb.Text = CLng(合計4_tb.Text) + CLng(合計5_tb.Text)
        比例1_tb.Text = Strings.Format(CLng(比例1_tb.Text), "#,##0.00") & " %" : 比例2_tb.Text = Strings.Format(CLng(比例2_tb.Text), "#,##0.00") & " %"
        比例3_tb.Text = Strings.Format(CLng(比例3_tb.Text), "#,##0.00") & " %" : 比例4_tb.Text = Strings.Format(CLng(比例4_tb.Text), "#,##0.00") & " %"
        比例5_tb.Text = Strings.Format(CLng(比例5_tb.Text), "#,##0.00") & " %" : 比例6_tb.Text = Strings.Format(CLng(比例6_tb.Text), "#,##0.00") & " %"
        合計1_tb.Text = Strings.Format(CLng(合計1_tb.Text), "#,##0") : 合計2_tb.Text = Strings.Format(CLng(合計2_tb.Text), "#,##0")
        合計3_tb.Text = Strings.Format(CLng(合計3_tb.Text), "#,##0") : 合計4_tb.Text = Strings.Format(CLng(合計4_tb.Text), "#,##0")
        合計5_tb.Text = Strings.Format(CLng(合計5_tb.Text), "#,##0") : 合計6_tb.Text = Strings.Format(CLng(合計6_tb.Text), "#,##0")
        彙總()
    End Sub
    Private Sub Set_進度條顯示1()
        Dim Col As New DataGridViewProgressColumn With {
            .Width = 30,
            .DataPropertyName = "比例"
        }
        Col.HeaderText = "Percent (%)" : Col.Name = "容量" : Col.DataPropertyName = "比例" : 實際工資_dgv.Columns.Insert(5, Col)
    End Sub
    Private Sub Set_進度條顯示2()
        Dim Col As New DataGridViewProgressColumn With {
            .Width = 30,
            .DataPropertyName = "比例"
        }
        Col.HeaderText = "Percent (%)" : Col.Name = "容量" : Col.DataPropertyName = "比例" : 沖帳工資_dgv.Columns.Insert(5, Col)
    End Sub
    Private Sub Set_進度條顯示3()
        Dim Col As New DataGridViewProgressColumn With {
            .Width = 30,
            .DataPropertyName = "比例"
        }
        Col.HeaderText = "Percent (%)" : Col.Name = "容量" : Col.DataPropertyName = "比例" : 實際採購_dgv.Columns.Insert(5, Col)
    End Sub
    Private Sub Set_進度條顯示4()
        Dim Col As New DataGridViewProgressColumn With {
            .Width = 30,
            .DataPropertyName = "比例"
        }
        Col.HeaderText = "Percent (%)" : Col.Name = "容量" : Col.DataPropertyName = "比例" : 沖帳採購_dgv.Columns.Insert(5, Col)
    End Sub
    Private Sub 年分清單()
        SQL_年分清單() : 年份2_cb.Items.Clear()
        While (dr.Read()) : 年份2_cb.Items.Add(dr("日期")) : End While : conn.Close()
    End Sub
    Private Sub 財務報表1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.MdiParent = HX_PGS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
        H(316) = True : 介面 = "H316" : 顯示說明(999, False)
        分母 = 100 : 分段1 = 0.35 : 分段2 = 0.34 : 分段3 = 0.65 : 分段4 = 0.64 : 進度條後墜 = " %"
        Panel2.SendToBack()
    End Sub
    Private Sub 財務報表1_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
        年分清單() : 年份2_cb.Text = Year(Today) : 重新讀取_bt.PerformClick()
    End Sub
    Private Sub 財務報表1_SizeChanged(sender As Object, e As EventArgs) Handles MyBase.SizeChanged
        MyMod.清單字體大小調整()
        實際人工_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
        虛擬人工_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
        實際採購_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
        沖帳採購_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
        實際工資_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
        沖帳工資_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
    End Sub
    Private Sub 財務報表1_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
        HX_PGS_ERP_SYS.WindowState = 0 : HX_PGS_ERP_SYS.MaximizeBox = True : HX_PGS_ERP_SYS.MinimizeBox = True
        H(611) = False : MyMod.虛擬桌面開啟()
    End Sub
    Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
        timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
    End Sub
    Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
        timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
    End Sub
    Private Sub 縮放1_bt_Click(sender As Object, e As EventArgs) Handles 縮放1_bt.Click
        Panel2.BringToFront() : Panel1.SendToBack()
    End Sub
    Private Sub 縮放2_bt_Click(sender As Object, e As EventArgs) Handles 縮放2_bt.Click
        Panel2.SendToBack() : Panel1.BringToFront()
    End Sub
    Private Sub 彙總()
        Chart1.ChartAreas.Clear() : Chart1.ChartAreas.Add(0) : Chart1.Series.Clear()
        Chart1.ChartAreas(0).AxisX.Minimum = 0
        Chart1.ChartAreas(0).AxisX.CustomLabels.Clear() ' 清除现有的自定义标签
        For i As Integer = 0 To 12        ' 添加自定义标签
            Dim label As New CustomLabel(i - 0.5, i + 0.5, i.ToString("D2"), 0, LabelMarkStyle.None)
            Chart1.ChartAreas(0).AxisX.CustomLabels.Add(label)
        Next
        Chart1.ChartAreas(0).AxisY.LabelStyle.Font = New Font("Arial", 8) : Chart1.ChartAreas(0).AxisY.LabelStyle.Format = "#,##0" & " M"

        Chart1.Series.Add("實際工資") : Chart1.Series("實際工資").ChartType = SeriesChartType.Line
        Chart1.Series.Add("沖帳工資") : Chart1.Series("沖帳工資").ChartType = SeriesChartType.Line
        Chart1.Series.Add("實際工資.") : Chart1.Series("實際工資.").ChartType = SeriesChartType.Column
        Chart1.Series.Add("沖帳工資.") : Chart1.Series("沖帳工資.").ChartType = SeriesChartType.Column
        For i As Integer = 0 To 實際工資_dgv.Rows.Count - 1
            Chart1.Series("實際工資.").Points.AddXY(實際工資_dgv.Rows(i).Cells("月").Value.ToString, CLng(實際工資_dgv.Rows(i).Cells("總金額").Value.ToString) / 1000000)
            Chart1.Series("沖帳工資.").Points.AddXY(沖帳工資_dgv.Rows(i).Cells("月").Value.ToString, CLng(沖帳工資_dgv.Rows(i).Cells("總金額").Value.ToString) / 1000000)
            Chart1.Series("實際工資").Points.AddXY(實際工資_dgv.Rows(i).Cells("月").Value.ToString, CLng(實際工資_dgv.Rows(i).Cells("總金額").Value.ToString) / 1000000)
            Chart1.Series("沖帳工資").Points.AddXY(沖帳工資_dgv.Rows(i).Cells("月").Value.ToString, CLng(沖帳工資_dgv.Rows(i).Cells("總金額").Value.ToString) / 1000000)
        Next

        Chart2.ChartAreas.Clear() : Chart2.ChartAreas.Add(0) : Chart2.Series.Clear()
        Chart2.ChartAreas(0).AxisX.Minimum = 0
        Chart2.ChartAreas(0).AxisX.CustomLabels.Clear() ' 清除现有的自定义标签
        For i As Integer = 0 To 12        ' 添加自定义标签
            Dim label As New CustomLabel(i - 0.5, i + 0.5, i.ToString("D2"), 0, LabelMarkStyle.None)
            Chart2.ChartAreas(0).AxisX.CustomLabels.Add(label)
        Next
        Chart2.ChartAreas(0).AxisY.LabelStyle.Font = New Font("Arial", 8) : Chart2.ChartAreas(0).AxisY.LabelStyle.Format = "#,##0" & " M"

        Chart2.Series.Add("實際採購") : Chart2.Series("實際採購").ChartType = SeriesChartType.Line
        Chart2.Series.Add("沖帳採購") : Chart2.Series("沖帳採購").ChartType = SeriesChartType.Line
        Chart2.Series.Add("實際採購.") : Chart2.Series("實際採購.").ChartType = SeriesChartType.Column
        Chart2.Series.Add("沖帳採購.") : Chart2.Series("沖帳採購.").ChartType = SeriesChartType.Column
        For i As Integer = 0 To 實際採購_dgv.Rows.Count - 1
            Chart2.Series("實際採購.").Points.AddXY(實際採購_dgv.Rows(i).Cells("月").Value.ToString, CLng(實際採購_dgv.Rows(i).Cells("總金額").Value.ToString) / 1000000)
            Chart2.Series("沖帳採購.").Points.AddXY(沖帳採購_dgv.Rows(i).Cells("月").Value.ToString, CLng(沖帳採購_dgv.Rows(i).Cells("總金額").Value.ToString) / 1000000)
            Chart2.Series("實際採購").Points.AddXY(實際採購_dgv.Rows(i).Cells("月").Value.ToString, CLng(實際採購_dgv.Rows(i).Cells("總金額").Value.ToString) / 1000000)
            Chart2.Series("沖帳採購").Points.AddXY(沖帳採購_dgv.Rows(i).Cells("月").Value.ToString, CLng(沖帳採購_dgv.Rows(i).Cells("總金額").Value.ToString) / 1000000)
        Next
    End Sub
    Private Sub 重新讀取_bt_Click(sender As Object, e As EventArgs) Handles 重新讀取_bt.Click
        PA25 = 年份2_cb.Text : Set_實際人工() : Set_虛擬人工() : Set_計算()
    End Sub
    Private Sub 年份2_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 年份2_cb.SelectedIndexChanged
        CB選擇清單(年份2_cb, 年份2_cb.Text) : 重新讀取_bt.PerformClick()
    End Sub
End Class