radboy 0.0.660__py3-none-any.whl → 0.0.661__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.

Binary file
radboy/DB/db.py CHANGED
@@ -5913,3 +5913,40 @@ def CD4E(code):
5913
5913
  except Exception as e:
5914
5914
  print(e)
5915
5915
  return Entry('EXCEPTION','Exception')
5916
+
5917
+ @dataclass
5918
+ class TaxRate(BASE,Template):
5919
+ __tablename__="TaxRate"
5920
+ txrt_id=Column(Integer,primary_key=True)
5921
+ DTOE=Column(DateTime,default=datetime.now())
5922
+
5923
+ TaxRate=Column(Float,default=0)
5924
+ Name=Column(String,default=None)
5925
+
5926
+ StreetAddress=Column(String,default='6819 Waltons Ln')
5927
+ City=Column(String,default=None)
5928
+ County=Column(String,default='Gloucester')
5929
+ State=Column(String,default='VA')
5930
+ ZIP=Column(String,default='23061')
5931
+ Country=Column(String,default='USA')
5932
+
5933
+ def as_json(self,excludes=['txrt_id','DTOE']):
5934
+ dd={str(d.name):self.__dict__[d.name] for d in self.__table__.columns if d.name not in excludes}
5935
+ return json.dumps(dd)
5936
+
5937
+ def asID(self):
5938
+ return f"{self.__class__.__name__}(cbid={self.cbid})"
5939
+
5940
+ def __init__(self,**kwargs):
5941
+ if 'DTOE' not in kwargs:
5942
+ self.DTOE=datetime.now()
5943
+ for k in kwargs.keys():
5944
+ if k in [s.name for s in self.__table__.columns]:
5945
+ setattr(self,k,kwargs.get(k))
5946
+
5947
+ try:
5948
+ TaxRate.metadata.create_all(ENGINE)
5949
+ except Exception as e:
5950
+ print(e)
5951
+ TaxRate.__table__.drop(ENGINE)
5952
+ TaxRate.metadata.create_all(ENGINE)
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.660'
1
+ VERSION='0.0.661'
Binary file
@@ -446,4 +446,38 @@ Here:
446
446
  'desc':f'is item taxable?[taxable=True,non-taxable=False]',
447
447
  'exec':lambda: Taxable.general_taxable(None),
448
448
  },
449
+ f'{uuid1()}':{
450
+ 'cmds':['tax add',],
451
+ 'desc':'''AddNewTaxRate() -> None
452
+
453
+ add a new taxrate to db.''',
454
+ 'exec':lambda: AddNewTaxRate(),
455
+ },
456
+ f'{uuid1()}':{
457
+ 'cmds':['tax get',],
458
+ 'desc': '''GetTaxRate() -> TaxRate:Decimal
459
+
460
+ search for and return a Decimal/decc
461
+ taxrate for use by prompt.
462
+ ''',
463
+ 'exec':lambda: GetTaxRate(),
464
+ },
465
+ f'{uuid1()}':{
466
+ 'cmds':['tax delete',],
467
+ 'desc':'''DeleteTaxRate() -> None
468
+
469
+ search for and delete selected
470
+ taxrate.
471
+ ''',
472
+ 'exec':lambda: DeleteTaxRate(),
473
+ },
474
+ f'{uuid1()}':{
475
+ 'cmds':['tax edit',],
476
+ 'desc':'''EditTaxRate() -> None
477
+
478
+ search for and edit selected
479
+ taxrate.
480
+ ''',
481
+ 'exec':lambda: EditTaxRate(),
482
+ },
449
483
  }
