B70340 1 year ago
parent
commit
e9b569b9b5
33 changed files with 1525 additions and 1123 deletions
  1. BIN
      .vs/TENDEN-MES-SYS/FileContentIndex/492d8f7f-9044-403b-b3a5-4a4ffa565906.vsidx
  2. BIN
      .vs/TENDEN-MES-SYS/FileContentIndex/b5b08675-32f3-4ea4-85d4-67bd14ef1497.vsidx
  3. BIN
      .vs/TENDEN-MES-SYS/v17/.suo
  4. 35
    27
      TENDEN-MES-SYS/0、Module/SQL_圖片資料庫管理.vb
  5. 103
    71
      TENDEN-MES-SYS/0、Module/SQL_成本系統管理.vb
  6. 32
    18
      TENDEN-MES-SYS/0、Module/SQL_量產訂單系統.vb
  7. 3
    3
      TENDEN-MES-SYS/0、Module/全域變數.vb
  8. 2
    2
      TENDEN-MES-SYS/2、成本系統管理/出貨明細表1.Designer.vb
  9. 34
    30
      TENDEN-MES-SYS/2、成本系統管理/出貨明細表1.vb
  10. 95
    8
      TENDEN-MES-SYS/2、成本系統管理/出貨銷帳明細表.Designer.vb
  11. 417
    270
      TENDEN-MES-SYS/2、成本系統管理/出貨銷帳明細表.vb
  12. 10
    39
      TENDEN-MES-SYS/2、成本系統管理/列印_訂單價格利潤表.Designer.vb
  13. 166
    214
      TENDEN-MES-SYS/2、成本系統管理/列印_訂單價格利潤表.vb
  14. 45
    73
      TENDEN-MES-SYS/2、成本系統管理/訂單價格利潤明細表.Designer.vb
  15. 103
    87
      TENDEN-MES-SYS/2、成本系統管理/訂單價格利潤明細表.vb
  16. 16
    7
      TENDEN-MES-SYS/4、量產訂單管理/系統列印介面/列印_訂單明細.vb
  17. 33
    33
      TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/訂單控制表.Designer.vb
  18. 29
    14
      TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/訂單控制表.vb
  19. 3
    2
      TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/訂單明細表.Designer.vb
  20. 4
    9
      TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/訂單明細表.vb
  21. 67
    30
      TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/量產訂單輸入.Designer.vb
  22. 20
    18
      TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/量產訂單輸入.vb
  23. 47
    11
      TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告圖片導入資料庫.Designer.vb
  24. 33
    12
      TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告圖片導入資料庫.vb
  25. 19
    19
      TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告資料庫.Designer.vb
  26. 3
    1
      TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告資料庫.vb
  27. 144
    80
      TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告資料庫修正.Designer.vb
  28. 62
    45
      TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告資料庫修正.vb
  29. BIN
      TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.exe
  30. BIN
      TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.pdb
  31. BIN
      TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.exe
  32. BIN
      TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.pdb
  33. BIN
      TENDEN-MES-SYS/obj/Debug/天盾系統.vbproj.GenerateResource.cache

BIN
.vs/TENDEN-MES-SYS/FileContentIndex/492d8f7f-9044-403b-b3a5-4a4ffa565906.vsidx View File


BIN
.vs/TENDEN-MES-SYS/FileContentIndex/b5b08675-32f3-4ea4-85d4-67bd14ef1497.vsidx View File


BIN
.vs/TENDEN-MES-SYS/v17/.suo View File


+ 35
- 27
TENDEN-MES-SYS/0、Module/SQL_圖片資料庫管理.vb View File

@@ -7,14 +7,21 @@
7 7
     End Sub
8 8
     Friend Sub SQL_訂單控制表1()
9 9
         ConnOpen()
10
-        SQL1 = "SELECT   訂單流水號, 年份季度, 客戶訂單號, 形體號, 驗貨報告圖片 FROM " & 訂單資料表(1) & "
11
-                WHERE   (客戶訂單號 LIKE '%" & 驗貨報告資料庫修正.客戶訂單號_tb.Text & "%') AND (形體號 LIKE N'" & 驗貨報告資料庫修正.型體名稱_tb.Text & "')"
10
+        SQL1 = "SELECT   訂單流水號, 年份季度, 客戶訂單號, 力威訂單號 AS 客戶訂單號2, 形體號, 驗貨報告圖片, 驗報圖庫, 驗貨報告圖片2, 驗報圖庫2
11
+                FROM " & 訂單資料表(1) & "
12
+                WHERE   (客戶訂單號 LIKE '%" & 驗貨報告資料庫修正.客戶訂單號_tb.Text & "%') OR (力威訂單號 LIKE N'" & 驗貨報告資料庫修正.客戶訂單號_tb.Text & "') OR
13
+                        (客戶訂單號 LIKE '%" & 驗貨報告資料庫修正.客戶訂單號2_tb.Text & "%') OR (力威訂單號 LIKE N'" & 驗貨報告資料庫修正.客戶訂單號2_tb.Text & "')"
12 14
         CmdSet_For_DGV()
13 15
     End Sub
14 16
     Friend Sub SQL_訂單控制表修改()
15 17
         ConnOpen()
16
-        SQL1 = "UPDATE " & 訂單資料表(1) & " SET 驗貨報告圖片 = N'" & 驗貨報告資料庫修正.驗貨報告編號_tb.Text & "'
17
-                    WHERE   (客戶訂單號 LIKE N'" & PA & "') AND (形體號 LIKE N'" & PA1 & "')"
18
+        SQL1 = "UPDATE " & 訂單資料表(1) & " SET 驗貨報告圖片 = N'" & PA2 & "', 驗報圖庫 = N'" & PA3 & "', 驗貨報告圖片2 = N'" & PA4 & "', 驗報圖庫2 = N'" & PA5 & "'
19
+                    WHERE   (客戶訂單號 LIKE N'" & PA & "') AND (形體號 LIKE N'" & PA6 & "')"
20
+        CmdSet_For_dr()
21
+    End Sub
22
+    Friend Sub SQL_驗貨報告資料刪除()
23
+        圖片庫 = PA1 : SQL_連線字串_圖片資料庫() : ConnOpen_工程圖庫SQL()
24
+        SQL1 = "DELETE 驗貨報告圖庫 WHERE  (驗貨報告編號 LIKE N'" & 驗貨報告資料庫修正.驗貨報告編號_tb.Text & "')"
18 25
         CmdSet_For_dr()
19 26
     End Sub
20 27
     '---------------------------驗貨報告圖片導入資料庫--------------------------------------------------------------
@@ -22,47 +29,47 @@
22 29
         ConnOpen() : SQL1 = "SELECT  TOP (1) 圖片資料庫  FROM  圖片資料庫管理  WHERE  (是否可用 = 0)  ORDER BY  圖片資料庫" : CmdSet_For_dr()
23 30
     End Sub
24 31
     Friend Sub SQL_訂單清單()
25
-        SQL1 = "SELECT    訂單流水號, 年份季度, 力威訂單號 AS 客戶訂單號, 形體號, 顏色, 楦型, 訂單數量, 備註, 訂單種類, 生產工廠, 裁斷時間, 針車時間, 
26
-                          成型時間, 驗貨時間, 驗貨報告圖片, 客戶訂單號 AS 力威訂單號, 資料流水號 FROM " & 訂單資料表(1) & " 
27
-                WHERE    (CXL = 0 OR CXL IS NULL) AND (訂單數量 - 出貨數量 <> 0) AND (驗貨報告圖片 LIKE '' OR 驗貨報告圖片 IS NULL OR 驗貨報告圖片2 LIKE '' OR 驗貨報告圖片2 IS NULL) 
32
+        SQL1 = "SELECT    訂單流水號, 年份季度, 力威訂單號 AS 客戶訂單號, 客戶訂單號 AS 客戶訂單號2, 形體號, 顏色, 楦型, 訂單數量, 備註, 訂單種類, 生產工廠, 裁斷時間, 針車時間, 
33
+                          成型時間, 驗貨時間, 驗貨報告圖片, 資料流水號, 驗貨報告圖片2 FROM " & 訂單資料表(1) & " 
34
+                WHERE    (驗貨報告圖片 LIKE '' OR 驗貨報告圖片 IS NULL OR 驗貨報告圖片2 LIKE '' OR 驗貨報告圖片2 IS NULL) 
28 35
                 ORDER BY  SUBSTRING(訂單流水號, 4, 6), 客戶訂單號, 形體號"
29 36
     End Sub
30 37
     Friend Sub SQL_訂單清單查詢()
31
-        SQL1 = "SELECT   訂單流水號, 年份季度, 力威訂單號 AS 客戶訂單號, 形體號, 顏色, 楦型, 訂單數量, 備註, 訂單種類, 生產工廠, 裁斷時間, 針車時間, 成型時間, 驗貨時間, 驗貨報告圖片, 客戶訂單號 AS 力威訂單號 FROM " & 訂單資料表(1) & " 
32
-                WHERE   (CXL = 0 OR CXL IS NULL) AND (訂單數量 - 出貨數量 <> 0) AND (驗貨時間 LIKE '') AND (訂單流水號 LIKE '%" & PA & "%' OR 年份季度 LIKE '%" & PA & "%' OR 
33
-                         客戶訂單號 LIKE '%" & PA & "%' OR 形體號 LIKE '%" & PA & "%' OR 生產工廠 LIKE '%" & PA & "%' OR 力威訂單號 LIKE '%" & PA & "%') 
34
-                ORDER BY SUBSTRING(訂單流水號, 4, 6), 客戶訂單號, 形體號"
38
+        SQL1 = "SELECT    訂單流水號, 年份季度, 力威訂單號 AS 客戶訂單號, 客戶訂單號 AS 客戶訂單號2, 形體號, 顏色, 楦型, 訂單數量, 備註, 訂單種類, 生產工廠, 裁斷時間, 針車時間, 
39
+                          成型時間, 驗貨時間, 驗貨報告圖片, 資料流水號, 驗貨報告圖片2 FROM " & 訂單資料表(1) & " 
40
+                WHERE    (驗貨報告圖片 LIKE '' OR 驗貨報告圖片 IS NULL OR 驗貨報告圖片2 LIKE '' OR 驗貨報告圖片2 IS NULL) AND (訂單流水號 LIKE '%" & PA & "%' OR 年份季度 LIKE '%" & PA & "%' OR 
41
+                         客戶訂單號 LIKE '%" & PA & "%' OR 形體號 LIKE '%" & PA & "%' OR 生產工廠 LIKE '%" & PA & "%' OR 力威訂單號 LIKE '%" & PA & "%')
42
+                ORDER BY  SUBSTRING(訂單流水號, 4, 6), 客戶訂單號, 形體號"
35 43
     End Sub
36 44
     Friend Sub SQL_查詢最後一筆驗貨報告編號()
37 45
         圖片庫 = PA1 : SQL_連線字串_圖片資料庫() : ConnOpen_工程圖庫SQL()
38 46
         SQL1 = "SELECT TOP (1) 驗貨報告編號 FROM 驗貨報告圖庫 ORDER BY 驗貨報告編號 DESC"
39 47
         CmdSet_For_dr()
40 48
     End Sub
41
-    Friend Sub SQL_新增驗貨報告編號_測試()
49
+    Friend Sub SQL_修改驗貨報告圖庫_正式()
42 50
         圖片庫 = PA1 : SQL_連線字串_圖片資料庫() : ConnOpen_工程圖庫SQL()
43
-        SQL1 = "INSERT INTO 驗貨報告圖庫 (客戶訂單號, 型體名稱, 驗貨報告編號, 操作人, 副檔名, 驗貨報告) 
44
-                SELECT N'" & 驗貨報告圖片導入資料庫.客戶訂單號_tb.Text & "','" & 驗貨報告圖片導入資料庫.型體名稱_tb.Text & "',
45
-                        '" & 驗貨報告圖片導入資料庫.TextBox3.Text & "','" & gUserName & "', '" & 驗貨報告圖片導入資料庫.副檔名_bt.Text & "', @binary_file"
51
+        SQL1 = "UPDATE 驗貨報告圖庫 SET  操作人 = N'" & gUserName & "', 副檔名 = '" & 驗貨報告圖片導入資料庫.副檔名_bt.Text & "', 驗貨報告 = @binary_file 
52
+                       WHERE 驗貨報告編號 LIKE N'" & 驗貨報告圖片導入資料庫.驗報編碼_tb.Text & "'"
46 53
         CmdSet_For_dr_pic()
47 54
     End Sub
48 55
     Friend Sub SQL_新增驗貨報告圖庫_正式()
49 56
         圖片庫 = PA1 : SQL_連線字串_圖片資料庫() : ConnOpen_工程圖庫SQL()
50 57
         SQL1 = "INSERT INTO 驗貨報告圖庫 (客戶訂單號, 型體名稱, 驗貨報告編號, 操作人, 副檔名, 驗貨報告) 
51 58
                 SELECT N'" & 驗貨報告圖片導入資料庫.客戶訂單號_tb.Text & "','" & 驗貨報告圖片導入資料庫.型體名稱_tb.Text & "',
52
-                        '" & 驗貨報告圖片導入資料庫.TextBox3.Text & "','" & gUserName & "', '" & 驗貨報告圖片導入資料庫.副檔名_bt.Text & "', @binary_file"
59
+                        '" & 驗貨報告圖片導入資料庫.TextBox3.Text & "',N'" & gUserName & "', '" & 驗貨報告圖片導入資料庫.副檔名_bt.Text & "', @binary_file"
53 60
         CmdSet_For_dr_pic()
54 61
     End Sub
55 62
     Friend Sub SQL_修改驗貨報告圖庫()
56 63
         ConnOpen()
57 64
         SQL1 = "UPDATE " & 訂單資料表(1) & " SET 驗貨時間 = '" & DTP & "', 驗貨報告圖片 = '" & 驗貨報告圖片導入資料庫.TextBox3.Text & "', 驗報圖庫 = '" & PA20 & "'
58
-                WHERE (訂單流水號 LIKE N'" & 驗貨報告圖片導入資料庫.天盾訂單號_tb.Text & "' AND 客戶訂單號 LIKE N'" & 驗貨報告圖片導入資料庫.客戶訂單號_tb.Text & "' AND 
65
+                WHERE (訂單流水號 LIKE N'" & 驗貨報告圖片導入資料庫.天盾訂單號_tb.Text & "' AND 力威訂單號 LIKE N'" & 驗貨報告圖片導入資料庫.客戶訂單號_tb.Text & "' AND 
59 66
                        形體號 LIKE N'" & 驗貨報告圖片導入資料庫.型體名稱_tb.Text & "')"
60 67
         CmdSet_For_dr()
61 68
     End Sub
62 69
     Friend Sub SQL_修改驗貨報告圖庫1()
63 70
         ConnOpen()
64 71
         SQL1 = "UPDATE " & 訂單資料表(1) & " SET 驗貨報告圖片2 = '" & 驗貨報告圖片導入資料庫.TextBox3.Text & "', 驗報圖庫2 = '" & PA20 & "'
65
-                WHERE (訂單流水號 LIKE N'" & 驗貨報告圖片導入資料庫.天盾訂單號_tb.Text & "' AND 客戶訂單號 LIKE N'" & 驗貨報告圖片導入資料庫.客戶訂單號_tb.Text & "' AND 
72
+                WHERE (訂單流水號 LIKE N'" & 驗貨報告圖片導入資料庫.天盾訂單號_tb.Text & "' AND 力威訂單號 LIKE N'" & 驗貨報告圖片導入資料庫.客戶訂單號_tb.Text & "' AND 
66 73
                        形體號 LIKE N'" & 驗貨報告圖片導入資料庫.型體名稱_tb.Text & "')"
67 74
         CmdSet_For_dr()
68 75
     End Sub
@@ -72,7 +79,7 @@
72 79
                            訂單流水號, 年份季度, 力威訂單號 AS 客戶訂單號, 形體號 AS 型體名稱, 顏色, 驗貨報告圖片 AS 驗貨報告編號, 
73 80
                            驗報圖庫, 驗貨報告圖片2 AS 驗貨報告編號2,  驗報圖庫2
74 81
                 FROM      " & 訂單資料表(1) & "
75
-                WHERE      驗貨報告圖片 NOT LIKE '' AND 驗貨報告圖片 IS NOT NULL
82
+                WHERE      (驗貨報告圖片 NOT LIKE '' AND 驗貨報告圖片 IS NOT NULL) OR (驗貨報告圖片2 NOT LIKE '' AND 驗貨報告圖片2 IS NOT NULL)
76 83
                 GROUP BY   訂單流水號, 年份季度, 形體號, 顏色, 形體號, 力威訂單號, 驗貨報告圖片, 驗報圖庫, 驗貨報告圖片2, 驗報圖庫2
77 84
                 ORDER BY   客戶訂單號, 型體名稱"
78 85
     End Sub
@@ -82,14 +89,15 @@
82 89
         CmdSet_For_dr()
83 90
     End Sub
84 91
     Friend Sub SQL_驗貨報告圖庫查詢1()
85
-        SQL1 = "SELECT   " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".年份季度, " & PA20 & ".dbo.驗貨報告圖庫.客戶訂單號, " & PA20 & ".dbo.驗貨報告圖庫.型體名稱, 
86
-                         " & 訂單資料表(1) & ".顏色,  " & PA20 & ".dbo.驗貨報告圖庫.驗貨報告編號 
87
-                FROM     " & PA20 & ".dbo.驗貨報告圖庫 LEFT OUTER JOIN " & 訂單資料表(1) & " ON " & PA20 & ".dbo.驗貨報告圖庫.客戶訂單號 = " & 訂單資料表(1) & ".客戶訂單號 
88
-                WHERE    " & 訂單資料表(1) & ".訂單流水號 LIKE '%" & PA & "%' OR " & 訂單資料表(1) & ".年份季度 LIKE '%" & PA & "%' OR 
89
-                         " & PA20 & ".dbo.驗貨報告圖庫.客戶訂單號 LIKE '%" & PA & "%' OR " & PA20 & ".dbo.驗貨報告圖庫.型體名稱 LIKE '%" & PA & "%' 
90
-                GROUP BY " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".年份季度, " & PA20 & ".dbo.驗貨報告圖庫.客戶訂單號, " & PA20 & ".dbo.驗貨報告圖庫.型體名稱, 
91
-                         " & 訂單資料表(1) & ".顏色, " & PA20 & ".dbo.驗貨報告圖庫.驗貨報告編號 
92
-                ORDER BY " & PA20 & ".dbo.驗貨報告圖庫.客戶訂單號, " & PA20 & ".dbo.驗貨報告圖庫.型體名稱"
92
+        SQL1 = "SELECT DISTINCT 
93
+                           訂單流水號, 年份季度, 力威訂單號 AS 客戶訂單號, 形體號 AS 型體名稱, 顏色, 驗貨報告圖片 AS 驗貨報告編號, 
94
+                           驗報圖庫, 驗貨報告圖片2 AS 驗貨報告編號2,  驗報圖庫2
95
+                FROM      " & 訂單資料表(1) & "
96
+                WHERE     ((驗貨報告圖片 NOT LIKE '' AND 驗貨報告圖片 IS NOT NULL) OR (驗貨報告圖片2 NOT LIKE '' AND 驗貨報告圖片2 IS NOT NULL)) AND
97
+                           (訂單流水號 LIKE N'%" & PA & "%' OR 年份季度 LIKE N'%" & PA & "%' OR 力威訂單號 LIKE N'%" & PA & "%' OR 形體號 LIKE N'%" & PA & "%' OR 
98
+                            顏色 LIKE N'%" & PA & "%' )
99
+                GROUP BY   訂單流水號, 年份季度, 形體號, 顏色, 形體號, 力威訂單號, 驗貨報告圖片, 驗報圖庫, 驗貨報告圖片2, 驗報圖庫2
100
+                ORDER BY   客戶訂單號, 型體名稱"
93 101
     End Sub
94 102
     Friend Sub SQL_驗貨報告圖庫3()
95 103
         圖片庫 = PA1 : SQL_連線字串_圖片資料庫()

+ 103
- 71
TENDEN-MES-SYS/0、Module/SQL_成本系統管理.vb View File

@@ -61,7 +61,7 @@
61 61
                             " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".楦型, " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, " & 訂單資料表(1) & ".單價, 
62 62
                             " & 訂單資料表(1) & ".總金額, " & 訂單資料表(1) & ".備註, " & 訂單資料表(1) & ".生產工廠 AS 工廠, " & 訂單資料表(1) & ".訂單種類, 
63 63
                             " & 訂單資料表(6) & ".Quantity, " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS FTY_1,
64
-                            " & 訂單資料表(6) & ".FTYPrice AS FTY_2, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) 
64
+                            " & 訂單資料表(6) & ".FTYPrice AS FTY_2, " & 訂單資料表(6) & ".客戶單價 AS FTY_3, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) 
65 65
                             * " & 訂單資料表(6) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) 
66 66
                             * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionDarren, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) 
67 67
                             * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionTendenza, " & 訂單資料表(6) & ".FTYPrice AS [%_1], " & 訂單資料表(6) & ".FTYPrice AS [%_2], 
@@ -94,19 +94,20 @@
94 94
                             " & 訂單資料表(6) & ".年份, " & 訂單資料表(6) & ".利潤表流水號, " & 訂單資料表(1) & ".訂單數量 - " & 訂單資料表(6) & ".Quantity, 
95 95
                             STYLELIST.ItemNumber, " & 訂單資料表(6) & ".審核, " & 訂單資料表(1) & ".客戶訂單號, " & 訂單資料表(1) & ".ProductID, 
96 96
                             " & 訂單資料表(0) & ".SalesOrder, " & 訂單資料表(0) & ".CustomerName, " & 訂單資料表(0) & ".最終運送, " & 訂單資料表(6) & ".FTY廠價, 
97
-                            " & 訂單資料表(1) & ".工廠回復交期, " & 訂單資料表(1) & ".TVW
97
+                            " & 訂單資料表(1) & ".工廠回復交期, " & 訂單資料表(1) & ".TVW, " & 訂單資料表(6) & ".客戶單價
98 98
                 ORDER BY    " & 訂單資料表(1) & ".訂單流水號 DESC"
99 99
     End Sub
100 100
     '----------------------------------訂單價格利潤明細表--------------------------------------------------------------
101 101
     Friend Sub SQL_訂單價格利潤明細表1()
102
-        SQL1 = "SELECT " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".資料流水號, " & 訂單資料表(1) & ".年份季度, " & 訂單資料表(1) & ".力威訂單號, " & 訂單資料表(1) & ".形體號, 
103
-                       " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".ProductID, " & 訂單資料表(1) & ".楦型, " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, 
104
-                       " & 訂單資料表(1) & ".單價, 
102
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : 表頭1 = "HTS#" : Else : 表頭1 = "ProductID" : End If
103
+        SQL1 = "SELECT " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".資料流水號, " & 訂單資料表(1) & ".年份季度, " & 訂單資料表(1) & ".力威訂單號 AS 客人訂單號, 
104
+                       " & 訂單資料表(1) & ".形體號, " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".ProductID AS [" & 表頭1 & "], " & 訂單資料表(1) & ".楦型, 
105
+                       " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, " & 訂單資料表(1) & ".單價, 
105 106
                        " & 訂單資料表(1) & ".總金額, " & 訂單資料表(1) & ".備註, " & 訂單資料表(1) & ".生產工廠 AS 工廠, " & 訂單資料表(1) & ".訂單種類, " & 訂單資料表(6) & ".Quantity, 
106
-                       " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS FTY_1, " & 訂單資料表(6) & ".FTYPrice AS FTY_2, 
107
-                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * 
108
-                       " & 訂單資料表(6) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionDarren, 
109
-                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionTendenza, " & 訂單資料表(6) & ".FTYPrice AS [%_1],
107
+                       " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS 實際廠價, " & 訂單資料表(6) & ".FTYPrice AS 天盾單價, 
108
+                       " & 訂單資料表(6) & ".客戶單價, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * 
109
+                       " & 訂單資料表(6) & ".Quantity AS [Commission TTL], (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS [Commission Darren], 
110
+                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS [Commission Tendenza], " & 訂單資料表(6) & ".FTYPrice AS [%_1],
110 111
                        " & 訂單資料表(6) & ".FTYPrice AS [%_2], " & 訂單資料表(6) & ".BasicPrice, " & 訂單資料表(6) & ".Polybag AS [PG/MOQ], " & 訂單資料表(6) & ".FOOTformOrPETform AS FOOTorPET, 
111 112
                        " & 訂單資料表(6) & ".Tooling, " & 訂單資料表(6) & ".RubberBand, " & 訂單資料表(6) & ".JHOOK, " & 訂單資料表(6) & ".WaterResistant, " & 訂單資料表(6) & ".P16VAT, 
112 113
                        " & 訂單資料表(6) & ".EXWsaving, " & 訂單資料表(6) & ".Quantity * " & 訂單資料表(6) & ".Tooling AS CollectedToolng, " & 訂單資料表(6) & ".年份, 
@@ -117,14 +118,15 @@
117 118
                 ORDER BY " & 訂單資料表(1) & ".訂單流水號 DESC, " & 訂單資料表(1) & ".形體號, " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".楦型"
118 119
     End Sub
119 120
     Friend Sub SQL_訂單價格利潤明細表2()
120
-        SQL1 = "SELECT " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".資料流水號, " & 訂單資料表(1) & ".年份季度, " & 訂單資料表(1) & ".力威訂單號, " & 訂單資料表(1) & ".形體號, 
121
-                       " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".ProductID, " & 訂單資料表(1) & ".楦型, " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, 
122
-                       " & 訂單資料表(1) & ".單價, 
121
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : 表頭1 = "HTS#" : Else : 表頭1 = "ProductID" : End If
122
+        SQL1 = "SELECT " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".資料流水號, " & 訂單資料表(1) & ".年份季度, " & 訂單資料表(1) & ".力威訂單號 AS 客人訂單號, 
123
+                       " & 訂單資料表(1) & ".形體號, " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".ProductID AS [" & 表頭1 & "], " & 訂單資料表(1) & ".楦型, 
124
+                       " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, " & 訂單資料表(1) & ".單價, 
123 125
                        " & 訂單資料表(1) & ".總金額, " & 訂單資料表(1) & ".備註, " & 訂單資料表(1) & ".生產工廠 AS 工廠, " & 訂單資料表(1) & ".訂單種類, " & 訂單資料表(6) & ".Quantity, 
124
-                       " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS FTY_1, " & 訂單資料表(6) & ".FTYPrice AS FTY_2, 
125
-                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * 
126
-                       " & 訂單資料表(6) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionDarren, 
127
-                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionTendenza, " & 訂單資料表(6) & ".FTYPrice AS [%_1],
126
+                       " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS 實際廠價, " & 訂單資料表(6) & ".FTYPrice AS 天盾單價, 
127
+                       " & 訂單資料表(6) & ".客戶單價, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * 
128
+                       " & 訂單資料表(6) & ".Quantity AS [Commission TTL], (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS [Commission Darren], 
129
+                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS [Commission Tendenza], " & 訂單資料表(6) & ".FTYPrice AS [%_1],
128 130
                        " & 訂單資料表(6) & ".FTYPrice AS [%_2], " & 訂單資料表(6) & ".BasicPrice, " & 訂單資料表(6) & ".Polybag AS [PG/MOQ], " & 訂單資料表(6) & ".FOOTformOrPETform AS FOOTorPET, 
129 131
                        " & 訂單資料表(6) & ".Tooling, " & 訂單資料表(6) & ".RubberBand, " & 訂單資料表(6) & ".JHOOK, " & 訂單資料表(6) & ".WaterResistant, " & 訂單資料表(6) & ".P16VAT, 
130 132
                        " & 訂單資料表(6) & ".EXWsaving, " & 訂單資料表(6) & ".Quantity * " & 訂單資料表(6) & ".Tooling AS CollectedToolng, " & 訂單資料表(6) & ".年份, 
@@ -140,14 +142,15 @@
140 142
                 ORDER BY " & 訂單資料表(1) & ".訂單流水號 DESC"
141 143
     End Sub
142 144
     Friend Sub SQL_訂單價格利潤明細表3()
143
-        SQL1 = "SELECT " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".資料流水號, " & 訂單資料表(1) & ".年份季度, " & 訂單資料表(1) & ".力威訂單號, " & 訂單資料表(1) & ".形體號, 
144
-                       " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".ProductID, " & 訂單資料表(1) & ".楦型, " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, 
145
-                       " & 訂單資料表(1) & ".單價, 
145
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : 表頭1 = "HTS#" : Else : 表頭1 = "ProductID" : End If
146
+        SQL1 = "SELECT " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".資料流水號, " & 訂單資料表(1) & ".年份季度, " & 訂單資料表(1) & ".力威訂單號 AS 客人訂單號, 
147
+                       " & 訂單資料表(1) & ".形體號, " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".ProductID AS [" & 表頭1 & "], " & 訂單資料表(1) & ".楦型, 
148
+                       " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, " & 訂單資料表(1) & ".單價, 
146 149
                        " & 訂單資料表(1) & ".總金額, " & 訂單資料表(1) & ".備註, " & 訂單資料表(1) & ".生產工廠 AS 工廠, " & 訂單資料表(1) & ".訂單種類, " & 訂單資料表(6) & ".Quantity, 
147
-                       " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS FTY_1, " & 訂單資料表(6) & ".FTYPrice AS FTY_2, 
148
-                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * 
149
-                       " & 訂單資料表(6) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionDarren, 
150
-                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionTendenza, " & 訂單資料表(6) & ".FTYPrice AS [%_1],
150
+                       " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS 實際廠價, " & 訂單資料表(6) & ".FTYPrice AS 天盾單價, 
151
+                       " & 訂單資料表(6) & ".客戶單價, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * 
152
+                       " & 訂單資料表(6) & ".Quantity AS [Commission TTL], (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS [Commission Darren], 
153
+                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS [Commission Tendenza], " & 訂單資料表(6) & ".FTYPrice AS [%_1],
151 154
                        " & 訂單資料表(6) & ".FTYPrice AS [%_2], " & 訂單資料表(6) & ".BasicPrice, " & 訂單資料表(6) & ".Polybag AS [PG/MOQ], " & 訂單資料表(6) & ".FOOTformOrPETform AS FOOTorPET, 
152 155
                        " & 訂單資料表(6) & ".Tooling, " & 訂單資料表(6) & ".RubberBand, " & 訂單資料表(6) & ".JHOOK, " & 訂單資料表(6) & ".WaterResistant, " & 訂單資料表(6) & ".P16VAT, 
153 156
                        " & 訂單資料表(6) & ".EXWsaving, " & 訂單資料表(6) & ".Quantity * " & 訂單資料表(6) & ".Tooling AS CollectedToolng, " & 訂單資料表(6) & ".年份, 
@@ -159,15 +162,16 @@
159 162
                 ORDER BY " & 訂單資料表(1) & ".訂單流水號 DESC"
160 163
     End Sub
161 164
     Friend Sub SQL_訂單價格利潤明細表4()
165
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : 表頭1 = "HTS#" : Else : 表頭1 = "ProductID" : End If
162 166
         列印用SQL = "WHERE " & 訂單資料表(6) & ".年份 LIKE '" & PA25 & "' AND (" & 訂單資料表(1) & ".CXL IS NULL OR " & 訂單資料表(1) & ".CXL = 0) "
163
-        SQL1 = "SELECT " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".資料流水號, " & 訂單資料表(1) & ".年份季度, " & 訂單資料表(1) & ".力威訂單號, " & 訂單資料表(1) & ".形體號, 
164
-                       " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".ProductID, " & 訂單資料表(1) & ".楦型, " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, 
165
-                       " & 訂單資料表(1) & ".單價, 
167
+        SQL1 = "SELECT " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".資料流水號, " & 訂單資料表(1) & ".年份季度, " & 訂單資料表(1) & ".力威訂單號 AS 客人訂單號, 
168
+                       " & 訂單資料表(1) & ".形體號, " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".ProductID AS [" & 表頭1 & "], " & 訂單資料表(1) & ".楦型, 
169
+                       " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, " & 訂單資料表(1) & ".單價, 
166 170
                        " & 訂單資料表(1) & ".總金額, " & 訂單資料表(1) & ".備註, " & 訂單資料表(1) & ".生產工廠 AS 工廠, " & 訂單資料表(1) & ".訂單種類, " & 訂單資料表(6) & ".Quantity, 
167
-                       " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS FTY_1, " & 訂單資料表(6) & ".FTYPrice AS FTY_2, 
168
-                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * 
169
-                       " & 訂單資料表(6) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionDarren, 
170
-                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionTendenza, " & 訂單資料表(6) & ".FTYPrice AS [%_1],
171
+                       " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS 實際廠價, " & 訂單資料表(6) & ".FTYPrice AS 天盾單價, 
172
+                       " & 訂單資料表(6) & ".客戶單價, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * 
173
+                       " & 訂單資料表(6) & ".Quantity AS [Commission TTL], (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS [Commission Darren], 
174
+                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS [Commission Tendenza], " & 訂單資料表(6) & ".FTYPrice AS [%_1],
171 175
                        " & 訂單資料表(6) & ".FTYPrice AS [%_2], " & 訂單資料表(6) & ".BasicPrice, " & 訂單資料表(6) & ".Polybag AS [PG/MOQ], " & 訂單資料表(6) & ".FOOTformOrPETform AS FOOTorPET, 
172 176
                        " & 訂單資料表(6) & ".Tooling, " & 訂單資料表(6) & ".RubberBand, " & 訂單資料表(6) & ".JHOOK, " & 訂單資料表(6) & ".WaterResistant, " & 訂單資料表(6) & ".P16VAT, 
173 177
                        " & 訂單資料表(6) & ".EXWsaving, " & 訂單資料表(6) & ".Quantity * " & 訂單資料表(6) & ".Tooling AS CollectedToolng, " & 訂單資料表(6) & ".年份, 
@@ -178,6 +182,7 @@
178 182
                 ORDER BY " & 訂單資料表(1) & ".訂單流水號 DESC"
179 183
     End Sub
180 184
     Friend Sub SQL_訂單價格利潤明細表5()
185
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : 表頭1 = "HTS#" : Else : 表頭1 = "ProductID" : End If
181 186
         列印用SQL = " WHERE ((" & 訂單資料表(1) & ".訂單流水號 LIKE '%" & PA & "%') OR (" & 訂單資料表(1) & ".年份季度 LIKE '%" & PA & "%') OR 
182 187
                             (" & 訂單資料表(1) & ".客戶訂單號 LIKE '%" & PA & "%') OR (" & 訂單資料表(1) & ".形體號 LIKE '%" & PA & "%') OR 
183 188
                             (" & 訂單資料表(1) & ".顏色 LIKE '%" & PA & "%') OR (" & 訂單資料表(1) & ".楦型 LIKE '%" & PA & "%') OR 
@@ -186,14 +191,14 @@
186 191
                             (" & 訂單資料表(1) & ".力威訂單號 LIKE '%" & PA & "%')) AND " & 訂單資料表(6) & ".天盾訂單號 IS NOT NULL AND 
187 192
                             " & 訂單資料表(6) & ".年份 LIKE '" & PA25 & "' AND (" & 訂單資料表(1) & ".CXL IS NULL OR " & 訂單資料表(1) & ".CXL = 0) "
188 193
 
189
-        SQL1 = "SELECT " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".資料流水號, " & 訂單資料表(1) & ".年份季度, " & 訂單資料表(1) & ".力威訂單號, " & 訂單資料表(1) & ".形體號, 
190
-                       " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".ProductID, " & 訂單資料表(1) & ".楦型, " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, 
191
-                       " & 訂單資料表(1) & ".單價, 
194
+        SQL1 = "SELECT " & 訂單資料表(1) & ".訂單流水號, " & 訂單資料表(1) & ".資料流水號, " & 訂單資料表(1) & ".年份季度, " & 訂單資料表(1) & ".力威訂單號 AS 客人訂單號, 
195
+                       " & 訂單資料表(1) & ".形體號, " & 訂單資料表(1) & ".顏色, " & 訂單資料表(1) & ".ProductID AS [" & 表頭1 & "], " & 訂單資料表(1) & ".楦型, 
196
+                       " & 訂單資料表(1) & ".訂單數量 AS 數量, " & 訂單資料表(1) & ".客戶交期, " & 訂單資料表(1) & ".單價, 
192 197
                        " & 訂單資料表(1) & ".總金額, " & 訂單資料表(1) & ".備註, " & 訂單資料表(1) & ".生產工廠 AS 工廠, " & 訂單資料表(1) & ".訂單種類, " & 訂單資料表(6) & ".Quantity, 
193
-                       " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS FTY_1, " & 訂單資料表(6) & ".FTYPrice AS FTY_2, 
194
-                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * 
195
-                       " & 訂單資料表(6) & ".Quantity AS CommissionTTL, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionDarren, 
196
-                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS CommissionTendenza, " & 訂單資料表(6) & ".FTYPrice AS [%_1],
198
+                       " & 訂單資料表(6) & ".Currency, " & 訂單資料表(6) & ".Exchange, " & 訂單資料表(6) & ".FTY廠價 AS 實際廠價, " & 訂單資料表(6) & ".FTYPrice AS 天盾單價, 
199
+                       " & 訂單資料表(6) & ".客戶單價, (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * 
200
+                       " & 訂單資料表(6) & ".Quantity AS [Commission TTL], (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS [Commission Darren], 
201
+                      (" & 訂單資料表(1) & ".單價 - " & 訂單資料表(6) & ".FTYPrice) * " & 訂單資料表(6) & ".Quantity / 2 AS [Commission Tendenza], " & 訂單資料表(6) & ".FTYPrice AS [%_1],
197 202
                        " & 訂單資料表(6) & ".FTYPrice AS [%_2], " & 訂單資料表(6) & ".BasicPrice, " & 訂單資料表(6) & ".Polybag AS [PG/MOQ], " & 訂單資料表(6) & ".FOOTformOrPETform AS FOOTorPET, 
198 203
                        " & 訂單資料表(6) & ".Tooling, " & 訂單資料表(6) & ".RubberBand, " & 訂單資料表(6) & ".JHOOK, " & 訂單資料表(6) & ".WaterResistant, " & 訂單資料表(6) & ".P16VAT, 
199 204
                        " & 訂單資料表(6) & ".EXWsaving, " & 訂單資料表(6) & ".Quantity * " & 訂單資料表(6) & ".Tooling AS CollectedToolng, " & 訂單資料表(6) & ".年份, 
@@ -310,10 +315,10 @@
310 315
     Friend Sub SQL_新增訂單成本利潤表新增()
311 316
         ConnOpen()
312 317
         SQL1 = "INSERT INTO " & 訂單資料表(6) & " (資料流水號, 天盾訂單號, 客戶流水號, FTYPrice, BasicPrice, Polybag, FOOTformOrPETform, Tooling, RubberBand, JHOOK, WaterResistant, 
313
-                                                               P16VAT, EXWsaving, Currency, Exchange, 年份, Quantity, 利潤表流水號, 審核, D庸, FTY廠價) 
318
+                                                               P16VAT, EXWsaving, Currency, Exchange, 年份, Quantity, 利潤表流水號, 審核, D庸, FTY廠價, 客戶單價) 
314 319
                 VALUES ('" & PA & "', '" & PA1 & "', '" & PA2 & "', '" & PA3 & "', '" & PA4 & "', '" & PA5 & "', '" & PA6 & "', '" & PA7 & "', '" & PA8 & "', '" & PA9 & "', 
315 320
                         '" & PA10 & "', '" & PA11 & "', '" & PA12 & "', '" & 訂單價格利潤明細表.Currency_cb.Text & "', '" & PA13 & "', '" & PA14 & "', '" & PA15 & "', 
316
-                        '" & 利潤表流水號 & "', '" & PA17 & "', '" & PA18 & "', '" & PA19 & "')"
321
+                        '" & 利潤表流水號 & "', '" & PA17 & "', '" & PA18 & "', '" & PA19 & "', '" & PA20 & "')"
317 322
         CmdSet_For_dr()
318 323
     End Sub
319 324
     Friend Sub SQL_增加訂單控制表修改紀錄()
@@ -334,7 +339,7 @@
334 339
                                                   Tooling = '" & PA7 & "', RubberBand = '" & PA8 & "', JHOOK = '" & PA9 & "', WaterResistant = '" & PA10 & "', 
335 340
                                                   P16VAT = '" & PA11 & "', EXWsaving = '" & PA12 & "', Currency = '" & 訂單價格利潤明細表.Currency_cb.Text & "', 
336 341
                                                   Exchange = '" & PA13 & "', 年份 = '" & PA14 & "', Quantity = '" & PA15 & "', 審核 = '" & PA16 & "', D庸 = '" & PA18 & "',
337
-                                                  FTY廠價 = '" & PA19 & "'
342
+                                                  FTY廠價 = '" & PA19 & "', 客戶單價 = '" & PA20 & "'
338 343
                         WHERE (利潤表流水號 LIKE '" & 利潤表流水號 & "')"
339 344
         CmdSet_For_dr()
340 345
     End Sub
@@ -356,7 +361,7 @@
356 361
                        " & 訂單資料表(6) & ".Tooling, " & 訂單資料表(6) & ".RubberBand, " & 訂單資料表(6) & ".JHOOK, " & 訂單資料表(6) & ".WaterResistant, " & 訂單資料表(6) & ".P16VAT, 
357 362
                        " & 訂單資料表(6) & ".EXWsaving, " & 訂單資料表(6) & ".Quantity * " & 訂單資料表(6) & ".Tooling AS CollectedToolng, " & 訂單資料表(6) & ".年份, 
358 363
                        " & 訂單資料表(6) & ".利潤表流水號, " & 訂單資料表(1) & ".訂單數量 - " & 訂單資料表(6) & ".Quantity AS 驗證, STYLELIST.ItemNumber, " & 訂單資料表(6) & ".審核, 
359
-                       " & 訂單資料表(1) & ".客戶訂單號, " & 訂單資料表(6) & ".FTY廠價
364
+                       " & 訂單資料表(1) & ".客戶訂單號, " & 訂單資料表(6) & ".FTY廠價, " & 訂單資料表(6) & ".客戶單價
360 365
                 FROM   " & 訂單資料表(1) & " LEFT OUTER JOIN STYLELIST ON " & 訂單資料表(1) & ".形體號 = STYLELIST.ProductName RIGHT OUTER JOIN " & 訂單資料表(6) & " ON 
361 366
                        " & 訂單資料表(1) & ".資料流水號 = " & 訂單資料表(6) & ".資料流水號 " & 列印用SQL & "
362 367
                 ORDER BY " & 訂單資料表(1) & ".力威訂單號 DESC"
@@ -382,35 +387,25 @@
382 387
                           貨款銷帳明細表.F_貼標費, 貨款銷帳明細表.利息or扣款 AS F_利息or扣款, 貨款銷帳明細表.F_增加款, 
383 388
                           貨款銷帳明細表.訂單數 AS 實付工廠金額, 貨款銷帳明細表.CUST_Price, 貨款銷帳明細表.訂單數 AS Amount2, 
384 389
                           貨款銷帳明細表.C_文件費, 貨款銷帳明細表.C_貼標費, 貨款銷帳明細表.C_利息or扣款, 
385
-                          貨款銷帳明細表.訂單數 AS 實際入帳金額, 貨款銷帳明細表.EX_FTY_DATE, 貨款銷帳明細表.Maturity_Date, 
390
+                          貨款銷帳明細表.訂單數 AS 實際入帳金額, 貨款銷帳明細表.Selling_Price, 貨款銷帳明細表.EX_FTY_DATE, 貨款銷帳明細表.Maturity_Date, 
386 391
                           貨款銷帳明細表.FTY_Payment_Date, 貨款銷帳明細表.訂單數 AS 總毛利, 貨款銷帳明細表.Darren佣金, 
387
-                          貨款銷帳明細表.Betty佣金, 貨款銷帳明細表.扣工廠手續費 AS 其他費用, 貨款銷帳明細表.訂單數 AS 公司毛利, 
392
+                          貨款銷帳明細表.Betty佣金, 貨款銷帳明細表.扣工廠手續費 AS 其他費用, 貨款銷帳明細表.訂單數 AS 公司毛利, 貨款銷帳明細表.訂單數 AS 客戶佣金, 
388 393
                           貨款銷帳明細表.Remark, QQ.客戶訂單號, 貨款銷帳明細表.已出貨 AS 異動, 貨款銷帳明細表.已出貨 AS 異動1, 
389 394
                           貨款銷帳明細表.已出貨 AS 已比對, 貨款銷帳明細表.已出貨 AS 模糊標註, 貨款銷帳明細表.已出貨 AS 需存檔
390 395
                 FROM      貨款銷帳明細表 LEFT OUTER JOIN
391 396
                          (SELECT  客戶訂單號, 力威訂單號  FROM  " & 訂單資料表(1) & "  GROUP BY  客戶訂單號, 力威訂單號) AS QQ ON LEFT(貨款銷帳明細表.訂單號, 10) = QQ.力威訂單號
392
-                WHERE    (貨款銷帳明細表.年份 LIKE '" & PA25 & "')
397
+                WHERE    (貨款銷帳明細表.年份 LIKE '" & PA25 & "') " & SQL2 & "
393 398
                 ORDER BY  " & PA30 & ", 貨款銷帳明細表.EX_FTY_DATE DESC"
394 399
         CmdSet_For_DGV()
395 400
     End Sub
396 401
     Friend Sub SQL_銷帳清單1()
397 402
         ConnOpen()
398
-        SQL1 = "SELECT    貨款銷帳明細表.流水號, 貨款銷帳明細表.年份, 貨款銷帳明細表.品牌, 貨款銷帳明細表.工廠, 貨款銷帳明細表.INV, 
399
-                          貨款銷帳明細表.訂單號, 貨款銷帳明細表.型體, 貨款銷帳明細表.顏色, 
400
-                          貨款銷帳明細表.楦型, 貨款銷帳明細表.訂單數, 貨款銷帳明細表.出貨數量, 貨款銷帳明細表.已出貨, 
401
-                          貨款銷帳明細表.已確認, 貨款銷帳明細表.FTY_PRICE, 貨款銷帳明細表.扣關稅or後廠價, 
402
-                          貨款銷帳明細表.訂單數 AS Amount1, 貨款銷帳明細表.F_銀行扣款, 貨款銷帳明細表.F_文件費, 
403
-                          貨款銷帳明細表.F_貼標費, 貨款銷帳明細表.利息or扣款 AS F_利息or扣款, 貨款銷帳明細表.F_增加款, 
404
-                          貨款銷帳明細表.訂單數 AS 實付工廠金額, 貨款銷帳明細表.CUST_Price, 貨款銷帳明細表.訂單數 AS Amount2, 
405
-                          貨款銷帳明細表.C_文件費, 貨款銷帳明細表.C_貼標費, 貨款銷帳明細表.C_利息or扣款, 
406
-                          貨款銷帳明細表.訂單數 AS 實際入帳金額, 貨款銷帳明細表.EX_FTY_DATE, 貨款銷帳明細表.Maturity_Date, 
407
-                          貨款銷帳明細表.FTY_Payment_Date, 貨款銷帳明細表.訂單數 AS 總毛利, 貨款銷帳明細表.Darren佣金, 
408
-                          貨款銷帳明細表.Betty佣金, 貨款銷帳明細表.扣工廠手續費 AS 其他費用, 貨款銷帳明細表.訂單數 AS 公司毛利, 
409
-                          貨款銷帳明細表.Remark, 貨款銷帳明細表.訂單號 AS 客戶訂單號, 貨款銷帳明細表.已出貨 AS 異動, 貨款銷帳明細表.已出貨 AS 異動1, 
410
-                          貨款銷帳明細表.已出貨 AS 已比對, 貨款銷帳明細表.已出貨 AS 需存檔
411
-                FROM      貨款銷帳明細表
412
-                WHERE    (貨款銷帳明細表.年份 LIKE '" & PA25 & "')
413
-                ORDER BY  " & PA30 & ", 貨款銷帳明細表.EX_FTY_DATE DESC"
403
+        SQL1 = "SELECT    流水號, 年份, 品牌, 工廠, INV, 訂單號, 型體, 顏色, 楦型, 訂單數, 出貨數量, 已出貨, 已確認, FTY_PRICE AS [FTY Price 實際廠價], 扣關稅or後廠價, 
404
+                          訂單數 AS Amount1, F_銀行扣款, F_文件費, F_貼標費, 利息or扣款 AS F_利息or扣款, F_增加款, 訂單數 AS 實付工廠金額, CUST_Price AS [Tendenza Price], 訂單數 AS Amount2, 
405
+                          C_文件費, C_貼標費, C_利息or扣款, 訂單數 AS 實際入帳金額, Selling_Price AS [Selling Price], EX_FTY_DATE, Maturity_Date, FTY_Payment_Date, 訂單數 AS 總毛利, Darren佣金, 
406
+                          Betty佣金, 扣工廠手續費 AS 其他費用, 訂單數 AS 公司毛利, Remark, 訂單號 AS 客戶訂單號, 已出貨 AS 異動, 已出貨 AS 異動1, 已出貨 AS 已比對, 
407
+                          已出貨 AS 需存檔
408
+                FROM      貨款銷帳明細表  WHERE  (年份 LIKE '" & PA25 & "')   ORDER BY  " & PA30 & ", EX_FTY_DATE DESC"
414 409
         CmdSet_For_DGV()
415 410
     End Sub
416 411
     Friend Sub SQL_銷帳清單_刪除()
@@ -422,18 +417,22 @@
422 417
                                           EX_FTY_DATE = N'" & PA66 & "', Maturity_Date = N'" & PA65 & "', FTY_Payment_Date = N'" & PA64 & "', Remark = N'" & PA63 & "', 
423 418
                                           Darren佣金 = N'" & PA62 & "', Betty佣金 = N'" & PA61 & "', 利息or扣款 = N'" & PA60 & "', 扣工廠手續費 = N'" & PA59 & "', 
424 419
                                           已確認 = N'" & PA58 & "', F_銀行扣款 = N'" & PA57 & "', F_文件費 = N'" & PA56 & "', F_貼標費 = N'" & PA55 & "', F_增加款 = N'" & PA54 & "', 
425
-                                          C_文件費 = N'" & PA53 & "', C_貼標費 = N'" & PA52 & "', C_利息or扣款 = N'" & PA51 & "', 已出貨 = N'" & PA50 & "', 訂單號 = '" & PA44 & "', 
426
-                                          型體 = N'" & PA49 & "', 顏色 = '" & PA48 & "', 楦型 = '" & PA47 & "'
420
+                                          C_文件費 = N'" & PA53 & "', C_貼標費 = N'" & PA52 & "', C_利息or扣款 = N'" & PA51 & "', 已出貨 = N'" & PA50 & "', 訂單號 = N'" & PA44 & "', 
421
+                                          型體 = N'" & PA49 & "', 顏色 = N'" & PA48 & "', 楦型 = N'" & PA47 & "', Selling_Price = N'" & PA46 & "'
427 422
                 WHERE  (流水號 LIKE '" & PA3 & "')"
428 423
         CmdSet_For_dr()
429 424
     End Sub
430 425
     Friend Sub SQL_銷帳清單_存檔1()
431 426
         ConnOpen()
432 427
         SQL1 = "UPDATE 貨款銷帳明細表 SET 出貨數量 = N'" & PA70 & "', FTY_PRICE = N'" & PA69 & "', 扣關稅or後廠價 = N'" & PA68 & "', CUST_Price = N'" & PA67 & "', 
433
-                                          EX_FTY_DATE = N'" & PA66 & "', Maturity_Date = N'" & PA65 & "', FTY_Payment_Date = N'" & PA64 & "', Remark = N'" & PA63 & "'
428
+                                          EX_FTY_DATE = N'" & PA66 & "', Maturity_Date = N'" & PA65 & "', FTY_Payment_Date = N'" & PA64 & "', Remark = N'" & PA63 & "',
429
+                                          Selling_Price = N'" & PA62 & "'
434 430
                 WHERE  (流水號 LIKE '" & PA3 & "')"
435 431
         CmdSet_For_dr()
436 432
     End Sub
433
+    Friend Sub SQL_銷帳清單_預設()
434
+        ConnOpen() : SQL1 = "UPDATE 貨款銷帳明細表 SET Selling_Price = N'0' WHERE  (Selling_Price IS NULL)" : CmdSet_For_dr()
435
+    End Sub
437 436
     Friend Sub SQL_銷帳清單_流水號()
438 437
         ConnOpen() : SQL1 = "SELECT  TOP (1) 流水號  FROM  貨款銷帳明細表  ORDER BY  流水號 DESC" : CmdSet_For_dr()
439 438
     End Sub
@@ -583,17 +582,46 @@
583 582
     End Sub
584 583
     Friend Sub SQL_訂單明細表讀取()
585 584
         ConnOpen()
586
-        SQL1 = "SELECT     天盾流水號, 客戶訂單號, ItemNumber AS Item, 裝箱 AS Item2, ProductName, ProductDescription, Color, DM, [5], [5.5], [6], [6.5], [7], [7.5], [8], 
587
-                           [8.5], [9], [9.5], [10], [10.5], [11], [11.5], [12], [12.5], [13], [14], 
588
-                           [5] + [5.5] + [6] + [6.5] + [7] + [7.5] + [8] + [8.5] + [9] + [9.5] + [10] + [10.5] + [11] + [11.5] + [12] + [12.5] + [13] + [14] AS TOTAL
589
-                FROM       " & 訂單資料表(5) & "
590
-                WHERE     (客戶訂單號 LIKE '" & PA70 & "') AND (天盾流水號 LIKE '" & PA69 & "')
591
-                ORDER BY   資料流水號"
585
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : 表頭1 = "HTS#"
586
+            SQL1 = "SELECT   " & 訂單資料表(5) & ".天盾流水號, " & 訂單資料表(5) & ".客戶訂單號, " & 訂單資料表(5) & ".ItemNumber AS Item, 
587
+                         " & 訂單資料表(5) & ".裝箱 AS Item2, " & 訂單資料表(1) & ".ProductID AS [" & 表頭1 & "], " & 訂單資料表(5) & ".ProductName, 
588
+                         " & 訂單資料表(5) & ".ProductDescription, " & 訂單資料表(5) & ".Color, " & 訂單資料表(5) & ".DM, " & 訂單資料表(5) & ".[5], 
589
+                         " & 訂單資料表(5) & ".[5.5], " & 訂單資料表(5) & ".[6], " & 訂單資料表(5) & ".[6.5], " & 訂單資料表(5) & ".[7], " & 訂單資料表(5) & ".[7.5], 
590
+                         " & 訂單資料表(5) & ".[8], " & 訂單資料表(5) & ".[8.5], " & 訂單資料表(5) & ".[9], " & 訂單資料表(5) & ".[9.5], " & 訂單資料表(5) & ".[10], 
591
+                         " & 訂單資料表(5) & ".[10.5], " & 訂單資料表(5) & ".[11], " & 訂單資料表(5) & ".[11.5], " & 訂單資料表(5) & ".[12], " & 訂單資料表(5) & ".[12.5], 
592
+                         " & 訂單資料表(5) & ".[13], " & 訂單資料表(5) & ".[14], 
593
+                         " & 訂單資料表(5) & ".[5] + " & 訂單資料表(5) & ".[5.5] + " & 訂單資料表(5) & ".[6] + " & 訂單資料表(5) & ".[6.5] + " & 訂單資料表(5) & ".[7] + " & 訂單資料表(5) & ".[7.5]
594
+                          + " & 訂單資料表(5) & ".[8] + " & 訂單資料表(5) & ".[8.5] + " & 訂單資料表(5) & ".[9] + " & 訂單資料表(5) & ".[9.5] + " & 訂單資料表(5) & ".[10] + " & 訂單資料表(5) & ".[10.5]
595
+                          + " & 訂單資料表(5) & ".[11] + " & 訂單資料表(5) & ".[11.5] + " & 訂單資料表(5) & ".[12] + " & 訂單資料表(5) & ".[12.5] + " & 訂單資料表(5) & ".[13] +
596
+                          " & 訂單資料表(5) & ".[14] AS TOTAL
597
+                FROM      " & 訂單資料表(5) & " INNER JOIN
598
+                          " & 訂單資料表(1) & " ON " & 訂單資料表(5) & ".資料流水號 = " & 訂單資料表(1) & ".資料流水號
599
+                WHERE    (" & 訂單資料表(5) & ".客戶訂單號 LIKE '" & PA70 & "') AND (" & 訂單資料表(5) & ".天盾流水號 LIKE '" & PA69 & "')
600
+                ORDER BY  " & 訂單資料表(5) & ".資料流水號"
601
+        Else : 表頭1 = "ProductID"
602
+            SQL1 = "SELECT   " & 訂單資料表(5) & ".天盾流水號, " & 訂單資料表(5) & ".客戶訂單號, " & 訂單資料表(5) & ".ItemNumber AS Item, 
603
+                         " & 訂單資料表(5) & ".裝箱 AS Item2, " & 訂單資料表(1) & ".ProductID AS [" & 表頭1 & "], " & 訂單資料表(5) & ".ProductName, 
604
+                         " & 訂單資料表(5) & ".ProductDescription, " & 訂單資料表(5) & ".Color, " & 訂單資料表(5) & ".DM, " & 訂單資料表(5) & ".[5], 
605
+                         " & 訂單資料表(5) & ".[5.5], " & 訂單資料表(5) & ".[6], " & 訂單資料表(5) & ".[6.5], " & 訂單資料表(5) & ".[7], " & 訂單資料表(5) & ".[7.5], 
606
+                         " & 訂單資料表(5) & ".[8], " & 訂單資料表(5) & ".[8.5], " & 訂單資料表(5) & ".[9], " & 訂單資料表(5) & ".[9.5], " & 訂單資料表(5) & ".[10], 
607
+                         " & 訂單資料表(5) & ".[10.5], " & 訂單資料表(5) & ".[11], " & 訂單資料表(5) & ".[11.5], " & 訂單資料表(5) & ".[12], " & 訂單資料表(5) & ".[12.5], 
608
+                         " & 訂單資料表(5) & ".[13], " & 訂單資料表(5) & ".[14], 
609
+                         " & 訂單資料表(5) & ".[5] + " & 訂單資料表(5) & ".[5.5] + " & 訂單資料表(5) & ".[6] + " & 訂單資料表(5) & ".[6.5] + " & 訂單資料表(5) & ".[7] + " & 訂單資料表(5) & ".[7.5]
610
+                          + " & 訂單資料表(5) & ".[8] + " & 訂單資料表(5) & ".[8.5] + " & 訂單資料表(5) & ".[9] + " & 訂單資料表(5) & ".[9.5] + " & 訂單資料表(5) & ".[10] + " & 訂單資料表(5) & ".[10.5]
611
+                          + " & 訂單資料表(5) & ".[11] + " & 訂單資料表(5) & ".[11.5] + " & 訂單資料表(5) & ".[12] + " & 訂單資料表(5) & ".[12.5] + " & 訂單資料表(5) & ".[13] +
612
+                          " & 訂單資料表(5) & ".[14] AS TOTAL
613
+                FROM      " & 訂單資料表(5) & " INNER JOIN
614
+                          " & 訂單資料表(1) & " ON " & 訂單資料表(5) & ".天盾流水號 = " & 訂單資料表(1) & ".訂單流水號 AND 
615
+                          " & 訂單資料表(5) & ".Color = " & 訂單資料表(1) & ".顏色 AND " & 訂單資料表(5) & ".ProductName = " & 訂單資料表(1) & ".形體號 AND 
616
+                          " & 訂單資料表(5) & ".DM = " & 訂單資料表(1) & ".楦型
617
+                WHERE    (" & 訂單資料表(5) & ".客戶訂單號 LIKE '" & PA70 & "') AND (" & 訂單資料表(5) & ".天盾流水號 LIKE '" & PA69 & "')
618
+                ORDER BY  " & 訂單資料表(5) & ".資料流水號"
619
+        End If
592 620
         CmdSet_For_DGV()
593 621
     End Sub
594 622
     Friend Sub SQL_訂單控制表讀取()
595 623
         ConnOpen()
596
-        SQL1 = "SELECT                訂單流水號,               年份季度,               力威訂單號,            形體號,             顏色,                  楦型,                 訂單數量, 
624
+        SQL1 = "SELECT                訂單流水號,               年份季度, 力威訂單號 AS 客人訂單號,            形體號,             顏色,                  楦型,                 訂單數量, 
597 625
                                         客戶交期,                   單價,                   總金額,              備註,         生產工廠,              訂單種類,             工廠回復交期, 
598 626
                                          CFMSPEC,              CFMSAMPLE,                   TRIAL1,            TRIAL2,           TRIAL3,                TRIAL4,             包裝確認時間, 
599 627
                                         貼標時間,               裁斷時間,                 針車時間,          成型時間,         驗貨時間,            實際離廠日,               資料流水號, 
@@ -659,7 +687,8 @@
659 687
         ConnOpen()
660 688
         SQL1 = "UPDATE " & 訂單資料表(1) & " SET 年份季度 = N'" & PA3 & "', 客戶訂單號 = N'" & PA1 & "', 形體號 = N'" & PA4 & "', 顏色 = N'" & PA5 & "', 楦型 = N'" & PA6 & "', 
661 689
                                                  訂單數量 = N'" & PA16 & "', 客戶交期 = N'" & PA7 & "', 生產工廠 = N'" & PA8 & "', 訂單種類 = N'" & PA9 & "', 工廠回復交期 = N'" & PA10 & "', 
662
-                                                 PO_S_Date = N'" & PA7 & "', Requested_XF = N'" & PA7 & "', Confirm_XF = N'" & PA7 & "', 力威訂單號 = N'" & PA11 & "',TVW =  N'" & PA35 & "' 
690
+                                                 PO_S_Date = N'" & PA7 & "', Requested_XF = N'" & PA7 & "', Confirm_XF = N'" & PA7 & "', 力威訂單號 = N'" & PA11 & "',TVW =  N'" & PA35 & "', 
691
+                                                 ProductID = N'" & PA36 & "'
663 692
                 WHERE 資料流水號 LIKE N'" & PA13 & "'"
664 693
         CmdSet_For_dr()
665 694
     End Sub
@@ -669,6 +698,9 @@
669 698
     Friend Sub SQL_Item2_下拉()
670 699
         ConnOpen() : SQL1 = "SELECT  裝箱  FROM  " & 訂單資料表(5) & "  GROUP BY   裝箱  ORDER BY  裝箱" : CmdSet_For_dr()
671 700
     End Sub
701
+    Friend Sub SQL_Item3_下拉()
702
+        ConnOpen() : SQL1 = "SELECT  ProductID  FROM  " & 訂單資料表(1) & "  GROUP BY   ProductID  ORDER BY  ProductID" : CmdSet_For_dr()
703
+    End Sub
672 704
     Friend Sub SQL_ProductDescription_下拉()
673 705
         ConnOpen() : SQL1 = "SELECT  ProductDescription  FROM  " & 訂單資料表(5) & "  GROUP BY   ProductDescription  ORDER BY  ProductDescription" : CmdSet_For_dr()
674 706
     End Sub

+ 32
- 18
TENDEN-MES-SYS/0、Module/SQL_量產訂單系統.vb View File

@@ -21,7 +21,11 @@
21 21
         CmdSet_For_dr()
22 22
     End Sub
23 23
     Friend Sub SQL_確認訂單明細表()
24
-        SQL1 = "SELECT      " & 訂單資料表(5) & ".天盾流水號, " & 訂單資料表(5) & ".客戶訂單號, " & 訂單資料表(5) & ".ItemNumber, " & 訂單資料表(5) & ".ProductName, 
24
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then
25
+            表頭1 = "HTS#"
26
+            SQL1 = "SELECT      " & 訂單資料表(5) & ".天盾流水號, " & 訂單資料表(5) & ".客戶訂單號, 
27
+                              CASE WHEN 裝箱 IS NULL OR 裝箱 = '' THEN ItemNumber 
28
+                              ELSE ItemNumber + ' - ' + 裝箱 END AS ItemNumber, " & 訂單資料表(5) & ".ProductName, 
25 29
                             " & 訂單資料表(5) & ".ProductDescription, " & 訂單資料表(5) & ".Color, " & 訂單資料表(5) & ".DM, " & 訂單資料表(5) & ".[5], 
26 30
                             " & 訂單資料表(5) & ".[5.5], " & 訂單資料表(5) & ".[6], " & 訂單資料表(5) & ".[6.5], " & 訂單資料表(5) & ".[7], " & 訂單資料表(5) & ".[7.5], 
27 31
                             " & 訂單資料表(5) & ".[8], " & 訂單資料表(5) & ".[8.5], " & 訂單資料表(5) & ".[9], " & 訂單資料表(5) & ".[9.5], " & 訂單資料表(5) & ".[10], 
@@ -29,24 +33,33 @@
29 33
                             " & 訂單資料表(5) & ".[13], " & 訂單資料表(5) & ".[14], " & 訂單資料表(5) & ".[5] + " & 訂單資料表(5) & ".[5.5] + " & 訂單資料表(5) & ".[6] + 
30 34
                             " & 訂單資料表(5) & ".[6.5] + " & 訂單資料表(5) & ".[7] + " & 訂單資料表(5) & ".[7.5] + " & 訂單資料表(5) & ".[8] + " & 訂單資料表(5) & ".[8.5] + 
31 35
                             " & 訂單資料表(5) & ".[9] + " & 訂單資料表(5) & ".[9.5] + " & 訂單資料表(5) & ".[10] + " & 訂單資料表(5) & ".[10.5] + " & 訂單資料表(5) & ".[11] + 
32
-                            " & 訂單資料表(5) & ".[11.5] + " & 訂單資料表(5) & ".[12] + " & 訂單資料表(5) & ".[12.5] + " & 訂單資料表(5) & ".[13] + " & 訂單資料表(5) & ".[14] AS TOTAL
33
-                FROM        " & 訂單資料表(5) & " 
36
+                            " & 訂單資料表(5) & ".[11.5] + " & 訂單資料表(5) & ".[12] + " & 訂單資料表(5) & ".[12.5] + " & 訂單資料表(5) & ".[13] + " & 訂單資料表(5) & ".[14] AS TOTAL,
37
+                            " & 訂單資料表(1) & ".ProductID AS [" & 表頭1 & "], " & 訂單資料表(1) & ".TVW AS [STYLE#]
38
+                FROM        " & 訂單資料表(5) & " LEFT OUTER JOIN
39
+                            " & 訂單資料表(1) & " ON " & 訂單資料表(5) & ".資料流水號 = " & 訂單資料表(1) & ".資料流水號
34 40
                 WHERE      (" & 訂單資料表(5) & ".客戶訂單號 LIKE '" & 訂單明細表.客戶訂單號_tb.Text & "') AND (" & 訂單資料表(5) & ".天盾流水號 LIKE '" & 訂單明細表.訂單號_tb.Text & "')
35
-                ORDER BY   " & 訂單資料表(5) & ".資料流水號"
36
-    End Sub
37
-    Friend Sub SQL_確認訂單明細表1()
38
-        SQL1 = "SELECT      " & 訂單資料表(5) & ".天盾流水號, " & 訂單資料表(5) & ".客戶訂單號, " & 訂單資料表(5) & ".ItemNumber, " & 訂單資料表(5) & ".ProductName, 
39
-                            " & 訂單資料表(5) & ".ProductDescription, " & 訂單資料表(5) & ".Color, " & 訂單資料表(5) & ".DM, " & 訂單資料表(5) & ".[5], " & 訂單資料表(5) & ".[5.5], 
40
-                            " & 訂單資料表(5) & ".[6], " & 訂單資料表(5) & ".[6.5], " & 訂單資料表(5) & ".[7], " & 訂單資料表(5) & ".[7.5], " & 訂單資料表(5) & ".[8], 
41
-                            " & 訂單資料表(5) & ".[8.5], " & 訂單資料表(5) & ".[9], " & 訂單資料表(5) & ".[9.5], " & 訂單資料表(5) & ".[10], " & 訂單資料表(5) & ".[10.5], 
42
-                            " & 訂單資料表(5) & ".[11], " & 訂單資料表(5) & ".[11.5], " & 訂單資料表(5) & ".[12], " & 訂單資料表(5) & ".[12.5], " & 訂單資料表(5) & ".[13], 
43
-                            " & 訂單資料表(5) & ".[14], " & 訂單資料表(5) & ".[5] + " & 訂單資料表(5) & ".[5.5] + " & 訂單資料表(5) & ".[6] + " & 訂單資料表(5) & ".[6.5] + 
44
-                            " & 訂單資料表(5) & ".[7] + " & 訂單資料表(5) & ".[7.5] + " & 訂單資料表(5) & ".[8] + " & 訂單資料表(5) & ".[8.5] + " & 訂單資料表(5) & ".[9] + 
45
-                            " & 訂單資料表(5) & ".[9.5] + " & 訂單資料表(5) & ".[10] + " & 訂單資料表(5) & ".[10.5] + " & 訂單資料表(5) & ".[11] + " & 訂單資料表(5) & ".[11.5]
46
-                            + " & 訂單資料表(5) & ".[12] + " & 訂單資料表(5) & ".[12.5] + " & 訂單資料表(5) & ".[13] + " & 訂單資料表(5) & ".[14] AS TOTAL
47
-                FROM        " & 訂單資料表(5) & "
48
-                WHERE     (" & 訂單資料表(5) & ".客戶訂單號 LIKE '" & 訂單明細表.客戶訂單號_tb.Text & "') AND (" & 訂單資料表(5) & ".天盾流水號 LIKE '" & 訂單明細表.訂單號_tb.Text & "')
49
-                ORDER BY   " & 訂單資料表(5) & ".ProductName, " & 訂單資料表(5) & ".Color"
41
+                " & SQL2
42
+        Else
43
+            表頭1 = "ProductID"
44
+            SQL1 = "SELECT      " & 訂單資料表(5) & ".天盾流水號, " & 訂單資料表(5) & ".客戶訂單號, 
45
+                              CASE WHEN 裝箱 IS NULL OR 裝箱 = '' THEN ItemNumber 
46
+                              ELSE ItemNumber + ' - ' + 裝箱 END AS ItemNumber, " & 訂單資料表(5) & ".ProductName, 
47
+                            " & 訂單資料表(5) & ".ProductDescription, " & 訂單資料表(5) & ".Color, " & 訂單資料表(5) & ".DM, " & 訂單資料表(5) & ".[5], 
48
+                            " & 訂單資料表(5) & ".[5.5], " & 訂單資料表(5) & ".[6], " & 訂單資料表(5) & ".[6.5], " & 訂單資料表(5) & ".[7], " & 訂單資料表(5) & ".[7.5], 
49
+                            " & 訂單資料表(5) & ".[8], " & 訂單資料表(5) & ".[8.5], " & 訂單資料表(5) & ".[9], " & 訂單資料表(5) & ".[9.5], " & 訂單資料表(5) & ".[10], 
50
+                            " & 訂單資料表(5) & ".[10.5], " & 訂單資料表(5) & ".[11], " & 訂單資料表(5) & ".[11.5], " & 訂單資料表(5) & ".[12], " & 訂單資料表(5) & ".[12.5], 
51
+                            " & 訂單資料表(5) & ".[13], " & 訂單資料表(5) & ".[14], " & 訂單資料表(5) & ".[5] + " & 訂單資料表(5) & ".[5.5] + " & 訂單資料表(5) & ".[6] + 
52
+                            " & 訂單資料表(5) & ".[6.5] + " & 訂單資料表(5) & ".[7] + " & 訂單資料表(5) & ".[7.5] + " & 訂單資料表(5) & ".[8] + " & 訂單資料表(5) & ".[8.5] + 
53
+                            " & 訂單資料表(5) & ".[9] + " & 訂單資料表(5) & ".[9.5] + " & 訂單資料表(5) & ".[10] + " & 訂單資料表(5) & ".[10.5] + " & 訂單資料表(5) & ".[11] + 
54
+                            " & 訂單資料表(5) & ".[11.5] + " & 訂單資料表(5) & ".[12] + " & 訂單資料表(5) & ".[12.5] + " & 訂單資料表(5) & ".[13] + " & 訂單資料表(5) & ".[14] AS TOTAL,
55
+                            " & 訂單資料表(1) & ".ProductID AS [" & 表頭1 & "], " & 訂單資料表(1) & ".TVW AS [STYLE#]
56
+                FROM        " & 訂單資料表(5) & "  INNER JOIN
57
+                            " & 訂單資料表(1) & " ON " & 訂單資料表(5) & ".天盾流水號 = " & 訂單資料表(1) & ".訂單流水號 AND 
58
+                            " & 訂單資料表(5) & ".Color = " & 訂單資料表(1) & ".顏色 AND " & 訂單資料表(5) & ".ProductName = " & 訂單資料表(1) & ".形體號 AND 
59
+                            " & 訂單資料表(5) & ".DM = " & 訂單資料表(1) & ".楦型
60
+                WHERE      (" & 訂單資料表(5) & ".客戶訂單號 LIKE '" & 訂單明細表.客戶訂單號_tb.Text & "') AND (" & 訂單資料表(5) & ".天盾流水號 LIKE '" & 訂單明細表.訂單號_tb.Text & "')
61
+                " & SQL2
62
+        End If
50 63
     End Sub
51 64
     Friend Sub SQL_確認訂單明細表2()
52 65
         SQL1 = "SELECT 天盾流水號, 客戶訂單號, ItemNumber, ProductName, ProductDescription, Color, DM, [5], [5.5], [6], [6.5], [7], [7.5], [8], [8.5], [9], [9.5], [10], [10.5], [11], 
@@ -907,6 +920,7 @@
907 920
     End Sub
908 921
     Friend Sub SQL_訂單控制出貨數量預設()
909 922
         ConnOpen() : SQL1 = "UPDATE " & 訂單資料表(1) & " SET 出貨數量 = '0' WHERE (出貨數量 IS NULL)" : CmdSet_For_dr() : conn.Close()
923
+        ConnOpen() : SQL1 = "UPDATE " & 訂單資料表(1) & " SET 驗貨報告圖片2 = '' WHERE (驗貨報告圖片2 IS NULL)" : CmdSet_For_dr() : conn.Close()
910 924
     End Sub
911 925
     Friend Sub SQL_訂單流水號站存清空()
912 926
         ConnOpen() : SQL1 = "DELETE FROM " & 訂單資料表(4) & " WHERE (訂單流水號 = '" & Strings.Right(訂單控制表.天盾訂單號_tb.Text, 6) & "')" : CmdSet_For_dr()

+ 3
- 3
TENDEN-MES-SYS/0、Module/全域變數.vb View File

@@ -3,13 +3,13 @@
3 3
     Public g_conn_type, gUserName, 版本號, Target, Target1, Target2, FTP帳號, FTP密碼, 登入人IP, AA(99), 圖片庫, SQL密碼 As String
4 4
     Public CC(99), 登入判斷 As Boolean
5 5
     '----系統版本-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6
-    Public 版本 As String = "2024012001"
6
+    Public 版本 As String = "2024022703"
7 7
     '----系統用全域變數-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8 8
     Public 匯率 As Double
9 9
     '----系統用全域變數----------------------------------------------------------------------------------------------------------------------------------------------------------------------
10 10
     Public 圖片傳遞 As Image
11 11
     Public 進度條後墜 As String
12
-    Public 首次開啟, 重新計算, BL1 As Boolean
12
+    Public 首次開啟, 重新計算, BL1, BL2, BL3 As Boolean
13 13
     '--------------整數變數
14 14
     Public 比例1, 比例2, 比例3, 分母, 計算累加 As Integer
15 15
     Public lastFoundRowIndex, lastFoundColIndex As Integer
@@ -21,7 +21,7 @@
21 21
     Public PA, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PA16, PA17, PA18, PA19, PA20, PA21, PA22, PA23, PA24, PA25, PA26,
22 22
            PA27, PA28, PA29, PA30, PA31, PA32, PA33, PA34, PA35, PA36, PA37, PA38, PA39, PA40, PA41, PA42, PA43, PA44, PA45, PA46, PA47, PA48, PA49, PA50, PA51, PA52,
23 23
            PA53, PA54, PA55, PA56, PA57, PA58, PA59, PA60, PA61, PA62, PA63, PA64, PA65, PA66, PA67, PA68, PA69, PA70,
24
-           WW, 條件, WWD1, WWD2, WWD3, 流水號2, EDFR, 日期(1), QQWEE, 樣品單流水號變數1, 樣品單流水號變數2, 樣品單流水號變數3, 部門, QWWE, ZXC,
24
+           WW, 條件, WWD1, WWD2, WWD3, 流水號2, EDFR, 日期(1), QQWEE, 樣品單流水號變數1, 樣品單流水號變數2, 樣品單流水號變數3, 部門, QWWE, ZXC, 表頭1,
25 25
            kkk1, kkk2, kkk3, kkk4, kkk5, kkk6, YR, YS, YD, ASDF, PP, 品牌V_R判斷, QA, PP1, PP2, PP3, PP4, PP5, PP6, PP7, PP8, ASD, 列印用SQL, 驗貨報告, 訂單紀錄流水號,
26 26
            PPAA, PPBB(3000), 排序(1), OD(42), 訂單資料表(10), PB(60), 利潤表流水號 As String
27 27
     '--------------整數變數

+ 2
- 2
TENDEN-MES-SYS/2、成本系統管理/出貨明細表1.Designer.vb View File

@@ -187,12 +187,12 @@ Partial Class 出貨明細表1
187 187
         Me.Controls.Add(Me.PO號_tb)
188 188
         Me.Controls.Add(Me.年份_cb)
189 189
         Me.Controls.Add(Me.Label16)
190
-        Me.Controls.Add(Me.銷帳1_dgv)
191 190
         Me.Controls.Add(Me.銷帳_dgv)
191
+        Me.Controls.Add(Me.銷帳1_dgv)
192 192
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
193 193
         Me.Margin = New System.Windows.Forms.Padding(4)
194 194
         Me.Name = "出貨明細表1"
195
-        Me.Text = "出貨明細表1"
195
+        Me.Text = "出貨明細表"
196 196
         CType(Me.銷帳_dgv, System.ComponentModel.ISupportInitialize).EndInit()
197 197
         CType(Me.銷帳1_dgv, System.ComponentModel.ISupportInitialize).EndInit()
198 198
         Me.ResumeLayout(False)

+ 34
- 30
TENDEN-MES-SYS/2、成本系統管理/出貨明細表1.vb View File

@@ -16,9 +16,9 @@
16 16
         銷帳_dgv.Columns(0).Visible = False : 銷帳_dgv.Columns(1).Visible = False : 銷帳_dgv.Columns(11).Visible = False : 銷帳_dgv.Columns(15).Visible = False
17 17
         銷帳_dgv.Columns(16).Visible = False : 銷帳_dgv.Columns(17).Visible = False : 銷帳_dgv.Columns(18).Visible = False : 銷帳_dgv.Columns(19).Visible = False
18 18
         銷帳_dgv.Columns(20).Visible = False : 銷帳_dgv.Columns(21).Visible = False : 銷帳_dgv.Columns(23).Visible = False : 銷帳_dgv.Columns(24).Visible = False
19
-        銷帳_dgv.Columns(25).Visible = False : 銷帳_dgv.Columns(26).Visible = False : 銷帳_dgv.Columns(27).Visible = False : 銷帳_dgv.Columns(31).Visible = False
20
-        銷帳_dgv.Columns(32).Visible = False : 銷帳_dgv.Columns(33).Visible = False : 銷帳_dgv.Columns(34).Visible = False : 銷帳_dgv.Columns(35).Visible = False
21
-        銷帳_dgv.Columns(37).Visible = False : 銷帳_dgv.Columns(38).Visible = False : 銷帳_dgv.Columns(39).Visible = False
19
+        銷帳_dgv.Columns(25).Visible = False : 銷帳_dgv.Columns(26).Visible = False : 銷帳_dgv.Columns(27).Visible = False : 銷帳_dgv.Columns(32).Visible = False
20
+        銷帳_dgv.Columns(33).Visible = False : 銷帳_dgv.Columns(34).Visible = False : 銷帳_dgv.Columns(35).Visible = False : 銷帳_dgv.Columns(36).Visible = False
21
+        銷帳_dgv.Columns(38).Visible = False : 銷帳_dgv.Columns(39).Visible = False : 銷帳_dgv.Columns(40).Visible = False
22 22
         銷帳_dgv.EditMode = DataGridViewEditMode.EditOnEnter
23 23
         銷帳_dgv.Columns(9).DefaultCellStyle.Format = "#,##0" : 銷帳_dgv.Columns(10).DefaultCellStyle.Format = "#,##0"
24 24
         銷帳_dgv.Columns(9).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
@@ -27,33 +27,33 @@
27 27
         銷帳_dgv.Columns(10).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
28 28
         銷帳_dgv.Columns(6).FillWeight = 60 : 銷帳_dgv.Columns(7).FillWeight = 60 : 銷帳_dgv.Columns(8).FillWeight = 40
29 29
         銷帳_dgv.Columns(9).FillWeight = 40 : 銷帳_dgv.Columns(10).FillWeight = 40 : 銷帳_dgv.Columns(11).FillWeight = 40 : 銷帳_dgv.Columns(12).FillWeight = 40
30
-        銷帳_dgv.Columns(36).FillWeight = 300 : 銷帳_dgv.Columns(5).FillWeight = 85
31
-        銷帳_dgv.Columns(38).FillWeight = 40 : 銷帳_dgv.Columns(39).FillWeight = 40 : 銷帳_dgv.Columns(2).FillWeight = 70 : 銷帳_dgv.Columns(3).FillWeight = 40
32
-        銷帳_dgv.Columns(28).FillWeight = 90 : 銷帳_dgv.Columns(29).FillWeight = 125 : 銷帳_dgv.Columns(30).FillWeight = 90 : 銷帳_dgv.Columns("需存檔").FillWeight = 40
33
-        For I As Integer = 13 To 27
30
+        銷帳_dgv.Columns(37).FillWeight = 300 : 銷帳_dgv.Columns(5).FillWeight = 85
31
+        銷帳_dgv.Columns(39).FillWeight = 40 : 銷帳_dgv.Columns(40).FillWeight = 40 : 銷帳_dgv.Columns(2).FillWeight = 70 : 銷帳_dgv.Columns(3).FillWeight = 40
32
+        銷帳_dgv.Columns(29).FillWeight = 90 : 銷帳_dgv.Columns(30).FillWeight = 125 : 銷帳_dgv.Columns(31).FillWeight = 90 : 銷帳_dgv.Columns("需存檔").FillWeight = 40
33
+        For I As Integer = 13 To 28
34 34
             銷帳_dgv.Columns(I).DefaultCellStyle.Format = "#,##0.00" : 銷帳_dgv.Columns(I).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
35 35
             銷帳_dgv.Columns(I).FillWeight = 60
36 36
         Next : 銷帳_dgv.Columns(21).FillWeight = 70 : 銷帳_dgv.Columns(23).FillWeight = 70 : 銷帳_dgv.Columns(27).FillWeight = 70
37
-        For I As Integer = 31 To 35
37
+        For I As Integer = 32 To 36
38 38
             銷帳_dgv.Columns(I).DefaultCellStyle.Format = "#,##0.00" : 銷帳_dgv.Columns(I).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
39 39
             銷帳_dgv.Columns(I).FillWeight = 70
40 40
         Next
41 41
 
42
-        For I As Integer = 0 To 41 : 銷帳_dgv.Columns(I).ReadOnly = True : Next
43
-        銷帳_dgv.Columns(13).ReadOnly = False : 銷帳_dgv.Columns(14).ReadOnly = False : 銷帳_dgv.Columns(22).ReadOnly = False : 銷帳_dgv.Columns(28).ReadOnly = False
44
-        銷帳_dgv.Columns(29).ReadOnly = False : 銷帳_dgv.Columns(30).ReadOnly = False : 銷帳_dgv.Columns(36).ReadOnly = False
42
+        For I As Integer = 0 To 42 : 銷帳_dgv.Columns(I).ReadOnly = True : Next
43
+        銷帳_dgv.Columns(13).ReadOnly = False : 銷帳_dgv.Columns(14).ReadOnly = False : 銷帳_dgv.Columns(22).ReadOnly = False : 銷帳_dgv.Columns(29).ReadOnly = False
44
+        銷帳_dgv.Columns(30).ReadOnly = False : 銷帳_dgv.Columns(31).ReadOnly = False : 銷帳_dgv.Columns(37).ReadOnly = False
45 45
 
46 46
         For I As Integer = 0 To 銷帳_dgv.Rows.Count - 1 : 銷帳_dgv("需存檔", I).Value = False
47 47
             If 銷帳_dgv(11, I).Value = False Then
48 48
                 For II As Integer = 2 To 10 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.White : Next
49 49
                 For II As Integer = 13 To 21 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.White : Next
50
-                For II As Integer = 22 To 27 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.White : Next
51
-                For II As Integer = 28 To 36 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.White : Next
50
+                For II As Integer = 22 To 28 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.White : Next
51
+                For II As Integer = 29 To 37 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.White : Next
52 52
             Else
53 53
                 For II As Integer = 2 To 10 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.LightCyan : Next
54 54
                 For II As Integer = 13 To 21 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.Cornsilk : Next
55
-                For II As Integer = 22 To 27 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.LavenderBlush : Next
56
-                For II As Integer = 28 To 36 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.Beige : Next
55
+                For II As Integer = 22 To 28 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.LavenderBlush : Next
56
+                For II As Integer = 29 To 37 : 銷帳_dgv.Rows(I).Cells(II).Style.BackColor = Color.Beige : Next
57 57
             End If
58 58
             If 銷帳_dgv(11, I).Value = True Then
59 59
                 If 銷帳_dgv(14, I).Value = 0 Then
@@ -64,15 +64,15 @@
64 64
                 銷帳_dgv(21, I).Value = 銷帳_dgv(15, I).Value - 銷帳_dgv(16, I).Value - 銷帳_dgv(17, I).Value - 銷帳_dgv(18, I).Value - 銷帳_dgv(19, I).Value + 銷帳_dgv(20, I).Value
65 65
                 銷帳_dgv(23, I).Value = 銷帳_dgv(10, I).Value * 銷帳_dgv(22, I).Value
66 66
                 銷帳_dgv(27, I).Value = 銷帳_dgv(23, I).Value - 銷帳_dgv(24, I).Value - 銷帳_dgv(25, I).Value - 銷帳_dgv(26, I).Value
67
-                銷帳_dgv(31, I).Value = 銷帳_dgv(27, I).Value - 銷帳_dgv(21, I).Value
68
-                銷帳_dgv(35, I).Value = 銷帳_dgv(31, I).Value - 銷帳_dgv(32, I).Value - 銷帳_dgv(33, I).Value - 銷帳_dgv(34, I).Value
67
+                銷帳_dgv(32, I).Value = 銷帳_dgv(28, I).Value - 銷帳_dgv(21, I).Value
68
+                銷帳_dgv(36, I).Value = 銷帳_dgv(32, I).Value - 銷帳_dgv(33, I).Value - 銷帳_dgv(34, I).Value - 銷帳_dgv(35, I).Value
69 69
             End If
70 70
             If 銷帳_dgv(12, I).Value = True Then : 銷帳_dgv(10, I).ReadOnly = True : 銷帳_dgv(11, I).ReadOnly = True : 銷帳_dgv(22, I).ReadOnly = True
71 71
                 For II As Integer = 13 To 14 : 銷帳_dgv(II, I).ReadOnly = True : Next : For II As Integer = 16 To 20 : 銷帳_dgv(II, I).ReadOnly = True : Next
72
-                For II As Integer = 24 To 26 : 銷帳_dgv(II, I).ReadOnly = True : Next : For II As Integer = 32 To 34 : 銷帳_dgv(II, I).ReadOnly = True : Next
72
+                For II As Integer = 24 To 28 : 銷帳_dgv(II, I).ReadOnly = True : Next : For II As Integer = 33 To 35 : 銷帳_dgv(II, I).ReadOnly = True : Next
73 73
             Else : 銷帳_dgv(10, I).ReadOnly = False : 銷帳_dgv(11, I).ReadOnly = False : 銷帳_dgv(22, I).ReadOnly = False
74 74
                 For II As Integer = 13 To 14 : 銷帳_dgv(II, I).ReadOnly = False : Next : For II As Integer = 16 To 20 : 銷帳_dgv(II, I).ReadOnly = False : Next
75
-                For II As Integer = 24 To 26 : 銷帳_dgv(II, I).ReadOnly = False : Next : For II As Integer = 32 To 34 : 銷帳_dgv(II, I).ReadOnly = False : Next
75
+                For II As Integer = 24 To 28 : 銷帳_dgv(II, I).ReadOnly = False : Next : For II As Integer = 33 To 35 : 銷帳_dgv(II, I).ReadOnly = False : Next
76 76
             End If
77 77
         Next : 銷帳_dgv.Columns("已比對").Visible = False : 銷帳_dgv.Columns("需存檔").Visible = True
78 78
     End Sub
@@ -82,18 +82,19 @@
82 82
         銷帳_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 7.6)
83 83
     End Sub
84 84
     Private Sub 出貨明細表1_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
85
-        Set_銷帳清單() : 首次開啟 = False
85
+        SQL_銷帳清單_預設() : Set_銷帳清單() : 首次開啟 = False
86 86
     End Sub
87 87
     Private Sub 銷帳_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 銷帳_dgv.CellEndEdit
88 88
         For I As Integer = 0 To 銷帳_dgv.Rows.Count - 1
89 89
             If 銷帳_dgv("出貨數量", I).Value.ToString <> 銷帳1_dgv("出貨數量", I).Value.ToString Or
90
-                   銷帳_dgv("FTY_PRICE", I).Value.ToString <> 銷帳1_dgv("FTY_PRICE", I).Value.ToString Or
90
+                   銷帳_dgv("FTY Price 實際廠價", I).Value.ToString <> 銷帳1_dgv("FTY Price 實際廠價", I).Value.ToString Or
91 91
                    銷帳_dgv("扣關稅or後廠價", I).Value.ToString <> 銷帳1_dgv("扣關稅or後廠價", I).Value.ToString Or
92
-                   銷帳_dgv("CUST_Price", I).Value.ToString <> 銷帳1_dgv("CUST_Price", I).Value.ToString Or
92
+                   銷帳_dgv("Tendenza Price", I).Value.ToString <> 銷帳1_dgv("Tendenza Price", I).Value.ToString Or
93 93
                    銷帳_dgv("EX_FTY_DATE", I).Value.ToString <> 銷帳1_dgv("EX_FTY_DATE", I).Value.ToString Or
94 94
                    銷帳_dgv("Maturity_Date", I).Value.ToString <> 銷帳1_dgv("Maturity_Date", I).Value.ToString Or
95 95
                    銷帳_dgv("FTY_Payment_Date", I).Value.ToString <> 銷帳1_dgv("FTY_Payment_Date", I).Value.ToString Or
96
-                   銷帳_dgv("Remark", I).Value.ToString <> 銷帳1_dgv("Remark", I).Value.ToString Then
96
+                   銷帳_dgv("Remark", I).Value.ToString <> 銷帳1_dgv("Remark", I).Value.ToString Or
97
+                   銷帳_dgv("Selling Price", I).Value.ToString <> 銷帳1_dgv("Selling Price", I).Value.ToString Then
97 98
                 銷帳_dgv("需存檔", I).Value = True
98 99
             Else
99 100
                 銷帳_dgv("需存檔", I).Value = False
@@ -152,13 +153,14 @@
152 153
     Private Sub 存檔_tb_Click(sender As Object, e As EventArgs) Handles 存檔_tb.Click
153 154
         For I As Integer = 0 To 銷帳_dgv.Rows.Count - 1
154 155
             If 銷帳_dgv("出貨數量", I).Value.ToString <> 銷帳1_dgv("出貨數量", I).Value.ToString Or
155
-                   銷帳_dgv("FTY_PRICE", I).Value.ToString <> 銷帳1_dgv("FTY_PRICE", I).Value.ToString Or
156
+                   銷帳_dgv("FTY Price 實際廠價", I).Value.ToString <> 銷帳1_dgv("FTY Price 實際廠價", I).Value.ToString Or
156 157
                    銷帳_dgv("扣關稅or後廠價", I).Value.ToString <> 銷帳1_dgv("扣關稅or後廠價", I).Value.ToString Or
157
-                   銷帳_dgv("CUST_Price", I).Value.ToString <> 銷帳1_dgv("CUST_Price", I).Value.ToString Or
158
+                   銷帳_dgv("Tendenza Price", I).Value.ToString <> 銷帳1_dgv("Tendenza Price", I).Value.ToString Or
158 159
                    銷帳_dgv("EX_FTY_DATE", I).Value.ToString <> 銷帳1_dgv("EX_FTY_DATE", I).Value.ToString Or
159 160
                    銷帳_dgv("Maturity_Date", I).Value.ToString <> 銷帳1_dgv("Maturity_Date", I).Value.ToString Or
160 161
                    銷帳_dgv("FTY_Payment_Date", I).Value.ToString <> 銷帳1_dgv("FTY_Payment_Date", I).Value.ToString Or
161
-                   銷帳_dgv("Remark", I).Value.ToString <> 銷帳1_dgv("Remark", I).Value.ToString Then
162
+                   銷帳_dgv("Remark", I).Value.ToString <> 銷帳1_dgv("Remark", I).Value.ToString Or
163
+                   銷帳_dgv("Selling Price", I).Value.ToString <> 銷帳1_dgv("Selling Price", I).Value.ToString Then
162 164
                 銷帳_dgv("需存檔", I).Value = True
163 165
             Else
164 166
                 銷帳_dgv("需存檔", I).Value = False
@@ -171,20 +173,22 @@
171 173
             If aa1 = MsgBoxResult.Ok Then : 資料數 = 銷帳_dgv.Rows.Count
172 174
                 For i As Integer = 0 To 銷帳_dgv.Rows.Count - 1 : MyModule1.進度條()
173 175
                     If 銷帳_dgv.Rows(i).Cells("需存檔").Value = True Then : PA3 = 銷帳_dgv.Rows(i).Cells("流水號").Value.ToString
174
-                        PA70 = 銷帳_dgv.Rows(i).Cells("出貨數量").Value.ToString : PA69 = 銷帳_dgv.Rows(i).Cells("FTY_PRICE").Value.ToString
175
-                        PA68 = 銷帳_dgv.Rows(i).Cells("扣關稅or後廠價").Value.ToString : PA67 = 銷帳_dgv.Rows(i).Cells("CUST_Price").Value.ToString
176
+                        PA70 = 銷帳_dgv.Rows(i).Cells("出貨數量").Value.ToString : PA69 = 銷帳_dgv.Rows(i).Cells("FTY Price 實際廠價").Value.ToString
177
+                        PA68 = 銷帳_dgv.Rows(i).Cells("扣關稅or後廠價").Value.ToString : PA67 = 銷帳_dgv.Rows(i).Cells("Tendenza Price").Value.ToString
176 178
                         PA66 = 銷帳_dgv.Rows(i).Cells("EX_FTY_DATE").Value.ToString : PA65 = 銷帳_dgv.Rows(i).Cells("Maturity_Date").Value.ToString
177 179
                         PA64 = 銷帳_dgv.Rows(i).Cells("FTY_Payment_Date").Value.ToString : PA63 = 銷帳_dgv.Rows(i).Cells("Remark").Value.ToString
180
+                        PA62 = 銷帳_dgv.Rows(i).Cells("Selling Price").Value.ToString
178 181
                         SQL_銷帳清單_存檔1() : 銷帳_dgv.Rows(i).Cells("需存檔").Value = False
179 182
                     End If
180 183
                 Next : TENDEN_MES_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0 : MsgBox("整體存檔完成")
181 184
             End If
182 185
         Else
183 186
             If 流水號_tb.Text = "" Then : MsgBox("沒有選擇要存檔的資料!!") : Else : PA3 = 流水號_tb.Text
184
-                PA70 = 銷帳_dgv.Rows(目前選擇項).Cells("出貨數量").Value.ToString : PA69 = 銷帳_dgv.Rows(目前選擇項).Cells("FTY_PRICE").Value.ToString
185
-                PA68 = 銷帳_dgv.Rows(目前選擇項).Cells("扣關稅or後廠價").Value.ToString : PA67 = 銷帳_dgv.Rows(目前選擇項).Cells("CUST_Price").Value.ToString
187
+                PA70 = 銷帳_dgv.Rows(目前選擇項).Cells("出貨數量").Value.ToString : PA69 = 銷帳_dgv.Rows(目前選擇項).Cells("FTY Price 實際廠價").Value.ToString
188
+                PA68 = 銷帳_dgv.Rows(目前選擇項).Cells("扣關稅or後廠價").Value.ToString : PA67 = 銷帳_dgv.Rows(目前選擇項).Cells("Tendenza Price").Value.ToString
186 189
                 PA66 = 銷帳_dgv.Rows(目前選擇項).Cells("EX_FTY_DATE").Value.ToString : PA65 = 銷帳_dgv.Rows(目前選擇項).Cells("Maturity_Date").Value.ToString
187 190
                 PA64 = 銷帳_dgv.Rows(目前選擇項).Cells("FTY_Payment_Date").Value.ToString : PA63 = 銷帳_dgv.Rows(目前選擇項).Cells("Remark").Value.ToString
191
+                PA62 = 銷帳_dgv.Rows(目前選擇項).Cells("Selling Price").Value.ToString
188 192
                 銷帳_dgv.Rows(目前選擇項).Cells("需存檔").Value = False : SQL_銷帳清單_存檔1() : MsgBox("單筆存檔完成")
189 193
             End If
190 194
         End If

+ 95
- 8
TENDEN-MES-SYS/2、成本系統管理/出貨銷帳明細表.Designer.vb View File

@@ -58,6 +58,8 @@ Partial Class 出貨銷帳明細表
58 58
         Me.流水號_tb = New System.Windows.Forms.TextBox()
59 59
         Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
60 60
         Me.視窗2_pl = New System.Windows.Forms.Panel()
61
+        Me.差異_下1_bt = New System.Windows.Forms.Button()
62
+        Me.差異_上1_bt = New System.Windows.Forms.Button()
61 63
         Me.Panel3 = New System.Windows.Forms.Panel()
62 64
         Me.控制表1_dgv = New System.Windows.Forms.DataGridView()
63 65
         Me.控制表_dgv = New System.Windows.Forms.DataGridView()
@@ -84,6 +86,10 @@ Partial Class 出貨銷帳明細表
84 86
         Me.比對關鍵字_bt = New System.Windows.Forms.Button()
85 87
         Me.銷帳1_dgv = New System.Windows.Forms.DataGridView()
86 88
         Me.模糊比對_ch = New System.Windows.Forms.CheckBox()
89
+        Me.篩選2_ch = New System.Windows.Forms.CheckBox()
90
+        Me.篩選3_ch = New System.Windows.Forms.CheckBox()
91
+        Me.篩選4_ch = New System.Windows.Forms.CheckBox()
92
+        Me.篩選1_ch = New System.Windows.Forms.CheckBox()
87 93
         CType(Me.利潤表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
88 94
         CType(Me.訂單明細表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
89 95
         CType(Me.銷帳_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -145,7 +151,7 @@ Partial Class 出貨銷帳明細表
145 151
         '
146 152
         Me.Label20.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
147 153
         Me.Label20.AutoSize = True
148
-        Me.Label20.Location = New System.Drawing.Point(1240, 10)
154
+        Me.Label20.Location = New System.Drawing.Point(1240, 19)
149 155
         Me.Label20.Name = "Label20"
150 156
         Me.Label20.Size = New System.Drawing.Size(88, 16)
151 157
         Me.Label20.TabIndex = 563
@@ -213,7 +219,7 @@ Partial Class 出貨銷帳明細表
213 219
         Me.品牌標註_lb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
214 220
         Me.品牌標註_lb.AutoSize = True
215 221
         Me.品牌標註_lb.ForeColor = System.Drawing.Color.Red
216
-        Me.品牌標註_lb.Location = New System.Drawing.Point(1328, 10)
222
+        Me.品牌標註_lb.Location = New System.Drawing.Point(1328, 19)
217 223
         Me.品牌標註_lb.Name = "品牌標註_lb"
218 224
         Me.品牌標註_lb.Size = New System.Drawing.Size(57, 16)
219 225
         Me.品牌標註_lb.TabIndex = 570
@@ -261,7 +267,7 @@ Partial Class 出貨銷帳明細表
261 267
         Me.INV排序_cb.AutoSize = True
262 268
         Me.INV排序_cb.Checked = True
263 269
         Me.INV排序_cb.CheckState = System.Windows.Forms.CheckState.Checked
264
-        Me.INV排序_cb.Location = New System.Drawing.Point(744, 8)
270
+        Me.INV排序_cb.Location = New System.Drawing.Point(822, 0)
265 271
         Me.INV排序_cb.Name = "INV排序_cb"
266 272
         Me.INV排序_cb.Size = New System.Drawing.Size(71, 20)
267 273
         Me.INV排序_cb.TabIndex = 1376
@@ -272,7 +278,7 @@ Partial Class 出貨銷帳明細表
272 278
         '
273 279
         Me.PO排序_cb.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
274 280
         Me.PO排序_cb.AutoSize = True
275
-        Me.PO排序_cb.Location = New System.Drawing.Point(822, 8)
281
+        Me.PO排序_cb.Location = New System.Drawing.Point(822, 17)
276 282
         Me.PO排序_cb.Name = "PO排序_cb"
277 283
         Me.PO排序_cb.Size = New System.Drawing.Size(67, 20)
278 284
         Me.PO排序_cb.TabIndex = 1377
@@ -313,6 +319,8 @@ Partial Class 出貨銷帳明細表
313 319
         '
314 320
         Me.視窗2_pl.BackColor = System.Drawing.Color.LightCyan
315 321
         Me.視窗2_pl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
322
+        Me.視窗2_pl.Controls.Add(Me.差異_下1_bt)
323
+        Me.視窗2_pl.Controls.Add(Me.差異_上1_bt)
316 324
         Me.視窗2_pl.Controls.Add(Me.Panel3)
317 325
         Me.視窗2_pl.Controls.Add(Me.隱藏_bt)
318 326
         Me.視窗2_pl.Controls.Add(Me.新增資料_bt)
@@ -323,6 +331,32 @@ Partial Class 出貨銷帳明細表
323 331
         Me.視窗2_pl.Size = New System.Drawing.Size(1545, 408)
324 332
         Me.視窗2_pl.TabIndex = 1403
325 333
         '
334
+        '差異_下1_bt
335
+        '
336
+        Me.差異_下1_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
337
+        Me.差異_下1_bt.BackgroundImage = Global.天盾國際管理系統.My.Resources.Resources.arrow_down
338
+        Me.差異_下1_bt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
339
+        Me.差異_下1_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
340
+        Me.差異_下1_bt.ForeColor = System.Drawing.Color.Blue
341
+        Me.差異_下1_bt.Location = New System.Drawing.Point(375, 2)
342
+        Me.差異_下1_bt.Name = "差異_下1_bt"
343
+        Me.差異_下1_bt.Size = New System.Drawing.Size(25, 25)
344
+        Me.差異_下1_bt.TabIndex = 1382
345
+        Me.差異_下1_bt.UseVisualStyleBackColor = True
346
+        '
347
+        '差異_上1_bt
348
+        '
349
+        Me.差異_上1_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
350
+        Me.差異_上1_bt.BackgroundImage = Global.天盾國際管理系統.My.Resources.Resources.arrow_up
351
+        Me.差異_上1_bt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
352
+        Me.差異_上1_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
353
+        Me.差異_上1_bt.ForeColor = System.Drawing.Color.Blue
354
+        Me.差異_上1_bt.Location = New System.Drawing.Point(340, 2)
355
+        Me.差異_上1_bt.Name = "差異_上1_bt"
356
+        Me.差異_上1_bt.Size = New System.Drawing.Size(25, 25)
357
+        Me.差異_上1_bt.TabIndex = 1381
358
+        Me.差異_上1_bt.UseVisualStyleBackColor = True
359
+        '
326 360
         'Panel3
327 361
         '
328 362
         Me.Panel3.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
@@ -685,19 +719,64 @@ Partial Class 出貨銷帳明細表
685 719
         '
686 720
         '模糊比對_ch
687 721
         '
722
+        Me.模糊比對_ch.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
688 723
         Me.模糊比對_ch.AutoSize = True
689
-        Me.模糊比對_ch.Location = New System.Drawing.Point(520, 8)
724
+        Me.模糊比對_ch.Location = New System.Drawing.Point(1245, 0)
690 725
         Me.模糊比對_ch.Name = "模糊比對_ch"
691
-        Me.模糊比對_ch.Size = New System.Drawing.Size(98, 20)
726
+        Me.模糊比對_ch.Size = New System.Drawing.Size(128, 20)
692 727
         Me.模糊比對_ch.TabIndex = 1848
693
-        Me.模糊比對_ch.Text = "開啟模糊比對"
728
+        Me.模糊比對_ch.Text = "開          對"
694 729
         Me.模糊比對_ch.UseVisualStyleBackColor = True
695 730
         '
731
+        '篩選2_ch
732
+        '
733
+        Me.篩選2_ch.AutoSize = True
734
+        Me.篩選2_ch.Location = New System.Drawing.Point(529, 17)
735
+        Me.篩選2_ch.Name = "篩選2_ch"
736
+        Me.篩選2_ch.Size = New System.Drawing.Size(42, 20)
737
+        Me.篩選2_ch.TabIndex = 1849
738
+        Me.篩選2_ch.Text = "HP"
739
+        Me.篩選2_ch.UseVisualStyleBackColor = True
740
+        '
741
+        '篩選3_ch
742
+        '
743
+        Me.篩選3_ch.AutoSize = True
744
+        Me.篩選3_ch.Location = New System.Drawing.Point(579, -1)
745
+        Me.篩選3_ch.Name = "篩選3_ch"
746
+        Me.篩選3_ch.Size = New System.Drawing.Size(68, 20)
747
+        Me.篩選3_ch.TabIndex = 1850
748
+        Me.篩選3_ch.Text = "VIONIC"
749
+        Me.篩選3_ch.UseVisualStyleBackColor = True
750
+        '
751
+        '篩選4_ch
752
+        '
753
+        Me.篩選4_ch.AutoSize = True
754
+        Me.篩選4_ch.Location = New System.Drawing.Point(579, 17)
755
+        Me.篩選4_ch.Name = "篩選4_ch"
756
+        Me.篩選4_ch.Size = New System.Drawing.Size(73, 20)
757
+        Me.篩選4_ch.TabIndex = 1851
758
+        Me.篩選4_ch.Text = "DRS/ LIF"
759
+        Me.篩選4_ch.UseVisualStyleBackColor = True
760
+        '
761
+        '篩選1_ch
762
+        '
763
+        Me.篩選1_ch.AutoSize = True
764
+        Me.篩選1_ch.Checked = True
765
+        Me.篩選1_ch.CheckState = System.Windows.Forms.CheckState.Checked
766
+        Me.篩選1_ch.Location = New System.Drawing.Point(529, 0)
767
+        Me.篩選1_ch.Name = "篩選1_ch"
768
+        Me.篩選1_ch.Size = New System.Drawing.Size(46, 20)
769
+        Me.篩選1_ch.TabIndex = 1852
770
+        Me.篩選1_ch.Text = "ALL"
771
+        Me.篩選1_ch.UseVisualStyleBackColor = True
772
+        '
696 773
         '出貨銷帳明細表
697 774
         '
698 775
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
699 776
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
700 777
         Me.ClientSize = New System.Drawing.Size(1593, 679)
778
+        Me.Controls.Add(Me.篩選1_ch)
779
+        Me.Controls.Add(Me.篩選3_ch)
701 780
         Me.Controls.Add(Me.模糊比對_ch)
702 781
         Me.Controls.Add(Me.導入_bt)
703 782
         Me.Controls.Add(Me.楦型_tb)
@@ -719,7 +798,6 @@ Partial Class 出貨銷帳明細表
719 798
         Me.Controls.Add(Me.差異_下_bt)
720 799
         Me.Controls.Add(Me.差異_上_bt)
721 800
         Me.Controls.Add(Me.PO號1_tb)
722
-        Me.Controls.Add(Me.PO排序_cb)
723 801
         Me.Controls.Add(Me.INV排序_cb)
724 802
         Me.Controls.Add(Me.比對關鍵字_bt)
725 803
         Me.Controls.Add(Me.年份_cb)
@@ -733,6 +811,9 @@ Partial Class 出貨銷帳明細表
733 811
         Me.Controls.Add(Me.利潤表_dgv)
734 812
         Me.Controls.Add(Me.銷帳_dgv)
735 813
         Me.Controls.Add(Me.銷帳1_dgv)
814
+        Me.Controls.Add(Me.PO排序_cb)
815
+        Me.Controls.Add(Me.篩選2_ch)
816
+        Me.Controls.Add(Me.篩選4_ch)
736 817
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
737 818
         Me.Margin = New System.Windows.Forms.Padding(4)
738 819
         Me.Name = "出貨銷帳明細表"
@@ -801,4 +882,10 @@ Partial Class 出貨銷帳明細表
801 882
     Friend WithEvents 導入_bt As Button
802 883
     Friend WithEvents 銷帳1_dgv As DataGridView
803 884
     Friend WithEvents 模糊比對_ch As CheckBox
885
+    Friend WithEvents 差異_下1_bt As Button
886
+    Friend WithEvents 差異_上1_bt As Button
887
+    Friend WithEvents 篩選2_ch As CheckBox
888
+    Friend WithEvents 篩選3_ch As CheckBox
889
+    Friend WithEvents 篩選4_ch As CheckBox
890
+    Friend WithEvents 篩選1_ch As CheckBox
804 891
 End Class

+ 417
- 270
TENDEN-MES-SYS/2、成本系統管理/出貨銷帳明細表.vb
File diff suppressed because it is too large
View File


+ 10
- 39
TENDEN-MES-SYS/2、成本系統管理/列印_訂單價格利潤表.Designer.vb View File

@@ -1,9 +1,9 @@
1
-<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
1
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
2 2
 Partial Class 列印_訂單價格利潤表
3 3
     Inherits System.Windows.Forms.Form
4 4
 
5 5
     'Form 覆寫 Dispose 以清除元件清單。
6
-    <System.Diagnostics.DebuggerNonUserCode()> _
6
+    <System.Diagnostics.DebuggerNonUserCode()>
7 7
     Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 8
         Try
9 9
             If disposing AndAlso components IsNot Nothing Then
@@ -15,19 +15,17 @@ Partial Class 列印_訂單價格利潤表
15 15
     End Sub
16 16
 
17 17
     '為 Windows Form 設計工具的必要項
18
-    Private  components As System.ComponentModel.IContainer
18
+    Private components As System.ComponentModel.IContainer
19 19
 
20 20
     '注意: 以下為 Windows Form 設計工具所需的程序
21 21
     '可以使用 Windows Form 設計工具進行修改。
22 22
     '請勿使用程式碼編輯器進行修改。
23 23
     <System.Diagnostics.DebuggerStepThrough()>
24
-    Private  Sub InitializeComponent()
25
-        Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
24
+    Private Sub InitializeComponent()
25
+        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26 26
         Me.取消列印_bt = New System.Windows.Forms.Button()
27 27
         Me.確認列印_bt = New System.Windows.Forms.Button()
28 28
         Me.利潤表_dgv = New System.Windows.Forms.DataGridView()
29
-        Me.CB_1 = New System.Windows.Forms.CheckBox()
30
-        Me.CB_2 = New System.Windows.Forms.CheckBox()
31 29
         CType(Me.利潤表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
32 30
         Me.SuspendLayout()
33 31
         '
@@ -35,7 +33,7 @@ Partial Class 列印_訂單價格利潤表
35 33
         '
36 34
         Me.取消列印_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
37 35
         Me.取消列印_bt.ForeColor = System.Drawing.Color.Red
38
-        Me.取消列印_bt.Location = New System.Drawing.Point(128, 36)
36
+        Me.取消列印_bt.Location = New System.Drawing.Point(128, 3)
39 37
         Me.取消列印_bt.Name = "取消列印_bt"
40 38
         Me.取消列印_bt.Size = New System.Drawing.Size(110, 54)
41 39
         Me.取消列印_bt.TabIndex = 314
@@ -46,7 +44,7 @@ Partial Class 列印_訂單價格利潤表
46 44
         '
47 45
         Me.確認列印_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
48 46
         Me.確認列印_bt.ForeColor = System.Drawing.Color.Blue
49
-        Me.確認列印_bt.Location = New System.Drawing.Point(12, 36)
47
+        Me.確認列印_bt.Location = New System.Drawing.Point(12, 3)
50 48
         Me.確認列印_bt.Name = "確認列印_bt"
51 49
         Me.確認列印_bt.Size = New System.Drawing.Size(110, 54)
52 50
         Me.確認列印_bt.TabIndex = 313
@@ -55,8 +53,8 @@ Partial Class 列印_訂單價格利潤表
55 53
         '
56 54
         '利潤表_dgv
57 55
         '
58
-        DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
59
-        Me.利潤表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4
56
+        DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
57
+        Me.利潤表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
60 58
         Me.利潤表_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
61 59
         Me.利潤表_dgv.Location = New System.Drawing.Point(12, 114)
62 60
         Me.利潤表_dgv.Name = "利潤表_dgv"
@@ -65,35 +63,11 @@ Partial Class 列印_訂單價格利潤表
65 63
         Me.利潤表_dgv.Size = New System.Drawing.Size(775, 143)
66 64
         Me.利潤表_dgv.TabIndex = 312
67 65
         '
68
-        'CB_1
69
-        '
70
-        Me.CB_1.AutoSize = True
71
-        Me.CB_1.Checked = True
72
-        Me.CB_1.CheckState = System.Windows.Forms.CheckState.Checked
73
-        Me.CB_1.Location = New System.Drawing.Point(12, 10)
74
-        Me.CB_1.Name = "CB_1"
75
-        Me.CB_1.Size = New System.Drawing.Size(107, 20)
76
-        Me.CB_1.TabIndex = 315
77
-        Me.CB_1.Text = "顯示 FTY DATE"
78
-        Me.CB_1.UseVisualStyleBackColor = True
79
-        '
80
-        'CB_2
81
-        '
82
-        Me.CB_2.AutoSize = True
83
-        Me.CB_2.Location = New System.Drawing.Point(128, 10)
84
-        Me.CB_2.Name = "CB_2"
85
-        Me.CB_2.Size = New System.Drawing.Size(111, 20)
86
-        Me.CB_2.TabIndex = 316
87
-        Me.CB_2.Text = "顯示 Product Id"
88
-        Me.CB_2.UseVisualStyleBackColor = True
89
-        '
90 66
         '列印_訂單價格利潤表
91 67
         '
92 68
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
93 69
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
94
-        Me.ClientSize = New System.Drawing.Size(250, 95)
95
-        Me.Controls.Add(Me.CB_2)
96
-        Me.Controls.Add(Me.CB_1)
70
+        Me.ClientSize = New System.Drawing.Size(250, 61)
97 71
         Me.Controls.Add(Me.取消列印_bt)
98 72
         Me.Controls.Add(Me.確認列印_bt)
99 73
         Me.Controls.Add(Me.利潤表_dgv)
@@ -106,14 +80,11 @@ Partial Class 列印_訂單價格利潤表
106 80
         Me.Text = "訂單價格利潤表列印"
107 81
         CType(Me.利潤表_dgv, System.ComponentModel.ISupportInitialize).EndInit()
108 82
         Me.ResumeLayout(False)
109
-        Me.PerformLayout()
110 83
 
111 84
     End Sub
112 85
 
113 86
     Friend WithEvents 取消列印_bt As Button
114 87
     Friend WithEvents 確認列印_bt As Button
115 88
     Friend WithEvents 利潤表_dgv As DataGridView
116
-    Friend WithEvents CB_1 As CheckBox
117
-    Friend WithEvents CB_2 As CheckBox
118 89
 End Class
119 90
 

+ 166
- 214
TENDEN-MES-SYS/2、成本系統管理/列印_訂單價格利潤表.vb View File

@@ -17,7 +17,7 @@ Public Class 列印_訂單價格利潤表
17 17
         ConnOpen()
18 18
     End Sub
19 19
     Private Sub Set_DGV1載入後設定()
20
-        CmdSet_For_DGV() :  : da.Fill(ds) : 利潤表_dgv.DataSource = ds.Tables(0) : conn.Close()
20
+        CmdSet_For_DGV() :: da.Fill(ds) : 利潤表_dgv.DataSource = ds.Tables(0) : conn.Close()
21 21
     End Sub
22 22
     Private Sub Set_訂單清單()
23 23
         Set_DGV1載入前設定() : SQL_訂單價格利潤表() : Set_DGV1載入後設定()
@@ -35,64 +35,41 @@ Public Class 列印_訂單價格利潤表
35 35
         Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
36 36
 
37 37
         xlApp = CType(CreateObject("Excel.Application"), Microsoft.Office.Interop.Excel.Application)
38
-        xlBook = xlApp.Workbooks.Add
39
-        xlApp.DisplayAlerts = True
40
-        xlBook.Activate()
41
-        xlSheet = NewMethod(xlBook)
42
-        xlSheet.Activate()
43
-        xlApp.Visible = True
44
-        xlApp.Application.WindowState = xlMaximized
38
+        xlBook = xlApp.Workbooks.Add : xlApp.DisplayAlerts = True : xlBook.Activate() : xlSheet = NewMethod(xlBook)
39
+        xlSheet.Activate() : xlApp.Visible = True : xlApp.Application.WindowState = xlMaximized
45 40
 
46
-        xlSheet.Cells(3, 1) = "Tendenza Po#"
47
-        xlSheet.Cells(3, 2) = "Season"
48
-        xlSheet.Cells(3, 3) = "Po#"
49
-        xlSheet.Cells(3, 4) = "Style"
50
-        xlSheet.Cells(3, 5) = "Style #"
51
-        xlSheet.Cells(3, 6) = "CLR"
52
-        If CB_1.Checked = True Then : xlSheet.Cells(3, 7) = "FTY DATE" : Else : xlSheet.Cells(3, 7) = "Product Id" : End If
41
+        xlSheet.Cells(3, 1) = "Tendenza Po#" : xlSheet.Cells(3, 2) = "Season" : xlSheet.Cells(3, 3) = "Po#" : xlSheet.Cells(3, 4) = "Style"
42
+        xlSheet.Cells(3, 5) = "Style #" : xlSheet.Cells(3, 6) = "CLR" : xlSheet.Cells(3, 7) = "FTY DATE" : xlSheet.Cells(3, 8) = "DM"
43
+        xlSheet.Cells(3, 9) = "PRS" : xlSheet.Cells(3, 10) = "X/F Date"
44
+        '
45
+        xlSheet.Cells(3, 11) = "Amount" : xlSheet.Cells(3, 12) = "Remark"
46
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : xlSheet.Cells(3, 13) = "HTS#" : Else : xlSheet.Cells(3, 13) = "ProductID" : End If
47
+        xlSheet.Cells(3, 14) = "Factory" : xlSheet.Cells(3, 15) = "DIV"
53 48
 
54
-        xlSheet.Cells(3, 8) = "DM"
55
-        xlSheet.Cells(3, 9) = "PRS"
56
-        xlSheet.Cells(3, 10) = "X/F Date"
57
-        xlSheet.Cells(3, 11) = "Price"
58
-        xlSheet.Cells(3, 12) = "Amount"
59
-        xlSheet.Cells(3, 13) = "Remark"
60
-        xlSheet.Cells(3, 14) = "Factory"
61
-        xlSheet.Cells(3, 15) = "DIV"
62
-        xlSheet.Cells(3, 16) = "FTY Price"
63
-        xlSheet.Cells(3, 17) = "Commission TTL"
64
-        xlSheet.Cells(3, 18) = "Commission Darren"
65
-        xlSheet.Cells(3, 19) = "Commission Tendenza"
66
-        xlSheet.Cells(3, 20) = "%"
67
-        xlSheet.Cells(3, 21) = "Basic Price(+)"
68
-        xlSheet.Cells(3, 22) = "PG/MOQ (+)"
69
-        xlSheet.Cells(3, 23) = "Foot form/ PET form(+)"
70
-        xlSheet.Cells(3, 24) = "Tooling (+)"
71
-        xlSheet.Cells(3, 25) = "Rubber Band(+)"
72
-        xlSheet.Cells(3, 26) = "J.HOOK (+)"
73
-        xlSheet.Cells(3, 27) = "Water Resistant(+)"
74
-        xlSheet.Cells(3, 28) = "16% VAT(+)"
75
-        xlSheet.Cells(3, 29) = "EXW Saving(-)"
76
-        xlSheet.Cells(3, 30) = "TTL Collected Toolng"
77
-        xlSheet.Cells(3, 31) = "Exchange"
78
-        xlSheet.Cells(1, 8) = "Total-PRS"
79
-        xlSheet.Cells(1, 12) = "Total-Amount"
80
-        xlSheet.Cells(1, 16) = "Total-Commission-TTL"
81
-        xlSheet.Cells(1, 18) = "Total-Commission-Darren"
82
-        xlSheet.Cells(1, 19) = "Total-Commission-Tendenza"
83
-        xlSheet.Cells(1, 30) = "Total-TTL Collected Toolng"
84
-        xlSheet.Cells(2, 8) = "=SUBTOTAL(9,M4:H$99999)"
85
-        xlSheet.Cells(2, 12) = "=SUBTOTAL(9,L4:K$99999)"
86
-        xlSheet.Cells(2, 16) = "=SUBTOTAL(9,Q4:P$99999)"
87
-        xlSheet.Cells(2, 18) = "=SUBTOTAL(9,R4:Q$99999)"
88
-        xlSheet.Cells(2, 19) = "=SUBTOTAL(9,S4:R$99999)"
89
-        xlSheet.Cells(2, 30) = "=SUBTOTAL(9,AD4:AC$99999)"
90
-        xlSheet.Cells(3, 32) = "ItemNumber"
91
-        xlSheet.Cells(3, 33) = "審核"
92
-        xlSheet.Cells(3, 34) = "Vionic Po#"
93
-        xlSheet.Cells(3, 35) = "Ship Mode"
94
-        xlSheet.Cells(3, 36) = "Company code"
95
-        xlSheet.Cells(3, 37) = "Final Customer Ship To"
49
+        xlSheet.Cells(3, 16) = "FTY Price 實際廠價" : xlSheet.Cells(3, 17) = "" : xlSheet.Cells(3, 18) = "%"
50
+
51
+        xlSheet.Cells(3, 19) = "FTYPrice (D廠價)" : xlSheet.Cells(3, 20) = "TendenzaPrice" : xlSheet.Cells(3, 21) = "Comm-TTL"
52
+        xlSheet.Cells(3, 22) = "Comm-Darren" : xlSheet.Cells(3, 23) = "Comm-Tendenza" : xlSheet.Cells(3, 24) = "%"
53
+
54
+        xlSheet.Cells(3, 25) = "Selling Price" : xlSheet.Cells(3, 26) = "Comm-TTL" : xlSheet.Cells(3, 27) = "%"
55
+
56
+        xlSheet.Cells(3, 28) = "Basic Price(+)" : xlSheet.Cells(3, 29) = "PG/MOQ (+)" : xlSheet.Cells(3, 30) = "Foot form/ PET form(+)"
57
+        xlSheet.Cells(3, 31) = "Tooling (+)" : xlSheet.Cells(3, 32) = "Rubber Band(+)" : xlSheet.Cells(3, 33) = "J.HOOK (+)"
58
+        xlSheet.Cells(3, 34) = "Water Resistant(+)" : xlSheet.Cells(3, 35) = "16% VAT(+)" : xlSheet.Cells(3, 36) = "EXW Saving(-)"
59
+        xlSheet.Cells(3, 37) = "TTL Collected Toolng" : xlSheet.Cells(3, 38) = "Exchange"
60
+
61
+        xlSheet.Cells(1, 8) = "Total-PRS" : xlSheet.Cells(1, 10) = "Total-Amount" : xlSheet.Cells(1, 17) = ""
62
+        xlSheet.Cells(1, 21) = "Total-Comm (D+T)" : xlSheet.Cells(1, 23) = "Total-Comm/2" : xlSheet.Cells(1, 26) = "Total-Comm (Me Too)"
63
+        xlSheet.Cells(1, 37) = "Total-TTL Collected Toolng"
64
+
65
+        xlSheet.Cells(2, 8) = "=SUBTOTAL(9,I4:I$99999)" : xlSheet.Cells(2, 10) = "=SUBTOTAL(9,K4:K$99999)"
66
+        xlSheet.Cells(2, 17) = "" : xlSheet.Cells(2, 21) = "=SUBTOTAL(9,U4:U$99999)"
67
+        xlSheet.Cells(2, 23) = "=SUBTOTAL(9,W4:W$99999)" : xlSheet.Cells(2, 26) = "=SUBTOTAL(9,Z4:Z$99999)"
68
+        xlSheet.Cells(2, 37) = "=SUBTOTAL(9,AK4:AK$99999)"
69
+
70
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : xlSheet.Cells(3, 41) = "DSW Po#" : Else : xlSheet.Cells(3, 41) = "Vionic Po#" : End If
71
+        xlSheet.Cells(3, 39) = "ItemNumber" : xlSheet.Cells(3, 40) = "審核"
72
+        xlSheet.Cells(3, 42) = "Ship Mode" : xlSheet.Cells(3, 43) = "Company code" : xlSheet.Cells(3, 44) = "Final Customer Ship To"
96 73
         AA(xlApp, xlSheet)
97 74
         For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
98 75
             xlSheet.Cells(i + 4, 1) = 利潤表_dgv.Rows(i).Cells("訂單流水號").Value
@@ -101,57 +78,54 @@ Public Class 列印_訂單價格利潤表
101 78
             xlSheet.Cells(i + 4, 4) = 利潤表_dgv.Rows(i).Cells("形體號").Value
102 79
             xlSheet.Cells(i + 4, 5) = 利潤表_dgv.Rows(i).Cells("TVW").Value
103 80
             xlSheet.Cells(i + 4, 6) = 利潤表_dgv.Rows(i).Cells("顏色").Value
104
-            If CB_1.Checked = True Then : xlSheet.Cells(i + 4, 7) = 利潤表_dgv.Rows(i).Cells("工廠回復交期").Value
105
-            Else : xlSheet.Cells(i + 4, 7) = 利潤表_dgv.Rows(i).Cells("ProductID").Value : End If
81
+            xlSheet.Cells(i + 4, 7) = 利潤表_dgv.Rows(i).Cells("工廠回復交期").Value
106 82
 
107 83
             xlSheet.Cells(i + 4, 8) = 利潤表_dgv.Rows(i).Cells("楦型").Value
108 84
             xlSheet.Cells(i + 4, 9) = 利潤表_dgv.Rows(i).Cells("數量").Value
109 85
             xlSheet.Cells(i + 4, 10) = 利潤表_dgv.Rows(i).Cells("客戶交期").Value
110
-            xlSheet.Cells(i + 4, 11) = "=U" & i + 4 & "+V" & i + 4 & "+W" & i + 4 & "+X" & i + 4 & "+Y" & i + 4 & "+Z" & i + 4 & "+AA" & i + 4 & "+AB" & i + 4 & "/AE" & i + 4 & "-AC" & i + 4
111
-            xlSheet.Cells(i + 4, 12) = "=I" & i + 4 & "*K" & i + 4 & ""
112
-            xlSheet.Cells(i + 4, 13) = 利潤表_dgv.Rows(i).Cells("備註").Value
86
+
87
+            xlSheet.Cells(i + 4, 12) = 利潤表_dgv.Rows(i).Cells("備註").Value
88
+            xlSheet.Cells(i + 4, 13) = 利潤表_dgv.Rows(i).Cells("ProductID").Value
113 89
             xlSheet.Cells(i + 4, 14) = 利潤表_dgv.Rows(i).Cells("工廠").Value
114 90
             xlSheet.Cells(i + 4, 15) = 利潤表_dgv.Rows(i).Cells("訂單種類").Value
115
-            If BL1 = True Then
116
-                xlSheet.Cells(i + 4, 16) = 利潤表_dgv.Rows(i).Cells("FTY_2").Value
117
-                xlSheet.Cells(i + 4, 17) = "=L" & i + 4 & "-(I" & i + 4 & "*P" & i + 4 & ")"
118
-                xlSheet.Cells(i + 4, 18) = "=(L" & i + 4 & "-(I" & i + 4 & "*P" & i + 4 & "))/2"
119
-                xlSheet.Cells(i + 4, 19) = "=(L" & i + 4 & "-(I" & i + 4 & "*P" & i + 4 & "))/2"
120
-            Else
121
-                xlSheet.Cells(i + 4, 16) = 利潤表_dgv.Rows(i).Cells("FTY_1").Value
122
-                xlSheet.Cells(i + 4, 17) = "=L" & i + 4 & "-(I" & i + 4 & "*P" & i + 4 & ")"
123
-                xlSheet.Cells(i + 4, 18) = "0"
124
-                xlSheet.Cells(i + 4, 19) = "0"
125
-            End If
126
-            xlSheet.Cells(i + 4, 20) = "=IF(L" & i + 4 & "=0,0,(L" & i + 4 & "-I" & i + 4 & "*P" & i + 4 & ")/L" & i + 4 & ")"
127
-            xlSheet.Cells(i + 4, 21) = 利潤表_dgv.Rows(i).Cells("BasicPrice").Value
128
-            xlSheet.Cells(i + 4, 22) = 利潤表_dgv.Rows(i).Cells("Polybag").Value
129
-            xlSheet.Cells(i + 4, 23) = 利潤表_dgv.Rows(i).Cells("FOOTorPET").Value
130
-            xlSheet.Cells(i + 4, 24) = 利潤表_dgv.Rows(i).Cells("Tooling").Value
131
-            xlSheet.Cells(i + 4, 25) = 利潤表_dgv.Rows(i).Cells("RubberBand").Value
132
-            xlSheet.Cells(i + 4, 26) = 利潤表_dgv.Rows(i).Cells("JHOOK").Value
133
-            xlSheet.Cells(i + 4, 27) = 利潤表_dgv.Rows(i).Cells("WaterResistant").Value
134
-            xlSheet.Cells(i + 4, 28) = 利潤表_dgv.Rows(i).Cells("P16VAT").Value
135
-            xlSheet.Cells(i + 4, 29) = 利潤表_dgv.Rows(i).Cells("EXWsaving").Value
136
-            xlSheet.Cells(i + 4, 30) = "=X" & i + 4 & "*I" & i + 4 & ""
137
-            xlSheet.Cells(i + 4, 31) = 利潤表_dgv.Rows(i).Cells("Exchange").Value
138
-            xlSheet.Cells(i + 4, 32) = 利潤表_dgv.Rows(i).Cells("ItemNumber").Value
139
-            xlSheet.Cells(i + 4, 33) = 利潤表_dgv.Rows(i).Cells("審核").Value
140
-            xlSheet.Cells(i + 4, 34) = 利潤表_dgv.Rows(i).Cells("客戶訂單號").Value
141
-            xlSheet.Cells(i + 4, 35) = 利潤表_dgv.Rows(i).Cells("SalesOrder").Value
142
-            xlSheet.Cells(i + 4, 36) = 利潤表_dgv.Rows(i).Cells("CustomerName").Value
143
-            xlSheet.Cells(i + 4, 37) = 利潤表_dgv.Rows(i).Cells("最終運送").Value
144
-            With xlApp.Selection
145
-                .Font.Bold = True
146
-            End With
147
-        Next i
148
-        BB(xlApp, xlSheet)
149
-        xlSheet.PageSetup.PrintArea = ""
150
-        xlApp.Cells.Select()
151
-        xlSheet.Range("B1").Select()
152
-        xlApp.Application.WindowState = xlMinimized
153
-        MsgBox("列印完成")
154
-        列印用SQL = "" : Me.Close()
91
+
92
+            xlSheet.Cells(i + 4, 28) = 利潤表_dgv.Rows(i).Cells("BasicPrice").Value
93
+            xlSheet.Cells(i + 4, 29) = 利潤表_dgv.Rows(i).Cells("Polybag").Value
94
+            xlSheet.Cells(i + 4, 30) = 利潤表_dgv.Rows(i).Cells("FOOTorPET").Value
95
+            xlSheet.Cells(i + 4, 31) = 利潤表_dgv.Rows(i).Cells("Tooling").Value
96
+            xlSheet.Cells(i + 4, 32) = 利潤表_dgv.Rows(i).Cells("RubberBand").Value
97
+            xlSheet.Cells(i + 4, 33) = 利潤表_dgv.Rows(i).Cells("JHOOK").Value
98
+            xlSheet.Cells(i + 4, 34) = 利潤表_dgv.Rows(i).Cells("WaterResistant").Value
99
+            xlSheet.Cells(i + 4, 35) = 利潤表_dgv.Rows(i).Cells("P16VAT").Value
100
+            xlSheet.Cells(i + 4, 36) = 利潤表_dgv.Rows(i).Cells("EXWsaving").Value
101
+
102
+            xlSheet.Cells(i + 4, 38) = 利潤表_dgv.Rows(i).Cells("Exchange").Value
103
+            xlSheet.Cells(i + 4, 39) = 利潤表_dgv.Rows(i).Cells("ItemNumber").Value
104
+            xlSheet.Cells(i + 4, 40) = 利潤表_dgv.Rows(i).Cells("審核").Value
105
+            xlSheet.Cells(i + 4, 41) = 利潤表_dgv.Rows(i).Cells("客戶訂單號").Value
106
+            xlSheet.Cells(i + 4, 42) = 利潤表_dgv.Rows(i).Cells("SalesOrder").Value
107
+            xlSheet.Cells(i + 4, 43) = 利潤表_dgv.Rows(i).Cells("CustomerName").Value
108
+            xlSheet.Cells(i + 4, 44) = 利潤表_dgv.Rows(i).Cells("最終運送").Value
109
+
110
+            xlSheet.Cells(i + 4, 16) = 利潤表_dgv.Rows(i).Cells("FTY_1").Value
111
+            xlSheet.Cells(i + 4, 19) = 利潤表_dgv.Rows(i).Cells("FTY_2").Value
112
+            xlSheet.Cells(i + 4, 25) = 利潤表_dgv.Rows(i).Cells("FTY_3").Value
113
+
114
+            xlSheet.Cells(i + 4, 11) = "=I" & i + 4 & "*T" & i + 4
115
+            xlSheet.Cells(i + 4, 37) = "=AE" & i + 4 & "*I" & i + 4
116
+            xlSheet.Cells(i + 4, 17) = ""  '"=(I" & i + 4 & "*S" & i + 4 & ")-(I" & i + 4 & "*P" & i + 4 & ")"
117
+            xlSheet.Cells(i + 4, 18) = "=IF(AB" & i + 4 & "=0,0,(AB" & i + 4 & "*I" & i + 4 & "-I" & i + 4 & "*P" & i + 4 & ")/(AB" & i + 4 & "*I" & i + 4 & "))"
118
+            xlSheet.Cells(i + 4, 20) = "=AB" & i + 4 & "+AC" & i + 4 & "+AD" & i + 4 & "+AE" & i + 4 & "+AF" & i + 4 & "+AG" & i + 4 & "+AH" & i + 4 & "+AI" & i + 4 & "/AL" & i + 4 & "-AJ" & i + 4
119
+            xlSheet.Cells(i + 4, 21) = "=K" & i + 4 & "-(I" & i + 4 & "*S" & i + 4 & ")"
120
+            xlSheet.Cells(i + 4, 22) = "=U" & i + 4 & "/2"
121
+            xlSheet.Cells(i + 4, 23) = "=U" & i + 4 & "/2"
122
+            xlSheet.Cells(i + 4, 24) = "=IF(K" & i + 4 & "=0,0,(K" & i + 4 & "-I" & i + 4 & "*S" & i + 4 & ")/K" & i + 4 & ")"
123
+            xlSheet.Cells(i + 4, 26) = "=(I" & i + 4 & "*Y" & i + 4 & ")-K" & i + 4 & ""
124
+            xlSheet.Cells(i + 4, 27) = "=IF(Y" & i + 4 & "=0,0,(Y" & i + 4 & "*I" & i + 4 & "-K" & i + 4 & ")/(Y" & i + 4 & "*I" & i + 4 & "))"
125
+            With xlApp.Selection : .Font.Bold = True : End With
126
+        Next i : BB(xlApp, xlSheet)
127
+        xlSheet.PageSetup.PrintArea = "" : xlApp.Cells.Select() : xlSheet.Range("B1").Select()
128
+        xlApp.Application.WindowState = xlMinimized : MsgBox("列印完成") : Me.Close()
155 129
     End Sub
156 130
     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles 取消列印_bt.Click
157 131
         列印用SQL = "" : 財務列印(0) = False : 財務列印(1) = False : Me.Close()
@@ -161,130 +135,124 @@ Public Class 列印_訂單價格利潤表
161 135
     End Function
162 136
     Private Sub AA(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
163 137
         xlSheet.Columns("C:C").Select : myExcel.Selection.NumberFormatLocal = "@"
138
+        xlSheet.Columns("AO:AO").Select : myExcel.Selection.NumberFormatLocal = "@"
164 139
     End Sub
165 140
     Private Sub BB(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
166 141
         Dim 位置1 As String
167
-        xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 11 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 8
168
-        xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 13 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 9
169
-        xlSheet.Columns("E:F").Select : myExcel.Selection.ColumnWidth = 8 : xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 13
170
-
171
-        xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 5
172
-        xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("J:J").Select : myExcel.Selection.ColumnWidth = 9
173
-        xlSheet.Columns("K:K").Select : myExcel.Selection.ColumnWidth = 5.5 : xlSheet.Columns("L:L").Select : myExcel.Selection.ColumnWidth = 11
174
-        xlSheet.Columns("M:M").Select : myExcel.Selection.ColumnWidth = 6.5 : xlSheet.Columns("N:N").Select : myExcel.Selection.ColumnWidth = 10
175
-        xlSheet.Columns("O:O").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("P:P").Select : myExcel.Selection.ColumnWidth = 11
176
-        xlSheet.Columns("Q:Q").Select : myExcel.Selection.ColumnWidth = 14 : xlSheet.Columns("R:E").Select : myExcel.Selection.ColumnWidth = 11
177
-        xlSheet.Columns("S:S").Select : myExcel.Selection.ColumnWidth = 11 : xlSheet.Columns("T:T").Select : myExcel.Selection.ColumnWidth = 6.5
178
-        xlSheet.Columns("U:U").Select : myExcel.Selection.ColumnWidth = 7 : xlSheet.Columns("V:V").Select : myExcel.Selection.ColumnWidth = 7
179
-        xlSheet.Columns("W:W").Select : myExcel.Selection.ColumnWidth = 7 : xlSheet.Columns("X:X").Select : myExcel.Selection.ColumnWidth = 6
180
-        xlSheet.Columns("Y:Y").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("Z:Z").Select : myExcel.Selection.ColumnWidth = 6.5
181
-        xlSheet.Columns("AA:AA").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("AB:AB").Select : myExcel.Selection.ColumnWidth = 5
182
-        xlSheet.Columns("AC:AC").Select : myExcel.Selection.ColumnWidth = 9 : xlSheet.Columns("AD:AD").Select : myExcel.Selection.ColumnWidth = 8
183
-        xlSheet.Columns("AE:AE").Select : myExcel.Selection.ColumnWidth = 11 : xlSheet.Columns("AF:AF").Select : myExcel.Selection.ColumnWidth = 11
184
-        xlSheet.Columns("AG:AG").Select : myExcel.Selection.ColumnWidth = 13 : xlSheet.Columns("AH:AH").Select : myExcel.Selection.ColumnWidth = 13
185
-        xlSheet.Columns("AI:AI").Select : myExcel.Selection.ColumnWidth = 14 : xlSheet.Columns("AJ:AJ").Select : myExcel.Selection.ColumnWidth = 8
186
-        xlSheet.Columns("AK:AK").Select : myExcel.Selection.ColumnWidth = 75
187
-
188
-
189 142
         xlSheet.Cells.Select()
190
-        With myExcel.Selection.Font
191
-            .Name = "微軟正黑體" : .Size = 9 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
192
-            .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone
193
-        End With
143
+        With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 9 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
144
+            .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
194 145
 
195
-        xlSheet.Rows("1:1").Select
196
-        With myExcel.Selection
197
-            .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
198
-            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
199
-        End With
146
+        xlSheet.Rows("3:3").Select : myExcel.Selection.AutoFilter
147
+        xlSheet.Range("G4").Select() : myExcel.ActiveWindow.FreezePanes = True
200 148
 
201 149
         xlSheet.Rows("3:3").Select
202
-        With myExcel.Selection
203
-            .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
204
-            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
205
-        End With
206
-        With myExcel.Selection
207
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
208
-            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
209
-        End With
210
-
150
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
151
+            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
211 152
         xlSheet.Rows("1:1").Select
212
-        With myExcel.Selection
213
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
214
-            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
215
-        End With
216
-        xlSheet.Columns("A:A").Select
217
-        xlSheet.Columns("I:I").Select : myExcel.Selection.NumberFormatLocal = "#,##0_ ;[紅色]-#,##0 "
218
-        xlSheet.Columns("J:J").Select : myExcel.Selection.NumberFormatLocal = "yyyy/mm/dd"
219
-        xlSheet.Columns("K:L").Select : myExcel.Selection.NumberFormatLocal = "#,##0.00_ ;[紅色]-#,##0.00 "
220
-        xlSheet.Columns("P:S").Select : myExcel.Selection.NumberFormatLocal = "#,##0.00_ ;[紅色]-#,##0.00 "
221
-        xlSheet.Range("H2:I2").Select() : myExcel.Selection.NumberFormatLocal = "#,##0_ ;[紅色]-#,##0 "
222
-        xlSheet.Columns("T:T").Select : myExcel.Selection.NumberFormatLocal = "0.00%"
223
-        myExcel.ActiveWindow.ScrollColumn = 2 : myExcel.ActiveWindow.ScrollColumn = 3 : myExcel.ActiveWindow.ScrollColumn = 4
224
-        xlSheet.Columns("U:AD").Select : myExcel.Selection.NumberFormatLocal = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
225
-        myExcel.ActiveWindow.ScrollColumn = 3 : myExcel.ActiveWindow.ScrollColumn = 2 : myExcel.ActiveWindow.ScrollColumn = 1
226
-        xlSheet.Rows("4:4").Select : myExcel.ActiveWindow.FreezePanes = True
227
-        xlSheet.Range("I6").Select()
153
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
154
+            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
155
+        xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 9 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 8
156
+        xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 13 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 9
157
+        xlSheet.Columns("E:F").Select : myExcel.Selection.ColumnWidth = 8 : xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 10
158
+        xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 6
159
+        xlSheet.Columns("J:J").Select : myExcel.Selection.ColumnWidth = 9 : xlSheet.Columns("K:K").Select : myExcel.Selection.ColumnWidth = 5.5
160
+        xlSheet.Columns("L:L").Select : myExcel.Selection.ColumnWidth = 11 : xlSheet.Columns("M:M").Select : myExcel.Selection.ColumnWidth = 6.5
161
+        xlSheet.Columns("N:N").Select : myExcel.Selection.ColumnWidth = 8 : xlSheet.Columns("O:O").Select : myExcel.Selection.ColumnWidth = 8
162
+        xlSheet.Columns("P:P").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("T:T").Select : myExcel.Selection.ColumnWidth = 6
163
+        xlSheet.Columns("AN:AN").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("AM:AM").Select : myExcel.Selection.ColumnWidth = 10
164
+        xlSheet.Columns("AO:AO").Select : myExcel.Selection.ColumnWidth = 13 : xlSheet.Columns("AP:AP").Select : myExcel.Selection.ColumnWidth = 14
165
+        xlSheet.Columns("AQ:AQ").Select : myExcel.Selection.ColumnWidth = 8 : xlSheet.Columns("AR:AR").Select : myExcel.Selection.ColumnWidth = 75
166
+        xlSheet.Columns("D:D").Select : xlSheet.Columns("D:D").EntireColumn.AutoFit : xlSheet.Columns("E:E").Select : xlSheet.Columns("E:E").EntireColumn.AutoFit
167
+        xlSheet.Columns("F:F").Select : xlSheet.Columns("F:F").EntireColumn.AutoFit : xlSheet.Columns("K:K").Select : xlSheet.Columns("K:K").EntireColumn.AutoFit
168
+        xlSheet.Columns("L:L").Select : xlSheet.Columns("L:L").EntireColumn.AutoFit : xlSheet.Columns("M:M").Select : xlSheet.Columns("M:M").EntireColumn.AutoFit
169
+        myExcel.Selection.NumberFormatLocal = "@"
170
+        xlSheet.Columns("I:I").Select : myExcel.Selection.NumberFormatLocal = "#,##0_ "
171
+
172
+        xlSheet.Columns("N:N").Select
173
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
174
+            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
228 175
 
229
-        xlSheet.Range("A1:F2").Select() : With myExcel.Selection
230
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
176
+        xlSheet.Columns("R:R").Select : myExcel.Selection.Style = "Percent" : myExcel.Selection.NumberFormatLocal = "0.00%" : myExcel.Selection.ColumnWidth = 6
177
+        xlSheet.Columns("X:X").Select : myExcel.Selection.Style = "Percent" : myExcel.Selection.NumberFormatLocal = "0.00%" : myExcel.Selection.ColumnWidth = 6
178
+        xlSheet.Columns("AA:AA").Select : myExcel.Selection.Style = "Percent" : myExcel.Selection.NumberFormatLocal = "0.00%" : myExcel.Selection.ColumnWidth = 6
179
+        xlSheet.Columns("AB:AK").Select : myExcel.Selection.Style = "Comma" : xlSheet.Columns("Y:Z").Select : myExcel.Selection.Style = "Comma"
180
+        xlSheet.Columns("S:W").Select : myExcel.Selection.Style = "Comma" : xlSheet.Columns("P:Q").Select : myExcel.Selection.Style = "Comma"
181
+        xlSheet.Columns("K:K").Select : myExcel.Selection.Style = "Comma"
182
+
183
+        xlSheet.Columns("AO:AO").Select : myExcel.Selection.Cut
184
+        xlSheet.Columns("D:D").Select : myExcel.Selection.Insert(Shift:=xlRight)
185
+        xlSheet.Columns("R:R").Select : myExcel.Selection.EntireColumn.Hidden = True
186
+        xlSheet.Range("A1:H2").Select()
187
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
231 188
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
232
-        xlSheet.Range("H1:I1").Select() : With myExcel.Selection
233
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
189
+        xlSheet.Range("I1:J1").Select()
190
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
234 191
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
235
-        xlSheet.Range("H2:I2").Select() : With myExcel.Selection
236
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
192
+        xlSheet.Range("I2:J2").Select()
193
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
237 194
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
238
-        xlSheet.Range("J1:K2").Select() : With myExcel.Selection
239
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
195
+        xlSheet.Range("K1:L1").Select()
196
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
240 197
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
241
-        xlSheet.Range("M1:O2").Select() : With myExcel.Selection
242
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
198
+        xlSheet.Range("K2:L2").Select()
199
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
243 200
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
244
-        xlSheet.Range("P1:Q1").Select() : With myExcel.Selection
245
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
201
+        xlSheet.Range("M1:U2").Select()
202
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
246 203
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
247
-        xlSheet.Range("P2:Q2").Select() : With myExcel.Selection
248
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
204
+        xlSheet.Range("V1:W1").Select()
205
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
249 206
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
250
-        xlSheet.Range("S1:T1").Select() : With myExcel.Selection
251
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
207
+        xlSheet.Range("V2:W2").Select()
208
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
252 209
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
253
-        xlSheet.Range("S2:T2").Select() : With myExcel.Selection
254
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
210
+        xlSheet.Range("X1:Y1").Select()
211
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
255 212
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
256
-        xlSheet.Range("U1:AB2").Select() : With myExcel.Selection
257
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
213
+        xlSheet.Range("X2:Y2").Select()
214
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
258 215
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
259
-        xlSheet.Range("AC1:AD1").Select() : With myExcel.Selection
260
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
216
+        xlSheet.Range("AA1:AB1").Select()
217
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
261 218
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
262
-        xlSheet.Range("AC2:AD2").Select() : With myExcel.Selection
263
-            .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
219
+        xlSheet.Range("AA2:AB2").Select()
220
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
221
+            .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
222
+        xlSheet.Range("Z1:Z2").Select()
223
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
224
+            .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
225
+        xlSheet.Range("AC1:AK2").Select()
226
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
227
+            .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
228
+        xlSheet.Range("AM1:AR2").Select()
229
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
264 230
             .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
265 231
 
266
-        xlSheet.Range("A1:O3").Select() : With myExcel.Selection.Interior
267
-            .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorDark2 : .TintAndShade = -0.0999786370433668 : .PatternTintAndShade = 0 : End With
268
-        xlSheet.Range("O1:T3").Select() : With myExcel.Selection.Interior
269
-            .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .Color = 65535 : .TintAndShade = 0 : .PatternTintAndShade = 0 : End With
270
-        xlSheet.Range("U1:AD3").Select() : With myExcel.Selection.Interior
271
-            .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0.399975585192419 : .PatternTintAndShade = 0 : End With
272
-
273
-        xlSheet.Range("A1:AK3").Select() : myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
232
+        xlSheet.Range("A3:P3").Select()
233
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorDark2
234
+            .TintAndShade = -0.0999786370433668 : .PatternTintAndShade = 0 : End With
235
+        xlSheet.Range("Q3:S3").Select()
236
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .Color = 65535 : .TintAndShade = 0
237
+            .PatternTintAndShade = 0 : End With
238
+        xlSheet.Range("T3:Y3").Select()
239
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .Color = 5296274 : .TintAndShade = 0
240
+            .PatternTintAndShade = 0 : End With
241
+        xlSheet.Range("Z3:AB3").Select()
242
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent1
243
+            .TintAndShade = 0.399975585192419 : .PatternTintAndShade = 0 : End With
244
+        xlSheet.Range("AC3:AL3").Select()
245
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent5
246
+            .TintAndShade = 0.799981688894314 : .PatternTintAndShade = 0 : End With
247
+        xlSheet.Range("A1:AR3").Select() : myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
274 248
         With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
275 249
         With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
276 250
         With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
277 251
         With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
278 252
         With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
279 253
         With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
280
-
281
-        xlSheet.Rows("3:3").Select : myExcel.Selection.AutoFilter
282
-
283 254
         Dim M As Integer = 4
284
-        For M = 4 To 利潤表_dgv.Rows.Count + 2
285
-            M += 1
286
-        Next M
287
-        位置1 = "A4:AK" & M
255
+        For M = 4 To 利潤表_dgv.Rows.Count + 2 : M += 1 : Next M : 位置1 = "A4:AR" & M
288 256
         xlSheet.Range(位置1).Select() : myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
289 257
         With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
290 258
         With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
@@ -292,22 +260,6 @@ Public Class 列印_訂單價格利潤表
292 260
         With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
293 261
         With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
294 262
         With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
295
-
296
-        xlSheet.Range("AF1:AQ2").Select()
297
-        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
298
-            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
299
-        End With : myExcel.Selection.Merge
300
-
301
-        xlSheet.Range("AK4:AK" & M).Select()
302
-        With myExcel.Selection : .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
303
-            .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
304
-
305
-        myExcel.ActiveWindow.DisplayGridlines = False
306
-    End Sub
307
-    Private Sub CB_1_CheckedChanged(sender As Object, e As EventArgs) Handles CB_1.Click
308
-        CB_1.Checked = True : CB_2.Checked = False
309
-    End Sub
310
-    Private Sub CB_2_CheckedChanged(sender As Object, e As EventArgs) Handles CB_2.Click
311
-        CB_1.Checked = False : CB_2.Checked = True
263
+        xlSheet.Range("A3").Select() : myExcel.ActiveWindow.DisplayGridlines = False
312 264
     End Sub
313 265
 End Class

+ 45
- 73
TENDEN-MES-SYS/2、成本系統管理/訂單價格利潤明細表.Designer.vb View File

@@ -23,12 +23,12 @@ Partial Class 訂單價格利潤明細表
23 23
     <System.Diagnostics.DebuggerStepThrough()>
24 24
     Private  Sub InitializeComponent()
25 25
         Me.components = New System.ComponentModel.Container()
26
-        Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
-        Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28
-        Dim DataGridViewCellStyle9 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29
-        Dim DataGridViewCellStyle10 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
30
-        Dim DataGridViewCellStyle11 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
31
-        Dim DataGridViewCellStyle12 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
+        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
+        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28
+        Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29
+        Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
30
+        Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
31
+        Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
32 32
         Me.利潤表_dgv = New System.Windows.Forms.DataGridView()
33 33
         Me.利潤拆分_bt = New System.Windows.Forms.Button()
34 34
         Me.成本組成_bt = New System.Windows.Forms.Button()
@@ -100,12 +100,10 @@ Partial Class 訂單價格利潤明細表
100 100
         Me.列印_bt = New System.Windows.Forms.Button()
101 101
         Me.錨點1 = New System.Windows.Forms.TextBox()
102 102
         Me.空間2 = New System.Windows.Forms.Panel()
103
-        Me.FTY1_ch = New System.Windows.Forms.CheckBox()
104
-        Me.FTY2_ch = New System.Windows.Forms.CheckBox()
103
+        Me.PID_cb = New System.Windows.Forms.CheckBox()
105 104
         Me.Panel1 = New System.Windows.Forms.Panel()
106 105
         Me.利潤表1_dgv = New System.Windows.Forms.DataGridView()
107 106
         Me.空間1 = New System.Windows.Forms.Panel()
108
-        Me.PID_cb = New System.Windows.Forms.CheckBox()
109 107
         CType(Me.利潤表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
110 108
         CType(Me.訂單流水號_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
111 109
         Me.GroupBox1.SuspendLayout()
@@ -124,19 +122,19 @@ Partial Class 訂單價格利潤明細表
124 122
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
125 123
         Me.利潤表_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
126 124
         Me.利潤表_dgv.BackgroundColor = System.Drawing.Color.White
127
-        DataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control
128
-        DataGridViewCellStyle7.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
129
-        DataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText
130
-        DataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight
131
-        DataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText
132
-        DataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
133
-        Me.利潤表_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle7
125
+        DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control
126
+        DataGridViewCellStyle1.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
127
+        DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText
128
+        DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight
129
+        DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText
130
+        DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
131
+        Me.利潤表_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1
134 132
         Me.利潤表_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
135 133
         Me.利潤表_dgv.Location = New System.Drawing.Point(3, 130)
136 134
         Me.利潤表_dgv.Name = "利潤表_dgv"
137 135
         Me.利潤表_dgv.RowHeadersWidth = 5
138
-        DataGridViewCellStyle8.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
139
-        Me.利潤表_dgv.RowsDefaultCellStyle = DataGridViewCellStyle8
136
+        DataGridViewCellStyle2.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
137
+        Me.利潤表_dgv.RowsDefaultCellStyle = DataGridViewCellStyle2
140 138
         Me.利潤表_dgv.RowTemplate.Height = 24
141 139
         Me.利潤表_dgv.Size = New System.Drawing.Size(1792, 831)
142 140
         Me.利潤表_dgv.TabIndex = 2
@@ -163,19 +161,19 @@ Partial Class 訂單價格利潤明細表
163 161
         '
164 162
         '訂單流水號_dgv
165 163
         '
166
-        DataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
167
-        Me.訂單流水號_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle9
164
+        DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
165
+        Me.訂單流水號_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
168 166
         Me.訂單流水號_dgv.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
169 167
             Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
170 168
         Me.訂單流水號_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
171 169
         Me.訂單流水號_dgv.BackgroundColor = System.Drawing.Color.White
172
-        DataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control
173
-        DataGridViewCellStyle10.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
174
-        DataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText
175
-        DataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight
176
-        DataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText
177
-        DataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
178
-        Me.訂單流水號_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle10
170
+        DataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control
171
+        DataGridViewCellStyle4.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
172
+        DataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText
173
+        DataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight
174
+        DataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText
175
+        DataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
176
+        Me.訂單流水號_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle4
179 177
         Me.訂單流水號_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
180 178
         Me.訂單流水號_dgv.Location = New System.Drawing.Point(2, 1)
181 179
         Me.訂單流水號_dgv.Name = "訂單流水號_dgv"
@@ -625,10 +623,10 @@ Partial Class 訂單價格利潤明細表
625 623
         '
626 624
         'ProgressBar1
627 625
         '
628
-        Me.ProgressBar1.Location = New System.Drawing.Point(714, 105)
626
+        Me.ProgressBar1.Location = New System.Drawing.Point(827, 105)
629 627
         Me.ProgressBar1.Maximum = 10000
630 628
         Me.ProgressBar1.Name = "ProgressBar1"
631
-        Me.ProgressBar1.Size = New System.Drawing.Size(365, 20)
629
+        Me.ProgressBar1.Size = New System.Drawing.Size(238, 20)
632 630
         Me.ProgressBar1.TabIndex = 489
633 631
         '
634 632
         'GroupBox1
@@ -725,7 +723,7 @@ Partial Class 訂單價格利潤明細表
725 723
         'Label19
726 724
         '
727 725
         Me.Label19.AutoSize = True
728
-        Me.Label19.Location = New System.Drawing.Point(653, 107)
726
+        Me.Label19.Location = New System.Drawing.Point(766, 107)
729 727
         Me.Label19.Name = "Label19"
730 728
         Me.Label19.Size = New System.Drawing.Size(55, 16)
731 729
         Me.Label19.TabIndex = 563
@@ -835,8 +833,6 @@ Partial Class 訂單價格利潤明細表
835 833
         Me.空間2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
836 834
         Me.空間2.Controls.Add(Me.PID_cb)
837 835
         Me.空間2.Controls.Add(Me.Label19)
838
-        Me.空間2.Controls.Add(Me.FTY1_ch)
839
-        Me.空間2.Controls.Add(Me.FTY2_ch)
840 836
         Me.空間2.Controls.Add(Me.Panel1)
841 837
         Me.空間2.Controls.Add(Me.Label9)
842 838
         Me.空間2.Controls.Add(Me.ProgressBar1)
@@ -863,27 +859,15 @@ Partial Class 訂單價格利潤明細表
863 859
         Me.空間2.Size = New System.Drawing.Size(1800, 964)
864 860
         Me.空間2.TabIndex = 494
865 861
         '
866
-        'FTY1_ch
867
-        '
868
-        Me.FTY1_ch.AutoSize = True
869
-        Me.FTY1_ch.Location = New System.Drawing.Point(420, 105)
870
-        Me.FTY1_ch.Name = "FTY1_ch"
871
-        Me.FTY1_ch.Size = New System.Drawing.Size(58, 20)
872
-        Me.FTY1_ch.TabIndex = 498
873
-        Me.FTY1_ch.Text = "FTY_1"
874
-        Me.FTY1_ch.UseVisualStyleBackColor = True
875
-        '
876
-        'FTY2_ch
862
+        'PID_cb
877 863
         '
878
-        Me.FTY2_ch.AutoSize = True
879
-        Me.FTY2_ch.Checked = True
880
-        Me.FTY2_ch.CheckState = System.Windows.Forms.CheckState.Checked
881
-        Me.FTY2_ch.Location = New System.Drawing.Point(488, 105)
882
-        Me.FTY2_ch.Name = "FTY2_ch"
883
-        Me.FTY2_ch.Size = New System.Drawing.Size(58, 20)
884
-        Me.FTY2_ch.TabIndex = 497
885
-        Me.FTY2_ch.Text = "FTY_2"
886
-        Me.FTY2_ch.UseVisualStyleBackColor = True
864
+        Me.PID_cb.AutoSize = True
865
+        Me.PID_cb.Location = New System.Drawing.Point(672, 105)
866
+        Me.PID_cb.Name = "PID_cb"
867
+        Me.PID_cb.Size = New System.Drawing.Size(82, 20)
868
+        Me.PID_cb.TabIndex = 565
869
+        Me.PID_cb.Text = "ProductID"
870
+        Me.PID_cb.UseVisualStyleBackColor = True
887 871
         '
888 872
         'Panel1
889 873
         '
@@ -907,19 +891,19 @@ Partial Class 訂單價格利潤明細表
907 891
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
908 892
         Me.利潤表1_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
909 893
         Me.利潤表1_dgv.BackgroundColor = System.Drawing.Color.White
910
-        DataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control
911
-        DataGridViewCellStyle11.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
912
-        DataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText
913
-        DataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight
914
-        DataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText
915
-        DataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
916
-        Me.利潤表1_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle11
894
+        DataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control
895
+        DataGridViewCellStyle5.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
896
+        DataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText
897
+        DataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight
898
+        DataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText
899
+        DataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
900
+        Me.利潤表1_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle5
917 901
         Me.利潤表1_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
918 902
         Me.利潤表1_dgv.Location = New System.Drawing.Point(3, 130)
919 903
         Me.利潤表1_dgv.Name = "利潤表1_dgv"
920 904
         Me.利潤表1_dgv.RowHeadersWidth = 5
921
-        DataGridViewCellStyle12.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
922
-        Me.利潤表1_dgv.RowsDefaultCellStyle = DataGridViewCellStyle12
905
+        DataGridViewCellStyle6.Font = New System.Drawing.Font("微軟正黑體", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
906
+        Me.利潤表1_dgv.RowsDefaultCellStyle = DataGridViewCellStyle6
923 907
         Me.利潤表1_dgv.RowTemplate.Height = 24
924 908
         Me.利潤表1_dgv.Size = New System.Drawing.Size(1792, 831)
925 909
         Me.利潤表1_dgv.TabIndex = 564
@@ -936,16 +920,6 @@ Partial Class 訂單價格利潤明細表
936 920
         Me.空間1.Size = New System.Drawing.Size(108, 964)
937 921
         Me.空間1.TabIndex = 493
938 922
         '
939
-        'PID_cb
940
-        '
941
-        Me.PID_cb.AutoSize = True
942
-        Me.PID_cb.Location = New System.Drawing.Point(559, 105)
943
-        Me.PID_cb.Name = "PID_cb"
944
-        Me.PID_cb.Size = New System.Drawing.Size(82, 20)
945
-        Me.PID_cb.TabIndex = 565
946
-        Me.PID_cb.Text = "ProductID"
947
-        Me.PID_cb.UseVisualStyleBackColor = True
948
-        '
949 923
         '訂單價格利潤明細表
950 924
         '
951 925
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
@@ -1050,8 +1024,6 @@ Partial Class 訂單價格利潤明細表
1050 1024
     Friend WithEvents 空間1 As Panel
1051 1025
     Friend WithEvents Panel1 As Panel
1052 1026
     Friend WithEvents 資料庫選擇3_bt As Button
1053
-    Friend WithEvents FTY1_ch As CheckBox
1054
-    Friend WithEvents FTY2_ch As CheckBox
1055 1027
     Friend WithEvents 利潤表1_dgv As DataGridView
1056 1028
     Friend WithEvents PID_cb As CheckBox
1057 1029
 End Class

+ 103
- 87
TENDEN-MES-SYS/2、成本系統管理/訂單價格利潤明細表.vb View File

@@ -1,27 +1,18 @@
1 1
 Option Strict Off
2 2
 Public Class 訂單價格利潤明細表
3
-    Dim ds, ds1, ds2 As New DataSet
4 3
     ReadOnly BB(3) As Boolean : Public 平均數 As Integer : Public 最終數 As Integer = 0 : Public 資料數 As Integer = 0
5 4
     Dim A1, A2, A3, B1, B2, B3 As Integer
6
-    Private Sub 利潤表載入前設定()
5
+    Private Sub Set_訂單清單()
6
+        SQL_修改訂單資料表2()
7
+        Dim ds, ds2 As New DataSet
7 8
         利潤表_dgv.DataSource = Nothing : ds.Clear()
8 9
         利潤表_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
9
-        利潤表_dgv.ColumnHeadersHeight = 25 : 利潤表_dgv.AllowUserToAddRows = False
10
+        利潤表_dgv.ColumnHeadersHeight = 40 : 利潤表_dgv.AllowUserToAddRows = False
10 11
 
11 12
         利潤表1_dgv.DataSource = Nothing : ds2.Clear()
12 13
         利潤表1_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
13 14
         利潤表1_dgv.ColumnHeadersHeight = 25 : 利潤表1_dgv.AllowUserToAddRows = False
14 15
         ConnOpen()
15
-    End Sub
16
-    Private Sub 利潤表載入後設定()
17
-        CmdSet_For_DGV() : da.Fill(ds) : 利潤表_dgv.DataSource = ds.Tables(0) : da.Fill(ds2) : 利潤表1_dgv.DataSource = ds2.Tables(0) : conn.Close()
18
-        For I As Integer = 0 To 利潤表_dgv.Rows.Count - 1
19
-            利潤表_dgv("需存檔", I).Value = False : 利潤表1_dgv("需存檔", I).Value = False
20
-        Next
21
-    End Sub
22
-    Private Sub Set_訂單清單()
23
-        SQL_修改訂單資料表2()
24
-        利潤表載入前設定()
25 16
         If 未建檔_cb.Checked = True Then
26 17
             Timer1.Enabled = True : 存檔_bt.Enabled = True : 刪除_bt.Enabled = False : 修改_bt.Enabled = False
27 18
             等於訂單數_bt.Enabled = True : 等於零_bt.Enabled = True : 匯率為1_bt.Enabled = True
@@ -30,7 +21,11 @@ Public Class 訂單價格利潤明細表
30 21
             Else
31 22
                 SQL_訂單價格利潤明細表3()
32 23
             End If
33
-            利潤表載入後設定() : Set_自動彙總1() : Set_grid() : Set_暫存資料設定()
24
+            CmdSet_For_DGV() : da.Fill(ds) : 利潤表_dgv.DataSource = ds.Tables(0) : da.Fill(ds2) : 利潤表1_dgv.DataSource = ds2.Tables(0) : conn.Close()
25
+            For I As Integer = 0 To 利潤表_dgv.Rows.Count - 1
26
+                利潤表_dgv("需存檔", I).Value = False : 利潤表1_dgv("需存檔", I).Value = False
27
+            Next
28
+            Set_自動彙總1() : Set_grid() : Set_暫存資料設定()
34 29
         ElseIf 未建檔_cb.Checked = False Then
35 30
             Timer1.Enabled = False : Label47.Visible = False : 存檔_bt.Enabled = False : 刪除_bt.Enabled = True : 修改_bt.Enabled = True
36 31
             等於訂單數_bt.Enabled = False : 等於零_bt.Enabled = False : 匯率為1_bt.Enabled = False
@@ -39,19 +34,34 @@ Public Class 訂單價格利潤明細表
39 34
             Else
40 35
                 PA25 = 年份_cb.Text : SQL_訂單價格利潤明細表5()
41 36
             End If
42
-            利潤表載入後設定()
37
+            CmdSet_For_DGV() : da.Fill(ds) : 利潤表_dgv.DataSource = ds.Tables(0) : da.Fill(ds2) : 利潤表1_dgv.DataSource = ds2.Tables(0) : conn.Close()
38
+            For I As Integer = 0 To 利潤表_dgv.Rows.Count - 1
39
+                利潤表_dgv("需存檔", I).Value = False : 利潤表1_dgv("需存檔", I).Value = False
40
+            Next
43 41
         End If
44 42
         資料筆數_tb.Text = Format(利潤表_dgv.Rows.Count, "#,##0")
45 43
     End Sub
46 44
     Private Sub Set_編輯清單()
47
-        利潤表載入前設定() : SQL_訂單價格利潤明細表1() : 利潤表載入後設定()
45
+        Dim ds, ds2 As New DataSet
46
+        利潤表_dgv.DataSource = Nothing : ds.Clear()
47
+        利潤表_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
48
+        利潤表_dgv.ColumnHeadersHeight = 40 : 利潤表_dgv.AllowUserToAddRows = False
49
+
50
+        利潤表1_dgv.DataSource = Nothing : ds2.Clear()
51
+        利潤表1_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
52
+        利潤表1_dgv.ColumnHeadersHeight = 25 : 利潤表1_dgv.AllowUserToAddRows = False
53
+        ConnOpen()
54
+        SQL_訂單價格利潤明細表1()
55
+        CmdSet_For_DGV() : da.Fill(ds) : 利潤表_dgv.DataSource = ds.Tables(0) : da.Fill(ds2) : 利潤表1_dgv.DataSource = ds2.Tables(0) : conn.Close()
56
+        For I As Integer = 0 To 利潤表_dgv.Rows.Count - 1
57
+            利潤表_dgv("需存檔", I).Value = False : 利潤表1_dgv("需存檔", I).Value = False
58
+        Next
48 59
     End Sub
49 60
     Private Sub Set_暫存資料設定()
50 61
         SQL_刪除訂單價格利潤表暫存檔() : conn.Close()
51 62
         Dim NUM2 As Integer
52 63
         SQL_查詢利潤表流水號()
53
-        If dr.Read() Then : NUM2 = Strings.Right(dr("利潤表流水號").ToString, 8) : End If
54
-        conn.Close()
64
+        If dr.Read() Then : NUM2 = Strings.Right(dr("利潤表流水號").ToString, 8) : End If : conn.Close()
55 65
         For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
56 66
             NUM2 += 1
57 67
             If NUM2 < 10 Then : 利潤表流水號 = "PR" & "0000000" & NUM2
@@ -68,6 +78,7 @@ Public Class 訂單價格利潤明細表
68 78
         Next i
69 79
     End Sub
70 80
     Private Sub Set_未建檔清單()
81
+        Dim ds1 As New DataSet
71 82
         訂單流水號_dgv.DataSource = Nothing : ds1.Clear()
72 83
         訂單流水號_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
73 84
         訂單流水號_dgv.ColumnHeadersHeight = 25
@@ -77,16 +88,16 @@ Public Class 訂單價格利潤明細表
77 88
     End Sub
78 89
     Private Sub Set_grid()
79 90
         利潤表_dgv.Columns("訂單流水號").FillWeight = 80 : 利潤表_dgv.Columns("資料流水號").Visible = False : 利潤表_dgv.Columns("年份季度").FillWeight = 55
80
-        利潤表_dgv.Columns("力威訂單號").FillWeight = 100 : 利潤表_dgv.Columns("形體號").FillWeight = 90 : 利潤表_dgv.Columns("顏色").FillWeight = 70
81
-        利潤表_dgv.Columns("力威訂單號").FillWeight = 100 : 利潤表_dgv.Columns("楦型").FillWeight = 45 : 利潤表_dgv.Columns("數量").FillWeight = 45
82
-        If PID_cb.Checked = True Then : 利潤表_dgv.Columns("ProductID").Visible = True : Else : 利潤表_dgv.Columns("ProductID").Visible = False : End If
83
-        利潤表_dgv.Columns("ProductID").FillWeight = 120
91
+        利潤表_dgv.Columns("客人訂單號").FillWeight = 100 : 利潤表_dgv.Columns("形體號").FillWeight = 90 : 利潤表_dgv.Columns("顏色").FillWeight = 70
92
+        利潤表_dgv.Columns("楦型").FillWeight = 45 : 利潤表_dgv.Columns("數量").FillWeight = 45
93
+        If PID_cb.Checked = True Then : 利潤表_dgv.Columns(表頭1).Visible = True : Else : 利潤表_dgv.Columns(表頭1).Visible = False : End If
94
+        利潤表_dgv.Columns(表頭1).FillWeight = 120
84 95
         利潤表_dgv.Columns("單價").FillWeight = 45 : 利潤表_dgv.Columns("總金額").FillWeight = 75 : 利潤表_dgv.Columns("備註").FillWeight = 80
85 96
         利潤表_dgv.Columns("工廠").FillWeight = 40 : 利潤表_dgv.Columns("訂單種類").FillWeight = 65 : 利潤表_dgv.Columns("Quantity").FillWeight = 65
86
-        利潤表_dgv.Columns("Currency").FillWeight = 65 : 利潤表_dgv.Columns("Exchange").FillWeight = 70 : 利潤表_dgv.Columns("FTY_1").FillWeight = 60
87
-        利潤表_dgv.Columns("FTY_2").FillWeight = 60 : 利潤表_dgv.Columns("CommissionTTL").FillWeight = 130 : 利潤表_dgv.Columns("CommissionDarren").FillWeight = 150
88
-        利潤表_dgv.Columns("CommissionTendenza").FillWeight = 160 : 利潤表_dgv.Columns("%_1").FillWeight = 60 : 利潤表_dgv.Columns("%_2").FillWeight = 60
89
-        利潤表_dgv.Columns("BasicPrice").FillWeight = 70 : 利潤表_dgv.Columns("PG/MOQ").FillWeight = 60
97
+        利潤表_dgv.Columns("Currency").FillWeight = 65 : 利潤表_dgv.Columns("Exchange").FillWeight = 70 : 利潤表_dgv.Columns("實際廠價").FillWeight = 60
98
+        利潤表_dgv.Columns("天盾單價").FillWeight = 60 : 利潤表_dgv.Columns("Commission TTL").FillWeight = 80 : 利潤表_dgv.Columns("Commission Darren").FillWeight = 80
99
+        利潤表_dgv.Columns("Commission Tendenza").FillWeight = 80 : 利潤表_dgv.Columns("%_1").FillWeight = 60 : 利潤表_dgv.Columns("%_2").FillWeight = 60
100
+        利潤表_dgv.Columns("BasicPrice").FillWeight = 70 : 利潤表_dgv.Columns("PG/MOQ").FillWeight = 60 : 利潤表_dgv.Columns("客戶單價").FillWeight = 60
90 101
         利潤表_dgv.Columns("FOOTorPET").FillWeight = 78 : 利潤表_dgv.Columns("Tooling").FillWeight = 58 : 利潤表_dgv.Columns("RubberBand").FillWeight = 83
91 102
         利潤表_dgv.Columns("JHOOK").FillWeight = 58 : 利潤表_dgv.Columns("WaterResistant").FillWeight = 95 : 利潤表_dgv.Columns("P16VAT").FillWeight = 60
92 103
         利潤表_dgv.Columns("EXWsaving").FillWeight = 75 : 利潤表_dgv.Columns("CollectedToolng").FillWeight = 110 : 利潤表_dgv.Columns("需存檔").FillWeight = 30
@@ -96,11 +107,12 @@ Public Class 訂單價格利潤明細表
96 107
         利潤表_dgv.Columns("總金額").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("總金額").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
97 108
         利潤表_dgv.Columns("Quantity").DefaultCellStyle.Format = "#,##0" : 利潤表_dgv.Columns("Quantity").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
98 109
         利潤表_dgv.Columns("Exchange").DefaultCellStyle.Format = "#,##0.0000" : 利潤表_dgv.Columns("Exchange").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
99
-        利潤表_dgv.Columns("FTY_1").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("FTY_1").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
100
-        利潤表_dgv.Columns("FTY_2").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("FTY_2").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
101
-        利潤表_dgv.Columns("CommissionTTL").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("CommissionTTL").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
102
-        利潤表_dgv.Columns("CommissionDarren").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("CommissionDarren").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
103
-        利潤表_dgv.Columns("CommissionTendenza").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("CommissionTendenza").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
110
+        利潤表_dgv.Columns("實際廠價").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("實際廠價").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
111
+        利潤表_dgv.Columns("天盾單價").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("天盾單價").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight  '客戶單價
112
+        利潤表_dgv.Columns("客戶單價").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("客戶單價").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
113
+        利潤表_dgv.Columns("Commission TTL").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("Commission TTL").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
114
+        利潤表_dgv.Columns("Commission Darren").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("Commission Darren").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
115
+        利潤表_dgv.Columns("Commission Tendenza").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("Commission Tendenza").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
104 116
         利潤表_dgv.Columns("%_1").DefaultCellStyle.Format = "#,##0.00%" : 利潤表_dgv.Columns("%_1").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
105 117
         利潤表_dgv.Columns("%_2").DefaultCellStyle.Format = "#,##0.00%" : 利潤表_dgv.Columns("%_2").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
106 118
         利潤表_dgv.Columns("BasicPrice").DefaultCellStyle.Format = "#,##0.00" : 利潤表_dgv.Columns("BasicPrice").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
@@ -122,20 +134,21 @@ Public Class 訂單價格利潤明細表
122 134
         利潤表_dgv.Columns("Quantity").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
123 135
         利潤表_dgv.Columns("Currency").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
124 136
         利潤表_dgv.Columns("Exchange").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
125
-        利潤表_dgv.Columns("FTY_1").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
126
-        利潤表_dgv.Columns("FTY_2").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
127
-        利潤表_dgv.Columns("CommissionTTL").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
128
-        利潤表_dgv.Columns("CommissionDarren").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
129
-        利潤表_dgv.Columns("CommissionTendenza").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
137
+        利潤表_dgv.Columns("實際廠價").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
138
+        利潤表_dgv.Columns("天盾單價").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
139
+        利潤表_dgv.Columns("客戶單價").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
140
+        利潤表_dgv.Columns("Commission TTL").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
141
+        利潤表_dgv.Columns("Commission Darren").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
142
+        利潤表_dgv.Columns("Commission Tendenza").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
130 143
         利潤表_dgv.Columns("%_1").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
131 144
         利潤表_dgv.Columns("%_2").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
132 145
         利潤表_dgv.Columns("年份").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
133 146
 
134 147
         利潤表_dgv.Columns("利潤表流水號").Visible = False
135 148
         If BB(0) = True And BB(1) = False And BB(2) = False And BB(3) = False Then
136
-            利潤表_dgv.Columns("FTY_1").Visible = True : 利潤表_dgv.Columns("FTY_2").Visible = True : 利潤表_dgv.Columns("CommissionTTL").Visible = True
137
-            利潤表_dgv.Columns("CommissionDarren").Visible = True : 利潤表_dgv.Columns("CommissionTendenza").Visible = True
138
-            利潤表_dgv.Columns("%_1").Visible = True : 利潤表_dgv.Columns("%_2").Visible = True
149
+            利潤表_dgv.Columns("實際廠價").Visible = True : 利潤表_dgv.Columns("天盾單價").Visible = True : 利潤表_dgv.Columns("Commission TTL").Visible = True
150
+            利潤表_dgv.Columns("Commission Darren").Visible = True : 利潤表_dgv.Columns("Commission Tendenza").Visible = True
151
+            利潤表_dgv.Columns("%_1").Visible = True : 利潤表_dgv.Columns("%_2").Visible = True : 利潤表_dgv.Columns("客戶單價").Visible = True
139 152
 
140 153
             利潤表_dgv.Columns("BasicPrice").Visible = False : 利潤表_dgv.Columns("PG/MOQ").Visible = False : 利潤表_dgv.Columns("FOOTorPET").Visible = False
141 154
             利潤表_dgv.Columns("Tooling").Visible = False : 利潤表_dgv.Columns("RubberBand").Visible = False : 利潤表_dgv.Columns("JHOOK").Visible = False
@@ -143,9 +156,9 @@ Public Class 訂單價格利潤明細表
143 156
             利潤表_dgv.Columns("CollectedToolng").Visible = False : 利潤表_dgv.Columns("驗證").Visible = False : 利潤表_dgv.Columns("需存檔").Visible = False
144 157
             利潤表_dgv.Columns("ItemNumber").Visible = False : 利潤表_dgv.Columns("審核").Visible = False : 利潤表_dgv.Columns("客戶訂單號").Visible = False
145 158
         ElseIf BB(0) = False And BB(1) = True And BB(2) = False And BB(3) = False Then
146
-            利潤表_dgv.Columns("FTY_1").Visible = False : 利潤表_dgv.Columns("FTY_2").Visible = False : 利潤表_dgv.Columns("CommissionTTL").Visible = False
147
-            利潤表_dgv.Columns("CommissionDarren").Visible = False : 利潤表_dgv.Columns("CommissionTendenza").Visible = False
148
-            利潤表_dgv.Columns("%_1").Visible = False : 利潤表_dgv.Columns("%_2").Visible = False
159
+            利潤表_dgv.Columns("實際廠價").Visible = False : 利潤表_dgv.Columns("天盾單價").Visible = False : 利潤表_dgv.Columns("Commission TTL").Visible = False
160
+            利潤表_dgv.Columns("Commission Darren").Visible = False : 利潤表_dgv.Columns("Commission Tendenza").Visible = False
161
+            利潤表_dgv.Columns("%_1").Visible = False : 利潤表_dgv.Columns("%_2").Visible = False : 利潤表_dgv.Columns("客戶單價").Visible = False
149 162
 
150 163
             利潤表_dgv.Columns("BasicPrice").Visible = True : 利潤表_dgv.Columns("PG/MOQ").Visible = True : 利潤表_dgv.Columns("FOOTorPET").Visible = True
151 164
             利潤表_dgv.Columns("Tooling").Visible = True : 利潤表_dgv.Columns("RubberBand").Visible = True : 利潤表_dgv.Columns("JHOOK").Visible = True
@@ -153,32 +166,32 @@ Public Class 訂單價格利潤明細表
153 166
             利潤表_dgv.Columns("CollectedToolng").Visible = True : 利潤表_dgv.Columns("驗證").Visible = False : 利潤表_dgv.Columns("需存檔").Visible = False
154 167
             利潤表_dgv.Columns("ItemNumber").Visible = False : 利潤表_dgv.Columns("審核").Visible = False : 利潤表_dgv.Columns("客戶訂單號").Visible = False
155 168
         ElseIf BB(0) = False And BB(1) = False And BB(2) = True And BB(3) = False Then
156
-            利潤表_dgv.Columns("CollectedToolng").Visible = True : 利潤表_dgv.Columns("CommissionTTL").Visible = True
157
-            利潤表_dgv.Columns("CommissionDarren").Visible = True : 利潤表_dgv.Columns("CommissionTendenza").Visible = True
169
+            利潤表_dgv.Columns("CollectedToolng").Visible = True : 利潤表_dgv.Columns("Commission TTL").Visible = True
170
+            利潤表_dgv.Columns("Commission Darren").Visible = True : 利潤表_dgv.Columns("Commission Tendenza").Visible = True
158 171
             利潤表_dgv.Columns("%_1").Visible = True : 利潤表_dgv.Columns("%_2").Visible = True
159 172
 
160 173
             利潤表_dgv.Columns("BasicPrice").Visible = False : 利潤表_dgv.Columns("PG/MOQ").Visible = False : 利潤表_dgv.Columns("FOOTorPET").Visible = False
161 174
             利潤表_dgv.Columns("Tooling").Visible = False : 利潤表_dgv.Columns("RubberBand").Visible = False : 利潤表_dgv.Columns("JHOOK").Visible = False
162 175
             利潤表_dgv.Columns("WaterResistant").Visible = False : 利潤表_dgv.Columns("P16VAT").Visible = False : 利潤表_dgv.Columns("EXWsaving").Visible = False
163
-            利潤表_dgv.Columns("FTY_1").Visible = False : 利潤表_dgv.Columns("FTY_2").Visible = False : 利潤表_dgv.Columns("驗證").Visible = False
176
+            利潤表_dgv.Columns("實際廠價").Visible = False : 利潤表_dgv.Columns("天盾單價").Visible = False : 利潤表_dgv.Columns("驗證").Visible = False
164 177
             利潤表_dgv.Columns("ItemNumber").Visible = False : 利潤表_dgv.Columns("審核").Visible = False : 利潤表_dgv.Columns("客戶訂單號").Visible = False
165
-            利潤表_dgv.Columns("需存檔").Visible = False
178
+            利潤表_dgv.Columns("需存檔").Visible = False : 利潤表_dgv.Columns("客戶單價").Visible = False
166 179
         ElseIf BB(0) = False And BB(1) = False And BB(2) = False And BB(3) = True Then
167
-            利潤表_dgv.Columns("CollectedToolng").Visible = False : 利潤表_dgv.Columns("CommissionTTL").Visible = False
168
-            利潤表_dgv.Columns("CommissionDarren").Visible = False : 利潤表_dgv.Columns("CommissionTendenza").Visible = False
180
+            利潤表_dgv.Columns("CollectedToolng").Visible = False : 利潤表_dgv.Columns("Commission TTL").Visible = False
181
+            利潤表_dgv.Columns("Commission Darren").Visible = False : 利潤表_dgv.Columns("Commission Tendenza").Visible = False
169 182
             利潤表_dgv.Columns("%_1").Visible = False : 利潤表_dgv.Columns("%_2").Visible = False
170 183
 
171 184
             利潤表_dgv.Columns("BasicPrice").Visible = False : 利潤表_dgv.Columns("PG/MOQ").Visible = False : 利潤表_dgv.Columns("FOOTorPET").Visible = False
172 185
             利潤表_dgv.Columns("Tooling").Visible = False : 利潤表_dgv.Columns("RubberBand").Visible = False : 利潤表_dgv.Columns("JHOOK").Visible = False
173 186
             利潤表_dgv.Columns("WaterResistant").Visible = False : 利潤表_dgv.Columns("P16VAT").Visible = False : 利潤表_dgv.Columns("EXWsaving").Visible = False
174
-            利潤表_dgv.Columns("FTY_1").Visible = False : 利潤表_dgv.Columns("FTY_2").Visible = False
187
+            利潤表_dgv.Columns("實際廠價").Visible = False : 利潤表_dgv.Columns("天盾單價").Visible = False : 利潤表_dgv.Columns("客戶單價").Visible = False
175 188
 
176 189
             利潤表_dgv.Columns("驗證").Visible = True : 利潤表_dgv.Columns("ItemNumber").Visible = True : 利潤表_dgv.Columns("審核").Visible = True
177 190
             利潤表_dgv.Columns("客戶訂單號").Visible = True : 利潤表_dgv.Columns("需存檔").Visible = True
178 191
         End If
179 192
         利潤表_dgv.Columns("年份").FillWeight = 50 : 利潤表_dgv.Columns("驗證").FillWeight = 50 : 利潤表_dgv.Columns("審核").FillWeight = 50
180
-        利潤表_dgv.Columns("FTY_1").DefaultCellStyle.BackColor = Color.MistyRose
181
-        利潤表_dgv.Columns("Quantity").DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns("FTY_2").DefaultCellStyle.BackColor = Color.MistyRose
193
+        利潤表_dgv.Columns("實際廠價").DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns("客戶單價").DefaultCellStyle.BackColor = Color.MistyRose
194
+        利潤表_dgv.Columns("Quantity").DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns("天盾單價").DefaultCellStyle.BackColor = Color.MistyRose
182 195
         利潤表_dgv.Columns("BasicPrice").DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns("PG/MOQ").DefaultCellStyle.BackColor = Color.MistyRose
183 196
         利潤表_dgv.Columns("FOOTorPET").DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns("Tooling").DefaultCellStyle.BackColor = Color.MistyRose
184 197
         利潤表_dgv.Columns("RubberBand").DefaultCellStyle.BackColor = Color.MistyRose : 利潤表_dgv.Columns("JHOOK").DefaultCellStyle.BackColor = Color.MistyRose
@@ -187,10 +200,16 @@ Public Class 訂單價格利潤明細表
187 200
         利潤表_dgv.EditMode = DataGridViewEditMode.EditOnEnter
188 201
 
189 202
         利潤表_dgv.Columns("單價").DefaultCellStyle.ForeColor = Color.Red : 利潤表_dgv.Columns("總金額").DefaultCellStyle.ForeColor = Color.Red
190
-        利潤表_dgv.Columns("CommissionTTL").DefaultCellStyle.ForeColor = Color.Red : 利潤表_dgv.Columns("CommissionDarren").DefaultCellStyle.ForeColor = Color.Red
191
-        利潤表_dgv.Columns("CommissionTendenza").DefaultCellStyle.ForeColor = Color.Red : 利潤表_dgv.Columns("%_1").DefaultCellStyle.ForeColor = Color.Red
203
+        利潤表_dgv.Columns("Commission TTL").DefaultCellStyle.ForeColor = Color.Red : 利潤表_dgv.Columns("Commission Darren").DefaultCellStyle.ForeColor = Color.Red
204
+        利潤表_dgv.Columns("Commission Tendenza").DefaultCellStyle.ForeColor = Color.Red : 利潤表_dgv.Columns("%_1").DefaultCellStyle.ForeColor = Color.Red
192 205
         利潤表_dgv.Columns("%_2").DefaultCellStyle.ForeColor = Color.Red : 利潤表_dgv.Columns("年份").DefaultCellStyle.ForeColor = Color.Red
193 206
         利潤表_dgv.Columns("CollectedToolng").DefaultCellStyle.ForeColor = Color.Red
207
+        For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
208
+            If IsDBNull(利潤表_dgv("實際廠價", i).Value) Then : 利潤表_dgv("實際廠價", i).Value = 0 : End If
209
+            If IsDBNull(利潤表_dgv("客戶單價", i).Value) Then : 利潤表_dgv("客戶單價", i).Value = 0 : End If
210
+            If IsDBNull(利潤表1_dgv("實際廠價", i).Value) Then : 利潤表1_dgv("實際廠價", i).Value = 0 : End If
211
+            If IsDBNull(利潤表1_dgv("客戶單價", i).Value) Then : 利潤表1_dgv("客戶單價", i).Value = 0 : End If
212
+        Next
194 213
     End Sub
195 214
     Private Sub Set_grid1()
196 215
         訂單流水號_dgv.Columns(0).FillWeight = 90
@@ -208,14 +227,14 @@ Public Class 訂單價格利潤明細表
208 227
             If 利潤表_dgv("P16VAT", i).Value.ToString = "" Then : EU(7) = 0 : Else : EU(7) = Double.Parse(利潤表_dgv("P16VAT", i).Value.ToString) : End If
209 228
             If 利潤表_dgv("EXWsaving", i).Value.ToString = "" Then : EU(8) = 0 : Else : EU(8) = Double.Parse(利潤表_dgv("EXWsaving", i).Value.ToString) : End If
210 229
             If 利潤表_dgv("Quantity", i).Value.ToString = "" Then : EU(9) = 0 : Else : EU(9) = Double.Parse(利潤表_dgv("Quantity", i).Value.ToString) : End If
211
-            If 利潤表_dgv("FTY_1", i).Value.ToString = "" Then : EU(12) = 0 : Else : EU(12) = Double.Parse(利潤表_dgv("FTY_1", i).Value.ToString) : End If
212
-            If 利潤表_dgv("FTY_2", i).Value.ToString = "" Then : EU(10) = 0 : Else : EU(10) = Double.Parse(利潤表_dgv("FTY_2", i).Value.ToString) : End If
230
+            If 利潤表_dgv("實際廠價", i).Value.ToString = "" Then : EU(12) = 0 : Else : EU(12) = Double.Parse(利潤表_dgv("實際廠價", i).Value.ToString) : End If
231
+            If 利潤表_dgv("天盾單價", i).Value.ToString = "" Then : EU(10) = 0 : Else : EU(10) = Double.Parse(利潤表_dgv("天盾單價", i).Value.ToString) : End If
213 232
             If 利潤表_dgv("Exchange", i).Value.ToString = "" Then : EU(11) = 1 : Else : EU(11) = Double.Parse(利潤表_dgv("Exchange", i).Value.ToString) : End If
214 233
             利潤表_dgv.Rows(i).Cells("單價").Value = EU(0) + EU(1) + EU(2) + EU(3) + EU(4) + EU(5) + EU(6) + EU(7) / EU(11) - EU(8)
215 234
             利潤表_dgv.Rows(i).Cells("CollectedToolng").Value = EU(9) * EU(3)
216
-            利潤表_dgv.Rows(i).Cells("CommissionTTL").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)
217
-            利潤表_dgv.Rows(i).Cells("CommissionDarren").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
218
-            利潤表_dgv.Rows(i).Cells("CommissionTendenza").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
235
+            利潤表_dgv.Rows(i).Cells("Commission TTL").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)
236
+            利潤表_dgv.Rows(i).Cells("Commission Darren").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
237
+            利潤表_dgv.Rows(i).Cells("Commission Tendenza").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
219 238
             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
220 239
                 利潤表_dgv.Rows(i).Cells("%_1").Value = 0
221 240
             Else
@@ -233,25 +252,25 @@ Public Class 訂單價格利潤明細表
233 252
             If 利潤表_dgv.RowCount = 0 Then
234 253
                 金額加總(1) = "0.00"
235 254
             Else
236
-                TextBox6.Text = 利潤表_dgv("CommissionTTL", i).Value.ToString
237
-                If TextBox6.Text = "" Then : 金額加總(1) += 0 : Else : 金額加總(1) += 利潤表_dgv.Rows(i).Cells("CommissionTTL").Value : End If
255
+                TextBox6.Text = 利潤表_dgv("Commission TTL", i).Value.ToString
256
+                If TextBox6.Text = "" Then : 金額加總(1) += 0 : Else : 金額加總(1) += 利潤表_dgv.Rows(i).Cells("Commission TTL").Value : End If
238 257
             End If
239 258
             If 利潤表_dgv.RowCount = 0 Then
240 259
                 金額加總(2) = "0.00"
241 260
             Else
242
-                TextBox7.Text = 利潤表_dgv("CommissionDarren", i).Value.ToString
243
-                If TextBox7.Text = "" Then : 金額加總(2) += 0 : Else : 金額加總(2) += 利潤表_dgv.Rows(i).Cells("CommissionDarren").Value : End If
261
+                TextBox7.Text = 利潤表_dgv("Commission Darren", i).Value.ToString
262
+                If TextBox7.Text = "" Then : 金額加總(2) += 0 : Else : 金額加總(2) += 利潤表_dgv.Rows(i).Cells("Commission Darren").Value : End If
244 263
             End If
245 264
             If 利潤表_dgv.RowCount = 0 Then
246 265
                 金額加總(3) = "0.00"
247 266
             Else
248
-                TextBox8.Text = 利潤表_dgv("CommissionTendenza", i).Value.ToString
249
-                If TextBox8.Text = "" Then : 金額加總(3) += 0 : Else : 金額加總(3) += 利潤表_dgv.Rows(i).Cells("CommissionTendenza").Value : End If
267
+                TextBox8.Text = 利潤表_dgv("Commission Tendenza", i).Value.ToString
268
+                If TextBox8.Text = "" Then : 金額加總(3) += 0 : Else : 金額加總(3) += 利潤表_dgv.Rows(i).Cells("Commission Tendenza").Value : End If
250 269
             End If
251 270
             If 利潤表_dgv.RowCount = 0 Then
252 271
                 金額加總(4) = "0.00"
253 272
             Else
254
-                TextBox10.Text = 利潤表_dgv("CommissionTendenza", i).Value.ToString
273
+                TextBox10.Text = 利潤表_dgv("Commission Tendenza", i).Value.ToString
255 274
                 If TextBox10.Text = "" Then : 金額加總(4) += 0 : Else : 金額加總(4) += 利潤表_dgv.Rows(i).Cells("CollectedToolng").Value : End If
256 275
             End If
257 276
             利潤表_dgv.Rows(i).Cells("年份").Value = Strings.Left(利潤表_dgv("客戶交期", i).Value.ToString, 4)
@@ -277,6 +296,7 @@ Public Class 訂單價格利潤明細表
277 296
         成本組成_bt.Enabled = False
278 297
         Set_訂單清單() : Set_grid() : Set_未建檔清單() : Set_grid1() : Set_自動彙總1() : Set_格式()
279 298
         A1 = 空間1.Location.X : A2 = 空間2.Location.X : B2 = 空間2.Location.Y : A3 = 空間2.Size.Width : B3 = 空間2.Size.Height
299
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : PID_cb.Text = "HTS#" : Else : PID_cb.Text = "ProductID" : End If
280 300
     End Sub
281 301
     Private Sub 訂單價格利潤明細表_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
282 302
         ZOOM_tb.PerformClick()
@@ -297,7 +317,7 @@ Public Class 訂單價格利潤明細表
297 317
     End Sub
298 318
     Private Sub 利潤表_dgv_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles 利潤表_dgv.CellClick
299 319
         If e.RowIndex = -1 Then : Else
300
-            天盾流水號_tb.Text = 利潤表_dgv("訂單流水號", e.RowIndex).Value.ToString : 客戶訂單號_tb.Text = 利潤表_dgv("力威訂單號", e.RowIndex).Value.ToString
320
+            天盾流水號_tb.Text = 利潤表_dgv("訂單流水號", e.RowIndex).Value.ToString : 客戶訂單號_tb.Text = 利潤表_dgv("客人訂單號", e.RowIndex).Value.ToString
301 321
             形體號_tb.Text = 利潤表_dgv("形體號", e.RowIndex).Value.ToString : 顏色_tb.Text = 利潤表_dgv("顏色", e.RowIndex).Value.ToString
302 322
             楦型_tb.Text = 利潤表_dgv("楦型", e.RowIndex).Value.ToString : 資料流水號_tb.Text = 利潤表_dgv("資料流水號", e.RowIndex).Value.ToString
303 323
             年份_cb.Text = 利潤表_dgv("年份", e.RowIndex).Value.ToString : Currency_cb.Text = 利潤表_dgv("Currency", e.RowIndex).Value.ToString
@@ -434,7 +454,7 @@ Public Class 訂單價格利潤明細表
434 454
                     SQL_修改訂單控制表() : conn.Close()
435 455
                     '--------------------------------------------------------------------------------------
436 456
                     PA1 = 利潤表_dgv.Rows(i).Cells("訂單流水號").Value.ToString
437
-                    PA2 = 利潤表_dgv.Rows(i).Cells("客戶訂單號").Value.ToString : PA3 = 利潤表_dgv.Rows(i).Cells("FTY_2").Value.ToString
457
+                    PA2 = 利潤表_dgv.Rows(i).Cells("客戶訂單號").Value.ToString : PA3 = 利潤表_dgv.Rows(i).Cells("天盾單價").Value.ToString
438 458
                     PA4 = 利潤表_dgv.Rows(i).Cells("BasicPrice").Value.ToString : PA5 = 利潤表_dgv.Rows(i).Cells("PG/MOQ").Value.ToString
439 459
                     PA6 = 利潤表_dgv.Rows(i).Cells("FOOTorPET").Value.ToString : PA7 = 利潤表_dgv.Rows(i).Cells("Tooling").Value.ToString
440 460
                     PA8 = 利潤表_dgv.Rows(i).Cells("RubberBand").Value.ToString : PA9 = 利潤表_dgv.Rows(i).Cells("JHOOK").Value.ToString
@@ -442,7 +462,8 @@ Public Class 訂單價格利潤明細表
442 462
                     PA12 = 利潤表_dgv.Rows(i).Cells("EXWsaving").Value.ToString : PA13 = 利潤表_dgv.Rows(i).Cells("Exchange").Value.ToString
443 463
                     PA14 = 利潤表_dgv.Rows(i).Cells("年份").Value.ToString : PA15 = 利潤表_dgv.Rows(i).Cells("Quantity").Value.ToString
444 464
                     利潤表流水號 = 利潤表_dgv.Rows(i).Cells("利潤表流水號").Value.ToString : PA17 = 利潤表_dgv.Rows(i).Cells("審核").Value.ToString
445
-                    PA18 = 利潤表_dgv.Rows(i).Cells("CommissionDarren").Value.ToString : PA19 = 利潤表_dgv.Rows(i).Cells("FTY_1").Value.ToString
465
+                    PA18 = 利潤表_dgv.Rows(i).Cells("Commission Darren").Value.ToString : PA19 = 利潤表_dgv.Rows(i).Cells("實際廠價").Value.ToString
466
+                    PA20 = 利潤表_dgv.Rows(i).Cells("客戶單價").Value.ToString
446 467
                     SQL_查詢最後一筆利潤表流水號()
447 468
                     If dr.Read() Then : NUM2 = Strings.Right(dr("利潤表流水號").ToString, 8) : End If : conn.Close() : NUM2 += 1
448 469
                     If NUM2 < 10 Then : 利潤表流水號 = "PR" & "0000000" & NUM2
@@ -473,7 +494,7 @@ Public Class 訂單價格利潤明細表
473 494
             MsgBox("年份或幣別沒有選擇")
474 495
         Else
475 496
             For I As Integer = 0 To 利潤表_dgv.Rows.Count - 1
476
-                If CDbl(利潤表_dgv("FTY_2", I).Value.ToString) <> CDbl(利潤表1_dgv("FTY_2", I).Value.ToString) Or
497
+                If CDbl(利潤表_dgv("天盾單價", I).Value.ToString) <> CDbl(利潤表1_dgv("天盾單價", I).Value.ToString) Or
477 498
                    CDbl(利潤表_dgv("BasicPrice", I).Value.ToString) <> CDbl(利潤表1_dgv("BasicPrice", I).Value.ToString) Or
478 499
                    CDbl(利潤表_dgv("PG/MOQ", I).Value.ToString) <> CDbl(利潤表1_dgv("PG/MOQ", I).Value.ToString) Or
479 500
                    CDbl(利潤表_dgv("FOOTorPET", I).Value.ToString) <> CDbl(利潤表1_dgv("FOOTorPET", I).Value.ToString) Or
@@ -487,7 +508,8 @@ Public Class 訂單價格利潤明細表
487 508
                    CDbl(利潤表_dgv("年份", I).Value.ToString) <> CDbl(利潤表1_dgv("年份", I).Value.ToString) Or
488 509
                    CDbl(利潤表_dgv("Quantity", I).Value.ToString) <> CDbl(利潤表1_dgv("Quantity", I).Value.ToString) Or
489 510
                    利潤表_dgv("審核", I).Value.ToString <> 利潤表1_dgv("審核", I).Value.ToString Or
490
-                   CDbl(利潤表_dgv("FTY_1", I).Value.ToString) <> CDbl(利潤表1_dgv("FTY_1", I).Value.ToString) Then
511
+                   CDbl(利潤表_dgv("實際廠價", I).Value.ToString) <> CDbl(利潤表1_dgv("實際廠價", I).Value.ToString) Or
512
+                   CDbl(利潤表_dgv("客戶單價", I).Value.ToString) <> CDbl(利潤表1_dgv("客戶單價", I).Value.ToString) Then
491 513
                     利潤表_dgv("需存檔", I).Value = True
492 514
                 Else
493 515
                     利潤表_dgv("需存檔", I).Value = False
@@ -507,7 +529,7 @@ Public Class 訂單價格利潤明細表
507 529
                     PA = 利潤表_dgv.Rows(i).Cells("資料流水號").Value.ToString : PA1 = 利潤表_dgv.Rows(i).Cells("單價").Value.ToString
508 530
                     PA2 = 利潤表_dgv.Rows(i).Cells("總金額").Value.ToString : SQL_修改訂單資料表() : conn.Close()
509 531
                     '-------------------------------------------------------------------------------------------------------
510
-                    PA3 = 利潤表_dgv.Rows(i).Cells("FTY_2").Value.ToString : PA4 = 利潤表_dgv.Rows(i).Cells("BasicPrice").Value.ToString
532
+                    PA3 = 利潤表_dgv.Rows(i).Cells("天盾單價").Value.ToString : PA4 = 利潤表_dgv.Rows(i).Cells("BasicPrice").Value.ToString
511 533
                     PA5 = 利潤表_dgv.Rows(i).Cells("PG/MOQ").Value.ToString : PA6 = 利潤表_dgv.Rows(i).Cells("FOOTorPET").Value.ToString
512 534
                     PA7 = 利潤表_dgv.Rows(i).Cells("Tooling").Value.ToString : PA8 = 利潤表_dgv.Rows(i).Cells("RubberBand").Value.ToString
513 535
                     PA9 = 利潤表_dgv.Rows(i).Cells("JHOOK").Value.ToString : PA10 = 利潤表_dgv.Rows(i).Cells("WaterResistant").Value.ToString
@@ -515,8 +537,8 @@ Public Class 訂單價格利潤明細表
515 537
                     PA13 = 利潤表_dgv.Rows(i).Cells("Exchange").Value.ToString : PA14 = 利潤表_dgv.Rows(i).Cells("年份").Value.ToString
516 538
                     PA15 = 利潤表_dgv.Rows(i).Cells("Quantity").Value.ToString : PA16 = 利潤表_dgv.Rows(i).Cells("審核").Value.ToString
517 539
                     利潤表流水號 = 利潤表_dgv.Rows(i).Cells("利潤表流水號").Value.ToString
518
-                    PA19 = 利潤表_dgv.Rows(i).Cells("FTY_1").Value.ToString
519
-                    PA18 = 利潤表_dgv.Rows(i).Cells("CommissionDarren").Value.ToString : SQL_訂單成本利潤表修改() : conn.Close()
540
+                    PA19 = 利潤表_dgv.Rows(i).Cells("實際廠價").Value.ToString : PA20 = 利潤表_dgv.Rows(i).Cells("客戶單價").Value.ToString
541
+                    PA18 = 利潤表_dgv.Rows(i).Cells("Commission Darren").Value.ToString : SQL_訂單成本利潤表修改() : conn.Close()
520 542
                 End If
521 543
             Next i : ProgressBar1.Value = 0 : 最終數 = 0
522 544
             MsgBox("修改完成") : PA = ""
@@ -543,9 +565,7 @@ Public Class 訂單價格利潤明細表
543 565
         Set_訂單清單() : Set_grid() : Set_未建檔清單() : Set_grid1() : Set_自動彙總1() : Set_格式()
544 566
     End Sub
545 567
     Private Sub 列印_bt_Click(sender As Object, e As EventArgs) Handles 列印_bt.Click
546
-        If 列印用SQL = "" Then : MsgBox("請先搜尋資料後再行列印") : Else
547
-            If FTY2_ch.Checked = True Then : BL1 = True : Else : BL1 = False : End If : 列印_訂單價格利潤表.Show()
548
-        End If
568
+        If 列印用SQL = "" Then : MsgBox("請先搜尋資料後再行列印") : Else : 列印_訂單價格利潤表.Show() : End If
549 569
     End Sub
550 570
     Private Sub ZOOM_tb_Click(sender As Object, e As EventArgs) Handles ZOOM_tb.Click
551 571
         If 空間1.Visible = True Then
@@ -563,29 +583,25 @@ Public Class 訂單價格利潤明細表
563 583
     Private Sub PID_cb_CheckedChanged(sender As Object, e As EventArgs) Handles PID_cb.CheckedChanged
564 584
         Set_grid()
565 585
     End Sub
566
-    Private Sub FTY1_ch_Click(sender As Object, e As EventArgs) Handles FTY1_ch.Click
567
-        FTY1_ch.Checked = True : FTY2_ch.Checked = False
568
-    End Sub
569
-    Private Sub FTY2_ch_Click(sender As Object, e As EventArgs) Handles FTY2_ch.Click
570
-        FTY1_ch.Checked = False : FTY2_ch.Checked = True
586
+    Private Sub 年份_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 年份_cb.SelectedIndexChanged
587
+        返回_bt.PerformClick()
571 588
     End Sub
572 589
     Private Sub 等於訂單數_bt_Click(sender As Object, e As EventArgs) Handles 等於訂單數_bt.Click
573
-        For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
574
-            利潤表_dgv.Rows(i).Cells("Quantity").Value = 利潤表_dgv.Rows(i).Cells("數量").Value
575
-        Next i
590
+        For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1 : 利潤表_dgv.Rows(i).Cells("Quantity").Value = 利潤表_dgv.Rows(i).Cells("數量").Value : Next i
576 591
     End Sub
577 592
     Private Sub 匯率為1_bt_Click(sender As Object, e As EventArgs) Handles 匯率為1_bt.Click
578
-        For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1
579
-            利潤表_dgv.Rows(i).Cells("Exchange").Value = 1
580
-        Next i
593
+        For i As Integer = 0 To 利潤表_dgv.Rows.Count - 1 : 利潤表_dgv.Rows(i).Cells("Exchange").Value = 1 : Next i
581 594
     End Sub
582 595
     Private Sub 資料庫選擇1_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇1_bt.Click
583 596
         SQL_訂單資料表選擇_VIONIC() : Set_訂單清單() : Set_grid() : Set_未建檔清單() : Set_grid1() : Set_自動彙總1() : Set_格式()
597
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : PID_cb.Text = "HTS#" : Else : PID_cb.Text = "ProductID" : End If
584 598
     End Sub
585 599
     Private Sub 資料庫選擇2_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇2_bt.Click
586 600
         SQL_訂單資料表選擇_DRS() : Set_訂單清單() : Set_grid() : Set_未建檔清單() : Set_grid1() : Set_自動彙總1() : Set_格式()
601
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : PID_cb.Text = "HTS#" : Else : PID_cb.Text = "ProductID" : End If
587 602
     End Sub
588 603
     Private Sub 資料庫選擇3_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇3_bt.Click
589 604
         SQL_訂單資料表選擇_HP() : Set_訂單清單() : Set_grid() : Set_未建檔清單() : Set_grid1() : Set_自動彙總1() : Set_格式()
605
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : PID_cb.Text = "HTS#" : Else : PID_cb.Text = "ProductID" : End If
590 606
     End Sub
591 607
 End Class

+ 16
- 7
TENDEN-MES-SYS/4、量產訂單管理/系統列印介面/列印_訂單明細.vb View File

@@ -10,7 +10,7 @@ Imports Microsoft.Office.Interop.Excel.XlWindowState
10 10
 Public Class 列印_訂單明細
11 11
     ReadOnly ds As New DataSet
12 12
     Dim N1 As Integer = 6 : Dim N2 As Integer
13
-    Dim M1 As String
13
+    Dim M1, M2 As String
14 14
     Dim xlApp As Microsoft.Office.Interop.Excel.Application
15 15
     Dim xlBook As Microsoft.Office.Interop.Excel.Workbook
16 16
     Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
@@ -78,7 +78,8 @@ Public Class 列印_訂單明細
78 78
             If OD(34) <> 0 Then : xlSheet.Cells(16, N1) = "11" : N1 += 1 : End If : If OD(41) <> 0 Then : xlSheet.Cells(16, N1) = "11.5" : N1 += 1 : End If
79 79
             If OD(35) <> 0 Then : xlSheet.Cells(16, N1) = "12" : N1 += 1 : End If : If OD(42) <> 0 Then : xlSheet.Cells(16, N1) = "12.5" : N1 += 1 : End If
80 80
             If OD(36) <> 0 Then : xlSheet.Cells(16, N1) = "13" : N1 += 1 : End If : If OD(37) <> 0 Then : xlSheet.Cells(16, N1) = "14" : N1 += 1 : End If
81
-            xlSheet.Cells(16, N1) = "TOTAL"
81
+            xlSheet.Cells(16, N1) = "TOTAL" : xlSheet.Cells(16, N1 + 2) = "STYLE#"
82
+            If Strings.Right(訂單資料表(5), 2) = "HP" Then : xlSheet.Cells(16, N1 + 1) = "HTS#" : Else : xlSheet.Cells(16, N1 + 1) = "ProductID" : End If
82 83
 
83 84
             For i As Integer = 0 To DataGridView1.Rows.Count - 1
84 85
                 xlSheet.Cells(i + 17, 1) = DataGridView1.Rows(i).Cells("ItemNumber").Value
@@ -106,9 +107,10 @@ Public Class 列印_訂單明細
106 107
                 If OD(36) <> 0 Then : xlSheet.Cells(i + 17, N1) = DataGridView1.Rows(i).Cells("13").Value : N1 += 1 : End If
107 108
                 If OD(37) <> 0 Then : xlSheet.Cells(i + 17, N1) = DataGridView1.Rows(i).Cells("14").Value : N1 += 1 : End If
108 109
                 xlSheet.Cells(i + 17, N1) = DataGridView1.Rows(i).Cells("TOTAL").Value
109
-                With xlApp.Selection
110
-                    .Font.Bold = True
111
-                End With
110
+                xlSheet.Cells(i + 17, N1 + 2) = DataGridView1.Rows(i).Cells("STYLE#").Value.ToString
111
+                If Strings.Right(訂單資料表(5), 2) = "HP" Then : xlSheet.Cells(i + 17, N1 + 1) = DataGridView1.Rows(i).Cells("HTS#").Value.ToString
112
+                Else : xlSheet.Cells(i + 17, N1 + 1) = DataGridView1.Rows(i).Cells("ProductID").Value.ToString : End If
113
+                With xlApp.Selection : .Font.Bold = True : End With
112 114
                 N2 = i
113 115
             Next i
114 116
 
@@ -124,7 +126,7 @@ Public Class 列印_訂單明細
124 126
             If OD(35) <> 0 Then : xlSheet.Cells(N2 + 17, N1) = OD(35) : N1 += 1 : End If : If OD(42) <> 0 Then : xlSheet.Cells(N2 + 17, N1) = OD(42) : N1 += 1 : End If  '12  12.5
125 127
             If OD(36) <> 0 Then : xlSheet.Cells(N2 + 17, N1) = OD(36) : N1 += 1 : End If : If OD(37) <> 0 Then : xlSheet.Cells(N2 + 17, N1) = OD(37) : N1 += 1 : End If  '13  14
126 128
             xlSheet.Cells(N2 + 17, N1) = OD(38)
127
-
129
+            N1 += 2
128 130
             BB(xlApp, xlSheet)
129 131
 
130 132
             xlSheet.PageSetup.PrintArea = ""
@@ -150,7 +152,11 @@ Public Class 列印_訂單明細
150 152
         ElseIf N1 = 15 Then : M1 = "O" : ElseIf N1 = 16 Then : M1 = "P" : ElseIf N1 = 17 Then : M1 = "Q" : ElseIf N1 = 18 Then : M1 = "R"
151 153
         ElseIf N1 = 19 Then : M1 = "S" : ElseIf N1 = 20 Then : M1 = "T" : ElseIf N1 = 21 Then : M1 = "U" : ElseIf N1 = 22 Then : M1 = "V"
152 154
         ElseIf N1 = 23 Then : M1 = "W" : ElseIf N1 = 24 Then : M1 = "X" : End If
153
-
155
+        If N1 - 1 = 7 Then : M2 = "G" : ElseIf N1 - 1 = 8 Then : M2 = "H" : ElseIf N1 - 1 = 9 Then : M2 = "I" : ElseIf N1 - 1 = 10 Then : M2 = "J"
156
+        ElseIf N1 - 1 = 11 Then : M2 = "K" : ElseIf N1 - 1 = 12 Then : M2 = "L" : ElseIf N1 - 1 = 13 Then : M2 = "M" : ElseIf N1 - 1 = 14 Then : M2 = "N"
157
+        ElseIf N1 - 1 = 15 Then : M2 = "O" : ElseIf N1 - 1 = 16 Then : M2 = "P" : ElseIf N1 - 1 = 17 Then : M2 = "Q" : ElseIf N1 - 1 = 18 Then : M2 = "R"
158
+        ElseIf N1 - 1 = 19 Then : M2 = "S" : ElseIf N1 - 1 = 20 Then : M2 = "T" : ElseIf N1 - 1 = 21 Then : M2 = "U" : ElseIf N1 - 1 = 22 Then : M2 = "V"
159
+        ElseIf N1 - 1 = 23 Then : M2 = "W" : ElseIf N1 - 1 = 24 Then : M2 = "X" : End If
154 160
         xlSheet.Cells.Select()
155 161
         With myExcel.Selection.Font
156 162
             .Name = "微軟正黑體" : .Size = 9 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
@@ -362,6 +368,9 @@ Public Class 列印_訂單明細
362 368
         End With
363 369
         myExcel.Selection.Merge
364 370
         xlSheet.Rows("6:6").Select : xlSheet.Range("O6").Activate() : myExcel.Selection.RowHeight = 12.75
371
+        xlSheet.Columns(M2 & ":" & M1).Select
372
+        xlSheet.Columns(M2 & ":" & M1).EntireColumn.AutoFit
373
+        myExcel.Selection.NumberFormatLocal = "@"
365 374
         xlSheet.Range("O7").Select()
366 375
     End Sub
367 376
 End Class

+ 33
- 33
TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/訂單控制表.Designer.vb View File

@@ -251,6 +251,7 @@ Partial Class 訂單控制表
251 251
         Me.Panel2 = New System.Windows.Forms.Panel()
252 252
         Me.Label51 = New System.Windows.Forms.Label()
253 253
         Me.Panel3 = New System.Windows.Forms.Panel()
254
+        Me.包裝資料_pb = New System.Windows.Forms.PictureBox()
254 255
         Me.CanceL3_bt = New System.Windows.Forms.Button()
255 256
         Me.TVW_tb = New System.Windows.Forms.TextBox()
256 257
         Me.Panel1 = New System.Windows.Forms.Panel()
@@ -263,7 +264,6 @@ Partial Class 訂單控制表
263 264
         Me.列印明細_bt = New System.Windows.Forms.Button()
264 265
         Me.驗貨報告_pb = New System.Windows.Forms.PictureBox()
265 266
         Me.PictureBox1 = New System.Windows.Forms.PictureBox()
266
-        Me.包裝資料_pb = New System.Windows.Forms.PictureBox()
267 267
         CType(Me.控制表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
268 268
         Me.GroupBox1.SuspendLayout()
269 269
         Me.GroupBox2.SuspendLayout()
@@ -279,11 +279,11 @@ Partial Class 訂單控制表
279 279
         Me.資訊_gb.SuspendLayout()
280 280
         Me.Panel2.SuspendLayout()
281 281
         Me.Panel3.SuspendLayout()
282
+        CType(Me.包裝資料_pb, System.ComponentModel.ISupportInitialize).BeginInit()
282 283
         Me.Panel1.SuspendLayout()
283 284
         CType(Me.表頭_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
284 285
         CType(Me.驗貨報告_pb, System.ComponentModel.ISupportInitialize).BeginInit()
285 286
         CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
286
-        CType(Me.包裝資料_pb, System.ComponentModel.ISupportInitialize).BeginInit()
287 287
         Me.SuspendLayout()
288 288
         '
289 289
         '控制表_dgv
@@ -715,9 +715,9 @@ Partial Class 訂單控制表
715 715
         'ACTUAL_ex_fty_dtp
716 716
         '
717 717
         Me.ACTUAL_ex_fty_dtp.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
718
-        Me.ACTUAL_ex_fty_dtp.Location = New System.Drawing.Point(107, 32)
718
+        Me.ACTUAL_ex_fty_dtp.Location = New System.Drawing.Point(113, 32)
719 719
         Me.ACTUAL_ex_fty_dtp.Name = "ACTUAL_ex_fty_dtp"
720
-        Me.ACTUAL_ex_fty_dtp.Size = New System.Drawing.Size(80, 22)
720
+        Me.ACTUAL_ex_fty_dtp.Size = New System.Drawing.Size(101, 22)
721 721
         Me.ACTUAL_ex_fty_dtp.TabIndex = 268
722 722
         '
723 723
         'Label57
@@ -1109,7 +1109,7 @@ Partial Class 訂單控制表
1109 1109
         'CXL訂單_bt
1110 1110
         '
1111 1111
         Me.CXL訂單_bt.ForeColor = System.Drawing.Color.Black
1112
-        Me.CXL訂單_bt.Location = New System.Drawing.Point(275, 10)
1112
+        Me.CXL訂單_bt.Location = New System.Drawing.Point(274, 10)
1113 1113
         Me.CXL訂單_bt.Name = "CXL訂單_bt"
1114 1114
         Me.CXL訂單_bt.Size = New System.Drawing.Size(66, 25)
1115 1115
         Me.CXL訂單_bt.TabIndex = 336
@@ -1167,25 +1167,22 @@ Partial Class 訂單控制表
1167 1167
         Me.整單出貨_ch.CheckState = System.Windows.Forms.CheckState.Checked
1168 1168
         Me.整單出貨_ch.Location = New System.Drawing.Point(11, 58)
1169 1169
         Me.整單出貨_ch.Name = "整單出貨_ch"
1170
-        Me.整單出貨_ch.Size = New System.Drawing.Size(70, 19)
1170
+        Me.整單出貨_ch.Size = New System.Drawing.Size(144, 19)
1171 1171
         Me.整單出貨_ch.TabIndex = 340
1172
-        Me.整單出貨_ch.Text = "整單出貨"
1172
+        Me.整單出貨_ch.Text = "整單出貨(以訂單號為主)"
1173 1173
         Me.整單出貨_ch.UseVisualStyleBackColor = True
1174 1174
         '
1175 1175
         'GroupBox1
1176 1176
         '
1177
-        Me.GroupBox1.Controls.Add(Me.啟用批量出貨_ch)
1178 1177
         Me.GroupBox1.Controls.Add(Me.批量出貨_bt)
1179
-        Me.GroupBox1.Controls.Add(Me.整單出貨可出貨數量_tb)
1180
-        Me.GroupBox1.Controls.Add(Me.Label19)
1181 1178
         Me.GroupBox1.Controls.Add(Me.確定出貨_tb)
1182
-        Me.GroupBox1.Controls.Add(Me.拆單出貨出貨數量_tb)
1183 1179
         Me.GroupBox1.Controls.Add(Me.清空4_bt)
1184 1180
         Me.GroupBox1.Controls.Add(Me.Label57)
1185 1181
         Me.GroupBox1.Controls.Add(Me.ACTUAL_ex_fty_dtp)
1186 1182
         Me.GroupBox1.Controls.Add(Me.整單出貨_ch)
1187 1183
         Me.GroupBox1.Controls.Add(Me.Label56)
1188 1184
         Me.GroupBox1.Controls.Add(Me.Label50)
1185
+        Me.GroupBox1.Controls.Add(Me.啟用批量出貨_ch)
1189 1186
         Me.GroupBox1.Location = New System.Drawing.Point(1056, 1)
1190 1187
         Me.GroupBox1.Name = "GroupBox1"
1191 1188
         Me.GroupBox1.Size = New System.Drawing.Size(347, 105)
@@ -1198,15 +1195,15 @@ Partial Class 訂單控制表
1198 1195
         Me.啟用批量出貨_ch.AutoSize = True
1199 1196
         Me.啟用批量出貨_ch.Location = New System.Drawing.Point(11, 79)
1200 1197
         Me.啟用批量出貨_ch.Name = "啟用批量出貨_ch"
1201
-        Me.啟用批量出貨_ch.Size = New System.Drawing.Size(92, 19)
1198
+        Me.啟用批量出貨_ch.Size = New System.Drawing.Size(147, 19)
1202 1199
         Me.啟用批量出貨_ch.TabIndex = 347
1203
-        Me.啟用批量出貨_ch.Text = "啟用批量出貨"
1200
+        Me.啟用批量出貨_ch.Text = "啟用批量出貨或分批出貨"
1204 1201
         Me.啟用批量出貨_ch.UseVisualStyleBackColor = True
1205 1202
         '
1206 1203
         '批量出貨_bt
1207 1204
         '
1208 1205
         Me.批量出貨_bt.ForeColor = System.Drawing.Color.Black
1209
-        Me.批量出貨_bt.Location = New System.Drawing.Point(290, 55)
1206
+        Me.批量出貨_bt.Location = New System.Drawing.Point(214, 56)
1210 1207
         Me.批量出貨_bt.Name = "批量出貨_bt"
1211 1208
         Me.批量出貨_bt.Size = New System.Drawing.Size(50, 45)
1212 1209
         Me.批量出貨_bt.TabIndex = 346
@@ -1216,16 +1213,16 @@ Partial Class 訂單控制表
1216 1213
         '整單出貨可出貨數量_tb
1217 1214
         '
1218 1215
         Me.整單出貨可出貨數量_tb.ForeColor = System.Drawing.Color.Red
1219
-        Me.整單出貨可出貨數量_tb.Location = New System.Drawing.Point(152, 55)
1216
+        Me.整單出貨可出貨數量_tb.Location = New System.Drawing.Point(194, 70)
1220 1217
         Me.整單出貨可出貨數量_tb.Name = "整單出貨可出貨數量_tb"
1221
-        Me.整單出貨可出貨數量_tb.Size = New System.Drawing.Size(79, 22)
1218
+        Me.整單出貨可出貨數量_tb.Size = New System.Drawing.Size(56, 22)
1222 1219
         Me.整單出貨可出貨數量_tb.TabIndex = 345
1223 1220
         Me.整單出貨可出貨數量_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
1224 1221
         '
1225 1222
         'Label19
1226 1223
         '
1227 1224
         Me.Label19.AutoSize = True
1228
-        Me.Label19.Location = New System.Drawing.Point(82, 59)
1225
+        Me.Label19.Location = New System.Drawing.Point(248, 45)
1229 1226
         Me.Label19.Name = "Label19"
1230 1227
         Me.Label19.Size = New System.Drawing.Size(62, 15)
1231 1228
         Me.Label19.TabIndex = 344
@@ -1234,7 +1231,7 @@ Partial Class 訂單控制表
1234 1231
         '確定出貨_tb
1235 1232
         '
1236 1233
         Me.確定出貨_tb.ForeColor = System.Drawing.Color.Black
1237
-        Me.確定出貨_tb.Location = New System.Drawing.Point(237, 55)
1234
+        Me.確定出貨_tb.Location = New System.Drawing.Point(161, 56)
1238 1235
         Me.確定出貨_tb.Name = "確定出貨_tb"
1239 1236
         Me.確定出貨_tb.Size = New System.Drawing.Size(50, 45)
1240 1237
         Me.確定出貨_tb.TabIndex = 343
@@ -1244,9 +1241,9 @@ Partial Class 訂單控制表
1244 1241
         '拆單出貨出貨數量_tb
1245 1242
         '
1246 1243
         Me.拆單出貨出貨數量_tb.ForeColor = System.Drawing.Color.Red
1247
-        Me.拆單出貨出貨數量_tb.Location = New System.Drawing.Point(152, 78)
1244
+        Me.拆單出貨出貨數量_tb.Location = New System.Drawing.Point(194, 42)
1248 1245
         Me.拆單出貨出貨數量_tb.Name = "拆單出貨出貨數量_tb"
1249
-        Me.拆單出貨出貨數量_tb.Size = New System.Drawing.Size(79, 22)
1246
+        Me.拆單出貨出貨數量_tb.Size = New System.Drawing.Size(56, 22)
1250 1247
         Me.拆單出貨出貨數量_tb.TabIndex = 342
1251 1248
         Me.拆單出貨出貨數量_tb.Text = "0"
1252 1249
         Me.拆單出貨出貨數量_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
@@ -1254,7 +1251,7 @@ Partial Class 訂單控制表
1254 1251
         '清空4_bt
1255 1252
         '
1256 1253
         Me.清空4_bt.ForeColor = System.Drawing.Color.Black
1257
-        Me.清空4_bt.Location = New System.Drawing.Point(189, 32)
1254
+        Me.清空4_bt.Location = New System.Drawing.Point(221, 32)
1258 1255
         Me.清空4_bt.Name = "清空4_bt"
1259 1256
         Me.清空4_bt.Size = New System.Drawing.Size(41, 22)
1260 1257
         Me.清空4_bt.TabIndex = 323
@@ -2412,6 +2409,17 @@ Partial Class 訂單控制表
2412 2409
         Me.Panel3.Size = New System.Drawing.Size(1180, 363)
2413 2410
         Me.Panel3.TabIndex = 1376
2414 2411
         '
2412
+        '包裝資料_pb
2413
+        '
2414
+        Me.包裝資料_pb.BackColor = System.Drawing.Color.White
2415
+        Me.包裝資料_pb.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
2416
+        Me.包裝資料_pb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
2417
+        Me.包裝資料_pb.Location = New System.Drawing.Point(-1, -1)
2418
+        Me.包裝資料_pb.Name = "包裝資料_pb"
2419
+        Me.包裝資料_pb.Size = New System.Drawing.Size(1179, 362)
2420
+        Me.包裝資料_pb.TabIndex = 1660
2421
+        Me.包裝資料_pb.TabStop = False
2422
+        '
2415 2423
         'CanceL3_bt
2416 2424
         '
2417 2425
         Me.CanceL3_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -2438,9 +2446,12 @@ Partial Class 訂單控制表
2438 2446
         '
2439 2447
         Me.Panel1.Controls.Add(Me.表頭_dgv)
2440 2448
         Me.Panel1.Controls.Add(Me.新增_bt)
2449
+        Me.Panel1.Controls.Add(Me.Label19)
2450
+        Me.Panel1.Controls.Add(Me.整單出貨可出貨數量_tb)
2441 2451
         Me.Panel1.Controls.Add(Me.確認新增_bt)
2442 2452
         Me.Panel1.Controls.Add(Me.計算_dgv)
2443 2453
         Me.Panel1.Controls.Add(Me.指定拆單_bt)
2454
+        Me.Panel1.Controls.Add(Me.拆單出貨出貨數量_tb)
2444 2455
         Me.Panel1.Controls.Add(Me.開啟訂單明細表_bt)
2445 2456
         Me.Panel1.Controls.Add(Me.拆單出貨_ch)
2446 2457
         Me.Panel1.Location = New System.Drawing.Point(576, 386)
@@ -2537,17 +2548,6 @@ Partial Class 訂單控制表
2537 2548
         Me.PictureBox1.TabIndex = 500
2538 2549
         Me.PictureBox1.TabStop = False
2539 2550
         '
2540
-        '包裝資料_pb
2541
-        '
2542
-        Me.包裝資料_pb.BackColor = System.Drawing.Color.White
2543
-        Me.包裝資料_pb.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
2544
-        Me.包裝資料_pb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
2545
-        Me.包裝資料_pb.Location = New System.Drawing.Point(-1, -1)
2546
-        Me.包裝資料_pb.Name = "包裝資料_pb"
2547
-        Me.包裝資料_pb.Size = New System.Drawing.Size(1179, 362)
2548
-        Me.包裝資料_pb.TabIndex = 1660
2549
-        Me.包裝資料_pb.TabStop = False
2550
-        '
2551 2551
         '訂單控制表
2552 2552
         '
2553 2553
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
@@ -2725,12 +2725,12 @@ Partial Class 訂單控制表
2725 2725
         Me.Panel2.ResumeLayout(False)
2726 2726
         Me.Panel2.PerformLayout()
2727 2727
         Me.Panel3.ResumeLayout(False)
2728
+        CType(Me.包裝資料_pb, System.ComponentModel.ISupportInitialize).EndInit()
2728 2729
         Me.Panel1.ResumeLayout(False)
2729 2730
         Me.Panel1.PerformLayout()
2730 2731
         CType(Me.表頭_dgv, System.ComponentModel.ISupportInitialize).EndInit()
2731 2732
         CType(Me.驗貨報告_pb, System.ComponentModel.ISupportInitialize).EndInit()
2732 2733
         CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
2733
-        CType(Me.包裝資料_pb, System.ComponentModel.ISupportInitialize).EndInit()
2734 2734
         Me.ResumeLayout(False)
2735 2735
         Me.PerformLayout()
2736 2736
 

+ 29
- 14
TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/訂單控制表.vb View File

@@ -40,7 +40,8 @@ Public Class 訂單控制表
40 40
                                               楦頭號,                   材質,                 七號模具,      TRIAL1 AS T1,     TRIAL2 AS T2, 長期試穿 AS WEAR_TEST,         CFMSAMPLE AS CFM, 
41 41
                                         TRIAL3 AS T3,           TRIAL4 AS T4,          CFMSPEC AS TEST,              面料,             副料,                  中底,                     鞋墊, 
42 42
                                                 大底,                     跟,     包裝確認時間 AS 包裝,  裁斷時間 AS 裁斷, 針車時間 AS 針車,      成型時間 AS 成型,         驗貨時間 AS 驗貨, 
43
-                                     工廠進度表備註1,        工廠進度表備註2,             客戶包裝確認,      東莞業務備註,     驗貨報告圖片,              工廠確認,                 利威確認, 
43
+                                     工廠進度表備註1,        工廠進度表備註2,             客戶包裝確認,      東莞業務備註,                驗貨報告圖片 + '-' + 驗貨報告圖片2 AS 驗貨報告圖片,
44
+                                            工廠確認,               利威確認, 
44 45
                                               結關日,                SMS簽回,                  FRS簽回,     MASTER_SWATCH,       客戶訂單號,             ProductID,                      UoM,
45 46
                                             驗報圖庫
46 47
                     FROM " & 訂單資料表(1) & ""
@@ -1006,7 +1007,10 @@ Public Class 訂單控制表
1006 1007
                 conn.Close() : PictureBox1.SizeMode = 4
1007 1008
 
1008 1009
                 '------------驗貨報告讀取--------------------------------------------------------------------------------------------
1009
-                PA1 = 控制表_dgv("驗報圖庫", e.RowIndex).Value.ToString : PA2 = 控制表_dgv("驗貨報告圖片", e.RowIndex).Value.ToString
1010
+                PA1 = 控制表_dgv("驗報圖庫", e.RowIndex).Value.ToString
1011
+                If Strings.Left(控制表_dgv("驗貨報告圖片", e.RowIndex).Value.ToString, 1) <> "-" Then
1012
+                    PA2 = Strings.Left(控制表_dgv("驗貨報告圖片", e.RowIndex).Value.ToString, 10)
1013
+                Else : PA2 = "" : End If
1010 1014
                 If 控制表_dgv("驗報圖庫", e.RowIndex).Value.ToString = "" Then : 驗貨報告_pb.Image = Nothing : Else : Dim 檔案 As String
1011 1015
                     SQL_驗貨報告檔案確認()
1012 1016
                     If dr.Read Then : If dr("副檔名").ToString = "PDF" Then : 檔案 = "PDF" : Else : 檔案 = "圖片" : End If : Else : 檔案 = "圖片" : End If
@@ -1021,7 +1025,11 @@ Public Class 訂單控制表
1021 1025
                     End If
1022 1026
                 End If : 圖片傳遞 = 驗貨報告_pb.Image
1023 1027
 
1024
-                驗貨報告 = 控制表_dgv("驗貨報告圖片", e.RowIndex).Value.ToString : PB(0) = 控制表_dgv("訂單流水號", e.RowIndex).Value.ToString
1028
+                If Strings.Left(控制表_dgv("驗貨報告圖片", e.RowIndex).Value.ToString, 1) <> "-" Then
1029
+                    驗貨報告 = Strings.Left(控制表_dgv("驗貨報告圖片", e.RowIndex).Value.ToString, 10)
1030
+                    PB(51) = Strings.Left(控制表_dgv("驗貨報告圖片", e.RowIndex).Value.ToString, 10)
1031
+                Else : 驗貨報告 = "" : PB(51) = "" : End If
1032
+                PB(0) = 控制表_dgv("訂單流水號", e.RowIndex).Value.ToString
1025 1033
                 PB(1) = 控制表_dgv("年份季度", e.RowIndex).Value.ToString : PB(2) = 控制表_dgv("客戶訂單號", e.RowIndex).Value.ToString : PB(4) = 控制表_dgv("形體號", e.RowIndex).Value.ToString
1026 1034
                 PB(5) = 控制表_dgv("顏色", e.RowIndex).Value.ToString : PB(6) = 控制表_dgv("楦型", e.RowIndex).Value.ToString : DN(0) = 控制表_dgv("訂單數量", e.RowIndex).Value.ToString
1027 1035
                 PB(7) = 控制表_dgv("客戶交期", e.RowIndex).Value.ToString : DN(1) = 控制表_dgv("單價", e.RowIndex).Value.ToString : DN(2) = 控制表_dgv("總金額", e.RowIndex).Value.ToString
@@ -1040,7 +1048,7 @@ Public Class 訂單控制表
1040 1048
                 PB(42) = 控制表_dgv("中底", e.RowIndex).Value.ToString : PB(43) = 控制表_dgv("鞋墊", e.RowIndex).Value.ToString : PB(44) = 控制表_dgv("大底", e.RowIndex).Value.ToString
1041 1049
                 PB(45) = 控制表_dgv("跟", e.RowIndex).Value.ToString : PB(46) = 控制表_dgv("工廠進度表備註1", e.RowIndex).Value.ToString : PB(47) = 控制表_dgv("七號模具", e.RowIndex).Value.ToString
1042 1050
                 PB(48) = 控制表_dgv("工廠進度表備註2", e.RowIndex).Value.ToString : BL(1) = 0 : PB(49) = 控制表_dgv("客戶包裝確認", e.RowIndex).Value.ToString
1043
-                PB(50) = 控制表_dgv("東莞業務備註", e.RowIndex).Value.ToString : PB(51) = 控制表_dgv("驗貨報告圖片", e.RowIndex).Value.ToString : PB(52) = 控制表_dgv("工廠確認", e.RowIndex).Value.ToString
1051
+                PB(50) = 控制表_dgv("東莞業務備註", e.RowIndex).Value.ToString : PB(52) = 控制表_dgv("工廠確認", e.RowIndex).Value.ToString
1044 1052
                 PB(53) = 控制表_dgv("利威確認", e.RowIndex).Value.ToString : PB(54) = 控制表_dgv("結關日", e.RowIndex).Value.ToString : PB(55) = 控制表_dgv("SMS簽回", e.RowIndex).Value.ToString
1045 1053
                 PB(56) = 控制表_dgv("FRS簽回", e.RowIndex).Value.ToString : PB(57) = 控制表_dgv("MASTER_SWATCH", e.RowIndex).Value.ToString : PB(58) = 控制表_dgv("力威訂單號", e.RowIndex).Value.ToString
1046 1054
                 PB(59) = 控制表_dgv("ProductID", e.RowIndex).Value.ToString : PB(60) = 控制表_dgv("UoM", e.RowIndex).Value.ToString
@@ -1405,13 +1413,16 @@ Public Class 訂單控制表
1405 1413
                                                         ConnOpen()
1406 1414
                                                         SQL1 = "SELECT  訂單流水號, 年份季度, 客戶訂單號, 形體號, 顏色, 楦型, 訂單數量, 客戶交期, 單價, 總金額, 備註, 生產工廠, 訂單種類, 
1407 1415
                                                                         工廠回復交期, CFMSPEC, CFMSAMPLE, TRIAL1, TRIAL2, TRIAL3, TRIAL4, 包裝確認時間, 貼標時間, 裁斷時間, 針車時間, 成型時間, 
1408
-                                                                        驗貨時間, 實際離廠日, 資料流水號, 明細建檔, GOODBOX, LEATHER, LEA_Note, CXL, CXLTime, 出貨數量, 驗貨報告圖片, 力威訂單號 
1416
+                                                                        驗貨時間, 實際離廠日, 資料流水號, 明細建檔, GOODBOX, LEATHER, LEA_Note, CXL, CXLTime, 出貨數量, 
1417
+                                                                        驗貨報告圖片 + '-' + 驗貨報告圖片2 AS 驗貨報告圖片, 力威訂單號 
1409 1418
                                                                 FROM    " & 訂單資料表(1) & " 
1410 1419
                                                                 WHERE  (資料流水號 = '" & TextBox7.Text & "') AND (CXL = 0 OR CXL IS NULL)"
1411 1420
                                                         CmdSet_For_DGV() : da.Fill(ds1) : 計算_dgv.DataSource = ds1.Tables(0) : conn.Close()
1412 1421
                                                         For i As Integer = 0 To 計算_dgv.Rows.Count - 1
1413 1422
                                                             GHJK = 計算_dgv(35, i).Value.ToString
1414
-                                                            If GHJK = "" Then : MsgBox("驗貨報告不齊全,請重新確認。") : Set_搜尋() : 天盾訂單號_tb.Text = "" : TextBox7.Text = "" : Exit Sub : End If
1423
+                                                            If GHJK = "" Or Strings.Left(GHJK, 1) = "-" Or Strings.Right(GHJK, 1) = "-" Then
1424
+                                                                MsgBox("驗貨報告不齊全,請重新確認。") : Set_搜尋() : 天盾訂單號_tb.Text = "" : TextBox7.Text = "" : Exit Sub
1425
+                                                            End If
1415 1426
                                                         Next
1416 1427
                                                         If 計算_dgv.Rows(0).Cells("出貨數量").Value >= 計算_dgv.Rows(0).Cells("訂單數量").Value Then
1417 1428
                                                             MsgBox("系統有誤,請通知系統管理員處理。") : Exit Sub
@@ -1456,7 +1467,7 @@ Public Class 訂單控制表
1456 1467
                                                                                             顏色, 楦型) 
1457 1468
                                                                 VALUES (N'" & 流水 & "', N'" & Strings.Left(計算_dgv.Rows(0).Cells("客戶交期").Value.ToString, 4) & "', N'" & Brand_tb.Text & "', 
1458 1469
                                                                         N'" & 工廠 & "', N'" & PA70 & "', N'" & 計算_dgv.Rows(0).Cells("力威訂單號").Value.ToString & "', N'" & 總雙數_tb.Text & "',
1459
-                                                                        N'" & EDRW & "', '0', '0', '0', N'" & 計算_dgv.Rows(0).Cells("客戶交期").Value.ToString & "', '', '', '', 
1470
+                                                                        N'" & EDRW & "', '0', '0', '0', N'" & Strings.Format(ACTUAL_ex_fty_dtp.Value, "yyyy/MM/dd") & "', '', '', '', 
1460 1471
                                                                         '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', N'" & 計算_dgv.Rows(0).Cells("形體號").Value.ToString & "', 
1461 1472
                                                                         N'" & 計算_dgv.Rows(0).Cells("顏色").Value.ToString & "', N'" & 計算_dgv.Rows(0).Cells("楦型").Value.ToString & "')"
1462 1473
                                                         CmdSet_For_dr()
@@ -1469,13 +1480,16 @@ Public Class 訂單控制表
1469 1480
                                                     ConnOpen()
1470 1481
                                                     SQL1 = "SELECT 訂單流水號, 年份季度, 客戶訂單號, 形體號, 顏色, 楦型, 訂單數量, 客戶交期, 單價, 總金額, 備註, 生產工廠, 訂單種類, 工廠回復交期,
1471 1482
                                                                CFMSPEC, CFMSAMPLE, TRIAL1, TRIAL2, TRIAL3, TRIAL4, 包裝確認時間, 貼標時間, 裁斷時間, 針車時間, 成型時間, 驗貨時間, 實際離廠日, 
1472
-                                                               資料流水號, 明細建檔, GOODBOX, LEATHER, LEA_Note, CXL, CXLTime, 出貨數量, 驗貨報告圖片, 力威訂單號  FROM " & 訂單資料表(1) & " 
1483
+                                                               資料流水號, 明細建檔, GOODBOX, LEATHER, LEA_Note, CXL, CXLTime, 出貨數量, 驗貨報告圖片 + '-' + 驗貨報告圖片2 AS 驗貨報告圖片, 
1484
+                                                               力威訂單號  FROM " & 訂單資料表(1) & " 
1473 1485
                                                             WHERE (訂單流水號 = '" & 天盾訂單號_tb.Text & "') AND (CXL = 0 OR CXL IS NULL)"
1474 1486
                                                     CmdSet_For_DGV() : da.Fill(ds1) : 計算_dgv.DataSource = ds1.Tables(0) : conn.Close()
1475 1487
 
1476 1488
                                                     For i As Integer = 0 To 計算_dgv.Rows.Count - 1
1477 1489
                                                         GHJK = 計算_dgv(35, i).Value.ToString
1478
-                                                        If GHJK = "" Then : MsgBox("驗貨報告不齊全,請重新確認。") : Set_搜尋() : 天盾訂單號_tb.Text = "" : TextBox7.Text = "" : Exit Sub : End If
1490
+                                                        If GHJK = "" Or Strings.Left(GHJK, 1) = "-" Or Strings.Right(GHJK, 1) = "-" Then
1491
+                                                            MsgBox("驗貨報告不齊全,請重新確認。") : Set_搜尋() : 天盾訂單號_tb.Text = "" : TextBox7.Text = "" : Exit Sub
1492
+                                                        End If
1479 1493
                                                     Next
1480 1494
 
1481 1495
                                                     SQL_出貨流水號()
@@ -1520,7 +1534,7 @@ Public Class 訂單控制表
1520 1534
                                                                                             顏色, 楦型) 
1521 1535
                                                                 VALUES (N'" & 流水 & "', N'" & Strings.Left(計算_dgv.Rows(i).Cells("客戶交期").Value.ToString, 4) & "', N'" & Brand_tb.Text & "', 
1522 1536
                                                                         N'" & 工廠 & "', N'" & PA70 & "', N'" & 計算_dgv.Rows(i).Cells("力威訂單號").Value.ToString & "', N'" & 總雙數_tb.Text & "',
1523
-                                                                        N'" & EDRW & "', '0', '0', '0', N'" & 計算_dgv.Rows(i).Cells("客戶交期").Value.ToString & "', '', '', '', 
1537
+                                                                        N'" & EDRW & "', '0', '0', '0', N'" & Strings.Format(ACTUAL_ex_fty_dtp.Value, "yyyy/MM/dd") & "', '', '', '', 
1524 1538
                                                                         '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', N'" & 計算_dgv.Rows(i).Cells("形體號").Value.ToString & "', 
1525 1539
                                                                         N'" & 計算_dgv.Rows(i).Cells("顏色").Value.ToString & "', N'" & 計算_dgv.Rows(i).Cells("楦型").Value.ToString & "')"
1526 1540
                                                         CmdSet_For_dr()
@@ -1586,13 +1600,14 @@ Public Class 訂單控制表
1586 1600
         平均數 = 10000 / 資料數 : 最終數 += 平均數 : If 最終數 > 10000 Then : 最終數 = 10000 : End If : ProgressBar1.Value = 最終數
1587 1601
     End Sub
1588 1602
     Private Sub 批量出貨_bt_Click(sender As Object, e As EventArgs) Handles 批量出貨_bt.Click
1589
-        發票號碼編輯.ShowDialog()
1603
+        發票號碼編輯.ShowDialog() : Dim 筆數 As Integer
1590 1604
         If PA70 = "" Then : MessageBox.Show("沒有發輸入票號碼無法操作出貨!!") : Else
1591 1605
             aa = MsgBox("執行批量出貨之前需要在訂單控制表清單中先勾選要出貨的資料,請確定你已完成出貨資料選擇?", MsgBoxStyle.OkCancel)
1592 1606
             If aa = MsgBoxResult.Ok Then : Dim EDR, 總雙 As Integer : Dim 流水, 工廠, 客戶 As String : 流水 = "" : 工廠 = "" : 客戶 = ""
1593 1607
                 For I As Integer = 0 To 控制表_dgv.Rows.Count - 1
1594 1608
                     資料數 = 控制表_dgv.Rows.Count : 進度條()
1595
-                    If 控制表_dgv("選擇", I).Value = True And 控制表_dgv("驗貨報告圖片", I).Value.ToString <> "" Then
1609
+                    If 控制表_dgv("選擇", I).Value = True And 控制表_dgv("驗貨報告圖片", I).Value.ToString <> "" And Strings.Left(控制表_dgv("驗貨報告圖片", I).Value.ToString, 1) <> "-" And
1610
+                        Strings.Right(控制表_dgv("驗貨報告圖片", I).Value.ToString, 1) <> "-" Then : 筆數 += 1
1596 1611
                         '-------寫入貨款匯入出款明細表-----------------------------------------------------------------------------------------------------------
1597 1612
                         SQL_出貨流水號()
1598 1613
                         If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("貨款流水號").ToString, 8)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1
@@ -1635,14 +1650,14 @@ Public Class 訂單控制表
1635 1650
                                                             顏色, 楦型) 
1636 1651
                                 VALUES (N'" & 流水 & "', N'" & Strings.Left(控制表_dgv.Rows(I).Cells("客戶交期").Value.ToString, 4) & "', N'" & 客戶 & "', 
1637 1652
                                         N'" & 工廠 & "', N'" & PA70 & "', N'" & 控制表_dgv.Rows(I).Cells("力威訂單號").Value.ToString & "', N'" & 總雙 & "',
1638
-                                        N'" & 控制表_dgv.Rows(I).Cells("訂單數量").Value & "', '0', '0', '0', N'" & 控制表_dgv.Rows(I).Cells("客戶交期").Value.ToString & "', '', '', '', 
1653
+                                        N'" & 控制表_dgv.Rows(I).Cells("訂單數量").Value & "', '0', '0', '0', N'" & Strings.Format(ACTUAL_ex_fty_dtp.Value, "yyyy/MM/dd") & "', '', '', '', 
1639 1654
                                         '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', N'" & 控制表_dgv.Rows(I).Cells("形體號").Value.ToString & "', 
1640 1655
                                         N'" & 控制表_dgv.Rows(I).Cells("顏色").Value.ToString & "', N'" & 控制表_dgv.Rows(I).Cells("楦型").Value.ToString & "')"
1641 1656
                         CmdSet_For_dr()
1642 1657
                         conn.Close()
1643 1658
                     End If
1644 1659
                 Next : ProgressBar1.Value = 0 : 最終數 = 0
1645
-            End If : MsgBox("出貨資料作業完成") : 返回_bt.PerformClick()
1660
+            End If : MsgBox("出貨資料作業完成,共轉移 " & 筆數 & " 筆資料!!") : 返回_bt.PerformClick()
1646 1661
         End If
1647 1662
     End Sub
1648 1663
     Private Sub 清單全選_bt_Click(sender As Object, e As EventArgs) Handles 清單全選_bt.Click

+ 3
- 2
TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/訂單明細表.Designer.vb View File

@@ -201,12 +201,13 @@ Partial Class 訂單明細表
201 201
             Or System.Windows.Forms.AnchorStyles.Left) _
202 202
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
203 203
         Me.訂單明細表_gdv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
204
+        Me.訂單明細表_gdv.BackgroundColor = System.Drawing.Color.White
204 205
         Me.訂單明細表_gdv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
205
-        Me.訂單明細表_gdv.Location = New System.Drawing.Point(9, 299)
206
+        Me.訂單明細表_gdv.Location = New System.Drawing.Point(3, 299)
206 207
         Me.訂單明細表_gdv.Name = "訂單明細表_gdv"
207 208
         Me.訂單明細表_gdv.RowHeadersWidth = 5
208 209
         Me.訂單明細表_gdv.RowTemplate.Height = 24
209
-        Me.訂單明細表_gdv.Size = New System.Drawing.Size(1333, 334)
210
+        Me.訂單明細表_gdv.Size = New System.Drawing.Size(1347, 334)
210 211
         Me.訂單明細表_gdv.TabIndex = 328
211 212
         '
212 213
         'Label11

+ 4
- 9
TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/訂單明細表.vb View File

@@ -24,15 +24,10 @@ Public Class 訂單明細表
24 24
         訂單明細表_gdv.AllowUserToAddRows = False
25 25
         ConnOpen()
26 26
         If 明細判斷 = True Then
27
-            If WS = False Then
28
-                SQL_確認訂單明細表()
29
-            Else
30
-                SQL_確認訂單明細表1()
31
-
32
-            End If
33
-        ElseIf 明細判斷 = False Then
34
-            SQL_確認訂單明細表2()
35
-        End If
27
+            If WS = False Then : SQL2 = "ORDER BY   " & 訂單資料表(5) & ".資料流水號"
28
+            Else : SQL2 = "ORDER BY   " & 訂單資料表(5) & ".ProductName, " & 訂單資料表(5) & ".Color"
29
+            End If : SQL_確認訂單明細表()
30
+        ElseIf 明細判斷 = False Then : SQL_確認訂單明細表2() : End If
36 31
         列印用SQL = SQL1
37 32
         cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds) : 訂單明細表_gdv.DataSource = ds.Tables(0) : conn.Close()
38 33
     End Sub

+ 67
- 30
TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/量產訂單輸入.Designer.vb View File

@@ -22,10 +22,10 @@ Partial Class 量產訂單輸入
22 22
     '請勿使用程式碼編輯器進行修改。
23 23
     <System.Diagnostics.DebuggerStepThrough()>
24 24
     Private Sub InitializeComponent()
25
-        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
-        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
-        Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28
-        Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
25
+        Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
+        Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
+        Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28
+        Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29 29
         Me.資料庫選擇3_bt = New System.Windows.Forms.Button()
30 30
         Me.資料庫選擇2_bt = New System.Windows.Forms.Button()
31 31
         Me.資料庫選擇1_bt = New System.Windows.Forms.Button()
@@ -34,6 +34,7 @@ Partial Class 量產訂單輸入
34 34
         Me.天盾訂單號_tb = New System.Windows.Forms.TextBox()
35 35
         Me.Label5 = New System.Windows.Forms.Label()
36 36
         Me.Panel1 = New System.Windows.Forms.Panel()
37
+        Me.開啟明細_bt = New System.Windows.Forms.Button()
37 38
         Me.Vendor_Cb = New System.Windows.Forms.ComboBox()
38 39
         Me.清空2_bt = New System.Windows.Forms.Button()
39 40
         Me.清空1_bt = New System.Windows.Forms.Button()
@@ -144,6 +145,8 @@ Partial Class 量產訂單輸入
144 145
         Me.Label30 = New System.Windows.Forms.Label()
145 146
         Me.STYLE_N_tb = New System.Windows.Forms.TextBox()
146 147
         Me.Item2_cb = New System.Windows.Forms.ComboBox()
148
+        Me.Label31 = New System.Windows.Forms.Label()
149
+        Me.HTPID_cb = New System.Windows.Forms.ComboBox()
147 150
         CType(Me.訂單流水號_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
148 151
         Me.Panel1.SuspendLayout()
149 152
         Me.Panel2.SuspendLayout()
@@ -185,19 +188,19 @@ Partial Class 量產訂單輸入
185 188
         '
186 189
         '訂單流水號_dgv
187 190
         '
188
-        DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
189
-        Me.訂單流水號_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
191
+        DataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
192
+        Me.訂單流水號_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle5
190 193
         Me.訂單流水號_dgv.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
191 194
             Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
192 195
         Me.訂單流水號_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
193 196
         Me.訂單流水號_dgv.BackgroundColor = System.Drawing.Color.White
194
-        DataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control
195
-        DataGridViewCellStyle2.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
196
-        DataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText
197
-        DataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight
198
-        DataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText
199
-        DataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
200
-        Me.訂單流水號_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle2
197
+        DataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control
198
+        DataGridViewCellStyle6.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
199
+        DataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText
200
+        DataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight
201
+        DataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText
202
+        DataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
203
+        Me.訂單流水號_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle6
201 204
         Me.訂單流水號_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
202 205
         Me.訂單流水號_dgv.Location = New System.Drawing.Point(2, 64)
203 206
         Me.訂單流水號_dgv.Name = "訂單流水號_dgv"
@@ -237,6 +240,7 @@ Partial Class 量產訂單輸入
237 240
         Me.Panel1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
238 241
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
239 242
         Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
243
+        Me.Panel1.Controls.Add(Me.開啟明細_bt)
240 244
         Me.Panel1.Controls.Add(Me.Vendor_Cb)
241 245
         Me.Panel1.Controls.Add(Me.清空2_bt)
242 246
         Me.Panel1.Controls.Add(Me.清空1_bt)
@@ -307,6 +311,17 @@ Partial Class 量產訂單輸入
307 311
         Me.Panel1.Size = New System.Drawing.Size(1701, 232)
308 312
         Me.Panel1.TabIndex = 1380
309 313
         '
314
+        '開啟明細_bt
315
+        '
316
+        Me.開啟明細_bt.BackgroundImage = Global.天盾國際管理系統.My.Resources.Resources.tests
317
+        Me.開啟明細_bt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
318
+        Me.開啟明細_bt.ForeColor = System.Drawing.Color.Olive
319
+        Me.開啟明細_bt.Location = New System.Drawing.Point(103, 2)
320
+        Me.開啟明細_bt.Name = "開啟明細_bt"
321
+        Me.開啟明細_bt.Size = New System.Drawing.Size(50, 50)
322
+        Me.開啟明細_bt.TabIndex = 1670
323
+        Me.開啟明細_bt.UseVisualStyleBackColor = True
324
+        '
310 325
         'Vendor_Cb
311 326
         '
312 327
         Me.Vendor_Cb.FormattingEnabled = True
@@ -369,7 +384,7 @@ Partial Class 量產訂單輸入
369 384
         Me.刪除_bt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
370 385
         Me.刪除_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
371 386
         Me.刪除_bt.ForeColor = System.Drawing.Color.Blue
372
-        Me.刪除_bt.Location = New System.Drawing.Point(148, 2)
387
+        Me.刪除_bt.Location = New System.Drawing.Point(163, 2)
373 388
         Me.刪除_bt.Name = "刪除_bt"
374 389
         Me.刪除_bt.Size = New System.Drawing.Size(50, 50)
375 390
         Me.刪除_bt.TabIndex = 1441
@@ -398,7 +413,7 @@ Partial Class 量產訂單輸入
398 413
         Me.存檔_tb.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
399 414
         Me.存檔_tb.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
400 415
         Me.存檔_tb.ForeColor = System.Drawing.Color.Blue
401
-        Me.存檔_tb.Location = New System.Drawing.Point(92, 2)
416
+        Me.存檔_tb.Location = New System.Drawing.Point(52, 2)
402 417
         Me.存檔_tb.Name = "存檔_tb"
403 418
         Me.存檔_tb.Size = New System.Drawing.Size(50, 50)
404 419
         Me.存檔_tb.TabIndex = 1440
@@ -429,7 +444,7 @@ Partial Class 量產訂單輸入
429 444
         Me.新增訂單_bt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
430 445
         Me.新增訂單_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
431 446
         Me.新增訂單_bt.ForeColor = System.Drawing.Color.Blue
432
-        Me.新增訂單_bt.Location = New System.Drawing.Point(36, 2)
447
+        Me.新增訂單_bt.Location = New System.Drawing.Point(2, 2)
433 448
         Me.新增訂單_bt.Name = "新增訂單_bt"
434 449
         Me.新增訂單_bt.Size = New System.Drawing.Size(50, 50)
435 450
         Me.新增訂單_bt.TabIndex = 1439
@@ -948,8 +963,8 @@ Partial Class 量產訂單輸入
948 963
         '
949 964
         '明細表_dgv
950 965
         '
951
-        DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
952
-        Me.明細表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
966
+        DataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
967
+        Me.明細表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle7
953 968
         Me.明細表_dgv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
954 969
             Or System.Windows.Forms.AnchorStyles.Left) _
955 970
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -965,8 +980,8 @@ Partial Class 量產訂單輸入
965 980
         '
966 981
         '控制表_dgv
967 982
         '
968
-        DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
969
-        Me.控制表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4
983
+        DataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
984
+        Me.控制表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle8
970 985
         Me.控制表_dgv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
971 986
             Or System.Windows.Forms.AnchorStyles.Left) _
972 987
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -1234,7 +1249,7 @@ Partial Class 量產訂單輸入
1234 1249
         'Item_cb
1235 1250
         '
1236 1251
         Me.Item_cb.FormattingEnabled = True
1237
-        Me.Item_cb.Location = New System.Drawing.Point(1241, 236)
1252
+        Me.Item_cb.Location = New System.Drawing.Point(1236, 236)
1238 1253
         Me.Item_cb.Name = "Item_cb"
1239 1254
         Me.Item_cb.Size = New System.Drawing.Size(61, 24)
1240 1255
         Me.Item_cb.TabIndex = 1459
@@ -1242,7 +1257,7 @@ Partial Class 量產訂單輸入
1242 1257
         'Label28
1243 1258
         '
1244 1259
         Me.Label28.AutoSize = True
1245
-        Me.Label28.Location = New System.Drawing.Point(1207, 241)
1260
+        Me.Label28.Location = New System.Drawing.Point(1202, 241)
1246 1261
         Me.Label28.Name = "Label28"
1247 1262
         Me.Label28.Size = New System.Drawing.Size(32, 16)
1248 1263
         Me.Label28.TabIndex = 1458
@@ -1251,7 +1266,7 @@ Partial Class 量產訂單輸入
1251 1266
         'PD_cb
1252 1267
         '
1253 1268
         Me.PD_cb.FormattingEnabled = True
1254
-        Me.PD_cb.Location = New System.Drawing.Point(1085, 261)
1269
+        Me.PD_cb.Location = New System.Drawing.Point(1080, 261)
1255 1270
         Me.PD_cb.Name = "PD_cb"
1256 1271
         Me.PD_cb.Size = New System.Drawing.Size(278, 24)
1257 1272
         Me.PD_cb.TabIndex = 1461
@@ -1259,7 +1274,7 @@ Partial Class 量產訂單輸入
1259 1274
         'Label29
1260 1275
         '
1261 1276
         Me.Label29.AutoSize = True
1262
-        Me.Label29.Location = New System.Drawing.Point(1082, 241)
1277
+        Me.Label29.Location = New System.Drawing.Point(1077, 241)
1263 1278
         Me.Label29.Name = "Label29"
1264 1279
         Me.Label29.Size = New System.Drawing.Size(118, 16)
1265 1280
         Me.Label29.TabIndex = 1460
@@ -1279,7 +1294,7 @@ Partial Class 量產訂單輸入
1279 1294
         Me.帶入資料_bt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
1280 1295
         Me.帶入資料_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1281 1296
         Me.帶入資料_bt.ForeColor = System.Drawing.Color.Blue
1282
-        Me.帶入資料_bt.Location = New System.Drawing.Point(1421, 235)
1297
+        Me.帶入資料_bt.Location = New System.Drawing.Point(1554, 235)
1283 1298
         Me.帶入資料_bt.Name = "帶入資料_bt"
1284 1299
         Me.帶入資料_bt.Size = New System.Drawing.Size(50, 50)
1285 1300
         Me.帶入資料_bt.TabIndex = 1463
@@ -1313,7 +1328,7 @@ Partial Class 量產訂單輸入
1313 1328
         Me.刪除單筆_bt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
1314 1329
         Me.刪除單筆_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1315 1330
         Me.刪除單筆_bt.ForeColor = System.Drawing.Color.Blue
1316
-        Me.刪除單筆_bt.Location = New System.Drawing.Point(1477, 235)
1331
+        Me.刪除單筆_bt.Location = New System.Drawing.Point(1610, 235)
1317 1332
         Me.刪除單筆_bt.Name = "刪除單筆_bt"
1318 1333
         Me.刪除單筆_bt.Size = New System.Drawing.Size(50, 50)
1319 1334
         Me.刪除單筆_bt.TabIndex = 1443
@@ -1325,7 +1340,7 @@ Partial Class 量產訂單輸入
1325 1340
         Me.新增訂單明細_bt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
1326 1341
         Me.新增訂單明細_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
1327 1342
         Me.新增訂單明細_bt.ForeColor = System.Drawing.Color.Blue
1328
-        Me.新增訂單明細_bt.Location = New System.Drawing.Point(1365, 235)
1343
+        Me.新增訂單明細_bt.Location = New System.Drawing.Point(1498, 235)
1329 1344
         Me.新增訂單明細_bt.Name = "新增訂單明細_bt"
1330 1345
         Me.新增訂單明細_bt.Size = New System.Drawing.Size(50, 50)
1331 1346
         Me.新增訂單明細_bt.TabIndex = 1442
@@ -1346,7 +1361,7 @@ Partial Class 量產訂單輸入
1346 1361
         'Label30
1347 1362
         '
1348 1363
         Me.Label30.AutoSize = True
1349
-        Me.Label30.Location = New System.Drawing.Point(1004, 240)
1364
+        Me.Label30.Location = New System.Drawing.Point(1001, 240)
1350 1365
         Me.Label30.Name = "Label30"
1351 1366
         Me.Label30.Size = New System.Drawing.Size(52, 16)
1352 1367
         Me.Label30.TabIndex = 1464
@@ -1355,7 +1370,7 @@ Partial Class 量產訂單輸入
1355 1370
         'STYLE_N_tb
1356 1371
         '
1357 1372
         Me.STYLE_N_tb.ForeColor = System.Drawing.Color.Black
1358
-        Me.STYLE_N_tb.Location = New System.Drawing.Point(1002, 262)
1373
+        Me.STYLE_N_tb.Location = New System.Drawing.Point(999, 262)
1359 1374
         Me.STYLE_N_tb.Name = "STYLE_N_tb"
1360 1375
         Me.STYLE_N_tb.Size = New System.Drawing.Size(79, 23)
1361 1376
         Me.STYLE_N_tb.TabIndex = 1465
@@ -1363,16 +1378,35 @@ Partial Class 量產訂單輸入
1363 1378
         'Item2_cb
1364 1379
         '
1365 1380
         Me.Item2_cb.FormattingEnabled = True
1366
-        Me.Item2_cb.Location = New System.Drawing.Point(1302, 236)
1381
+        Me.Item2_cb.Location = New System.Drawing.Point(1297, 236)
1367 1382
         Me.Item2_cb.Name = "Item2_cb"
1368 1383
         Me.Item2_cb.Size = New System.Drawing.Size(61, 24)
1369 1384
         Me.Item2_cb.TabIndex = 1466
1370 1385
         '
1386
+        'Label31
1387
+        '
1388
+        Me.Label31.AutoSize = True
1389
+        Me.Label31.Location = New System.Drawing.Point(1362, 240)
1390
+        Me.Label31.Name = "Label31"
1391
+        Me.Label31.Size = New System.Drawing.Size(31, 16)
1392
+        Me.Label31.TabIndex = 1467
1393
+        Me.Label31.Text = "........"
1394
+        '
1395
+        'HTPID_cb
1396
+        '
1397
+        Me.HTPID_cb.FormattingEnabled = True
1398
+        Me.HTPID_cb.Location = New System.Drawing.Point(1360, 261)
1399
+        Me.HTPID_cb.Name = "HTPID_cb"
1400
+        Me.HTPID_cb.Size = New System.Drawing.Size(132, 24)
1401
+        Me.HTPID_cb.TabIndex = 1469
1402
+        '
1371 1403
         '量產訂單輸入
1372 1404
         '
1373 1405
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
1374 1406
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
1375 1407
         Me.ClientSize = New System.Drawing.Size(1914, 966)
1408
+        Me.Controls.Add(Me.HTPID_cb)
1409
+        Me.Controls.Add(Me.Label31)
1376 1410
         Me.Controls.Add(Me.Item2_cb)
1377 1411
         Me.Controls.Add(Me.STYLE_N_tb)
1378 1412
         Me.Controls.Add(Me.Label30)
@@ -1547,4 +1581,7 @@ Partial Class 量產訂單輸入
1547 1581
     Friend WithEvents STYLE_N_tb As TextBox
1548 1582
     Friend WithEvents Vendor_Cb As ComboBox
1549 1583
     Friend WithEvents Item2_cb As ComboBox
1584
+    Friend WithEvents Label31 As Label
1585
+    Friend WithEvents 開啟明細_bt As Button
1586
+    Friend WithEvents HTPID_cb As ComboBox
1550 1587
 End Class

+ 20
- 18
TENDEN-MES-SYS/4、量產訂單管理/量產訂單系統/量產訂單輸入.vb View File

@@ -83,11 +83,11 @@ Public Class 量產訂單輸入
83 83
         明細表_dgv.EditMode = DataGridViewEditMode.EditOnEnter
84 84
         明細表_dgv.Columns("天盾流水號").Visible = False : 明細表_dgv.Columns("客戶訂單號").Visible = False : 明細表_dgv.Columns("Item2").FillWeight = 45
85 85
         明細表_dgv.Columns("Item").FillWeight = 45 : 明細表_dgv.Columns("ProductName").FillWeight = 90 : 明細表_dgv.Columns("ProductDescription").FillWeight = 190
86
-        明細表_dgv.Columns("Color").FillWeight = 80 : 明細表_dgv.Columns("DM").FillWeight = 70
87
-        For i As Integer = 8 To 26 : 明細表_dgv.Columns(i).FillWeight = 40 : Next
88
-        For i As Integer = 2 To 26 : 明細表_dgv.Columns(i).DefaultCellStyle.Format = "#,##0" : 明細表_dgv.Columns(i).ReadOnly = False : Next
89
-        明細表_dgv.Columns(26).FillWeight = 60 : 明細表_dgv.Columns(26).ReadOnly = True : 明細表_dgv.Columns(4).ReadOnly = True : 明細表_dgv.Columns(6).ReadOnly = True
90
-        明細表_dgv.Columns(7).ReadOnly = True
86
+        明細表_dgv.Columns("Color").FillWeight = 80 : 明細表_dgv.Columns("DM").FillWeight = 70 : 明細表_dgv.Columns(4).FillWeight = 100
87
+        For i As Integer = 9 To 27 : 明細表_dgv.Columns(i).FillWeight = 40 : Next
88
+        For i As Integer = 2 To 27 : 明細表_dgv.Columns(i).DefaultCellStyle.Format = "#,##0" : 明細表_dgv.Columns(i).ReadOnly = False : Next
89
+        明細表_dgv.Columns(27).FillWeight = 60 : 明細表_dgv.Columns(27).ReadOnly = True : 明細表_dgv.Columns(5).ReadOnly = True : 明細表_dgv.Columns(7).ReadOnly = True
90
+        明細表_dgv.Columns(8).ReadOnly = True
91 91
 
92 92
         If 明細表_dgv.Rows.Count > 0 Then
93 93
             If PP1 <> "" Then : PP1 = "" : C2下拉表單資料載入() : End If : If PP2 <> "" Then : PP2 = "" : C3下拉表單資料載入() : End If
@@ -117,6 +117,7 @@ Public Class 量產訂單輸入
117 117
     Private Sub C1下拉表單資料載入()
118 118
         SQL_Item_下拉() : Item_cb.Items.Clear() : While (dr.Read()) : Item_cb.Items.Add(dr("ItemNumber")) : End While
119 119
         SQL_Item2_下拉() : Item2_cb.Items.Clear() : While (dr.Read()) : Item2_cb.Items.Add(dr("裝箱")) : End While
120
+        SQL_Item3_下拉() : HTPID_cb.Items.Clear() : While (dr.Read()) : HTPID_cb.Items.Add(dr("ProductID")) : End While
120 121
     End Sub
121 122
     Private Sub C2下拉表單資料載入()
122 123
         ConnOpen()
@@ -151,6 +152,7 @@ Public Class 量產訂單輸入
151 152
         第一頁_bt.Enabled = False : 第二頁_bt.Enabled = True : 第三頁_bt.Enabled = True : 第四頁_bt.Enabled = True : 第五頁_bt.Enabled = True : 第六頁_bt.Enabled = True
152 153
         第七頁_bt.Enabled = True : 第八頁_bt.Enabled = True : 第九頁_bt.Enabled = True : 第十頁_bt.Enabled = True
153 154
         訂單資料庫選擇.ShowDialog()
155
+        If Strings.Right(訂單資料表(5), 2) = "HP" Then : Label31.Text = "HTS#" : Else : Label31.Text = "ProductID" : End If
154 156
     End Sub
155 157
     Private Sub 量產訂單輸入_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
156 158
         日期4_dtp.Format = DateTimePickerFormat.Custom : 日期4_dtp.CustomFormat = " "
@@ -207,7 +209,7 @@ Public Class 量產訂單輸入
207 209
             風格_cb.Text = 控制表_dgv.Rows(e.RowIndex).Cells("形體號").Value.ToString : 顏色_cb.Text = 控制表_dgv.Rows(e.RowIndex).Cells("顏色").Value.ToString
208 210
             DM_cb.Text = 控制表_dgv.Rows(e.RowIndex).Cells("楦型").Value.ToString : Item_cb.Text = 明細表_dgv.Rows(e.RowIndex).Cells("Item").Value.ToString
209 211
             PD_cb.Text = 明細表_dgv.Rows(e.RowIndex).Cells("ProductDescription").Value.ToString : DIV_cb.Text = 控制表_dgv.Rows(e.RowIndex).Cells("訂單種類").Value.ToString
210
-            Item2_cb.Text = 明細表_dgv.Rows(e.RowIndex).Cells("Item2").Value.ToString
212
+            Item2_cb.Text = 明細表_dgv.Rows(e.RowIndex).Cells("Item2").Value.ToString : HTPID_cb.Text = 明細表_dgv.Rows(e.RowIndex).Cells(4).Value.ToString
211 213
         End If
212 214
     End Sub
213 215
     Private Sub 明細表_dgv_CellEndEdit(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 明細表_dgv.CellEndEdit
@@ -366,13 +368,13 @@ Public Class 量產訂單輸入
366 368
         修改清單(6) = False : 修改清單(7) = False : 修改清單(8) = False : 修改清單(9) = False : 修改清單(10) = True : 修改清單(11) = False : 清單修改.Show() : 下拉表單資料載入()
367 369
     End Sub
368 370
     Private Sub 資料庫選擇1_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇1_bt.Click
369
-        SQL_訂單資料表選擇_VIONIC() : Set_已建檔清單()
371
+        SQL_訂單資料表選擇_VIONIC() : Set_已建檔清單() : If Strings.Right(訂單資料表(5), 2) = "HP" Then : Label31.Text = "HTS#" : Else : Label31.Text = "ProductID" : End If
370 372
     End Sub
371 373
     Private Sub 資料庫選擇2_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇2_bt.Click
372
-        SQL_訂單資料表選擇_DRS() : Set_已建檔清單()
374
+        SQL_訂單資料表選擇_DRS() : Set_已建檔清單() : If Strings.Right(訂單資料表(5), 2) = "HP" Then : Label31.Text = "HTS#" : Else : Label31.Text = "ProductID" : End If
373 375
     End Sub
374 376
     Private Sub 資料庫選擇3_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇3_bt.Click
375
-        SQL_訂單資料表選擇_HP() : Set_已建檔清單()
377
+        SQL_訂單資料表選擇_HP() : Set_已建檔清單() : If Strings.Right(訂單資料表(5), 2) = "HP" Then : Label31.Text = "HTS#" : Else : Label31.Text = "ProductID" : End If
376 378
     End Sub
377 379
     Private Sub 比對關鍵字_bt_Click(sender As Object, e As EventArgs) Handles 比對關鍵字_bt.Click
378 380
         查詢DGV中的關鍵字(訂單流水號_dgv, PO號_tb)
@@ -443,7 +445,7 @@ Public Class 量產訂單輸入
443 445
         PA7 = Strings.Format(日期_dtp.Value, "yyyy/MM/dd") : PA10 = Strings.Format(日期6_dtp.Value, "yyyy/MM/dd")
444 446
         For i As Integer = 0 To 控制表_dgv.Rows.Count - 1
445 447
             PA5 = 控制表_dgv.Rows(i).Cells("顏色").Value.ToString : PA6 = 控制表_dgv.Rows(i).Cells("楦型").Value.ToString : PA16 = 控制表_dgv.Rows(i).Cells("訂單數量").Value.ToString
446
-            PA13 = 控制表_dgv.Rows(i).Cells("資料流水號").Value.ToString : PA35 = 控制表_dgv.Rows(i).Cells("STYLE #").Value.ToString
448
+            PA13 = 控制表_dgv.Rows(i).Cells("資料流水號").Value.ToString : PA35 = 控制表_dgv.Rows(i).Cells("STYLE #").Value.ToString : PA36 = 明細表_dgv.Rows(i).Cells(4).Value.ToString()
447 449
             PA = 明細表_dgv.Rows(i).Cells("Item2").Value.ToString()
448 450
             PA12 = 明細表_dgv.Rows(i).Cells("Item").Value.ToString() : PA14 = 明細表_dgv.Rows(i).Cells("ProductDescription").Value.ToString()
449 451
             PA17 = 明細表_dgv.Rows(i).Cells("5").Value.ToString() : PA18 = 明細表_dgv.Rows(i).Cells("5.5").Value.ToString() : PA19 = 明細表_dgv.Rows(i).Cells("6").Value.ToString()
@@ -527,13 +529,10 @@ Public Class 量產訂單輸入
527 529
     Private Sub 帶入資料_bt_Click(sender As Object, e As EventArgs) Handles 帶入資料_bt.Click
528 530
         For i As Integer = 0 To 控制表_dgv.Rows.Count - 1
529 531
             If 資料流水號_tb.Text = 控制表_dgv.Rows(i).Cells("資料流水號").Value.ToString() Then
530
-                控制表_dgv.Rows(i).Cells("顏色").Value = 顏色_cb.Text
531
-                控制表_dgv.Rows(i).Cells("楦型").Value = DM_cb.Text
532
-                明細表_dgv.Rows(i).Cells("Item").Value = Item_cb.Text
533
-                明細表_dgv.Rows(i).Cells("Item2").Value = Item2_cb.Text
534
-                明細表_dgv.Rows(i).Cells("ProductDescription").Value = PD_cb.Text
535
-                明細表_dgv.Rows(i).Cells("Color").Value = 顏色_cb.Text
536
-                明細表_dgv.Rows(i).Cells("DM").Value = DM_cb.Text
532
+                控制表_dgv.Rows(i).Cells("顏色").Value = 顏色_cb.Text : 控制表_dgv.Rows(i).Cells("楦型").Value = DM_cb.Text
533
+                明細表_dgv.Rows(i).Cells("Item").Value = Item_cb.Text : 明細表_dgv.Rows(i).Cells("Item2").Value = Item2_cb.Text
534
+                明細表_dgv.Rows(i).Cells("ProductDescription").Value = PD_cb.Text : 明細表_dgv.Rows(i).Cells("Color").Value = 顏色_cb.Text
535
+                明細表_dgv.Rows(i).Cells("DM").Value = DM_cb.Text : 明細表_dgv.Rows(i).Cells(4).Value = HTPID_cb.Text
537 536
             End If
538 537
         Next
539 538
     End Sub
@@ -557,7 +556,7 @@ Public Class 量產訂單輸入
557 556
         For i As Integer = 0 To 控制表_dgv.Rows.Count - 1 : 控制表_dgv.Rows(i).Cells("生產工廠").Value = FTY_cb.Text : Next
558 557
     End Sub
559 558
     Private Sub 力威訂單號_tb_TextChanged(sender As Object, e As EventArgs) Handles 力威訂單號_tb.TextChanged
560
-        For i As Integer = 0 To 控制表_dgv.Rows.Count - 1 : 控制表_dgv.Rows(i).Cells("力威訂單號").Value = 力威訂單號_tb.Text : Next
559
+        For i As Integer = 0 To 控制表_dgv.Rows.Count - 1 : 控制表_dgv.Rows(i).Cells("客人訂單號").Value = 力威訂單號_tb.Text : Next
561 560
     End Sub
562 561
     Private Sub 日期_dtp_ValueChanged(sender As Object, e As EventArgs) Handles 日期_dtp.ValueChanged
563 562
         For i As Integer = 0 To 控制表_dgv.Rows.Count - 1
@@ -584,4 +583,7 @@ Public Class 量產訂單輸入
584 583
     Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles STYLE_N_tb.TextChanged
585 584
         For i As Integer = 0 To 控制表_dgv.Rows.Count - 1 : 控制表_dgv.Rows(i).Cells("STYLE #").Value = STYLE_N_tb.Text : Next
586 585
     End Sub
586
+    Private Sub 開啟明細_bt_Click(sender As Object, e As EventArgs) Handles 開啟明細_bt.Click
587
+        PA = 天盾訂單號_tb.Text : 訂單明細表.Show()
588
+    End Sub
587 589
 End Class

+ 47
- 11
TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告圖片導入資料庫.Designer.vb View File

@@ -22,7 +22,6 @@ Partial Class 驗貨報告圖片導入資料庫
22 22
     '請勿使用程式碼編輯器進行修改。
23 23
     <System.Diagnostics.DebuggerStepThrough()>
24 24
     Private  Sub InitializeComponent()
25
-        Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26 25
         Me.訂單清單_dgv = New System.Windows.Forms.DataGridView()
27 26
         Me.型體名稱_lb = New System.Windows.Forms.Label()
28 27
         Me.客戶訂單號_lb = New System.Windows.Forms.Label()
@@ -51,6 +50,9 @@ Partial Class 驗貨報告圖片導入資料庫
51 50
         Me.資料庫選擇3_bt = New System.Windows.Forms.Button()
52 51
         Me.TextBox1 = New System.Windows.Forms.TextBox()
53 52
         Me.Panel1 = New System.Windows.Forms.Panel()
53
+        Me.驗報編碼_tb = New System.Windows.Forms.TextBox()
54
+        Me.圖編2_tb = New System.Windows.Forms.TextBox()
55
+        Me.圖編1_tb = New System.Windows.Forms.TextBox()
54 56
         Me.副檔名_bt = New System.Windows.Forms.TextBox()
55 57
         Me.資料流水號_tb = New System.Windows.Forms.TextBox()
56 58
         Me.確認儲存1_bt = New System.Windows.Forms.Button()
@@ -61,8 +63,6 @@ Partial Class 驗貨報告圖片導入資料庫
61 63
         '
62 64
         '訂單清單_dgv
63 65
         '
64
-        DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
65
-        Me.訂單清單_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
66 66
         Me.訂單清單_dgv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
67 67
             Or System.Windows.Forms.AnchorStyles.Left) _
68 68
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -149,7 +149,7 @@ Partial Class 驗貨報告圖片導入資料庫
149 149
         Me.確認儲存_bt.Name = "確認儲存_bt"
150 150
         Me.確認儲存_bt.Size = New System.Drawing.Size(89, 52)
151 151
         Me.確認儲存_bt.TabIndex = 535
152
-        Me.確認儲存_bt.Text = "確認儲存" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "驗貨報告(舊)"
152
+        Me.確認儲存_bt.Text = "確認儲存" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "天盾QC版"
153 153
         Me.確認儲存_bt.UseVisualStyleBackColor = True
154 154
         '
155 155
         '驗貨日期_dtp
@@ -173,7 +173,7 @@ Partial Class 驗貨報告圖片導入資料庫
173 173
         '
174 174
         Me.TextBox3.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
175 175
         Me.TextBox3.ForeColor = System.Drawing.Color.Black
176
-        Me.TextBox3.Location = New System.Drawing.Point(21, 41)
176
+        Me.TextBox3.Location = New System.Drawing.Point(5, 33)
177 177
         Me.TextBox3.Name = "TextBox3"
178 178
         Me.TextBox3.Size = New System.Drawing.Size(149, 23)
179 179
         Me.TextBox3.TabIndex = 538
@@ -195,7 +195,7 @@ Partial Class 驗貨報告圖片導入資料庫
195 195
         Me.TextBox7.AllowDrop = True
196 196
         Me.TextBox7.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
197 197
         Me.TextBox7.ForeColor = System.Drawing.Color.Black
198
-        Me.TextBox7.Location = New System.Drawing.Point(21, 12)
198
+        Me.TextBox7.Location = New System.Drawing.Point(5, 8)
199 199
         Me.TextBox7.Multiline = True
200 200
         Me.TextBox7.Name = "TextBox7"
201 201
         Me.TextBox7.Size = New System.Drawing.Size(149, 23)
@@ -318,7 +318,7 @@ Partial Class 驗貨報告圖片導入資料庫
318 318
         '
319 319
         Me.TextBox1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
320 320
         Me.TextBox1.ForeColor = System.Drawing.Color.Black
321
-        Me.TextBox1.Location = New System.Drawing.Point(21, 70)
321
+        Me.TextBox1.Location = New System.Drawing.Point(5, 58)
322 322
         Me.TextBox1.Name = "TextBox1"
323 323
         Me.TextBox1.Size = New System.Drawing.Size(149, 23)
324 324
         Me.TextBox1.TabIndex = 1637
@@ -333,14 +333,44 @@ Partial Class 驗貨報告圖片導入資料庫
333 333
         Me.Panel1.Controls.Add(Me.TextBox3)
334 334
         Me.Panel1.Location = New System.Drawing.Point(389, 103)
335 335
         Me.Panel1.Name = "Panel1"
336
-        Me.Panel1.Size = New System.Drawing.Size(189, 171)
336
+        Me.Panel1.Size = New System.Drawing.Size(160, 210)
337 337
         Me.Panel1.TabIndex = 1638
338 338
         '
339
+        '驗報編碼_tb
340
+        '
341
+        Me.驗報編碼_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
342
+        Me.驗報編碼_tb.ForeColor = System.Drawing.Color.Black
343
+        Me.驗報編碼_tb.Location = New System.Drawing.Point(1027, 52)
344
+        Me.驗報編碼_tb.Name = "驗報編碼_tb"
345
+        Me.驗報編碼_tb.Size = New System.Drawing.Size(94, 23)
346
+        Me.驗報編碼_tb.TabIndex = 1642
347
+        Me.驗報編碼_tb.Visible = False
348
+        '
349
+        '圖編2_tb
350
+        '
351
+        Me.圖編2_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
352
+        Me.圖編2_tb.ForeColor = System.Drawing.Color.Black
353
+        Me.圖編2_tb.Location = New System.Drawing.Point(950, 53)
354
+        Me.圖編2_tb.Name = "圖編2_tb"
355
+        Me.圖編2_tb.Size = New System.Drawing.Size(71, 23)
356
+        Me.圖編2_tb.TabIndex = 1641
357
+        Me.圖編2_tb.Visible = False
358
+        '
359
+        '圖編1_tb
360
+        '
361
+        Me.圖編1_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
362
+        Me.圖編1_tb.ForeColor = System.Drawing.Color.Black
363
+        Me.圖編1_tb.Location = New System.Drawing.Point(950, 28)
364
+        Me.圖編1_tb.Name = "圖編1_tb"
365
+        Me.圖編1_tb.Size = New System.Drawing.Size(71, 23)
366
+        Me.圖編1_tb.TabIndex = 1640
367
+        Me.圖編1_tb.Visible = False
368
+        '
339 369
         '副檔名_bt
340 370
         '
341 371
         Me.副檔名_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
342 372
         Me.副檔名_bt.ForeColor = System.Drawing.Color.Black
343
-        Me.副檔名_bt.Location = New System.Drawing.Point(21, 128)
373
+        Me.副檔名_bt.Location = New System.Drawing.Point(5, 108)
344 374
         Me.副檔名_bt.Name = "副檔名_bt"
345 375
         Me.副檔名_bt.Size = New System.Drawing.Size(149, 23)
346 376
         Me.副檔名_bt.TabIndex = 1639
@@ -350,7 +380,7 @@ Partial Class 驗貨報告圖片導入資料庫
350 380
         '
351 381
         Me.資料流水號_tb.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
352 382
         Me.資料流水號_tb.ForeColor = System.Drawing.Color.Black
353
-        Me.資料流水號_tb.Location = New System.Drawing.Point(21, 99)
383
+        Me.資料流水號_tb.Location = New System.Drawing.Point(5, 83)
354 384
         Me.資料流水號_tb.Name = "資料流水號_tb"
355 385
         Me.資料流水號_tb.Size = New System.Drawing.Size(149, 23)
356 386
         Me.資料流水號_tb.TabIndex = 1638
@@ -364,7 +394,7 @@ Partial Class 驗貨報告圖片導入資料庫
364 394
         Me.確認儲存1_bt.Name = "確認儲存1_bt"
365 395
         Me.確認儲存1_bt.Size = New System.Drawing.Size(89, 52)
366 396
         Me.確認儲存1_bt.TabIndex = 1639
367
-        Me.確認儲存1_bt.Text = "確認儲存" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "驗貨報告(新)"
397
+        Me.確認儲存1_bt.Text = "確認儲存" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "客人版"
368 398
         Me.確認儲存1_bt.UseVisualStyleBackColor = True
369 399
         '
370 400
         '驗貨報告圖片導入資料庫
@@ -372,8 +402,11 @@ Partial Class 驗貨報告圖片導入資料庫
372 402
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
373 403
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
374 404
         Me.ClientSize = New System.Drawing.Size(1350, 701)
405
+        Me.Controls.Add(Me.驗報編碼_tb)
375 406
         Me.Controls.Add(Me.確認儲存1_bt)
407
+        Me.Controls.Add(Me.圖編2_tb)
376 408
         Me.Controls.Add(Me.Panel1)
409
+        Me.Controls.Add(Me.圖編1_tb)
377 410
         Me.Controls.Add(Me.資料庫選擇3_bt)
378 411
         Me.Controls.Add(Me.字體_NUD)
379 412
         Me.Controls.Add(Me.字體大小調整_lb)
@@ -440,5 +473,8 @@ Partial Class 驗貨報告圖片導入資料庫
440 473
     Friend WithEvents 資料流水號_tb As TextBox
441 474
     Friend WithEvents 副檔名_bt As TextBox
442 475
     Friend WithEvents 確認儲存1_bt As Button
476
+    Friend WithEvents 圖編2_tb As TextBox
477
+    Friend WithEvents 圖編1_tb As TextBox
478
+    Friend WithEvents 驗報編碼_tb As TextBox
443 479
 End Class
444 480
 

+ 33
- 12
TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告圖片導入資料庫.vb View File

@@ -10,21 +10,23 @@ Public Class 驗貨報告圖片導入資料庫
10 10
         訂單清單_dgv.AllowUserToAddRows = False : ConnOpen()
11 11
     End Sub
12 12
     Private Sub Set_DGV1載入後設定()
13
-        CmdSet_For_DGV() :: da.Fill(ds) : 訂單清單_dgv.DataSource = ds.Tables(0) : conn.Close()
13
+        CmdSet_For_DGV() : da.Fill(ds) : 訂單清單_dgv.DataSource = ds.Tables(0) : conn.Close() : Set_grid1()
14 14
     End Sub
15 15
     Private Sub Set_清單1()
16 16
         Set_DGV1載入前設定() : SQL_訂單清單() : Set_DGV1載入後設定()
17 17
     End Sub
18 18
     Private Sub Set_grid1()
19
-        訂單清單_dgv.Columns(0).FillWeight = 80 : 訂單清單_dgv.Columns(1).FillWeight = 70 : 訂單清單_dgv.Columns(2).FillWeight = 120 : 訂單清單_dgv.Columns(3).FillWeight = 140
20
-        訂單清單_dgv.Columns(4).FillWeight = 100 : 訂單清單_dgv.Columns(5).FillWeight = 80 : 訂單清單_dgv.Columns(6).FillWeight = 100 : 訂單清單_dgv.Columns(7).FillWeight = 100
21
-        訂單清單_dgv.Columns(8).FillWeight = 100 : 訂單清單_dgv.Columns(9).Visible = False : 訂單清單_dgv.Columns(10).Visible = False : 訂單清單_dgv.Columns("資料流水號").Visible = False
22
-        訂單清單_dgv.Columns("訂單數量").DefaultCellStyle.Format = "#,##0" : 訂單清單_dgv.Columns("力威訂單號").Visible = False
19
+        訂單清單_dgv.Columns(0).FillWeight = 80 : 訂單清單_dgv.Columns(1).FillWeight = 70 : 訂單清單_dgv.Columns(2).FillWeight = 120 : 訂單清單_dgv.Columns(3).FillWeight = 120
20
+        訂單清單_dgv.Columns(4).FillWeight = 140 : 訂單清單_dgv.Columns(5).FillWeight = 100 : 訂單清單_dgv.Columns(6).FillWeight = 80 : 訂單清單_dgv.Columns(7).FillWeight = 100
21
+        訂單清單_dgv.Columns(8).FillWeight = 100 : 訂單清單_dgv.Columns(9).FillWeight = 100
22
+        訂單清單_dgv.Columns(10).Visible = False : 訂單清單_dgv.Columns(11).Visible = False : 訂單清單_dgv.Columns("資料流水號").Visible = False
23
+        訂單清單_dgv.Columns("訂單數量").DefaultCellStyle.Format = "#,##0" : 訂單清單_dgv.Columns("針車時間").Visible = False : 訂單清單_dgv.Columns("備註").Visible = False
24
+        訂單清單_dgv.Columns("成型時間").Visible = False
23 25
     End Sub
24 26
     Private Sub 驗貨報告圖片導入資料庫_Load(sender As Object, e As EventArgs) Handles MyBase.Load
25 27
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
26 28
         訂單資料庫選擇.ShowDialog() : Target1 = Target & AA(3) & "/" : Panel1.SendToBack()
27
-        Set_清單1() : Set_grid1()
29
+        Set_清單1()
28 30
         TextBox3.Visible = False : TextBox7.Visible = False
29 31
         If FolderBrowserDialog1.ShowDialog = DialogResult.OK Then : WebBrowser2.Navigate(FolderBrowserDialog1.SelectedPath) : End If
30 32
         If TENDEN_MES_SYS.Size.Width > 1440 And TENDEN_MES_SYS.Size.Height > 900 Then : 字體_NUD.Value = 9
@@ -39,12 +41,27 @@ Public Class 驗貨報告圖片導入資料庫
39 41
     End Sub
40 42
     Private Sub 訂單清單_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 訂單清單_dgv.CellClick
41 43
         If e.RowIndex = -1 Then : Else
42
-            客戶訂單號_tb.Text = 訂單清單_dgv("力威訂單號", e.RowIndex).Value.ToString : 型體名稱_tb.Text = 訂單清單_dgv("形體號", e.RowIndex).Value.ToString
44
+            客戶訂單號_tb.Text = 訂單清單_dgv("客戶訂單號", e.RowIndex).Value.ToString : 型體名稱_tb.Text = 訂單清單_dgv("形體號", e.RowIndex).Value.ToString
43 45
             天盾訂單號_tb.Text = 訂單清單_dgv("訂單流水號", e.RowIndex).Value.ToString : 資料流水號_tb.Text = 訂單清單_dgv("資料流水號", e.RowIndex).Value.ToString
46
+            圖編1_tb.Text = 訂單清單_dgv("驗貨報告圖片", e.RowIndex).Value.ToString : 圖編2_tb.Text = 訂單清單_dgv("驗貨報告圖片2", e.RowIndex).Value.ToString
47
+        End If
48
+    End Sub
49
+    Private Sub 訂單清單_dgv_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 訂單清單_dgv.RowPostPaint
50
+        Dim linePen As New Pen(Color.Blue, 2)
51
+        If e.RowIndex = 訂單清單_dgv.Rows.Count - 1 Then
52
+            Exit Sub
53
+        Else
54
+            If 訂單清單_dgv(0, e.RowIndex).Value.ToString <> 訂單清單_dgv(0, e.RowIndex + 1).Value.ToString Then
55
+                Dim startX As Integer = IIf(訂單清單_dgv.RowHeadersVisible, 訂單清單_dgv.RowHeadersWidth, 0)
56
+                Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
57
+                Dim endX As Integer = startX + 訂單清單_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 訂單清單_dgv.HorizontalScrollingOffset
58
+                e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
59
+                Exit Sub
60
+            End If
44 61
         End If
45 62
     End Sub
46 63
     Private Sub 查詢_bt_Click(sender As Object, e As EventArgs) Handles 查詢_bt.Click
47
-        PA = InputBox("請輸入要查詢的資料") : Set_DGV1載入前設定() : SQL_訂單清單查詢() : Set_DGV1載入後設定() : Set_grid1() : PA = ""
64
+        PA = InputBox("請輸入要查詢的資料") : Set_DGV1載入前設定() : SQL_訂單清單查詢() : Set_DGV1載入後設定() : PA = ""
48 65
     End Sub
49 66
     Private Sub Button11_Click(sender As Object, e As EventArgs) Handles 確認儲存_bt.Click
50 67
         If 客戶訂單號_tb.Text = "" Or 型體名稱_tb.Text = "" Or 檔案名稱_tb.Text = "" Then : MsgBox("檔案名稱或資料不可空白") : Else
@@ -62,10 +79,12 @@ Public Class 驗貨報告圖片導入資料庫
62 79
             ElseIf NUM1 > 9999999 Then : TextBox3.Text = "IR" & NUM1 : End If
63 80
 
64 81
             If Strings.Right(TextBox1.Text, 3) = "pdf" Or Strings.Right(TextBox1.Text, 3) = "PDF" Then : 副檔名_bt.Text = "PDF" : Else : 副檔名_bt.Text = "" : End If
65
-            PA49 = TextBox1.Text : SQL_新增驗貨報告圖庫_正式() : conn.Close()
82
+            PA49 = TextBox1.Text
83
+            If 圖編1_tb.Text = "" Then : SQL_新增驗貨報告圖庫_正式() : conn.Close()
84
+            Else : 驗報編碼_tb.Text = 圖編1_tb.Text : TextBox3.Text = 圖編1_tb.Text : SQL_修改驗貨報告圖庫_正式() : End If
66 85
             DTP = Format(驗貨日期_dtp.Value, "yyyy/MM/dd") : SQL_修改驗貨報告圖庫() : conn.Close()
67 86
             '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
68
-            檔案名稱_tb.Text = "" : TextBox1.Text = "" : Set_清單1() : Set_grid1() : MsgBox("新增完成")
87
+            檔案名稱_tb.Text = "" : TextBox1.Text = "" : Set_清單1() : MsgBox("新增完成")
69 88
         End If
70 89
     End Sub
71 90
     Private Sub 確認儲存1_bt_Click(sender As Object, e As EventArgs) Handles 確認儲存1_bt.Click
@@ -84,10 +103,12 @@ Public Class 驗貨報告圖片導入資料庫
84 103
             ElseIf NUM1 > 9999999 Then : TextBox3.Text = "IR" & NUM1 : End If
85 104
 
86 105
             If Strings.Right(TextBox1.Text, 3) = "pdf" Or Strings.Right(TextBox1.Text, 3) = "PDF" Then : 副檔名_bt.Text = "PDF" : Else : 副檔名_bt.Text = "" : End If
87
-            PA49 = TextBox1.Text : SQL_新增驗貨報告圖庫_正式() : conn.Close()
106
+            PA49 = TextBox1.Text
107
+            If 圖編2_tb.Text = "" Then : SQL_新增驗貨報告圖庫_正式() : conn.Close()
108
+            Else : 驗報編碼_tb.Text = 圖編2_tb.Text : TextBox3.Text = 圖編2_tb.Text : SQL_修改驗貨報告圖庫_正式() : End If
88 109
             DTP = Format(驗貨日期_dtp.Value, "yyyy/MM/dd") : SQL_修改驗貨報告圖庫1() : conn.Close()
89 110
             '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
90
-            檔案名稱_tb.Text = "" : TextBox1.Text = "" : Set_清單1() : Set_grid1() : MsgBox("新增完成")
111
+            檔案名稱_tb.Text = "" : TextBox1.Text = "" : Set_清單1() : MsgBox("新增完成")
91 112
         End If
92 113
     End Sub
93 114
     Private Sub 檔案名稱_tb_DragEnter(sender As Object, e As DragEventArgs) Handles 檔案名稱_tb.DragEnter

+ 19
- 19
TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告資料庫.Designer.vb View File

@@ -22,8 +22,8 @@ Partial Class 驗貨報告資料庫
22 22
     '請勿使用程式碼編輯器進行修改。
23 23
     <System.Diagnostics.DebuggerStepThrough()>
24 24
     Private  Sub InitializeComponent()
25
-        Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
-        Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
25
+        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
+        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27 27
         Me.驗貨報告圖庫_dgv = New System.Windows.Forms.DataGridView()
28 28
         Me.驗貨報告編號_tb = New System.Windows.Forms.TextBox()
29 29
         Me.下載圖片_bt = New System.Windows.Forms.Button()
@@ -521,21 +521,21 @@ Partial Class 驗貨報告資料庫
521 521
         '
522 522
         '圖片資料庫管理_dgv
523 523
         '
524
-        DataGridViewCellStyle5.BackColor = System.Drawing.Color.White
525
-        Me.圖片資料庫管理_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle5
524
+        DataGridViewCellStyle1.BackColor = System.Drawing.Color.White
525
+        Me.圖片資料庫管理_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
526 526
         Me.圖片資料庫管理_dgv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
527 527
             Or System.Windows.Forms.AnchorStyles.Left) _
528 528
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
529 529
         Me.圖片資料庫管理_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
530 530
         Me.圖片資料庫管理_dgv.BackgroundColor = System.Drawing.Color.White
531
-        DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
532
-        DataGridViewCellStyle6.BackColor = System.Drawing.Color.White
533
-        DataGridViewCellStyle6.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
534
-        DataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText
535
-        DataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight
536
-        DataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText
537
-        DataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
538
-        Me.圖片資料庫管理_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle6
531
+        DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
532
+        DataGridViewCellStyle2.BackColor = System.Drawing.Color.White
533
+        DataGridViewCellStyle2.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
534
+        DataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText
535
+        DataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight
536
+        DataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText
537
+        DataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
538
+        Me.圖片資料庫管理_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle2
539 539
         Me.圖片資料庫管理_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
540 540
         Me.圖片資料庫管理_dgv.Location = New System.Drawing.Point(3, 29)
541 541
         Me.圖片資料庫管理_dgv.Name = "圖片資料庫管理_dgv"
@@ -565,11 +565,11 @@ Partial Class 驗貨報告資料庫
565 565
         '新版_ch
566 566
         '
567 567
         Me.新版_ch.AutoSize = True
568
-        Me.新版_ch.Location = New System.Drawing.Point(450, 7)
568
+        Me.新版_ch.Location = New System.Drawing.Point(541, 10)
569 569
         Me.新版_ch.Name = "新版_ch"
570
-        Me.新版_ch.Size = New System.Drawing.Size(50, 20)
570
+        Me.新版_ch.Size = New System.Drawing.Size(62, 20)
571 571
         Me.新版_ch.TabIndex = 1638
572
-        Me.新版_ch.Text = "版"
572
+        Me.新版_ch.Text = "客人版"
573 573
         Me.新版_ch.UseVisualStyleBackColor = True
574 574
         '
575 575
         '舊版_ch
@@ -577,11 +577,11 @@ Partial Class 驗貨報告資料庫
577 577
         Me.舊版_ch.AutoSize = True
578 578
         Me.舊版_ch.Checked = True
579 579
         Me.舊版_ch.CheckState = System.Windows.Forms.CheckState.Checked
580
-        Me.舊版_ch.Location = New System.Drawing.Point(506, 7)
580
+        Me.舊版_ch.Location = New System.Drawing.Point(459, 10)
581 581
         Me.舊版_ch.Name = "舊版_ch"
582
-        Me.舊版_ch.Size = New System.Drawing.Size(50, 20)
582
+        Me.舊版_ch.Size = New System.Drawing.Size(80, 20)
583 583
         Me.舊版_ch.TabIndex = 1639
584
-        Me.舊版_ch.Text = "版"
584
+        Me.舊版_ch.Text = "天盾QC版"
585 585
         Me.舊版_ch.UseVisualStyleBackColor = True
586 586
         '
587 587
         '驗貨報告資料庫
@@ -589,7 +589,6 @@ Partial Class 驗貨報告資料庫
589 589
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
590 590
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
591 591
         Me.ClientSize = New System.Drawing.Size(1422, 701)
592
-        Me.Controls.Add(Me.舊版_ch)
593 592
         Me.Controls.Add(Me.新版_ch)
594 593
         Me.Controls.Add(Me.資料庫選擇3_bt)
595 594
         Me.Controls.Add(Me.Label1)
@@ -599,6 +598,7 @@ Partial Class 驗貨報告資料庫
599 598
         Me.Controls.Add(Me.驗貨報告圖庫_dgv)
600 599
         Me.Controls.Add(Me.Panel2)
601 600
         Me.Controls.Add(Me.Panel1)
601
+        Me.Controls.Add(Me.舊版_ch)
602 602
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
603 603
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
604 604
         Me.Name = "驗貨報告資料庫"

+ 3
- 1
TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告資料庫.vb View File

@@ -65,11 +65,12 @@ Public Class 驗貨報告資料庫
65 65
     Private Sub 驗貨報告圖庫_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 驗貨報告圖庫_dgv.CellClick
66 66
         Try
67 67
             If e.RowIndex = -1 Then : Else
68
-                驗貨報告編號_tb.Text = 驗貨報告圖庫_dgv(5, e.RowIndex).Value.ToString : 年份季度_tb.Text = 驗貨報告圖庫_dgv(1, e.RowIndex).Value.ToString
68
+                年份季度_tb.Text = 驗貨報告圖庫_dgv(1, e.RowIndex).Value.ToString
69 69
                 客戶訂單號_tb.Text = 驗貨報告圖庫_dgv(2, e.RowIndex).Value.ToString : 型體名稱_tb.Text = 驗貨報告圖庫_dgv(3, e.RowIndex).Value.ToString
70 70
                 圖庫_tb.Text = 驗貨報告圖庫_dgv("驗報圖庫", e.RowIndex).Value.ToString
71 71
                 '------------驗貨報告讀取--------------------------------------------------------------------------------------------
72 72
                 If 舊版_ch.Checked = True Then
73
+                    驗貨報告編號_tb.Text = 驗貨報告圖庫_dgv("驗貨報告編號", e.RowIndex).Value.ToString
73 74
                     PA1 = 驗貨報告圖庫_dgv("驗報圖庫", e.RowIndex).Value.ToString : PA2 = 驗貨報告圖庫_dgv("驗貨報告編號", e.RowIndex).Value.ToString
74 75
                     If 驗貨報告圖庫_dgv("驗貨報告編號", e.RowIndex).Value.ToString = "" Then : 驗貨報告_pb.Image = Nothing : Else : Dim 檔案 As String
75 76
                         SQL_驗貨報告檔案確認()
@@ -100,6 +101,7 @@ Public Class 驗貨報告資料庫
100 101
                         End If
101 102
                     End If
102 103
                 Else
104
+                    驗貨報告編號_tb.Text = 驗貨報告圖庫_dgv("驗貨報告編號2", e.RowIndex).Value.ToString
103 105
                     PA1 = 驗貨報告圖庫_dgv("驗報圖庫2", e.RowIndex).Value.ToString : PA2 = 驗貨報告圖庫_dgv("驗貨報告編號2", e.RowIndex).Value.ToString
104 106
                     If 驗貨報告圖庫_dgv("驗貨報告編號2", e.RowIndex).Value.ToString = "" Then : 驗貨報告_pb.Image = Nothing : Else : Dim 檔案 As String
105 107
                         SQL_驗貨報告檔案確認()

+ 144
- 80
TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告資料庫修正.Designer.vb View File

@@ -22,15 +22,12 @@ Partial Class 驗貨報告資料庫修正
22 22
     '請勿使用程式碼編輯器進行修改。
23 23
     <System.Diagnostics.DebuggerStepThrough()> _
24 24
     Private Sub InitializeComponent()
25
-        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
-        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
-        Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28
-        Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
25
+        Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
+        Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
+        Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28
+        Dim DataGridViewCellStyle9 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29
+        Dim DataGridViewCellStyle10 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29 30
         Me.驗貨報告圖庫_dgv = New System.Windows.Forms.DataGridView()
30
-        Me.客戶訂單號_tb = New System.Windows.Forms.TextBox()
31
-        Me.客戶訂單號_lb = New System.Windows.Forms.Label()
32
-        Me.型體名稱_tb = New System.Windows.Forms.TextBox()
33
-        Me.型體名稱_lb = New System.Windows.Forms.Label()
34 31
         Me.訂單控制表_dgv = New System.Windows.Forms.DataGridView()
35 32
         Me.驗貨報告編號_tb = New System.Windows.Forms.TextBox()
36 33
         Me.驗貨報告編號_lb = New System.Windows.Forms.Label()
@@ -42,80 +39,58 @@ Partial Class 驗貨報告資料庫修正
42 39
         Me.圖片資料庫管理_dgv = New System.Windows.Forms.DataGridView()
43 40
         Me.重選資料庫_bt = New System.Windows.Forms.Button()
44 41
         Me.資料庫選擇3_bt = New System.Windows.Forms.Button()
42
+        Me.刪除資料_bt = New System.Windows.Forms.Button()
43
+        Me.客戶訂單號_lb = New System.Windows.Forms.Label()
44
+        Me.客戶訂單號_tb = New System.Windows.Forms.TextBox()
45
+        Me.型體名稱_lb = New System.Windows.Forms.Label()
46
+        Me.型體名稱_tb = New System.Windows.Forms.TextBox()
47
+        Me.訂單控制表1_dgv = New System.Windows.Forms.DataGridView()
48
+        Me.客戶訂單號2_tb = New System.Windows.Forms.TextBox()
49
+        Me.客戶訂單號1_tb = New System.Windows.Forms.TextBox()
45 50
         CType(Me.驗貨報告圖庫_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
46 51
         CType(Me.訂單控制表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
47 52
         Me.Panel1.SuspendLayout()
48 53
         CType(Me.圖片資料庫管理_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
54
+        CType(Me.訂單控制表1_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
49 55
         Me.SuspendLayout()
50 56
         '
51 57
         '驗貨報告圖庫_dgv
52 58
         '
53
-        DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
54
-        Me.驗貨報告圖庫_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
59
+        DataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
60
+        Me.驗貨報告圖庫_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle6
55 61
         Me.驗貨報告圖庫_dgv.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
56 62
             Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
57 63
         Me.驗貨報告圖庫_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
64
+        Me.驗貨報告圖庫_dgv.BackgroundColor = System.Drawing.Color.White
58 65
         Me.驗貨報告圖庫_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
59
-        Me.驗貨報告圖庫_dgv.Location = New System.Drawing.Point(7, 35)
66
+        Me.驗貨報告圖庫_dgv.Location = New System.Drawing.Point(2, 29)
60 67
         Me.驗貨報告圖庫_dgv.Name = "驗貨報告圖庫_dgv"
61 68
         Me.驗貨報告圖庫_dgv.RowHeadersWidth = 5
62 69
         Me.驗貨報告圖庫_dgv.RowTemplate.Height = 24
63
-        Me.驗貨報告圖庫_dgv.Size = New System.Drawing.Size(437, 507)
70
+        Me.驗貨報告圖庫_dgv.Size = New System.Drawing.Size(330, 516)
64 71
         Me.驗貨報告圖庫_dgv.TabIndex = 523
65 72
         '
66
-        '客戶訂單號_tb
67
-        '
68
-        Me.客戶訂單號_tb.ForeColor = System.Drawing.Color.Black
69
-        Me.客戶訂單號_tb.Location = New System.Drawing.Point(340, 6)
70
-        Me.客戶訂單號_tb.Name = "客戶訂單號_tb"
71
-        Me.客戶訂單號_tb.Size = New System.Drawing.Size(149, 23)
72
-        Me.客戶訂單號_tb.TabIndex = 532
73
-        '
74
-        '客戶訂單號_lb
75
-        '
76
-        Me.客戶訂單號_lb.AutoSize = True
77
-        Me.客戶訂單號_lb.Location = New System.Drawing.Point(266, 9)
78
-        Me.客戶訂單號_lb.Name = "客戶訂單號_lb"
79
-        Me.客戶訂單號_lb.Size = New System.Drawing.Size(67, 16)
80
-        Me.客戶訂單號_lb.TabIndex = 531
81
-        Me.客戶訂單號_lb.Text = "客戶訂單號"
82
-        '
83
-        '型體名稱_tb
84
-        '
85
-        Me.型體名稱_tb.ForeColor = System.Drawing.Color.Black
86
-        Me.型體名稱_tb.Location = New System.Drawing.Point(557, 6)
87
-        Me.型體名稱_tb.Name = "型體名稱_tb"
88
-        Me.型體名稱_tb.Size = New System.Drawing.Size(149, 23)
89
-        Me.型體名稱_tb.TabIndex = 534
90
-        '
91
-        '型體名稱_lb
92
-        '
93
-        Me.型體名稱_lb.AutoSize = True
94
-        Me.型體名稱_lb.Location = New System.Drawing.Point(495, 9)
95
-        Me.型體名稱_lb.Name = "型體名稱_lb"
96
-        Me.型體名稱_lb.Size = New System.Drawing.Size(55, 16)
97
-        Me.型體名稱_lb.TabIndex = 533
98
-        Me.型體名稱_lb.Text = "型體名稱"
99
-        '
100 73
         '訂單控制表_dgv
101 74
         '
102
-        DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
103
-        Me.訂單控制表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2
104
-        Me.訂單控制表_dgv.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
105
-            Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
75
+        DataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
76
+        Me.訂單控制表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle7
77
+        Me.訂單控制表_dgv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
78
+            Or System.Windows.Forms.AnchorStyles.Left) _
79
+            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
106 80
         Me.訂單控制表_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
81
+        Me.訂單控制表_dgv.BackgroundColor = System.Drawing.Color.White
107 82
         Me.訂單控制表_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
108
-        Me.訂單控制表_dgv.Location = New System.Drawing.Point(450, 35)
83
+        Me.訂單控制表_dgv.Location = New System.Drawing.Point(334, 29)
109 84
         Me.訂單控制表_dgv.Name = "訂單控制表_dgv"
110 85
         Me.訂單控制表_dgv.RowHeadersWidth = 5
111 86
         Me.訂單控制表_dgv.RowTemplate.Height = 24
112
-        Me.訂單控制表_dgv.Size = New System.Drawing.Size(799, 507)
87
+        Me.訂單控制表_dgv.Size = New System.Drawing.Size(916, 516)
113 88
         Me.訂單控制表_dgv.TabIndex = 535
114 89
         '
115 90
         '驗貨報告編號_tb
116 91
         '
117 92
         Me.驗貨報告編號_tb.ForeColor = System.Drawing.Color.Black
118
-        Me.驗貨報告編號_tb.Location = New System.Drawing.Point(798, 6)
93
+        Me.驗貨報告編號_tb.Location = New System.Drawing.Point(86, 3)
119 94
         Me.驗貨報告編號_tb.Name = "驗貨報告編號_tb"
120 95
         Me.驗貨報告編號_tb.Size = New System.Drawing.Size(149, 23)
121 96
         Me.驗貨報告編號_tb.TabIndex = 537
@@ -123,7 +98,7 @@ Partial Class 驗貨報告資料庫修正
123 98
         '驗貨報告編號_lb
124 99
         '
125 100
         Me.驗貨報告編號_lb.AutoSize = True
126
-        Me.驗貨報告編號_lb.Location = New System.Drawing.Point(712, 9)
101
+        Me.驗貨報告編號_lb.Location = New System.Drawing.Point(5, 7)
127 102
         Me.驗貨報告編號_lb.Name = "驗貨報告編號_lb"
128 103
         Me.驗貨報告編號_lb.Size = New System.Drawing.Size(79, 16)
129 104
         Me.驗貨報告編號_lb.TabIndex = 536
@@ -131,16 +106,17 @@ Partial Class 驗貨報告資料庫修正
131 106
         '
132 107
         '重新配對_bt
133 108
         '
134
-        Me.重新配對_bt.Location = New System.Drawing.Point(1107, 6)
109
+        Me.重新配對_bt.Location = New System.Drawing.Point(799, 1)
135 110
         Me.重新配對_bt.Name = "重新配對_bt"
136
-        Me.重新配對_bt.Size = New System.Drawing.Size(142, 23)
111
+        Me.重新配對_bt.Size = New System.Drawing.Size(104, 26)
137 112
         Me.重新配對_bt.TabIndex = 538
138
-        Me.重新配對_bt.Text = "重新配對"
113
+        Me.重新配對_bt.Text = "修改圖檔聯繫"
139 114
         Me.重新配對_bt.UseVisualStyleBackColor = True
140 115
         '
141 116
         '資料庫選擇2_bt
142 117
         '
143
-        Me.資料庫選擇2_bt.Location = New System.Drawing.Point(157, 4)
118
+        Me.資料庫選擇2_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
119
+        Me.資料庫選擇2_bt.Location = New System.Drawing.Point(1088, 1)
144 120
         Me.資料庫選擇2_bt.Name = "資料庫選擇2_bt"
145 121
         Me.資料庫選擇2_bt.Size = New System.Drawing.Size(75, 26)
146 122
         Me.資料庫選擇2_bt.TabIndex = 589
@@ -149,7 +125,8 @@ Partial Class 驗貨報告資料庫修正
149 125
         '
150 126
         '資料庫選擇1_bt
151 127
         '
152
-        Me.資料庫選擇1_bt.Location = New System.Drawing.Point(82, 4)
128
+        Me.資料庫選擇1_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
129
+        Me.資料庫選擇1_bt.Location = New System.Drawing.Point(1013, 1)
153 130
         Me.資料庫選擇1_bt.Name = "資料庫選擇1_bt"
154 131
         Me.資料庫選擇1_bt.Size = New System.Drawing.Size(75, 26)
155 132
         Me.資料庫選擇1_bt.TabIndex = 588
@@ -159,8 +136,10 @@ Partial Class 驗貨報告資料庫修正
159 136
         'Panel1
160 137
         '
161 138
         Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
162
-        Me.Panel1.Controls.Add(Me.Label38)
163 139
         Me.Panel1.Controls.Add(Me.圖片資料庫管理_dgv)
140
+        Me.Panel1.Controls.Add(Me.Label38)
141
+        Me.Panel1.Controls.Add(Me.客戶訂單號2_tb)
142
+        Me.Panel1.Controls.Add(Me.客戶訂單號_tb)
164 143
         Me.Panel1.Location = New System.Drawing.Point(525, 122)
165 144
         Me.Panel1.Name = "Panel1"
166 145
         Me.Panel1.Size = New System.Drawing.Size(205, 303)
@@ -179,23 +158,23 @@ Partial Class 驗貨報告資料庫修正
179 158
         '
180 159
         '圖片資料庫管理_dgv
181 160
         '
182
-        DataGridViewCellStyle3.BackColor = System.Drawing.Color.White
183
-        Me.圖片資料庫管理_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
161
+        DataGridViewCellStyle8.BackColor = System.Drawing.Color.White
162
+        Me.圖片資料庫管理_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle8
184 163
         Me.圖片資料庫管理_dgv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
185 164
             Or System.Windows.Forms.AnchorStyles.Left) _
186 165
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
187 166
         Me.圖片資料庫管理_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
188 167
         Me.圖片資料庫管理_dgv.BackgroundColor = System.Drawing.Color.White
189
-        DataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
190
-        DataGridViewCellStyle4.BackColor = System.Drawing.Color.White
191
-        DataGridViewCellStyle4.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
192
-        DataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText
193
-        DataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight
194
-        DataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText
195
-        DataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
196
-        Me.圖片資料庫管理_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle4
168
+        DataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
169
+        DataGridViewCellStyle9.BackColor = System.Drawing.Color.White
170
+        DataGridViewCellStyle9.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
171
+        DataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText
172
+        DataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight
173
+        DataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText
174
+        DataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
175
+        Me.圖片資料庫管理_dgv.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle9
197 176
         Me.圖片資料庫管理_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
198
-        Me.圖片資料庫管理_dgv.Location = New System.Drawing.Point(3, 29)
177
+        Me.圖片資料庫管理_dgv.Location = New System.Drawing.Point(4, 29)
199 178
         Me.圖片資料庫管理_dgv.Name = "圖片資料庫管理_dgv"
200 179
         Me.圖片資料庫管理_dgv.RowHeadersWidth = 5
201 180
         Me.圖片資料庫管理_dgv.RowTemplate.Height = 24
@@ -204,7 +183,8 @@ Partial Class 驗貨報告資料庫修正
204 183
         '
205 184
         '重選資料庫_bt
206 185
         '
207
-        Me.重選資料庫_bt.Location = New System.Drawing.Point(953, 4)
186
+        Me.重選資料庫_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
187
+        Me.重選資料庫_bt.Location = New System.Drawing.Point(1164, 1)
208 188
         Me.重選資料庫_bt.Name = "重選資料庫_bt"
209 189
         Me.重選資料庫_bt.Size = New System.Drawing.Size(85, 26)
210 190
         Me.重選資料庫_bt.TabIndex = 1636
@@ -213,18 +193,97 @@ Partial Class 驗貨報告資料庫修正
213 193
         '
214 194
         '資料庫選擇3_bt
215 195
         '
216
-        Me.資料庫選擇3_bt.Location = New System.Drawing.Point(7, 4)
196
+        Me.資料庫選擇3_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
197
+        Me.資料庫選擇3_bt.Location = New System.Drawing.Point(938, 1)
217 198
         Me.資料庫選擇3_bt.Name = "資料庫選擇3_bt"
218 199
         Me.資料庫選擇3_bt.Size = New System.Drawing.Size(75, 26)
219 200
         Me.資料庫選擇3_bt.TabIndex = 1637
220 201
         Me.資料庫選擇3_bt.Text = "HP"
221 202
         Me.資料庫選擇3_bt.UseVisualStyleBackColor = True
222 203
         '
204
+        '刪除資料_bt
205
+        '
206
+        Me.刪除資料_bt.Location = New System.Drawing.Point(248, 1)
207
+        Me.刪除資料_bt.Name = "刪除資料_bt"
208
+        Me.刪除資料_bt.Size = New System.Drawing.Size(84, 26)
209
+        Me.刪除資料_bt.TabIndex = 1638
210
+        Me.刪除資料_bt.Text = "刪除資料"
211
+        Me.刪除資料_bt.UseVisualStyleBackColor = True
212
+        '
213
+        '客戶訂單號_lb
214
+        '
215
+        Me.客戶訂單號_lb.AutoSize = True
216
+        Me.客戶訂單號_lb.Location = New System.Drawing.Point(343, 6)
217
+        Me.客戶訂單號_lb.Name = "客戶訂單號_lb"
218
+        Me.客戶訂單號_lb.Size = New System.Drawing.Size(67, 16)
219
+        Me.客戶訂單號_lb.TabIndex = 531
220
+        Me.客戶訂單號_lb.Text = "客戶訂單號"
221
+        '
222
+        '客戶訂單號_tb
223
+        '
224
+        Me.客戶訂單號_tb.ForeColor = System.Drawing.Color.Black
225
+        Me.客戶訂單號_tb.Location = New System.Drawing.Point(37, 55)
226
+        Me.客戶訂單號_tb.Name = "客戶訂單號_tb"
227
+        Me.客戶訂單號_tb.Size = New System.Drawing.Size(115, 23)
228
+        Me.客戶訂單號_tb.TabIndex = 532
229
+        '
230
+        '型體名稱_lb
231
+        '
232
+        Me.型體名稱_lb.AutoSize = True
233
+        Me.型體名稱_lb.Location = New System.Drawing.Point(653, 7)
234
+        Me.型體名稱_lb.Name = "型體名稱_lb"
235
+        Me.型體名稱_lb.Size = New System.Drawing.Size(55, 16)
236
+        Me.型體名稱_lb.TabIndex = 533
237
+        Me.型體名稱_lb.Text = "型體名稱"
238
+        '
239
+        '型體名稱_tb
240
+        '
241
+        Me.型體名稱_tb.ForeColor = System.Drawing.Color.Black
242
+        Me.型體名稱_tb.Location = New System.Drawing.Point(710, 3)
243
+        Me.型體名稱_tb.Name = "型體名稱_tb"
244
+        Me.型體名稱_tb.Size = New System.Drawing.Size(89, 23)
245
+        Me.型體名稱_tb.TabIndex = 534
246
+        '
247
+        '訂單控制表1_dgv
248
+        '
249
+        DataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
250
+        Me.訂單控制表1_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle10
251
+        Me.訂單控制表1_dgv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
252
+            Or System.Windows.Forms.AnchorStyles.Left) _
253
+            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
254
+        Me.訂單控制表1_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
255
+        Me.訂單控制表1_dgv.BackgroundColor = System.Drawing.Color.White
256
+        Me.訂單控制表1_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
257
+        Me.訂單控制表1_dgv.Location = New System.Drawing.Point(334, 29)
258
+        Me.訂單控制表1_dgv.Name = "訂單控制表1_dgv"
259
+        Me.訂單控制表1_dgv.RowHeadersWidth = 5
260
+        Me.訂單控制表1_dgv.RowTemplate.Height = 24
261
+        Me.訂單控制表1_dgv.Size = New System.Drawing.Size(916, 516)
262
+        Me.訂單控制表1_dgv.TabIndex = 1639
263
+        '
264
+        '客戶訂單號2_tb
265
+        '
266
+        Me.客戶訂單號2_tb.ForeColor = System.Drawing.Color.Black
267
+        Me.客戶訂單號2_tb.Location = New System.Drawing.Point(37, 84)
268
+        Me.客戶訂單號2_tb.Name = "客戶訂單號2_tb"
269
+        Me.客戶訂單號2_tb.Size = New System.Drawing.Size(115, 23)
270
+        Me.客戶訂單號2_tb.TabIndex = 1640
271
+        '
272
+        '客戶訂單號1_tb
273
+        '
274
+        Me.客戶訂單號1_tb.ForeColor = System.Drawing.Color.Black
275
+        Me.客戶訂單號1_tb.Location = New System.Drawing.Point(412, 4)
276
+        Me.客戶訂單號1_tb.Name = "客戶訂單號1_tb"
277
+        Me.客戶訂單號1_tb.Size = New System.Drawing.Size(115, 23)
278
+        Me.客戶訂單號1_tb.TabIndex = 1641
279
+        '
223 280
         '驗貨報告資料庫修正
224 281
         '
225 282
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
226 283
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
227 284
         Me.ClientSize = New System.Drawing.Size(1254, 547)
285
+        Me.Controls.Add(Me.客戶訂單號1_tb)
286
+        Me.Controls.Add(Me.刪除資料_bt)
228 287
         Me.Controls.Add(Me.資料庫選擇3_bt)
229 288
         Me.Controls.Add(Me.重選資料庫_bt)
230 289
         Me.Controls.Add(Me.Panel1)
@@ -233,12 +292,12 @@ Partial Class 驗貨報告資料庫修正
233 292
         Me.Controls.Add(Me.重新配對_bt)
234 293
         Me.Controls.Add(Me.驗貨報告編號_tb)
235 294
         Me.Controls.Add(Me.驗貨報告編號_lb)
236
-        Me.Controls.Add(Me.訂單控制表_dgv)
237 295
         Me.Controls.Add(Me.型體名稱_tb)
238 296
         Me.Controls.Add(Me.型體名稱_lb)
239
-        Me.Controls.Add(Me.客戶訂單號_tb)
240 297
         Me.Controls.Add(Me.客戶訂單號_lb)
241 298
         Me.Controls.Add(Me.驗貨報告圖庫_dgv)
299
+        Me.Controls.Add(Me.訂單控制表_dgv)
300
+        Me.Controls.Add(Me.訂單控制表1_dgv)
242 301
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
243 302
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
244 303
         Me.Name = "驗貨報告資料庫修正"
@@ -249,17 +308,13 @@ Partial Class 驗貨報告資料庫修正
249 308
         Me.Panel1.ResumeLayout(False)
250 309
         Me.Panel1.PerformLayout()
251 310
         CType(Me.圖片資料庫管理_dgv, System.ComponentModel.ISupportInitialize).EndInit()
311
+        CType(Me.訂單控制表1_dgv, System.ComponentModel.ISupportInitialize).EndInit()
252 312
         Me.ResumeLayout(False)
253 313
         Me.PerformLayout()
254 314
 
255 315
     End Sub
256 316
 
257 317
     Friend WithEvents 驗貨報告圖庫_dgv As DataGridView
258
-    Friend WithEvents 客戶訂單號_tb As TextBox
259
-    Friend WithEvents 客戶訂單號_lb As Label
260
-    Friend WithEvents 型體名稱_tb As TextBox
261
-    Friend WithEvents 型體名稱_lb As Label
262
-    Friend WithEvents 訂單控制表_dgv As DataGridView
263 318
     Friend WithEvents 驗貨報告編號_tb As TextBox
264 319
     Friend WithEvents 驗貨報告編號_lb As Label
265 320
     Friend WithEvents 重新配對_bt As Button
@@ -270,4 +325,13 @@ Partial Class 驗貨報告資料庫修正
270 325
     Friend WithEvents 圖片資料庫管理_dgv As DataGridView
271 326
     Friend WithEvents 重選資料庫_bt As Button
272 327
     Friend WithEvents 資料庫選擇3_bt As Button
328
+    Friend WithEvents 刪除資料_bt As Button
329
+    Friend WithEvents 客戶訂單號_lb As Label
330
+    Friend WithEvents 客戶訂單號_tb As TextBox
331
+    Friend WithEvents 型體名稱_lb As Label
332
+    Friend WithEvents 型體名稱_tb As TextBox
333
+    Friend WithEvents 訂單控制表_dgv As DataGridView
334
+    Friend WithEvents 訂單控制表1_dgv As DataGridView
335
+    Friend WithEvents 客戶訂單號2_tb As TextBox
336
+    Friend WithEvents 客戶訂單號1_tb As TextBox
273 337
 End Class

+ 62
- 45
TENDEN-MES-SYS/6、圖片資料庫管理/驗貨報告系統/驗貨報告資料庫修正.vb View File

@@ -1,6 +1,5 @@
1 1
 Option Strict Off
2 2
 Public Class 驗貨報告資料庫修正
3
-    ReadOnly ds As New DataSet : ReadOnly ds1 As New DataSet
4 3
     Private Sub Set_工程圖片資料庫狀態()
5 4
         Dim ds9 As New DataSet : 圖片資料庫管理_dgv.DataSource = Nothing : ds9.Clear()
6 5
         圖片資料庫管理_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
@@ -11,73 +10,91 @@ Public Class 驗貨報告資料庫修正
11 10
         圖片資料庫管理_dgv.Columns(0).FillWeight = 100 : 圖片資料庫管理_dgv.Columns(1).Visible = False
12 11
     End Sub
13 12
     Private Sub Set_清單1()
14
-        Try
15
-            驗貨報告圖庫_dgv.DataSource = Nothing : ds.Clear()
16
-            驗貨報告圖庫_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
17
-            驗貨報告圖庫_dgv.ColumnHeadersHeight = 25
18
-            驗貨報告圖庫_dgv.AllowUserToAddRows = False
19
-            SQL_驗貨報告圖庫() : da.Fill(ds) : 驗貨報告圖庫_dgv.DataSource = ds.Tables(0) : conn.Close()
20
-            驗貨報告圖庫_dgv.Columns(0).FillWeight = 100 : 驗貨報告圖庫_dgv.Columns(1).FillWeight = 100 : 驗貨報告圖庫_dgv.Columns(2).FillWeight = 80
21
-        Catch ex As Exception
22
-            MsgBox(ex.Message)
23
-        End Try
13
+        Dim ds As New DataSet : 驗貨報告圖庫_dgv.DataSource = Nothing : ds.Clear()
14
+        驗貨報告圖庫_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
15
+        驗貨報告圖庫_dgv.ColumnHeadersHeight = 25
16
+        驗貨報告圖庫_dgv.AllowUserToAddRows = False
17
+        SQL_驗貨報告圖庫() : da.Fill(ds) : 驗貨報告圖庫_dgv.DataSource = ds.Tables(0) : conn.Close()
18
+        驗貨報告圖庫_dgv.Columns(0).FillWeight = 100 : 驗貨報告圖庫_dgv.Columns(1).FillWeight = 100 : 驗貨報告圖庫_dgv.Columns(2).FillWeight = 80
24 19
     End Sub
25 20
     Private Sub Set_清單2()
26
-        Try
27
-            訂單控制表_dgv.DataSource = Nothing : ds1.Clear()
28
-            訂單控制表_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
29
-            訂單控制表_dgv.ColumnHeadersHeight = 25
30
-            訂單控制表_dgv.AllowUserToAddRows = False
31
-            SQL_訂單控制表1() : da.Fill(ds1) : 訂單控制表_dgv.DataSource = ds1.Tables(0) : conn.Close()
32
-            訂單控制表_dgv.Columns(0).FillWeight = 100 : 訂單控制表_dgv.Columns(1).FillWeight = 100 : 訂單控制表_dgv.Columns(2).FillWeight = 100
33
-            訂單控制表_dgv.Columns(3).FillWeight = 100 : 訂單控制表_dgv.Columns(4).FillWeight = 100
34
-        Catch ex As Exception
35
-            MsgBox(ex.Message)
36
-        End Try
21
+        Dim ds, ds1 As New DataSet
22
+        訂單控制表_dgv.DataSource = Nothing : ds1.Clear()
23
+        訂單控制表_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
24
+        訂單控制表_dgv.ColumnHeadersHeight = 25 : 訂單控制表_dgv.AllowUserToAddRows = False
25
+        訂單控制表1_dgv.DataSource = Nothing : ds1.Clear()
26
+        訂單控制表1_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
27
+        訂單控制表1_dgv.ColumnHeadersHeight = 25 : 訂單控制表1_dgv.AllowUserToAddRows = False
28
+
29
+        SQL_訂單控制表1()
30
+        da.Fill(ds1) : 訂單控制表_dgv.DataSource = ds1.Tables(0) : da.Fill(ds) : 訂單控制表1_dgv.DataSource = ds.Tables(0)
31
+        訂單控制表_dgv.Columns(0).FillWeight = 100 : 訂單控制表_dgv.Columns(1).FillWeight = 100 : 訂單控制表_dgv.Columns(2).FillWeight = 100
32
+        訂單控制表_dgv.Columns(3).FillWeight = 100 : 訂單控制表_dgv.Columns(4).FillWeight = 100
33
+        訂單控制表_dgv.EditMode = DataGridViewEditMode.EditOnEnter
34
+        訂單控制表_dgv.Columns(0).ReadOnly = True : 訂單控制表_dgv.Columns(1).ReadOnly = True : 訂單控制表_dgv.Columns(2).ReadOnly = True
35
+        訂單控制表_dgv.Columns(3).ReadOnly = True : 訂單控制表_dgv.Columns(4).ReadOnly = True
37 36
     End Sub
38 37
     Private Sub 驗貨報告資料庫修正_Load(sender As Object, e As EventArgs) Handles MyBase.Load
39
-        Set_工程圖片資料庫狀態() : SQL_訂單資料表選擇_VIONIC()
38
+        Set_工程圖片資料庫狀態() : SQL_訂單資料表選擇_HP()
39
+        驗貨報告圖庫_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 7.6)
40
+        訂單控制表_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 7.6)
41
+    End Sub
42
+    Private Sub 訂單控制表_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 訂單控制表_dgv.CellClick
43
+        If e.RowIndex = -1 Then : Else
44
+            客戶訂單號_tb.Text = 訂單控制表_dgv("客戶訂單號", e.RowIndex).Value.ToString
45
+            客戶訂單號2_tb.Text = 訂單控制表_dgv("客戶訂單號2", e.RowIndex).Value.ToString
46
+        End If
40 47
     End Sub
41 48
     Private Sub 圖片資料庫管理_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 圖片資料庫管理_dgv.CellClick
42 49
         If e.RowIndex = -1 Then : Else
43
-            PA1 = 圖片資料庫管理_dgv(0, e.RowIndex).Value.ToString : Set_清單1() : Panel1.Visible = False
50
+            PA1 = 圖片資料庫管理_dgv(0, e.RowIndex).Value.ToString : Set_清單1() : Set_清單2() : Panel1.Visible = False
44 51
         End If
45 52
     End Sub
46 53
     Private Sub 驗貨報告圖庫_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 驗貨報告圖庫_dgv.CellClick
47
-        Try
48
-            If e.RowIndex = -1 Then : Else
49
-                型體名稱_tb.Text = 驗貨報告圖庫_dgv(1, e.RowIndex).Value.ToString : 驗貨報告編號_tb.Text = 驗貨報告圖庫_dgv(2, e.RowIndex).Value.ToString
50
-                客戶訂單號_tb.Text = 驗貨報告圖庫_dgv(0, e.RowIndex).Value.ToString
51
-                Set_清單2()
52
-            End If
53
-        Catch ex As Exception
54
-            MsgBox(ex.Message)
55
-        End Try
54
+        If e.RowIndex = -1 Then : Else
55
+            驗貨報告編號_tb.Text = 驗貨報告圖庫_dgv(2, e.RowIndex).Value.ToString
56
+        End If
56 57
     End Sub
57 58
     Private Sub 客戶訂單號_tb_TextChanged(sender As Object, e As EventArgs) Handles 客戶訂單號_tb.TextChanged
58
-        Set_清單1()
59
+        Set_清單1() : Set_清單2()
60
+    End Sub
61
+    Private Sub 客戶訂單號2_tb_TextChanged(sender As Object, e As EventArgs) Handles 客戶訂單號2_tb.TextChanged
62
+        Set_清單1() : Set_清單2()
63
+    End Sub
64
+    Private Sub 客戶訂單號1_tb_TextChanged(sender As Object, e As EventArgs) Handles 客戶訂單號1_tb.TextChanged
65
+        客戶訂單號2_tb.Text = 客戶訂單號1_tb.Text : 客戶訂單號_tb.Text = 客戶訂單號1_tb.Text
59 66
     End Sub
60 67
     Private Sub 重新配對_bt_Click(sender As Object, e As EventArgs) Handles 重新配對_bt.Click
61
-        Try
62
-            For i As Integer = 0 To 訂單控制表_dgv.Rows.Count - 1
63
-                PA = 訂單控制表_dgv.Rows(i).Cells("客戶訂單號").Value : PA1 = 訂單控制表_dgv.Rows(i).Cells("形體號").Value
68
+        For i As Integer = 0 To 訂單控制表_dgv.Rows.Count - 1
69
+            If 訂單控制表_dgv.Rows(i).Cells("驗貨報告圖片").Value.ToString <> 訂單控制表1_dgv.Rows(i).Cells("驗貨報告圖片").Value.ToString Or
70
+                訂單控制表_dgv.Rows(i).Cells("驗報圖庫").Value.ToString <> 訂單控制表1_dgv.Rows(i).Cells("驗報圖庫").Value.ToString Or
71
+                訂單控制表_dgv.Rows(i).Cells("驗貨報告圖片2").Value.ToString <> 訂單控制表1_dgv.Rows(i).Cells("驗貨報告圖片2").Value.ToString Or
72
+                訂單控制表_dgv.Rows(i).Cells("驗報圖庫2").Value.ToString <> 訂單控制表1_dgv.Rows(i).Cells("驗報圖庫2").Value.ToString Then
73
+                PA = 訂單控制表_dgv.Rows(i).Cells("客戶訂單號").Value : PA6 = 訂單控制表_dgv.Rows(i).Cells("形體號").Value
74
+                PA2 = 訂單控制表_dgv.Rows(i).Cells("驗貨報告圖片").Value.ToString : PA3 = 訂單控制表_dgv.Rows(i).Cells("驗報圖庫").Value.ToString
75
+                PA4 = 訂單控制表_dgv.Rows(i).Cells("驗貨報告圖片2").Value.ToString : PA5 = 訂單控制表_dgv.Rows(i).Cells("驗報圖庫2").Value.ToString
64 76
                 SQL_訂單控制表修改() : conn.Close()
65
-            Next
66
-            MsgBox("修改完成。")
67
-        Catch ex As Exception
68
-            MsgBox(ex.Message)
69
-        End Try
77
+            End If
78
+        Next : MsgBox("修改完成。") : Set_清單2()
79
+    End Sub
80
+    Private Sub 刪除資料_bt_Click(sender As Object, e As EventArgs) Handles 刪除資料_bt.Click
81
+        Dim aa As MsgBoxResult = MsgBox("確定要刪除這個驗貨報告檔案?", MsgBoxStyle.OkCancel)
82
+        If aa = MsgBoxResult.Ok Then
83
+            SQL_驗貨報告資料刪除() : Set_清單1() : MsgBox("刪除完成。")
84
+        End If
70 85
     End Sub
71 86
     Private Sub 資料庫選擇1_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇1_bt.Click
72
-        SQL_訂單資料表選擇_VIONIC() : Set_清單2()
87
+        Panel1.Visible = True : SQL_訂單資料表選擇_VIONIC() : Set_清單1() : Set_清單2()
73 88
     End Sub
74 89
     Private Sub 資料庫選擇2_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇2_bt.Click
75
-        SQL_訂單資料表選擇_DRS() : Set_清單2()
90
+        Panel1.Visible = True : SQL_訂單資料表選擇_DRS() : Set_清單1() : Set_清單2()
76 91
     End Sub
77 92
     Private Sub 資料庫選擇3_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇3_bt.Click
78
-        SQL_訂單資料表選擇_HP() : Set_清單2()
93
+        Panel1.Visible = True : SQL_訂單資料表選擇_HP() : Set_清單1() : Set_清單2()
79 94
     End Sub
80 95
     Private Sub 重選資料庫_bt_Click(sender As Object, e As EventArgs) Handles 重選資料庫_bt.Click
81 96
         Panel1.Visible = True
82 97
     End Sub
98
+
99
+
83 100
 End Class

BIN
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.exe View File


BIN
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.pdb View File


BIN
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.exe View File


BIN
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.pdb View File


BIN
TENDEN-MES-SYS/obj/Debug/天盾系統.vbproj.GenerateResource.cache View File


Loading…
Cancel
Save