diff --git a/fpvt.frm b/fpvt.frm index 0ff699d..0b08c7c 100644 --- a/fpvt.frm +++ b/fpvt.frm @@ -345,7 +345,7 @@ Private Sub UserForm_Activate() For i = 1 To sp("package")("totals").Count Select Case sp("package")("totals")(i)("order_season") - Case 2020 + Case 2021 Select Case Me.iter_def(sp("package")("totals")(i)("iter")) Case "baseline" bVol = bVol + sp("package")("totals")(i)("units") @@ -657,7 +657,7 @@ Sub calc_val() 'build json Set adjust = JsonConverter.ParseJson("{""scenario"":" & scenario & "}") - adjust("scenario")("version") = "b20" + adjust("scenario")("version") = handler.plan adjust("scenario")("iter") = handler.basis adjust("stamp") = Format(Date + time, "yyyy-mm-dd hh:mm:ss") adjust("user") = Application.UserName @@ -709,12 +709,12 @@ Sub calc_price() 'build json Set adjust = JsonConverter.ParseJson("{""scenario"":" & scenario & "}") - adjust("scenario")("version") = "b20" + adjust("scenario")("version") = handler.plan adjust("scenario")("iter") = handler.basis adjust("stamp") = Format(Date + time, "yyyy-mm-dd hh:mm:ss") adjust("user") = Application.UserName adjust("source") = "adj" - adjust("version") = "b20" + adjust("version") = handler.plan If opEditSales Then If opPlugVol Then @@ -779,7 +779,7 @@ Sub calc_mval() 'build json Set j = JsonConverter.ParseJson("{""scenario"":" & scenario & "}") - j("scenario")("version") = "b20" + j("scenario")("version") = handler.plan j("scenario")("iter") = handler.basis j("stamp") = Format(Date + time, "yyyy-mm-dd hh:mm:ss") j("user") = Application.UserName @@ -848,7 +848,7 @@ Sub calc_mprice() 'build json Set j = JsonConverter.ParseJson("{""scenario"":" & scenario & "}") - j("scenario")("version") = "b20" + j("scenario")("version") = handler.plan j("scenario")("iter") = handler.basis j("stamp") = Format(Date + time, "yyyy-mm-dd hh:mm:ss") j("user") = Application.UserName diff --git a/fpvt.frx b/fpvt.frx index d7f4656..9428be6 100644 Binary files a/fpvt.frx and b/fpvt.frx differ diff --git a/handler.bas b/handler.bas index 0379b97..a3837fd 100644 --- a/handler.bas +++ b/handler.bas @@ -11,6 +11,7 @@ Public data() As String Public agg() As String Public showprice As Boolean Public server As String +Public plan As String Public basis() As Variant Public baseline() As Variant Public adjust() As Variant @@ -346,6 +347,8 @@ Sub load_config() i = i + 1 Loop ReDim Preserve handler.adjust(j - 1) + '---plan version-------------------------------------------------------------- + handler.plan = Sheets("config").Cells(9, 2) End Sub @@ -406,7 +409,7 @@ Sub month_tosheet(ByRef pkg() As Variant, ByRef basket() As Variant) If (pkg(i, 3) + pkg(i, 2)) = 0 Or pkg(i, 2) = 0 Then sh.Cells(i + 1, 8) = 0 Else - sh.Cells(i + 1, 8) = (pkg(i, 7) + pkg(i, 6)) / (pkg(i, 3) + pkg(i, 2)) - (pkg(i, 6) / pkg(i, 2)) + sh.Cells(i + 1, 8) = (Round(pkg(i, 7), 10) + Round(pkg(i, 6), 10)) / (Round(pkg(i, 3), 10) + Round(pkg(i, 2), 10)) - (Round(pkg(i, 6), 10) / Round(pkg(i, 2), 10)) End If '--current adjust--