accomodate tagging

This commit is contained in:
Trowbridge 2020-02-18 17:04:03 -05:00
parent ce6461007a
commit 988f72996a
6 changed files with 49 additions and 23 deletions

View File

@ -29,7 +29,7 @@ Private Sub cbUndo_Click()
For i = 0 To Me.lbHist.ListCount - 1
If Me.lbHist.Selected(i) Then
Call handler.undo_changes(x(i, 5), fail)
Call handler.undo_changes(x(i, 6), fail)
If fail Then
MsgBox ("undo did not work")
Exit Sub
@ -39,6 +39,8 @@ Private Sub cbUndo_Click()
Sheets("Orders").PivotTables("PivotTable1").PivotCache.Refresh
Me.Hide
End Sub

Binary file not shown.

View File

@ -72,6 +72,11 @@ Private Sub butAdjust_Click()
Exit Sub
End If
If cbTAG.text = "" Then
MsgBox ("no tag was selected")
Exit Sub
End If
Call handler.request_adjust(JsonConverter.ConvertToJson(adjust), fail)
If fail Then
MsgBox ("adjustment was not made due to error")
@ -79,6 +84,7 @@ Private Sub butAdjust_Click()
End If
Me.tbCOM = ""
Me.cbTAG.text = ""
Me.Hide
@ -565,6 +571,7 @@ Private Sub UserForm_Activate()
tags(i - 1, 0) = sp("package")("tags")(i)
Next i
cbTAG.list = tags
Sheets("month").cbMTAG.list = tags
End If
Call handler.month_tosheet(month, basket)
@ -778,6 +785,7 @@ Sub calc_val()
adjust("user") = Application.UserName
adjust("source") = "adj"
adjust("message") = tbCOM.text
adjust("tag") = cbTAG.text
If opEditSales Then
If opPlugVol Then
adjust("type") = "scale_v"
@ -831,6 +839,7 @@ Sub calc_price()
adjust("user") = Application.UserName
adjust("source") = "adj"
adjust("message") = tbCOM.text
adjust("tag") = cbTAG.text
adjust("version") = handler.plan
If opEditSales Then

BIN
fpvt.frx

Binary file not shown.

View File

@ -137,8 +137,8 @@ Sub pg_main_workset(rep As String)
res(i, 28) = json("x")(i)("version")
res(i, 29) = json("x")(i)("iter")
res(i, 30) = json("x")(i)("logid")
res(i, 31) = json("x")(i)("comment")
res(i, 32) = json("x")(i)("module")
res(i, 31) = json("x")(i)("tag")
res(i, 32) = json("x")(i)("comment")
Next i
res(0, 0) = "bill_cust_descr"
@ -172,8 +172,8 @@ Sub pg_main_workset(rep As String)
res(0, 28) = "version"
res(0, 29) = "iter"
res(0, 30) = "logid"
res(0, 31) = "comment"
res(0, 32) = "module"
res(0, 31) = "tag"
res(0, 32) = "comment"
Set json = Nothing
@ -283,8 +283,8 @@ Function request_adjust(doc As String, ByRef fail As Boolean) As Object
res(i - 1, 28) = json("x")(i)("version")
res(i - 1, 29) = json("x")(i)("iter")
res(i - 1, 30) = json("x")(i)("logid")
res(i - 1, 31) = json("x")(i)("comment")
res(i - 1, 32) = json("x")(i)("module")
res(i - 1, 31) = json("x")(i)("tag")
res(i - 1, 32) = json("x")(i)("comment")
Next i
Set json = Nothing
@ -505,16 +505,17 @@ Function list_changes(doc As String, ByRef fail As Boolean) As Variant()
Exit Function
End If
ReDim res(json("x").Count - 1, 6)
ReDim res(json("x").Count - 1, 7)
For i = 0 To UBound(res, 1)
res(i, 0) = json("x")(i + 1)("user")
res(i, 1) = json("x")(i + 1)("quota_rep_descr")
res(i, 2) = json("x")(i + 1)("stamp")
res(i, 3) = json("x")(i + 1)("comment")
res(i, 4) = json("x")(i + 1)("sales")
res(i, 5) = json("x")(i + 1)("id")
res(i, 6) = json("x")(i + 1)("def")
res(i, 3) = json("x")(i + 1)("tag")
res(i, 4) = json("x")(i + 1)("comment")
res(i, 5) = json("x")(i + 1)("sales")
res(i, 6) = json("x")(i + 1)("id")
res(i, 7) = json("x")(i + 1)("def")
Next i
list_changes = res

View File

@ -29,20 +29,11 @@ Private showbasket As Boolean
Private np As Object 'json dedicated to new part scenario
Private b() As Variant 'holds basket
Private Sub SpinButton1_Change()
End Sub
Private Sub ComboBox1_Change()
End Sub
Private Sub cbMTAG_Change()
Dim i As Long
For i = 2 To 13
Next i
End Sub
@ -52,12 +43,18 @@ Private Sub sbMPP_Change()
Application.ScreenUpdating = False
dumping = True
Set m = Sheets("month")
m.Cells(19, 11) = sbMPP.value / 100
For i = 6 To 17
m.Cells(i, 11) = (m.Cells(i, 9)) * m.Cells(19, 11)
Next i
Me.mvp_adj
dumping = False
Application.ScreenUpdating = True
End Sub
@ -68,6 +65,8 @@ Private Sub sbMPV_Change()
Application.ScreenUpdating = False
dumping = True
Set m = Sheets("month")
m.Cells(19, 5) = sbMPV.value / 100
For i = 6 To 17
@ -76,6 +75,11 @@ Private Sub sbMPV_Change()
End If
Next i
dumping = False
Call Me.mvp_adj
Application.ScreenUpdating = True
End Sub
@ -843,14 +847,24 @@ Sub post_adjust()
Dim i As Long
Dim fail As Boolean
Dim adjust As Object
Dim jdoc As String
If Me.newpart Then
Call handler.request_adjust(Sheets("_month").Cells(2, 16), fail)
Set adjust = JsonConverter.ParseJson(Sheets("_month").Cells(2, 16))
adjust("message") = Me.tbMCOM.text
adjust("tag") = Me.cbMTAG.text
jdoc = JsonConverter.ConvertToJson(adjust)
Call handler.request_adjust(jdoc, fail)
If fail Then Exit Sub
Else
For i = 2 To 13
If Sheets("_month").Cells(i, 16) <> "" Then
Call handler.request_adjust(Sheets("_month").Cells(i, 16), fail)
Set adjust = JsonConverter.ParseJson(Sheets("_month").Cells(i, 16))
adjust("message") = Me.tbMCOM.text
adjust("tag") = Me.cbMTAG.text
jdoc = JsonConverter.ConvertToJson(adjust)
Call handler.request_adjust(jdoc, fail)
If fail Then Exit Sub
End If
Next i