В расчетах взяты числа по модулю, чтобы избежать ввода отрицательных значений.
This commit is contained in:
parent
c8c01067da
commit
c84655bdc4
@ -114,7 +114,7 @@ def main():
|
|||||||
values[6], values[4]) # p, t, h, md, d, st, mk, am, post, x
|
values[6], values[4]) # p, t, h, md, d, st, mk, am, post, x
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = calculating(cost, values[5], params['marge']) # cost, mod, marg
|
result = calculating(abs(cost), values[5], params['marge']) # cost, mod, marg
|
||||||
except KeyError:
|
except KeyError:
|
||||||
Sgi.popup_ok(new_marge)
|
Sgi.popup_ok(new_marge)
|
||||||
result = 0
|
result = 0
|
||||||
|
7
LICENSE
7
LICENSE
@ -1,7 +0,0 @@
|
|||||||
Copyright <2023> <Risen>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -15,7 +15,7 @@ def cost_prise(p, t, h, md, d, st, mk, am, post, x):
|
|||||||
x = int(x) # количество экземпляров
|
x = int(x) # количество экземпляров
|
||||||
except ValueError:
|
except ValueError:
|
||||||
x = 1
|
x = 1
|
||||||
result = (p / 1000 * t / 60 * h) + (md * d * (st / mk) + am + post) * x
|
result = (abs(p) / 1000 * abs(t) / 60 * abs(h)) + (abs(md) * abs(d) * (abs(st) / abs(mk)) + abs(am) + abs(post)) * x
|
||||||
return round(result, 2)
|
return round(result, 2)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
lang_list = ['Русский', 'English']
|
|
@ -21,3 +21,4 @@ themes_list = ['Black', 'BlueMono', 'BluePurple', 'BrightColors', 'BrownBlue', '
|
|||||||
'Material1', 'Material2', 'NeutralBlue', 'Purple', 'Python', 'PythonPlus', 'Reddit', 'Reds',
|
'Material1', 'Material2', 'NeutralBlue', 'Purple', 'Python', 'PythonPlus', 'Reddit', 'Reds',
|
||||||
'SandyBeach', 'SystemDefault', 'SystemDefault1', 'SystemDefaultForReal', 'Tan', 'TanBlue',
|
'SandyBeach', 'SystemDefault', 'SystemDefault1', 'SystemDefaultForReal', 'Tan', 'TanBlue',
|
||||||
'TealMono', 'Topanga']
|
'TealMono', 'Topanga']
|
||||||
|
lang_list = ['Русский', 'English']
|
4
setts.py
4
setts.py
@ -3,8 +3,8 @@ import PySimpleGUI as Sgi
|
|||||||
import gettext
|
import gettext
|
||||||
|
|
||||||
from texts import amortization_calc, new_sets
|
from texts import amortization_calc, new_sets
|
||||||
from themes_list import themes_list
|
from lists import themes_list, lang_list
|
||||||
from lang_list import lang_list
|
|
||||||
|
|
||||||
with open('setts.json') as file:
|
with open('setts.json') as file:
|
||||||
old_data = json.load(file)
|
old_data = json.load(file)
|
||||||
|
Loading…
Reference in New Issue
Block a user