radboy 0.0.636__py3-none-any.whl → 0.0.637__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of radboy might be problematic. Click here for more details.

radboy/DB/Prompt.py CHANGED
@@ -189,23 +189,23 @@ def getExtras(entryId,extras):
189
189
  def getSuperTotal(results,location_fields,colormapped):
190
190
  with db.Session(db.ENGINE) as session:
191
191
  ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
192
- master_total=decR("0.00")
193
- master_total_crv=decR("0.00")
194
- master_total_tax=decR("0.00")
195
- master_total_tax_crv=decR("0.00")
192
+ master_total=decc("0.00",cf=ROUNDTO)
193
+ master_total_crv=decc("0.00",cf=ROUNDTO)
194
+ master_total_tax=decc("0.00",cf=ROUNDTO)
195
+ master_total_tax_crv=decc("0.00",cf=ROUNDTO)
196
196
  for num,i in enumerate(results):
197
- total=decR("0.00")
198
- crv=decR("0.00")
199
- tax=decR("0.00")
200
- tax_crv=decR("0.00")
201
- i.Tax=decR(i.Tax)
202
- i.CRV=decR(i.CRV)
203
- i.Price=decR(i.Price)
197
+ total=decc("0.00",cf=ROUNDTO)
198
+ crv=decc("0.00",cf=ROUNDTO)
199
+ tax=decc("0.00",cf=ROUNDTO)
200
+ tax_crv=decc("0.00",cf=ROUNDTO)
201
+ i.Tax=decc(i.Tax,cf=ROUNDTO)
202
+ i.CRV=decc(i.CRV,cf=ROUNDTO)
203
+ i.Price=decc(i.Price,cf=ROUNDTO)
204
204
  session.commit()
205
205
  for n2,f in enumerate(location_fields):
206
206
  try:
207
207
  if getattr(i,f) > 0:
208
- total+=decR(getattr(i,f))
208
+ total+=decc(getattr(i,f),cf=ROUNDTO)
209
209
  except Exception as e:
210
210
  print(e)
211
211
 
@@ -1135,10 +1135,12 @@ class Prompt(object):
1135
1135
  return
1136
1136
  #start
1137
1137
  ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
1138
+
1138
1139
  master_total=decc("0.0000",cf=ROUNDTO)
1139
1140
  master_total_crv=decc("0.00",cf=ROUNDTO)
1140
1141
  master_total_tax=decc("0.0000",cf=ROUNDTO)
1141
1142
  master_total_tax_crv=decc("0.0000",cf=ROUNDTO)
1143
+
1142
1144
  reRunRequired=False
1143
1145
  for num,i in enumerate(results):
1144
1146
  getExtras(i.EntryId,extras)
@@ -1192,16 +1194,17 @@ class Prompt(object):
1192
1194
  session.refresh(i)
1193
1195
 
1194
1196
  #print("#1")
1197
+
1195
1198
  if not minus:
1196
1199
  for n2,f in enumerate(location_fields):
1197
1200
  try:
1198
1201
  if getattr(i,f) > 0:
1199
- total+=decR(getattr(i,f))
1202
+ total+=decc(getattr(i,f),cf=ROUNDTO)
1200
1203
  except Exception as e:
1201
1204
  print(e)
1202
1205
  for n2,f in enumerate(location_fields):
1203
1206
  if getattr(i,f) > 0:
1204
- msg2=f'{colormapped[n2]}{f} = {decR(getattr(i,f))}{Style.reset}'
1207
+ msg2=f'{colormapped[n2]}{f} = {decc(getattr(i,f),cf=ROUNDTO)}{Style.reset}'
1205
1208
  if n2 < len(location_fields):
1206
1209
  msg2+=","
1207
1210
  msg+=msg2
@@ -1218,6 +1221,7 @@ class Prompt(object):
1218
1221
  if n2 < len(location_fields):
1219
1222
  msg2+=","
1220
1223
  msg+=msg2
1224
+
1221
1225
  master_total+=total*decc(i.Price,cf=ROUNDTO)
