B70340 3 jaren geleden
bovenliggende
commit
6fb4324a3c

BIN
.vs/YD-ERP-SYS/v16/.suo Bestand weergeven


+ 1
- 1
YD-ERP-SYS/Module/全域變數.vb Bestand weergeven

@@ -3,7 +3,7 @@
3 3
     Public g_conn_type, gUserName, 登入人職稱, 登入人級別, 登入人組別, 登入人IP, 版本號, Target, Target1, Target2, FTP帳號, FTP密碼, FTP物理位置, 業務號碼, AA(99) As String
4 4
     Public BB(99), CC(99), 登入判斷 As Boolean
5 5
     '----系統版本-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6
-    Public 版本 As String = "2022032201"
6
+    Public 版本 As String = "2022032202"
7 7
     '----系統用全域變數-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8 8
     Public 列印用SQL, 列印用SQL2, 公司編號, 公司電話, 公司統編, 公司地址, 關鍵字編號, 進度條後墜 As String
9 9
     '----系統閒置-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

BIN
YD-ERP-SYS/bin/Debug/YD-ERP-SYS.exe Bestand weergeven


BIN
YD-ERP-SYS/bin/Debug/YD-ERP-SYS.pdb Bestand weergeven


BIN
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.exe Bestand weergeven


BIN
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.pdb Bestand weergeven


BIN
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.vbprojAssemblyReference.cache Bestand weergeven


+ 17
- 11
YD-ERP-SYS/財務系統管理/業績運費明細表.vb Bestand weergeven

@@ -8,7 +8,7 @@ Imports Microsoft.Office.Interop.Excel.XlThemeColor
8 8
 Imports Microsoft.Office.Interop.Excel.XlWindowState
9 9
 Imports Microsoft.Office.Interop.Excel
10 10
 Public Class 業績運費明細表
11
-    ReadOnly ds As New DataSet : Dim N1 As Integer
11
+    ReadOnly ds As New DataSet : Dim N1, 總數 As Integer : Dim 首次開啟 As Boolean
12 12
     Dim xlApp As Application : Dim xlBook As Workbook : Dim xlSheet As Worksheet
13 13
     Private Sub Set_清單1()
14 14
         運費明細表_dgv.DataSource = Nothing : ds.Clear()
@@ -27,12 +27,12 @@ Public Class 業績運費明細表
27 27
         運費明細表_dgv.EditMode = DataGridViewEditMode.EditOnEnter
28 28
         運費明細表_dgv.Columns(0).ReadOnly = True : 運費明細表_dgv.Columns(1).ReadOnly = True : 運費明細表_dgv.Columns(2).ReadOnly = True : 運費明細表_dgv.Columns(3).ReadOnly = True
29 29
         運費明細表_dgv.Columns(5).ReadOnly = True
30
-
31
-        計算()
30
+        總數 = 運費明細表_dgv.Rows.Count - 1
31
+        '計算()
32 32
     End Sub
33 33
     Private Sub 計算()
34 34
         NUD1.Value = 0 : NUD2.Value = 0
35
-        For I As Integer = 0 To 運費明細表_dgv.Rows.Count - 1
35
+        For I As Integer = 0 To 總數
36 36
             If IsDBNull(運費明細表_dgv.Rows(I).Cells("運費已付").Value) = True Then
37 37
                 運費明細表_dgv.Rows(I).Cells("運費已付").Value = False
38 38
             End If
@@ -56,13 +56,17 @@ Public Class 業績運費明細表
56 56
     End Sub
57 57
     Private Sub 業績運費明細表_Load(sender As Object, e As EventArgs) Handles MyBase.Load
58 58
         Me.MdiParent = YD_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
59
-        日期格式() : Set_清單1()
59
+        首次開啟 = True
60
+        日期格式() : Set_清單1() : 計算()
60 61
         If YD_ERP_SYS.Size.Width > 1440 And YD_ERP_SYS.Size.Height > 900 Then
61 62
             字體_NUD.Value = 9
62 63
         ElseIf YD_ERP_SYS.Size.Width <= 1440 And YD_ERP_SYS.Size.Height <= 900 Then
63 64
             字體_NUD.Value = 8
64 65
         End If
65 66
     End Sub
