2023-03-03 14:29:04 -05:00
|
|
|
VERSION 5.00
|
|
|
|
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} changes
|
|
|
|
Caption = "History"
|
2023-04-24 21:09:12 -04:00
|
|
|
ClientHeight = 7815
|
2023-03-03 14:29:04 -05:00
|
|
|
ClientLeft = 120
|
|
|
|
ClientTop = 465
|
|
|
|
ClientWidth = 16710
|
|
|
|
OleObjectBlob = "changes.frx":0000
|
|
|
|
StartUpPosition = 1 'CenterOwner
|
|
|
|
End
|
|
|
|
Attribute VB_Name = "changes"
|
|
|
|
Attribute VB_GlobalNameSpace = False
|
|
|
|
Attribute VB_Creatable = False
|
|
|
|
Attribute VB_PredeclaredId = True
|
|
|
|
Attribute VB_Exposed = False
|
2023-04-24 21:09:12 -04:00
|
|
|
Private X As Variant
|
2023-03-03 14:29:04 -05:00
|
|
|
|
|
|
|
Private Sub cbCancel_Click()
|
|
|
|
Me.Hide
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub cbUndo_Click()
|
|
|
|
Call Me.delete_selected
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub lbHist_Change()
|
|
|
|
Dim i As Integer
|
|
|
|
|
|
|
|
For i = 0 To Me.lbHist.ListCount - 1
|
|
|
|
If Me.lbHist.Selected(i) Then
|
2023-04-24 21:09:12 -04:00
|
|
|
Me.tbPrint.value = X(i, 7)
|
2023-03-03 14:29:04 -05:00
|
|
|
Exit Sub
|
|
|
|
End If
|
|
|
|
Next i
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub UserForm_Activate()
|
|
|
|
Dim fail As Boolean
|
|
|
|
|
2023-04-24 21:09:12 -04:00
|
|
|
X = handler.list_changes("{""scenario"":{""quota_rep_descr"":""" & shData.Cells(2, 5) & """}}", fail)
|
2023-03-03 14:29:04 -05:00
|
|
|
If fail Then
|
|
|
|
Me.Hide
|
|
|
|
Exit Sub
|
|
|
|
End If
|
2023-04-24 21:09:12 -04:00
|
|
|
Me.lbHist.list = X
|
2023-03-03 14:29:04 -05:00
|
|
|
|
2023-04-24 21:09:12 -04:00
|
|
|
'lbHEAD.ColumnCount = lbHist.ColumnCount
|
|
|
|
'lbHEAD.ColumnWidths = lbHist.ColumnWidths
|
2023-03-03 14:29:04 -05:00
|
|
|
|
|
|
|
' add header elements
|
2023-04-24 21:09:12 -04:00
|
|
|
' lbHEAD.clear
|
|
|
|
' lbHEAD.AddItem
|
|
|
|
' lbHEAD.list(0, 0) = "Modifier"
|
|
|
|
' lbHEAD.list(0, 1) = "Owner"
|
|
|
|
' lbHEAD.list(0, 2) = "When"
|
|
|
|
' lbHEAD.list(0, 3) = "Tag"
|
|
|
|
' lbHEAD.list(0, 4) = "Comment"
|
|
|
|
' lbHEAD.list(0, 5) = "Sales"
|
|
|
|
' lbHEAD.list(0, 6) = "id"
|
2023-03-09 10:32:58 -05:00
|
|
|
Call Utils.frmListBoxHeader(Me.lbHEAD, Me.lbHist, "Modifier", "Owner", "When", "Tag", "Comment", "Sales", "id")
|
2023-03-03 14:29:04 -05:00
|
|
|
End Sub
|
|
|
|
|
|
|
|
Sub delete_selected()
|
|
|
|
Dim logid As Integer
|
|
|
|
Dim i As Integer
|
|
|
|
Dim fail As Boolean
|
|
|
|
Dim proceed As Boolean
|
|
|
|
|
|
|
|
If MsgBox("Permanently delete these changes?", vbOKCancel) = vbCancel Then
|
|
|
|
Exit Sub
|
|
|
|
End If
|
|
|
|
|
|
|
|
For i = 0 To Me.lbHist.ListCount - 1
|
|
|
|
If Me.lbHist.Selected(i) Then
|
2023-04-24 21:09:12 -04:00
|
|
|
Call handler.undo_changes(X(i, 6), fail)
|
2023-03-03 14:29:04 -05:00
|
|
|
If fail Then
|
|
|
|
MsgBox ("undo did not work")
|
|
|
|
Exit Sub
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
Next i
|
|
|
|
|
2023-03-09 10:32:58 -05:00
|
|
|
shOrders.PivotTables("ptOrders").PivotCache.Refresh
|
2023-03-03 14:29:04 -05:00
|
|
|
|
|
|
|
Me.lbHist.clear
|
|
|
|
Me.Hide
|
|
|
|
End Sub
|