1222
1226
 
1223
1227
  crv+=(decc(i.CRV,cf=ROUNDTO)*total)
@@ -1229,8 +1233,8 @@ class Prompt(object):
1229
1233
  master_total_tax_crv+=tax_crv
1230
1234
  #print("#exegen",type(total),type(tax_crv))
1231
1235
  try:
1232
- #print((total*decR(i.Price)+tax_crv),"s1")
1233
- #print(decR(getSuperTotal(results,location_fields,colormapped)['final total']).quantize(decR("00.00")),"s2")
1236
+ #print((total*decc(i.Price)+tax_crv),"s1")
1237
+ #print(decc(getSuperTotal(results,location_fields,colormapped)['final total']).quantize(decc("00.00")),"s2")
1234
1238
  #print(tax_crv,"s3")
1235
1239
  #super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
1236
1240
  if (total*decc(i.Price,cf=ROUNDTO)+tax+crv) > 0:
@@ -1246,25 +1250,26 @@ class Prompt(object):
1246
1250
  print(p2,"p2")
1247
1251
  super_total=0
1248
1252
  #print("#exegen2")
1249
- super_total=decR(super_total)
1253
+ super_total=decc(super_total,cf=ROUNDTO)
1250
1254
  #print(super_total)
1255
+
1251
1256
  if simple:
1252
1257
  msg+=f""" Total = {total}"""
1253
1258
  print(db.strip_colors(msg))
1254
1259
  else:
1255
1260
  msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{total}