@@ -193,4 +193,210 @@ juices)''',
193
193
  return True
194
194
 
195
195
  return False
196
-
196
+
197
+ #tax rate tools go here
198
+ def AddNewTaxRate(excludes=['txrt_id','DTOE']):
199
+ with Session(ENGINE) as session:
200
+ '''AddNewTaxRate() -> None
201
+
202
+ add a new taxrate to db.'''
203
+ tr=TaxRate()
204
+ session.add(tr)
205
+ session.commit()
206
+ session.refresh(tr)
207
+ fields={i.name:{
208
+ 'default':getattr(tr,i.name),
209
+ 'type':str(i.type).lower()} for i in tr.__table__.columns if i.name not in excludes
210
+ }
211
+
212
+ fd=FormBuilder(data=fields)
213
+ if fd is None:
214
+ session.delete(tr)
215
+ return
216
+ for k in fd:
217
+ setattr(tr,k,fd[k])
218
+
219
+
220
+ session.add(tr)
221
+ session.commit()
222
+ session.refresh(tr)
223
+ print(tr)
224
+ return tr.TaxRate
225
+
226
+ def GetTaxRate(excludes=['txrt_id','DTOE']):
227
+ with Session(ENGINE) as session:
228
+ '''GetTaxRate() -> TaxRate:Decimal
229
+
230
+ search for and return a Decimal/decc
231
+ taxrate for use by prompt.
232
+ '''
233
+ tr=TaxRate()
234
+ fields={i.name:{
235
+ 'default':getattr(tr,i.name),
236
+ 'type':str(i.type).lower()} for i in tr.__table__.columns if i.name not in excludes
237
+ }
238
+
239
+ fd=FormBuilder(data=fields)
240
+ if fd is None:
241
+ return
242
+ for k in fd:
243
+ setattr(tr,k,fd[k])
244
+ #and_
245
+ filte=[]
246
+ for k in fd:
247
+ if fd[k] is not None:
248
+ if isinstance(fd[k],str):
249
+ filte.append(getattr(TaxRate,k).icontains(fd[k]))
250
+ else:
251
+ filte.append(getattr(tr,k)==fd[k])
252
+
253
+ results=session.query(TaxRate).filter(and_(*filte)).all()
254
+ ct=len(results)
255
+ htext=[]
256
+ for num,i in enumerate(results):
257
+ m=std_colorize(i,num,ct)
258
+ print(m)
259
+ htext.append(m)
260
+ htext='\n'.join(htext)
261
+ if ct < 1:
262
+ print(f"{Fore.light_red}There is nothing to work on in TaxRates that match your criteria.{Style.reset}")
263
+ return
264
+ while True:
265
+ select=Control(func=FormBuilderMkText,ptext="Which index to return for tax rate[NAN=0.0000]?",helpText=htext,data="integer")
266
+ print(select)
267
+ if select is None:
268
+ return
269
+ elif isinstance(select,str) and select.upper() in ['NAN',]:
270
+ return 0
271
+ elif select in ['d',]:
272
+ return results[0].TaxRate
273
+ else:
274
+ if index_inList(select,results):
275
+ return results[select].TaxRate
276
+ else:
277
+ continue
278
+
279
+ def DeleteTaxRate(excludes=['txrt_id','DTOE']):
280
+ with Session(ENGINE) as session:
281
+ '''DeleteTaxRate() -> None
282
+
283
+ search for and delete selected
284
+ taxrate.
285
+ '''
286
+ '''AddNewTaxRate() -> None
287
+
288
+ add a new taxrate to db.'''
289
+ tr=TaxRate()
290
+ fields={i.name:{
291
+ 'default':getattr(tr,i.name),
292
+ 'type':str(i.type).lower()} for i in tr.__table__.columns if i.name not in excludes
293
+ }
294
+ fd=FormBuilder(data=fields)
295
+ if fd is None:
296
+ return
297
+ for k in fd:
298
+ setattr(tr,k,fd[k])
299
+ #and_
300
+ filte=[]
301
+ for k in fd:
302
+ if fd[k] is not None:
303
+ if isinstance(fd[k],str):
304
+ filte.append(getattr(TaxRate,k).icontains(fd[k]))
305
+ else:
306
+ filte.append(getattr(tr,k)==fd[k])
307
+ session.commit()
308
+
309
+ results=session.query(TaxRate).filter(and_(*filte)).all()
310
+ ct=len(results)
311
+ htext=[]
312
+ for num,i in enumerate(results):
313
+ m=std_colorize(i,num,ct)
314
+ print(m)
315
+ htext.append(m)
316
+ htext='\n'.join(htext)
317
+ if ct < 1:
318
+ print(f"{Fore.light_red}There is nothing to work on in TaxRates that match your criteria.{Style.reset}")
319
+ return
320
+ while True:
321
+ select=Control(func=FormBuilderMkText,ptext="Which index to delete?",helpText=htext,data="integer")
322
+ print(select)
323
+ if select is None:
324
+ print(f"{Fore.light_yellow}Nothing was deleted!{Style.reset}")
325
+ return
326
+ elif isinstance(select,str) and select.upper() in ['NAN',]:
327
+ print(f"{Fore.light_yellow}Nothing was deleted!{Style.reset}")
328
+ return 0
329
+ elif select in ['d',]:
330
+ print(f"{Fore.light_yellow}Nothing was deleted!{Style.reset}")
331
+ return
332
+ else:
333
+ if index_inList(select,results):
334
+ session.delete(results[select])
335
+ session.commit()
336
+ return
337
+ else:
338
+ continue
339
+
340
+ def EditTaxRate(excludes=['txrt_id','DTOE']):
341
+ '''DeleteTaxRate() -> None
342
+
343
+ search for and delete selected
344
+ taxrate.
345
+ '''
346
+ tr=TaxRate()
347
+ fields={i.name:{
348
+ 'default':getattr(tr,i.name),
349
+ 'type':str(i.type).lower()} for i in tr.__table__.columns if i.name not in excludes
350
+ }
351
+ fd=FormBuilder(data=fields)
352
+ if fd is None:
353
+ return
354
+ for k in fd:
355
+ setattr(tr,k,fd[k])
356
+ #and_
357
+ filte=[]
358
+ for k in fd:
359
+ if fd[k] is not None:
360
+ if isinstance(fd[k],str):
361
+ filte.append(getattr(TaxRate,k).icontains(fd[k]))
362
+ else:
363
+ filte.append(getattr(tr,k)==fd[k])
364
+ with Session(ENGINE) as session:
365
+ results=session.query(TaxRate).filter(and_(*filte)).all()
366
+ ct=len(results)
367
+ htext=[]
368
+ for num,i in enumerate(results):
369
+ m=std_colorize(i,num,ct)
370
+ print(m)
371
+ htext.append(m)
372
+ htext='\n'.join(htext)
373
+ if ct < 1:
374
+ print(f"{Fore.light_red}There is nothing to work on in TaxRates that match your criteria.{Style.reset}")
375
+ return
376
+ while True:
377
+ select=Control(func=FormBuilderMkText,ptext="Which index to edit?",helpText=htext,data="integer")
378
+ print(select)
379
+ if select is None:
380
+ print(f"{Fore.light_yellow}Nothing was deleted!{Style.reset}")
381
+ return
382
+ elif isinstance(select,str) and select.upper() in ['NAN',]:
383
+ print(f"{Fore.light_yellow}Nothing was deleted!{Style.reset}")
384
+ return 0
385
+ elif select in ['d',]:
386
+ print(f"{Fore.light_yellow}Nothing was deleted!{Style.reset}")
387
+ return
388
+ else:
389
+ if index_inList(select,results):
390
+ fields={i.name:{
391
+ 'default':getattr(results[select],i.name),
392
+ 'type':str(i.type).lower()} for i in results[select].__table__.columns if i.name not in excludes
393
+ }
394
+ fd=FormBuilder(data=fields)
395
+ for k in fd:
396
+ setattr(results[select],k,fd[k])
397
+ session.commit()
398
+ session.refresh(results[select])
399
+ print(results[select])
400
+ return
401
+ else:
402
+ continue
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.660
3
+ Version: 0.0.661
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=HVzz2j9RIBAdHhioHlbjRHUW1l05XF6VmcYkj7bJqZg,17
8
+ radboy/__init__.py,sha256=2d06B5zPbGVm5U3zM7RZLkR_Zku5DSbJ3panCWooouA,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
@@ -95,7 +95,7 @@ radboy/DB/SMLabelImporter.py,sha256=eUoBDxVUUEKGL2g_PwkASM67ZB7FmXtSnn4bCagskhY,
95
95
  radboy/DB/__init__.py,sha256=JiigA9B7GalP7YuRdcwyGDu5PDSBahoi0lLjtScxlN8,49
96
96
  radboy/DB/blankDataFile.py,sha256=YX_05Usi71UpDkZN9UTMYwUipbTndTAtEgqzBEga0kE,9285
97
97
  radboy/DB/config.py,sha256=bvu43dUl1_yO3Zq3gsLuenGUgJSiS3S9Cs6ppFEvZbg,239
98
- radboy/DB/db.py,sha256=AaHwBBY72PcPL6qI1aryHeroNQgY_hS4gA2odVGgqnA,261645
98
+ radboy/DB/db.py,sha256=GuaulDuCPgH6LF5KqT1DQxC_HkzC5bsqtwtt2W-Uzg8,262819
99
99
  radboy/DB/glossary_db.py,sha256=1_qxeEpjjEtpWB_eDjsgJisimLv7OBm75MuqM-Lt6zg,28218
100
100
  radboy/DB/masterLookup.py,sha256=DBaM2uscG3_X5dek49wjdnOzhrjWhKgvOEz_umdz0mY,4566
101
101
  radboy/DB/msg.txt,sha256=YxWed6A6tuP1djJ5QPS2Rz3ING4TKKf8kUiCCPtzHXE,7937
@@ -131,7 +131,7 @@ radboy/DB/__pycache__/config.cpython-312.pyc,sha256=Qo7E6MHrF6yqvKgepNFyCoekZXiv
131
131
  radboy/DB/__pycache__/config.cpython-313.pyc,sha256=_8wCIg_3jhyJjxnExD2Sm6aY-uZTw036p7Ki5znL7dc,376
132
132
  radboy/DB/__pycache__/db.cpython-311.pyc,sha256=rNgigyBd0D-cg1JxKAS8t0B_k0IEJivgVlRaZE10Xis,210105
133
133
  radboy/DB/__pycache__/db.cpython-312.pyc,sha256=ANDJPC0RoavbmSKFxG15vC7B4rEGyVt7xRJt7XGY3OA,334609
134
- radboy/DB/__pycache__/db.cpython-313.pyc,sha256=c4pmtaCfyZF2zzTTbilslCmyHj9iNfnQEjwsiyX4A8k,409921
134
+ radboy/DB/__pycache__/db.cpython-313.pyc,sha256=Q-cTX5QwWIUIvQDvmr2kBvZMkT64bGNOL5-vVGP6DgQ,412019
135
135
  radboy/DB/__pycache__/glossary_db.cpython-312.pyc,sha256=8UL-29cKqtKovx0BANm6kzKKteef1BW_2qF3wumzst4,36023
136
136
  radboy/DB/__pycache__/glossary_db.cpython-313.pyc,sha256=Ke9bkvllGv5CK0JdT9DRvQ3MOdrXxoYv7TVLNkqLux0,36582
137
137
  radboy/DB/__pycache__/masterLookup.cpython-312.pyc,sha256=bQiOkmMwwHgcO18tYSWGQ-YUff4GQlKVhBMp1GoWAqY,6324
@@ -402,7 +402,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
402
402
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
403
403
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
404
404
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
405
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=zmv6kQx6V4yH-PMM96LiWASJMOXMhgD6FfT57dblim0,165
405
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=lY-aUf6_P32D5mNEPdgH-bTqIlVoiTKX7EpIADsYPrI,165
406
406
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
407
407
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
408
408
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -412,8 +412,8 @@ radboy/__pycache__/t.cpython-311.pyc,sha256=bVszNkmfiyoNLd0WUc8aBJc2geGseW4O28cq
412
412
  radboy/__pycache__/te.cpython-311.pyc,sha256=vI8eNUE5VVrfCQvnrJ7WuWpoKcLz-vVK3ifdUZ4UNhk,592
413
413
  radboy/__pycache__/x.cpython-311.pyc,sha256=3jIvWoO5y5WqrL_hRmXNK8O0vO7DwJ4gufjm2b0V7VI,1963
414
414
  radboy/preloader/__init__.py,sha256=lrGR0JF0dkDM8N9ORGUKH_MucUFx1-PI38YsvqS-wgA,926
415
- radboy/preloader/preloader.py,sha256=SX7wmdp3-H5FT7TAcqcImT8XSPcvG25sfIKGfVBqTDo,12778
416
- radboy/preloader/preloader_func.py,sha256=Y0_6_gdvV0AAmTptxzcnuej9RS2nD9A2ii-PpflB0J8,5845
415
+ radboy/preloader/preloader.py,sha256=J0_rcCMMVQX-K26a1UA63dmSi1NvA7Prd0mSSpnIJOw,13506
416
+ radboy/preloader/preloader_func.py,sha256=DDWDFr3j-vnhpkmeu1dg2Z5uyNIHfJy-xmpkJVNj_4c,11336
417
417
  radboy/setCode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
418
418
  radboy/setCode/setCode.py,sha256=8UOf4okbx-Zane99odeoLAS_lfIt8pIaFomN7EtnnVA,5202
419
419
  radboy/setCode/__pycache__/__init__.cpython-311.pyc,sha256=cJuP5rve6Wn7ZO789tixyOlyrHZQWsBxDn9oZGoG5WE,232
@@ -430,7 +430,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
430
430
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
431
431
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
432
432
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
433
- radboy-0.0.660.dist-info/METADATA,sha256=5J3cukeMBqlhq1IL8PucmAIg-ZyDhbjKSUj1M-CKBd8,1891
434
- radboy-0.0.660.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
435
- radboy-0.0.660.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
436
- radboy-0.0.660.dist-info/RECORD,,
433
+ radboy-0.0.661.dist-info/METADATA,sha256=at2zfUxFHRV1MT6lq5FL24zKP_qdtZ2C4tPyVsXeOiI,1891
434
+ radboy-0.0.661.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
435
+ radboy-0.0.661.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
436
+ radboy-0.0.661.dist-info/RECORD,,