diff --git a/FL.bas b/FL.bas index 2f39b19..da56fba 100644 --- a/FL.bas +++ b/FL.bas @@ -895,12 +895,12 @@ Sub extract_price_matrix() End With For i = 1 To UBound(cms_pl, 1) - Select Case cms_pl(i, 11) + Select Case cms_pl(i, 13) Case "" Case "no unit conversion" - orig.Worksheet.Cells(orig.row + cms_pl(i, 12) - 1, orig.column + cms_pl(i, 13) - 1).Interior.Color = RGB(255, 255, 161) + orig.Worksheet.Cells(orig.row + cms_pl(i, 14) - 1, orig.column + cms_pl(i, 15) - 1).Interior.Color = RGB(255, 255, 161) Case "no part number" - orig.Worksheet.Cells(orig.row + cms_pl(i, 12) - 1, orig.column + cms_pl(i, 13) - 1).Interior.Color = RGB(220, 220, 220) + orig.Worksheet.Cells(orig.row + cms_pl(i, 14) - 1, orig.column + cms_pl(i, 15) - 1).Interior.Color = RGB(220, 220, 220) End Select Next i @@ -939,9 +939,9 @@ Sub go_to_price_issue() i = 1 Do Until price_sheet.Cells(i, 1) = "" - If price_sheet.Cells(i, 13) = trow And price_sheet.Cells(i, 14) = tcol And price_sheet.Cells(i, 12) <> "" Then + If price_sheet.Cells(i, 15) = trow And price_sheet.Cells(i, 16) = tcol And price_sheet.Cells(i, 14) <> "" Then price_sheet.Select - ActiveSheet.Cells(i, 12).Select + ActiveSheet.Cells(i, 14).Select Exit Sub End If i = i + 1 @@ -982,6 +982,14 @@ PRICELIST_SHOW: GoTo PRICELIST_SHOW End If + If Not pricelist.cbInactive Then + Call x.TBLp_FilterSingle(pl, 11, "I", False) + End If + + If Not pricelist.cbNonStocked Then + Call x.TBLp_FilterSingle(pl, 10, "A", True) + End If + ul(0, 0) = "HDR" ul(1, 0) = pl_action @@ -993,22 +1001,21 @@ PRICELIST_SHOW: ul(7, 0) = "N" j = 0 For i = LBound(pl, 2) + 1 To UBound(pl, 2) - 'if there is no UOM conversion, don't create a row - If pl(10, i) <> "" And pl(11, i) <> "" Then + 'if there is no [uom, part#, price], don't create a row + If pl(12, i) <> "" And pl(13, i) <> "" And pl(8, i) <> "" And pl(9, i) <> "" Then j = j + 1 - ul(0, j) = "DTL" - ul(1, j) = pl_code - ul(2, j) = pl(9, i) - ul(3, j) = pl(7, i) - ul(4, j) = Format(CDbl(pl(6, i)) * CDbl(pl(10, i)) / CDbl(pl(11, i)), "0.00") - ul(5, j) = Format(pl(6, i), "0.00") - ul(11, j) = "1" + ul(0, j) = "DTL" 'DTL + ul(1, j) = pl_code 'Price list code + ul(2, j) = pl(9, i) 'part number + ul(3, j) = pl(7, i) 'price unit + ul(4, j) = Format(CDbl(pl(6, i)) * CDbl(pl(12, i)) / CDbl(pl(13, i)), "0.00") 'volume break in price uom + ul(5, j) = Format(pl(8, i), "0.00") 'price + ul(11, j) = "1" 'add, update, delete End If Next i ReDim Preserve ul(11, j) - - + '--------Open file------------- diff --git a/TheBigOne.cls b/TheBigOne.cls index eedb34d..d20ae4f 100644 --- a/TheBigOne.cls +++ b/TheBigOne.cls @@ -34,6 +34,8 @@ Public Enum SQLsyntax End Enum + + Public Function TBLp_Aggregate(ByRef tbl() As String, ByRef needsort As Boolean, ByRef headers As Boolean, ByRef del_unused As Boolean, ParamArray groupnum_type_sumnum()) As Boolean Dim i As Long @@ -501,17 +503,16 @@ End Function Public Sub TBLp_FilterSingle(ByRef table() As String, ByRef column As Long, ByVal Filter As String, ByVal Equals As Boolean) - Dim i As Long Dim j As Long Dim m As Long - j = 0 - i = 1 + j = LBound(table, 2) + i = LBound(table, 2) + 1 While i <= UBound(table, 2) If (table(column, i) = Filter) = Equals Then j = j + 1 - m = 0 + m = LBound(table, 1) While m <= UBound(table, 1) table(m, j) = table(m, i) m = m + 1 @@ -520,7 +521,7 @@ Public Sub TBLp_FilterSingle(ByRef table() As String, ByRef column As Long, ByVa i = i + 1 Wend - ReDim Preserve table(UBound(table, 1), j) + ReDim Preserve table(LBound(table, 1) To UBound(table, 1), LBound(table, 2) To j) End Sub @@ -1679,10 +1680,10 @@ Function FILEp_CreateCSV(ByRef path As String, ByRef recs() As String) As Boolea For j = 0 To UBound(recs, 1) If j = 0 Then test_empty = Replace(Replace(recs(j, i), ",", ""), """", "") - wl = """" & Replace(Replace(recs(j, i), ",", ""), """", "") & """" + wl = Replace(Replace(recs(j, i), ",", ""), """", "") Else test_empty = test_empty & Replace(Replace(recs(j, i), ",", ""), """", "") - wl = wl & ",""" & Replace(Replace(recs(j, i), ",", ""), """", "") & """" + wl = wl & "," & Replace(Replace(recs(j, i), ",", ""), """", "") End If Next j If Len(test_empty) > 0 Then diff --git a/login.frm b/login.frm index 073d0ca..abd5169 100644 --- a/login.frm +++ b/login.frm @@ -1,10 +1,10 @@ VERSION 5.00 Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} login Caption = "CMS Login" - ClientHeight = 2325 + ClientHeight = 2295 ClientLeft = 120 ClientTop = 465 - ClientWidth = 1950 + ClientWidth = 2445 OleObjectBlob = "login.frx":0000 StartUpPosition = 1 'CenterOwner End diff --git a/login.frx b/login.frx index 24dd09a..ee5b39b 100644 Binary files a/login.frx and b/login.frx differ diff --git a/pricelist.frm b/pricelist.frm index 904e0f5..ad66d1c 100644 --- a/pricelist.frm +++ b/pricelist.frm @@ -1,7 +1,7 @@ VERSION 5.00 Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} pricelist Caption = "Price List Name" - ClientHeight = 4590 + ClientHeight = 5115 ClientLeft = 120 ClientTop = 465 ClientWidth = 4110 diff --git a/pricelist.frx b/pricelist.frx index b409b6e..34e97e2 100644 Binary files a/pricelist.frx and b/pricelist.frx differ