1256
- {Fore.light_magenta}Price({decR(i.Price):.{getcontext().prec}f}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({total}):{decR(i.Price)*total:.{getcontext().prec}f}
1257
- {Fore.grey_70}+CRV({decR(i.CRV):.{getcontext().prec}f})*Total({total}){Fore.slate_blue_1}
1258
- {Fore.medium_spring_green}= {Fore.slate_blue_1}TotalCRV({crv:.{getcontext().prec}f})+TotalPrice({total*decR(i.Price):.{getcontext().prec}f})
1259
- {Fore.medium_spring_green}= {Fore.green_3a}NetPrice({total*decR(i.Price)+crv:.{getcontext().prec}f}){Style.reset}
1260
- {Fore.grey_70}+Tax({decR(i.Tax):.{getcontext().prec}f}) w/o CRV({decR(i.CRV):.{getcontext().prec}f})*Total({total}){Fore.slate_blue_1}
1261
+ {Fore.light_magenta}Price({decc(i.Price):.{getcontext().prec}f}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({total}):{decc(i.Price)*total:.{getcontext().prec}f}
1262
+ {Fore.grey_70}+CRV({decc(i.CRV):.{getcontext().prec}f})*Total({total}){Fore.slate_blue_1}
1263
+ {Fore.medium_spring_green}= {Fore.slate_blue_1}TotalCRV({crv:.{getcontext().prec}f})+TotalPrice({total*decc(i.Price):.{getcontext().prec}f})
1264
+ {Fore.medium_spring_green}= {Fore.green_3a}NetPrice({total*decc(i.Price)+crv:.{getcontext().prec}f}){Style.reset}
1265
+ {Fore.grey_70}+Tax({decc(i.Tax):.{getcontext().prec}f}) w/o CRV({decc(i.CRV):.{getcontext().prec}f})*Total({total}){Fore.slate_blue_1}
1261
1266
  {Fore.medium_spring_green}= {Fore.slate_blue_1}TaxNoCRVTotal({tax:.{getcontext().prec}f})+TotalPrice({total*i.Price:.{getcontext().prec}f})
1262
- {Fore.medium_spring_green}= {Fore.green_3a}NetPrice({total*decR(i.Price)+tax:.{getcontext().prec}f}){Style.reset}
1263
- {Fore.grey_70}+Tax({decR(i.Tax):.{getcontext().prec}f}) w/ CRV({decR(i.CRV):.{getcontext().prec}f})*Total({total}){Fore.slate_blue_1}
1267
+ {Fore.medium_spring_green}= {Fore.green_3a}NetPrice({total*decc(i.Price)+tax:.{getcontext().prec}f}){Style.reset}
1268
+ {Fore.grey_70}+Tax({decc(i.Tax):.{getcontext().prec}f}) w/ CRV({decc(i.CRV):.{getcontext().prec}f})*Total({total}){Fore.slate_blue_1}
1264
1269
  {Fore.medium_spring_green}= {Fore.slate_blue_1}TaxCRVTotal({tax_crv:.{getcontext().prec}f})+TotalPrice({total*i.Price:.{getcontext().prec}f})
1265
- {Fore.medium_spring_green}= {Fore.green_3a}NetPrice({total*decR(i.Price)+tax+crv:.{getcontext().prec}f}){Style.reset}
1270
+ {Fore.medium_spring_green}= {Fore.green_3a}NetPrice({total*decc(i.Price)+tax+crv:.{getcontext().prec}f}){Style.reset}
1266
1271
  {Fore.medium_violet_red}PercentOfTotal({super_total:.{getcontext().prec}f}%) of FinalTotal({getSuperTotal(results,location_fields,colormapped)['final total']})
1267
- {Fore.orange_red_1}TaxRate({taxRate:.{getcontext().prec}f})={decR(taxRate*100):.{getcontext().prec}f}%{Style.reset}
1272
+ {Fore.orange_red_1}TaxRate({taxRate:.{getcontext().prec}f})={decc(taxRate*100):.{getcontext().prec}f}%{Style.reset}
1268
1273
  {'*'*os.get_terminal_size().columns}{Style.reset}"""
1269
1274
  if bldlse:
1270
1275
  db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
@@ -1296,10 +1301,11 @@ class Prompt(object):
1296
1301
  cse(i.Barcode)
1297
1302
  continue
1298
1303
 
1299
- master_total=decR(str(master_total))
1300
- master_total_crv=decR(str(master_total_crv))
1301
- master_total_tax=decR(str(master_total_tax))
1302
- master_total_tax_crv=decR(str(master_total_tax_crv))
1304
+ #exit(f"here {master_total} {master_total_crv} {master_total_tax} {master_total_tax_crv}")
1305
+ master_total=decc(str(master_total),cf=ROUNDTO)
1306
+ master_total_crv=decc(str(master_total_crv),cf=ROUNDTO)
1307
+ master_total_tax=decc(str(master_total_tax),cf=ROUNDTO)
1308
+ master_total_tax_crv=decc(str(master_total_tax_crv),cf=ROUNDTO)
1303
1309
 
1304
1310
  actual=(master_total_crv+master_total)+master_total_tax
1305
1311
 
radboy/DB/types.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from decimal import Decimal as TDecimal,getcontext
2
- import string,random
2
+ import string,random,re
3
3
  class decc(TDecimal):
4
4
  ''' defines a decimal of 'cf\''''
5
5
  def __new__(self,value,cf=3):
@@ -14,8 +14,23 @@ class decc(TDecimal):
14
14
  value=f"{value:.{cf}f}"
15
15
  print(value)
16
16
  '''
17
-
18
- value=f"{value:.{cf}f}"
17
+ print(value,type(value))
18
+ if isinstance(value,str):
19
+ scientific=re.findall(r'[-+]?[0-9]+\.?[0-9]*[Ee](?:\ *[-+]?\ *[0-9]+)?',value)
20
+ if len(scientific) < 1:
21
+ try:
22
+ whole,part=value.split(".")
23
+ except Exception as e:
24
+ whole,part=value,"0"*cf
25
+ if len(part) > cf:
26
+ part=part[:cf-1]
27
+ value=f"{whole}.{part}"
28
+ print(value)
29
+ else:
30
+ pass
31
+
32
+ else:
33
+ value=f"{value:.{cf}f}"
19
34
  return super().__new__(self,value)
20
35
 
21
36
  class dec3(TDecimal):
@@ -96,5 +111,3 @@ class stre(str):
96
111
  else:
97
112
  raise NotImplemented
98
113
 
99
-
100
- decR=lambda x,ROUNDTO=4:decc(x,cf=ROUNDTO)
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.636'
1
+ VERSION='0.0.637'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.636
3
+ Version: 0.0.637
4
4
  Summary: A Retail Calculator for Android/Linux
5
5
  Author: Carl Joseph Hirner III
6
6
  Author-email: Carl Hirner III <k.j.hirner.wisdom@gmail.com>
@@ -5,7 +5,7 @@ radboy/Holidays.txt,sha256=y-JZPihh5iaWKxMIHNXD39yVuVmf1vMs4FdNDcg0f1Y,3114
5
5
  radboy/InventoryGlossary.txt,sha256=018-Yqca6DFb10jPdkUY-5qhkRlQN1k3rxoTaERQ-LA,91008
6
6
  radboy/RecordMyCodes.py,sha256=KI7Jmf3MX0Zng_YUvcjVKN2siyUOhaMAHQGzpPuX8KQ,41373
7
7
  radboy/Run.py,sha256=JUoCTHnzQBv7n8PB2_i93ANdAC_iW__RkAge8esCnk4,76
8
- radboy/__init__.py,sha256=UBvy7HCgsGul5Ygf6DQL0WGNElYxRnoILhDl_fDhCMk,17
8
+ radboy/__init__.py,sha256=KpbRErXmwbZBx529_08OhxumP8psv-2FE57sL0bjdLo,17
9
9
  radboy/api_key,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  radboy/case-export-2024-05-14-13-10-00.672971.xlsx,sha256=Wd592d_VLFmfUI9KKKSVjNwjV91euc1T7ATyvwvUhlg,5431
11
11
  radboy/case-export-2024-05-14-13-13-22.540614.xlsx,sha256=OnGrhmScHfGp_mVaWW-LNMsqrQgyZDpiU3wV-2s3U5Q,5556
@@ -87,7 +87,7 @@ radboy/DB/OrderedAndRxd.py,sha256=PZ_Rbm0H3DFhHuN1SZEnd1RhEnKOU_L0X0MHXwYN3-s,23
87
87
  radboy/DB/PayDay.py,sha256=H2kPGvBCDkMOz7lbxQhYtUt_oAInpxi37Q6MFrah98I,8710
88
88
  radboy/DB/PayModels.py,sha256=hjwWxP7PL33hmfzQl5YTf0HqzaMxXJxFknPdxFJXJc8,3499
89
89
  radboy/DB/PrintLogging.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
90
- radboy/DB/Prompt.py,sha256=lkCxjs3W5pZyKj0FCV8td5pVUpGtH-cEbvt3gk3gAXM,166735
90
+ radboy/DB/Prompt.py,sha256=P8cQg9bxU5q13G2UScsmzOrBIR2Far4923eBwz0WVo4,167060
91
91
  radboy/DB/RandomStringUtil.py,sha256=eZCpR907WStgfbk4Evcghjv9hOkUDXH-iMXIq0-kXq8,24386
92
92
  radboy/DB/ResetTools.py,sha256=RbI-Ua7UlsN0S9qLqtEkTWvzyTZ6R-hHR3CW4NHlUPE,6660
93
93
  radboy/DB/SMLabelImporter.py,sha256=eUoBDxVUUEKGL2g_PwkASM67ZB7FmXtSnn4bCagskhY,4013
@@ -100,7 +100,7 @@ radboy/DB/masterLookup.py,sha256=DBaM2uscG3_X5dek49wjdnOzhrjWhKgvOEz_umdz0mY,456
100
100
  radboy/DB/msg.txt,sha256=YxWed6A6tuP1djJ5QPS2Rz3ING4TKKf8kUiCCPtzHXE,7937
101
101
  radboy/DB/renderText2Png.py,sha256=PWnTicLTfOPg9UlQYia3wMpjM9rh7MIyDVsmcsDRUBo,5678
102
102
  radboy/DB/testClass.py,sha256=t3zT1gbvReUncnPY8R9JUfKXQ5UEB2wmQx8DNeds0hI,310
103
- radboy/DB/types.py,sha256=X9UI3Opx3Bv-VEi3MOi3h9sG6wdQbxr78YjN-q-8OPU,3302
103
+ radboy/DB/types.py,sha256=uxDpJDHa9TPUDz9kbMvfFham0fDbLKwk88fkpmQravk,3825
104
104
  radboy/DB/__pycache__/DatePicker.cpython-311.pyc,sha256=VMJnJ7scb4VHMQi1HDZCF67KVYfb9m-fZK96IAoJzTQ,19676
105
105
  radboy/DB/__pycache__/DatePicker.cpython-312.pyc,sha256=cc5XWJ6Sbtcg0xWPz3SOP93VceIqr1pH42kjkLl5iYs,30294
106
106
  radboy/DB/__pycache__/DatePicker.cpython-313.pyc,sha256=jV__j5ER1oshsenGPynR0UNHWMI7VStgyw73-iLKxzg,33993
@@ -112,7 +112,7 @@ radboy/DB/__pycache__/FormBuilder.cpython-312.pyc,sha256=p1o-5SMRL8OXP_XQ5liUpf-
112
112
  radboy/DB/__pycache__/PrintLogging.cpython-312.pyc,sha256=pIAFqTi6OiQQORSc-oMH1zAbsdH7sY1TifxrN_QOvnU,148
113
113
  radboy/DB/__pycache__/Prompt.cpython-311.pyc,sha256=P2uPRpeqfLFtxieZ0JHBG3X_HZzWUCsFSLb_fpRqky0,6407
114
114
  radboy/DB/__pycache__/Prompt.cpython-312.pyc,sha256=6CcQ1gE2hcz3cKPjo4f6d7xNM2PTDnl8NzQG0Pme5BE,142886
115
- radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=ZVOclt9s8KSalBsgBsWG3TN5v0JS81nxaQVzqJDR6mE,251934
115
+ radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=J6mKv__62KSvmzb7RoO6JPd5tvux4oH12RLz9zqAYMU,251947
116
116
  radboy/DB/__pycache__/RandomStringUtil.cpython-312.pyc,sha256=TrbEY89MuLmNlvoo5d8vOE6Dyshh5_EMlTZvk8MDVN4,48597
117
117
  radboy/DB/__pycache__/RandomStringUtil.cpython-313.pyc,sha256=MCcgVwV2Y-9rAY2FVaJZCKcou3HDX70EZudoiCigT0o,49217
118
118
  radboy/DB/__pycache__/ResetTools.cpython-311.pyc,sha256=4Vyc57iAAF0yRPjjglnVKovnTn8OoFIi6Zok3Wpj_YM,9292
@@ -401,7 +401,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
401
401
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
402
402
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
403
403
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
404
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=WL1GTbbZWZ2upB5RCQ9ERY8PlezI5jy3udI6FUCEh2w,165
404
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=cPpgtLvEWNhEH38L-_7yNl4am9LRN4EWwHueMx9A7i8,165
405
405
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
406
406
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
407
407
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -429,7 +429,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
429
429
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
430
430
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
431
431
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
432
- radboy-0.0.636.dist-info/METADATA,sha256=zQdfICJ_bgDNlyM5FFPlLkhE4RYKtK0jZxjdCaP-iX4,1891
433
- radboy-0.0.636.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
434
- radboy-0.0.636.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
435
- radboy-0.0.636.dist-info/RECORD,,
432
+ radboy-0.0.637.dist-info/METADATA,sha256=ViD4OzEs0y5YrZN4FwxTPmoblnBHaBMLKRPJkl8sJSM,1891
433
+ radboy-0.0.637.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
434
+ radboy-0.0.637.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
435
+ radboy-0.0.637.dist-info/RECORD,,