|
@@ -946,7 +946,7 @@ Public Class 銷售單申請
|
946
|
946
|
|
947
|
947
|
DTP = Strings.Format(開單日期_dtp.Value, "yyyy/MM/dd") : DTP1 = Strings.Format(交貨日期_dtp.Value, "yyyy/MM/dd") : BL1 = 含稅_ch.Checked : 運費 = 司機運費_tb.Text
|
948
|
948
|
PA1 = 流水號_tb.Text : PA2 = 單號_tb.Text : PA3 = 客戶編號_tb.Text : PA4 = 流水號_tb.Text : PA5 = 送貨地點_cb.Text : NU1 = 司機運費_tb.Text : NU2 = 管銷費用_tb.Text
|
949
|
|
- NU3 = 稅金_tb.Text : NU4 = 刷卡傭金_tb.Text
|
|
949
|
+ NU3 = 稅金_tb.Text : NU4 = 刷卡傭金_tb.Text : NU5 = 銷售合計_tb.Text
|
950
|
950
|
SQL_銷售控制表_修改() '--------------------資料修改
|
951
|
951
|
|
952
|
952
|
For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
|
|
@@ -1046,7 +1046,7 @@ Public Class 銷售單申請
|
1046
|
1046
|
|
1047
|
1047
|
DTP = Strings.Format(開單日期_dtp.Value, "yyyy/MM/dd") : DTP1 = Strings.Format(交貨日期_dtp.Value, "yyyy/MM/dd") : BL1 = 含稅_ch.Checked : 運費 = 司機運費_tb.Text
|
1048
|
1048
|
PA1 = 流水號_tb.Text : PA2 = 單號_tb.Text : PA3 = 客戶編號_tb.Text : PA4 = 流水號_tb.Text : PA5 = 送貨地點_cb.Text : NU1 = 司機運費_tb.Text : NU2 = 管銷費用_tb.Text
|
1049
|
|
- NU3 = 稅金_tb.Text : NU4 = 刷卡傭金_tb.Text
|
|
1049
|
+ NU3 = 稅金_tb.Text : NU4 = 刷卡傭金_tb.Text : NU5 = 銷售合計_tb.Text
|
1050
|
1050
|
SQL_銷售控制表_修改() '--------------------資料修改
|
1051
|
1051
|
|
1052
|
1052
|
For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
|
|
@@ -1100,7 +1100,7 @@ Public Class 銷售單申請
|
1100
|
1100
|
|
1101
|
1101
|
DTP = Strings.Format(開單日期_dtp.Value, "yyyy/MM/dd") : DTP1 = Strings.Format(交貨日期_dtp.Value, "yyyy/MM/dd") : BL1 = 含稅_ch.Checked : 運費 = 司機運費_tb.Text
|
1102
|
1102
|
PA1 = 流水號_tb.Text : PA2 = 單號_tb.Text : PA3 = 客戶編號_tb.Text : PA4 = 流水號_tb.Text : PA5 = 送貨地點_cb.Text : NU1 = 司機運費_tb.Text : NU2 = 管銷費用_tb.Text
|
1103
|
|
- NU3 = 稅金_tb.Text : NU4 = 刷卡傭金_tb.Text
|
|
1103
|
+ NU3 = 稅金_tb.Text : NU4 = 刷卡傭金_tb.Text : NU5 = 銷售合計_tb.Text
|
1104
|
1104
|
SQL_銷售控制表_修改() '--------------------資料修改
|
1105
|
1105
|
|
1106
|
1106
|
For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
|
|
@@ -1814,12 +1814,13 @@ Public Class 銷售單申請
|
1814
|
1814
|
xlSheet.Cells(5, 13) = "0" : xlSheet.Cells(6, 1) = "業務員:" : xlSheet.Cells(6, 2) = 業務_cb.Text : xlSheet.Cells(6, 4) = "稅金:"
|
1815
|
1815
|
xlSheet.Cells(6, 5) = CInt(稅金_tb.Text) + CInt(刷卡稅金_tb.Text) : xlSheet.Cells(6, 6) = "手續:" : xlSheet.Cells(6, 7) = 刷卡傭金_tb.Text : xlSheet.Cells(6, 8) = "總額:"
|
1816
|
1816
|
xlSheet.Cells(6, 9) = 銷售合計_tb.Text : xlSheet.Cells(6, 10) = "餘額:" : xlSheet.Cells(6, 11) = N2 : xlSheet.Cells(8, 2) = "品號"
|
1817
|
|
- xlSheet.Cells(8, 5) = "品名規格" : xlSheet.Cells(8, 8) = "數量" : xlSheet.Cells(8, 9) = "單價" : xlSheet.Cells(8, 11) = "金額"
|
|
1817
|
+ xlSheet.Cells(8, 5) = "品名規格" : xlSheet.Cells(8, 8) = "數量" : xlSheet.Cells(8, 9) = "單價" : xlSheet.Cells(8, 11) = "金額" : xlSheet.Cells(8, 12) = "含管銷"
|
1818
|
1818
|
xlSheet.Cells(8, 13) = "成本價" : xlSheet.Cells(8, 14) = "廠商名稱"
|
1819
|
1819
|
For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
|
1820
|
1820
|
xlSheet.Cells(i + 9, 1) = 銷售明細_dgv.Rows(i).Cells("料號").Value : xlSheet.Cells(i + 9, 3) = 銷售明細_dgv.Rows(i).Cells("品名").Value
|
1821
|
1821
|
xlSheet.Cells(i + 9, 8) = 銷售明細_dgv.Rows(i).Cells("數量").Value : xlSheet.Cells(i + 9, 9) = 銷售明細_dgv.Rows(i).Cells("單價").Value
|
1822
|
1822
|
xlSheet.Cells(i + 9, 11) = 銷售明細_dgv.Rows(i).Cells("售價").Value : xlSheet.Cells(i + 9, 13) = 銷售明細_dgv.Rows(i).Cells("成本").Value
|
|
1823
|
+ xlSheet.Cells(i + 9, 12) = 銷售明細_dgv.Rows(i).Cells("成本").Value * 1.06
|
1823
|
1824
|
PA30 = Strings.Left(銷售明細_dgv.Rows(i).Cells("料號").Value.ToString, 4) : Set_料號轉簡稱() : xlSheet.Cells(i + 9, 14) = 轉換_tb.Text
|
1824
|
1825
|
With xlApp.Selection
|
1825
|
1826
|
.Font.Bold = True
|
|
@@ -1827,7 +1828,7 @@ Public Class 銷售單申請
|
1827
|
1828
|
N1 = i + 9
|
1828
|
1829
|
Next
|
1829
|
1830
|
xlSheet.Cells(N1 + 3, 1) = "銷貨總額:" : xlSheet.Cells(N1 + 3, 2) = 銷售合計_tb.Text : xlSheet.Cells(N1 + 3, 4) = "成本:" : xlSheet.Cells(N1 + 3, 5) = 物料成本_tb.Text
|
1830
|
|
- xlSheet.Cells(N1 + 3, 7) = "運費:" : xlSheet.Cells(N1 + 3, 8) = 司機運費_tb.Text : xlSheet.Cells(N1 + 3, 10) = "管銷費用:" : xlSheet.Cells(N1 + 3, 11) = 管銷費用_tb.Text
|
|
1831
|
+ xlSheet.Cells(N1 + 3, 7) = "運費:" : xlSheet.Cells(N1 + 3, 8) = 司機運費_tb.Text : xlSheet.Cells(N1 + 3, 9) = "管銷費用:" : xlSheet.Cells(N1 + 3, 10) = 管銷費用_tb.Text
|
1831
|
1832
|
xlSheet.Cells(N1 + 3, 13) = "毛利:" : xlSheet.Cells(N1 + 3, 14) = 預估利潤_tb.Text
|
1832
|
1833
|
BB(xlApp, xlSheet)
|
1833
|
1834
|
xlApp.Cells.Select()
|
|
@@ -1849,18 +1850,21 @@ Public Class 銷售單申請
|
1849
|
1850
|
End With
|
1850
|
1851
|
'-------------------------------------------------------------------------------------------------------------------
|
1851
|
1852
|
myExcel.Selection.ColumnWidth = 12.5
|
1852
|
|
-
|
1853
|
|
- xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 12
|
1854
|
|
- xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 11.75
|
|
1853
|
+ xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 11
|
|
1854
|
+ xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 11
|
|
1855
|
+ xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 11
|
|
1856
|
+ xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 11
|
1855
|
1857
|
xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 10.75
|
1856
|
1858
|
xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 10.88
|
|
1859
|
+ xlSheet.Columns("K:K").Select : myExcel.Selection.ColumnWidth = 11
|
1857
|
1860
|
xlSheet.Columns("N:N").Select : myExcel.Selection.ColumnWidth = 30.63
|
1858
|
1861
|
xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 5
|
1859
|
1862
|
xlSheet.Columns("E:F").Select : myExcel.Selection.ColumnWidth = 10
|
1860
|
|
- xlSheet.Columns("L:L").Select : myExcel.Selection.ColumnWidth = 7
|
|
1863
|
+ xlSheet.Columns("L:L").Select : myExcel.Selection.ColumnWidth = 12.5
|
1861
|
1864
|
'---------調數字
|
1862
|
1865
|
xlSheet.Columns("I:I").Select : myExcel.Selection.NumberFormatLocal = "#,##0_ ;[紅色]-#,##0 "
|
1863
|
1866
|
xlSheet.Columns("K:K").Select : myExcel.Selection.NumberFormatLocal = "#,##0_ ;[紅色]-#,##0 "
|
|
1867
|
+ xlSheet.Columns("L:L").Select : myExcel.Selection.NumberFormatLocal = "#,##0_ ;[紅色]-#,##0 "
|
1864
|
1868
|
xlSheet.Columns("M:M").Select : myExcel.Selection.NumberFormatLocal = "#,##0_ ;[紅色]-#,##0 "
|
1865
|
1869
|
'---------------------------------------------------------------------------------------------------------------------
|
1866
|
1870
|
xlSheet.Range("A8:N8").Select() '畫線
|
|
@@ -1954,6 +1958,9 @@ Public Class 銷售單申請
|
1954
|
1958
|
xlSheet.Range("N8").Select()
|
1955
|
1959
|
With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
|
1956
|
1960
|
.ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
|
|
1961
|
+ xlSheet.Range("L8").Select()
|
|
1962
|
+ With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
|
|
1963
|
+ .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
|
1957
|
1964
|
'---------------------------------------------------------------------------------------------------------------------------
|
1958
|
1965
|
For i As Integer = 0 To 銷售明細_dgv.Rows.Count - 1
|
1959
|
1966
|
xlSheet.Range("A" & i + 9 & ":B" & i + 9 & "").Select() '迴圈合併儲存格
|