Compare commits

..

2 Commits

Author SHA1 Message Date
pt
7182502669 list of parts to change not wrapped in an array if only one row 2020-03-06 00:33:24 -05:00
pt
19021da028 price volume colors 2020-03-06 00:32:12 -05:00
3 changed files with 48 additions and 10 deletions

View File

@ -2188,7 +2188,7 @@ Public Function json_from_table(ByRef tbl() As Variant, ByRef array_label As Str
End Function End Function
Public Function json_from_table_zb(ByRef tbl() As Variant, ByRef array_label As String, Optional strip_braces As Boolean) As String Public Function json_from_table_zb(ByRef tbl() As Variant, ByRef array_label As String, ByVal force_array As Boolean, Optional strip_braces As Boolean) As String
Dim ajson As String Dim ajson As String
@ -2234,7 +2234,7 @@ Public Function json_from_table_zb(ByRef tbl() As Variant, ByRef array_label As
'if theres more the one record, include brackets for array 'if theres more the one record, include brackets for array
'if an array_label is given give the array a key and the array become the value 'if an array_label is given give the array a key and the array become the value
'then if the array is labeled with a key it should have braces unless specified otherwise 'then if the array is labeled with a key it should have braces unless specified otherwise
If r > 2 Then If r > 2 Or force_array Then
ajson = "[" & ajson & "]" ajson = "[" & ajson & "]"
If array_label <> "" Then If array_label <> "" Then
ajson = """" & array_label & """:" & ajson ajson = """" & array_label & """:" & ajson

View File

@ -4,7 +4,7 @@ Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} fpvt
ClientHeight = 8445.001 ClientHeight = 8445.001
ClientLeft = 120 ClientLeft = 120
ClientTop = 465 ClientTop = 465
ClientWidth = 9285.001 ClientWidth = 8805.001
OleObjectBlob = "fpvt.frx":0000 OleObjectBlob = "fpvt.frx":0000
StartUpPosition = 1 'CenterOwner StartUpPosition = 1 'CenterOwner
End End
@ -97,8 +97,9 @@ Private Sub butAdjust_Click()
Exit Sub Exit Sub
End If End If
Case Else Case Else
MsgBox ("not on an adjustable tab") doc = tbAPI.text
Exit Sub 'MsgBox ("not on an adjustable tab")
'Exit Sub
End Select End Select
Call handler.request_adjust(doc, fail) Call handler.request_adjust(doc, fail)
@ -229,7 +230,7 @@ Private Sub cbPLIST_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift
vtable = x.ARRAYp_TransposeVar(vSwap) vtable = x.ARRAYp_TransposeVar(vSwap)
vtable = x.ARRAYp_zerobased_addheader(vtable, "original", "sales", "replace", "fit") vtable = x.ARRAYp_zerobased_addheader(vtable, "original", "sales", "replace", "fit")
vtable = x.ARRAYp_TransposeVar(vtable) vtable = x.ARRAYp_TransposeVar(vtable)
ptable = x.json_from_table_zb(vtable, "rows", False) ptable = x.json_from_table_zb(vtable, "rows", True, False)
Set jswap("swap") = JsonConverter.ParseJson(ptable) Set jswap("swap") = JsonConverter.ParseJson(ptable)
jswap("scenario")("version") = handler.plan jswap("scenario")("version") = handler.plan
@ -269,7 +270,7 @@ Private Sub dbGETSWAP_Click()
vtable = x.ARRAYp_TransposeVar(vSwap) vtable = x.ARRAYp_TransposeVar(vSwap)
vtable = x.ARRAYp_zerobased_addheader(vtable, "original", "sales", "replace", "fit") vtable = x.ARRAYp_zerobased_addheader(vtable, "original", "sales", "replace", "fit")
vtable = x.ARRAYp_TransposeVar(vtable) vtable = x.ARRAYp_TransposeVar(vtable)
ptable = x.json_from_table_zb(vtable, "rows", False) ptable = x.json_from_table_zb(vtable, "rows", True, False)
Set jswap("swap") = JsonConverter.ParseJson(ptable) Set jswap("swap") = JsonConverter.ParseJson(ptable)
jswap("scenario")("version") = handler.plan jswap("scenario")("version") = handler.plan
@ -434,10 +435,35 @@ End Sub
Private Sub opPlugPrice_Click() Private Sub opPlugPrice_Click()
calc_val calc_val
If opPlugPrice.value = True Then
opPlugPrice.BackColor = -2147483624
Else
opPlugPrice.BackColor = -2147483644
End If
If opPlugVol.value = True Then
opPlugVol.BackColor = -2147483624
Else
opPlugVol.BackColor = -2147483644
End If
End Sub End Sub
Private Sub opPlugVol_Click() Private Sub opPlugVol_Click()
calc_val calc_val
If opPlugVol.value = True Then
opPlugVol.BackColor = -2147483624
Else
opPlugVol.BackColor = -2147483644
End If
If opPlugPrice.value = True Then
opPlugPrice.BackColor = -2147483624
Else
opPlugPrice.BackColor = -2147483644
End If
End Sub
Private Sub pickSWAP_Change()
End Sub End Sub
Private Sub sbpd_Change() Private Sub sbpd_Change()
@ -733,10 +759,22 @@ Private Sub UserForm_Activate()
'--------reset swap tab------------------------------- '--------reset swap tab-------------------------------
lbSWAP.clear lbSWAP.clear
pickSWAP.value = "" pickSWAP.value = ""
pickSWAP.text = "" pickSWAP.text = Mid(sp("package")("basket")(1)("part_descr"), 1, 8)
pickSWAP.list = Application.transpose(Worksheets("mdata").Range("F2:F1672")) pickSWAP.list = Application.transpose(Worksheets("mdata").Range("F2:F1112"))
Call x.frmListBoxHeader(Me.lbSWAPH, Me.lbSWAP, "Original", "Sales", "Replacement", "Fit") Call x.frmListBoxHeader(Me.lbSWAPH, Me.lbSWAP, "Original", "Sales", "Replacement", "Fit")
'---------price volume radio button colors----------
If opPlugPrice.value = True Then
opPlugPrice.BackColor = -2147483624
Else
opPlugPrice.BackColor = -2147483644
End If
If opPlugVol.value = True Then
opPlugVol.BackColor = -2147483624
Else
opPlugVol.BackColor = -2147483644
End If
Call handler.month_tosheet(month, basket) Call handler.month_tosheet(month, basket)
Application.StatusBar = False Application.StatusBar = False
@ -771,7 +809,7 @@ Sub crunch_array()
ReDim mload(UBound(month, 1), 5) ReDim mload(UBound(month, 1), 5)
For i = 0 To UBound(month, 1) For i = 0 To UBound(month, 1)
mload(i, 0) = Format(month(i, 0), "#,###") mload(i, 0) = month(i, 0)
mload(i, 1) = Format(month(i, 1), "#,###") mload(i, 1) = Format(month(i, 1), "#,###")
mload(i, 2) = Format(month(i, 4), "#,###") mload(i, 2) = Format(month(i, 4), "#,###")
mload(i, 3) = Format(month(i, 5), "#,###") mload(i, 3) = Format(month(i, 5), "#,###")

BIN
fpvt.frx

Binary file not shown.