67
+    Private Sub 業績運費明細表_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
68
+        首次開啟 = False
69
+    End Sub
66 70
     Private Sub 業績獎金彙總表_SizeChanged(sender As Object, e As EventArgs) Handles MyBase.SizeChanged
67 71
         If YD_ERP_SYS.Size.Width > 1440 And YD_ERP_SYS.Size.Height > 900 Then
68 72
             字體_NUD.Value = 9
@@ -102,19 +106,21 @@ Public Class 業績運費明細表
102 106
         End Try
103 107
     End Sub
104 108
     Private Sub 運費明細表_dgv_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles 運費明細表_dgv.CellEnter
105
-        計算()
109
+        If 首次開啟 = False Then
110
+            計算()
111
+        End If
106 112
     End Sub
107 113
     Private Sub 上個月_bt_Click(sender As Object, e As EventArgs) Handles 上個月_bt.Click
108 114
         中間日期_dtp.Value = 中間日期_dtp.Value.AddMonths(-1)
109 115
         開始日期_dtp.Value = 中間日期_dtp.Value
110 116
         結束日期_dtp.Value = 中間日期_dtp.Value
111
-        日期格式() : Set_清單1()
117
+        日期格式() : Set_清單1() : 計算()
112 118
     End Sub
113 119
     Private Sub 下個月_bt_Click(sender As Object, e As EventArgs) Handles 下個月_bt.Click
114 120
         中間日期_dtp.Value = 中間日期_dtp.Value.AddMonths(1)
115 121
         開始日期_dtp.Value = 中間日期_dtp.Value
116 122
         結束日期_dtp.Value = 中間日期_dtp.Value
117
-        日期格式() : Set_清單1()
123
+        日期格式() : Set_清單1() : 計算()
118 124
     End Sub
119 125
     Private Sub 字體_NUD_ValueChanged(sender As Object, e As EventArgs) Handles 字體_NUD.ValueChanged
120 126
         運費明細表_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 字體_NUD.Value)
@@ -127,7 +133,7 @@ Public Class 業績運費明細表
127 133
                 PA = 運費明細表_dgv.Rows(I).Cells("單號").Value : PA1 = 運費明細表_dgv.Rows(I).Cells("運費已付").Value : PA2 = 運費明細表_dgv.Rows(I).Cells("備註").Value
128 134
                 SQL_業績運費_修正()
129 135
             Next : YD_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
130
-            MsgBox("存檔完成!!!") : Set_清單1()
136
+            MsgBox("存檔完成!!!") : Set_清單1() : 計算()
131 137
         Catch ex As Exception
132 138
             MsgBox(ex.Message)
133 139
         End Try
@@ -189,7 +195,7 @@ Public Class 業績運費明細表
189 195
         xlSheet.Range("D5:D" & N1 + 5).Select() : myExcel.Selection.Style = "Comma" : myExcel.Selection.NumberFormatLocal = "_-* #,##0_-;-* #,##0_-;_-* ""-""??_-;_-@_-"
190 196
         xlSheet.Range("B" & N1 + 6).Select() : myExcel.Selection.Style = "Comma" : myExcel.Selection.NumberFormatLocal = "_-* #,##0_-;-* #,##0_-;_-* ""-""??_-;_-@_-"
191 197
         xlSheet.Range("D" & N1 + 6).Select() : myExcel.Selection.Style = "Comma" : myExcel.Selection.NumberFormatLocal = "_-* #,##0_-;-* #,##0_-;_-* ""-""??_-;_-@_-"
192
-        xlSheet.Range("F" & N1 + 6).Select() : myExcel.Selection.Style = "Comma" : myExcel.Selection.NumberFormatLocal = "_-* #,##0_-;-* #,##0_-;_-* ""-""??_-;_-@_-"
198
+        xlSheet.Range("F" & N1 + 6).Select() : myExcel.Selection.Style = "Comma" : myExcel.Selection.NumberFormatLocal = "#,##0_ ;[紅色]-#,##0 "
193 199
         With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
194 200
             .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
195 201
 
@@ -220,7 +226,7 @@ Public Class 業績運費明細表
220 226
         myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
221 227
         myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
222 228
 
223
-        xlSheet.Range("A20:G" & N1 + 5).Select()
229
+        xlSheet.Range("A" & N1 + 5 & ":G" & N1 + 5).Select()
224 230
         myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
225 231
         myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
226 232
         With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With

Laden…
Annuleren
Opslaan