Simplify code. Add backdoor to openf form. Fix integer overflow in undo.

This commit is contained in:
PhilRunninger 2023-05-17 15:09:08 -04:00
parent 0d83f19e33
commit e726349c98
8 changed files with 12 additions and 13 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -516,8 +516,8 @@ Function list_changes(doc As String, ByRef fail As Boolean) As Variant()
Dim req As New WinHttp.WinHttpRequest Dim req As New WinHttp.WinHttpRequest
Dim json As Object Dim json As Object
Dim wr As String Dim wr As String
Dim i As Integer Dim i As Long
Dim j As Integer Dim j As Long
Dim res() As Variant Dim res() As Variant
If doc = "" Then If doc = "" Then
@ -570,8 +570,8 @@ Function undo_changes(ByVal logid As Integer, ByRef fail As Boolean) As Variant(
Dim req As New WinHttp.WinHttpRequest Dim req As New WinHttp.WinHttpRequest
Dim json As Object Dim json As Object
Dim wr As String Dim wr As String
Dim i As Integer Dim i As Long
Dim j As Integer Dim j As Long
Dim res() As Variant Dim res() As Variant
Dim doc As String Dim doc As String
Dim ds As Worksheet Dim ds As Worksheet

View File

@ -29,6 +29,12 @@ Private Sub cbOK_Click()
openf.Hide openf.Hide
End Sub End Sub
Private Sub cbOK_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 2 And Shift = 2 Then
shConfig.Range("debug_mode") = Not shConfig.Range("debug_mode")
End If
End Sub
Private Sub opDSM_Click() Private Sub opDSM_Click()
cbDSM.Enabled = True cbDSM.Enabled = True
cbDirector.Enabled = False cbDirector.Enabled = False

Binary file not shown.

Binary file not shown.

View File

@ -440,14 +440,7 @@ Private Sub BuildJson()
'if there is no existing volume on the target month but units are being added 'if there is no existing volume on the target month but units are being added
If units(pos, 2) + units(pos, 3) = 0 And units(pos, 4) <> 0 Then If units(pos, 2) + units(pos, 3) = 0 And units(pos, 4) <> 0 Then
'add month 'add month
If Round(price(pos, 5), 8) <> Round(tprice(1, 2) + tprice(1, 3), 8) Then
'if the target price is diferent from the average and a month is being added
adjust(pos)("type") = "addmonth_vp" adjust(pos)("type") = "addmonth_vp"
Else
'if the target price is the same as average and a month is being added
'--ignore above comment and always use add month_vp
adjust(pos)("type") = "addmonth_vp"
End If
adjust(pos)("month") = shMonthView.Range("OrderMonths").Cells(pos, 1) adjust(pos)("month") = shMonthView.Range("OrderMonths").Cells(pos, 1)
adjust(pos)("qty") = units(pos, 4) adjust(pos)("qty") = units(pos, 4)
adjust(pos)("amount") = sales(pos, 4) adjust(pos)("amount") = sales(pos, 4)