radboy 0.0.349__py3-none-any.whl → 0.0.351__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
@@ -30,6 +30,22 @@ from decimal import Decimal
30
30
  import biip
31
31
  import signal
32
32
 
33
+ def getExtras(entryId,extras):
34
+ if not extras:
35
+ return
36
+ with db.Session(db.ENGINE) as session:
37
+ msg=f'{Fore.light_green}-----------|{Fore.light_yellow}For EntryId: {entryId} {Fore.light_green}|-----------{Style.reset}\n'
38
+ extras_items=session.query(db.EntryDataExtras).filter(db.EntryDataExtras.EntryId==entryId).all()
39
+ extras_ct=len(extras_items)
40
+ mtext=[]
41
+ for n,e in enumerate(extras_items):
42
+ mtext.append(f"\t- {Fore.orange_red_1}{e.field_name}:{Fore.light_steel_blue}{e.field_type}={Fore.light_yellow}{e.field_value} {Fore.cyan}ede_id={e.ede_id} {Fore.light_magenta}doe={e.doe}{Style.reset}")
43
+ mtext='\n'.join(mtext)
44
+ msg+=mtext
45
+
46
+ print(msg)
47
+ return msg
48
+
33
49
  def getSuperTotal(results,location_fields,colormapped):
34
50
  with db.Session(db.ENGINE) as session:
35
51
  ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
@@ -866,9 +882,18 @@ class Prompt(object):
866
882
  {m}{Fore.black}{Back.grey_70} P_CMDS SncLstCmd:{str(duration).split(".")[0]} {Style.reset}|{Fore.black}{Back.grey_50} TmInShl:{str(InShellElapsed).split(".")[0]}|DT:{now.ctime()}| {Fore.dark_blue}{Style.bold}{Style.underline}Week {datetime.now().strftime("%W")} {Style.reset}|{Fore.light_magenta}#RPLC#={Fore.tan}rplc {Fore.light_magenta}#RPLC#{Fore.tan} frm {Fore.light_red}CB{Fore.orange_3}.{Fore.light_green}default={Fore.light_yellow}True{Fore.light_steel_blue} or by {Fore.light_red}CB{Fore.orange_3}.{Fore.light_green}doe={Fore.light_yellow}Newest{Style.reset}|{Fore.light_salmon_1}c2c=calc2cmd={Fore.sky_blue_2}clctr rslt to inpt{Style.reset}|b={color2}back|{Fore.light_red}h={color3}help{color4}|{Fore.light_red}h+={color3}help+{color4}|{Fore.light_magenta}i={color3}info|{Fore.light_green}{Fore.light_steel_blue}CMD#c2cb[{Fore.light_red}e{Fore.light_steel_blue}]{Fore.light_green}{Fore.light_red}|{Fore.orange_3}c2cb[{Fore.light_red}e{Fore.orange_3}]#CMD{Fore.light_green} - copy CMD to cb and set default | Note: optional [{Fore.light_red}e{Fore.light_green}] executes after copy{Style.reset} {Fore.light_steel_blue}NTE: cmd ends/start-swith [{Fore.light_red}#clr|clr#{Fore.light_green}{Fore.light_steel_blue}] clrs crnt ln 4 a rtry{Style.reset} {Fore.orange_red_1}|c{Fore.light_steel_blue}=calc|{Fore.spring_green_3a}cb={Fore.light_blue}clipboard{Style.reset}|{Fore.light_salmon_1}cdp={Fore.green_yellow}paste cb dflt {Fore.green}|q={Fore.green_yellow}Quit Menu (qm)
867
883
  {Fore.light_red+os.get_terminal_size().columns*'.'}
868
884
  {Fore.rgb(55,191,78)}HFL:{Fore.rgb(55,130,191)}{lineTotal()}{Fore.light_red} ->{Fore.light_green}{Back.grey_15}''')
885
+
886
+ def strip_null(text):
887
+ if '\0' in text:
888
+ return text.replace("\00","").replace("\0","")
889
+ else:
890
+ return text
891
+ cmd=strip_null(cmd)
892
+
869
893
  db.logInput(cmd)
870
894
  print(f"{Fore.medium_violet_red}{os.get_terminal_size().columns*'.'}{Style.reset}",end='')
871
895
 
896
+
872
897
  def preProcess_RPLC(cmd):
873
898
  if '#RPLC#' in cmd:
874
899
  with db.Session(db.ENGINE) as session:
@@ -1955,6 +1980,10 @@ last month = today-30d
1955
1980
  result=global_search_for_text()
1956
1981
  return func(result,data)
1957
1982
  elif cmd.lower() in ["bldls","build","buildls","build list","bld ls",'lsbld','list build','ls bld','bld']:
1983
+ extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
1984
+ if extras in [None,'d',False]:
1985
+ extras=False
1986
+
1958
1987
  with db.Session(db.ENGINE) as session:
1959
1988
  results_query=session.query(db.Entry).filter(db.Entry.InList==True)
1960
1989
  location_fields=["Shelf","BackRoom","Display_1","Display_2","Display_3","Display_4","Display_5","Display_6","ListQty","SBX_WTR_DSPLY","SBX_CHP_DSPLY","SBX_WTR_KLR","FLRL_CHP_DSPLY","FLRL_WTR_DSPLY","WD_DSPLY","CHKSTND_SPLY","Distress"]
@@ -1978,6 +2007,7 @@ last month = today-30d
1978
2007
  master_total_tax_crv=0
1979
2008
 
1980
2009
  for num,i in enumerate(results):
2010
+ getExtras(i.EntryId,extras)
1981
2011
  msg=f'{"*"*os.get_terminal_size().columns}\n{Fore.light_green}{num}{Fore.light_magenta}/{Fore.orange_3}{num+1} of {Fore.light_red}{ct}[{Fore.dark_slate_gray_1}EID{Fore.orange_3}]{Fore.dark_violet_1b}{i.EntryId}{Style.reset} |-| {Fore.light_yellow}{i.Name}|{Fore.light_salmon_1}[{Fore.light_red}BCD]{i.rebar()}{Fore.medium_violet_red}|[{Fore.light_red}CD{Fore.medium_violet_red}]{i.cfmt(i.Code)} {Style.reset}|-| '
1982
2012
  colormapped=[
1983
2013
  Fore.deep_sky_blue_4c,
@@ -2063,6 +2093,9 @@ last month = today-30d
2063
2093
  if t is not None:
2064
2094
  return func(str(t),data)
2065
2095
  elif cmd.lower() in ["bldlse","builde","buildlse","build list export ","bld ls exp",'elsbld','export list build','exp ls bld','ebld']:
2096
+ extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2097
+ if extras in [None,'d',False]:
2098
+ extras=False
2066
2099
  msg=''
2067
2100
  db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file,clear_only=True)
2068
2101
  with db.Session(db.ENGINE) as session:
@@ -2091,6 +2124,7 @@ last month = today-30d
2091
2124
  master_total_tax_crv=0
2092
2125
 
2093
2126
  for num,i in enumerate(results):
2127
+ getExtras(i.EntryId,extras)
2094
2128
  msg=f'{"*"*os.get_terminal_size().columns}\n{Fore.light_green}{num}{Fore.light_magenta}/{Fore.orange_3}{num+1} of {Fore.light_red}{ct}[{Fore.dark_slate_gray_1}EID{Fore.orange_3}]{Fore.dark_violet_1b}{i.EntryId}{Style.reset} |-| {Fore.light_yellow}{i.Name}|{Fore.light_salmon_1}[{Fore.light_red}BCD]{i.rebar()}{Fore.medium_violet_red}|[{Fore.light_red}CD{Fore.medium_violet_red}]{i.cfmt(i.Code)} {Style.reset}|-| '
2095
2129
  colormapped=[
2096
2130
  Fore.deep_sky_blue_4c,
@@ -2173,6 +2207,9 @@ last month = today-30d
2173
2207
  db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2174
2208
  print(msg)
2175
2209
  elif cmd.lower() in ['sbld','search build','search_build','scan build','scan_bld']:
2210
+ extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2211
+ if extras in [None,'d',False]:
2212
+ extras=False
2176
2213
  end=False
2177
2214
  while not end:
2178
2215
  with db.Session(db.ENGINE) as session:
@@ -2218,6 +2255,7 @@ last month = today-30d
2218
2255
  master_total_tax_crv=0
2219
2256
 
2220
2257
  for num,i in enumerate(results):
2258
+ getExtras(i.EntryId,extras)
2221
2259
  msg=f'{"*"*os.get_terminal_size().columns}\n{Fore.light_green}{num}{Fore.light_magenta}/{Fore.orange_3}{num+1} of {Fore.light_red}{ct}[{Fore.dark_slate_gray_1}EID{Fore.orange_3}]{Fore.dark_violet_1b}{i.EntryId}{Style.reset} |-| {Fore.light_yellow}{i.Name}|{Fore.light_salmon_1}[{Fore.light_red}BCD]{i.rebar()}{Fore.medium_violet_red}|[{Fore.light_red}CD{Fore.medium_violet_red}]{i.cfmt(i.Code)} {Style.reset}|-| '
2222
2260
  colormapped=[
2223
2261
  Fore.deep_sky_blue_4c,
@@ -2298,6 +2336,9 @@ last month = today-30d
2298
2336
  {Style.reset}"""
2299
2337
  print(msg)
2300
2338
  elif cmd.lower() in ['esbld','export search build','export_search_build','exp scan build','exp_scan_bld']:
2339
+ extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2340
+ if extras in [None,'d',False]:
2341
+ extras=False
2301
2342
  end=False
2302
2343
  msg=''
2303
2344
  db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file,clear_only=True)
@@ -2347,6 +2388,7 @@ last month = today-30d
2347
2388
  master_total_tax_crv=0
2348
2389
 
2349
2390
  for num,i in enumerate(results):
2391
+ getExtras(i.EntryId,extras)
2350
2392
  msg=f'{"*"*os.get_terminal_size().columns}\n{Fore.light_green}{num}{Fore.light_magenta}/{Fore.orange_3}{num+1} of {Fore.light_red}{ct}[{Fore.dark_slate_gray_1}EID{Fore.orange_3}]{Fore.dark_violet_1b}{i.EntryId}{Style.reset} |-| {Fore.light_yellow}{i.Name}|{Fore.light_salmon_1}[{Fore.light_red}BCD]{i.rebar()}{Fore.medium_violet_red}|[{Fore.light_red}CD{Fore.medium_violet_red}]{i.cfmt(i.Code)} {Style.reset}|-| '
2351
2393
  colormapped=[
2352
2394
  Fore.deep_sky_blue_4c,
@@ -2429,6 +2471,9 @@ last month = today-30d
2429
2471
  db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2430
2472
  print(msg)
2431
2473
  elif cmd.lower() in ["bldls-","build-","buildls-","build list -","bld ls -",'lsbld-','list build -','ls bld -','bld-']:
2474
+ extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2475
+ if extras in [None,'d',False]:
2476
+ extras=False
2432
2477
  with db.Session(db.ENGINE) as session:
2433
2478
  results_query=session.query(db.Entry).filter(db.Entry.InList==True)
2434
2479
  location_fields=["Shelf","BackRoom","Display_1","Display_2","Display_3","Display_4","Display_5","Display_6","ListQty","SBX_WTR_DSPLY","SBX_CHP_DSPLY","SBX_WTR_KLR","FLRL_CHP_DSPLY","FLRL_WTR_DSPLY","WD_DSPLY","CHKSTND_SPLY","Distress"]
@@ -2452,6 +2497,7 @@ last month = today-30d
2452
2497
  master_total_tax_crv=0
2453
2498
 
2454
2499
  for num,i in enumerate(results):
2500
+ getExtras(i.EntryId,extras)
2455
2501
  msg=f'{"*"*os.get_terminal_size().columns}\n{Fore.light_green}{num}{Fore.light_magenta}/{Fore.orange_3}{num+1} of {Fore.light_red}{ct}[{Fore.dark_slate_gray_1}EID{Fore.orange_3}]{Fore.dark_violet_1b}{i.EntryId}{Style.reset} |-| {Fore.light_yellow}{i.Name}|{Fore.light_salmon_1}[{Fore.light_red}BCD]{i.rebar()}{Fore.medium_violet_red}|[{Fore.light_red}CD{Fore.medium_violet_red}]{i.cfmt(i.Code)} {Style.reset}|-| '
2456
2502
  colormapped=[
2457
2503
  Fore.deep_sky_blue_4c,
@@ -2529,6 +2575,9 @@ last month = today-30d
2529
2575
  {Style.reset}"""
2530
2576
  print(msg)
2531
2577
  elif cmd.lower() in ["bldlse-","builde-","buildlse-","build list export -","bld ls exp -",'elsbld-','export list build -','exp ls bld -','ebld-']:
2578
+ extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2579
+ if extras in [None,'d',False]:
2580
+ extras=False
2532
2581
  msg=''
2533
2582
  db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file,clear_only=True)
2534
2583
  with db.Session(db.ENGINE) as session:
@@ -2556,6 +2605,7 @@ last month = today-30d
2556
2605
  master_total_tax_crv=0
2557
2606
 
2558
2607
  for num,i in enumerate(results):
2608
+ getExtras(i.EntryId,extras)
2559
2609
  msg=f'{"*"*os.get_terminal_size().columns}\n{Fore.light_green}{num}{Fore.light_magenta}/{Fore.orange_3}{num+1} of {Fore.light_red}{ct}[{Fore.dark_slate_gray_1}EID{Fore.orange_3}]{Fore.dark_violet_1b}{i.EntryId}{Style.reset} |-| {Fore.light_yellow}{i.Name}|{Fore.light_salmon_1}[{Fore.light_red}BCD]{i.rebar()}{Fore.medium_violet_red}|[{Fore.light_red}CD{Fore.medium_violet_red}]{i.cfmt(i.Code)} {Style.reset}|-| '
2560
2610
  colormapped=[
2561
2611
  Fore.deep_sky_blue_4c,
@@ -2636,6 +2686,9 @@ last month = today-30d
2636
2686
  print(msg)
2637
2687
  db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2638
2688
  elif cmd.lower() in ['sbld-','search build -','search_build-','scan build-','scan_bld-']:
2689
+ extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2690
+ if extras in [None,'d',False]:
2691
+ extras=False
2639
2692
  end=False
2640
2693
  while not end:
2641
2694
  with db.Session(db.ENGINE) as session:
@@ -2679,6 +2732,7 @@ last month = today-30d
2679
2732
  master_total_tax_crv=0
2680
2733
 
2681
2734
  for num,i in enumerate(results):
2735
+ getExtras(i.EntryId,extras)
2682
2736
  msg=f'{"*"*os.get_terminal_size().columns}\n{Fore.light_green}{num}{Fore.light_magenta}/{Fore.orange_3}{num+1} of {Fore.light_red}{ct}[{Fore.dark_slate_gray_1}EID{Fore.orange_3}]{Fore.dark_violet_1b}{i.EntryId}{Style.reset} |-| {Fore.light_yellow}{i.Name}|{Fore.light_salmon_1}[{Fore.light_red}BCD]{i.rebar()}{Fore.medium_violet_red}|[{Fore.light_red}CD{Fore.medium_violet_red}]{i.cfmt(i.Code)} {Style.reset}|-| '
2683
2737
  colormapped=[
2684
2738
  Fore.deep_sky_blue_4c,
@@ -2756,6 +2810,9 @@ last month = today-30d
2756
2810
  {Style.reset}"""
2757
2811
  print(msg)
2758
2812
  elif cmd.lower() in ['esbld-','export search build -','export_search_build-','exp scan build-','exp_scan_bld-']:
2813
+ extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2814
+ if extras in [None,'d',False]:
2815
+ extras=False
2759
2816
  end=False
2760
2817
  msg=''
2761
2818
  db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file,clear_only=True)
@@ -2803,6 +2860,7 @@ last month = today-30d
2803
2860
  master_total_tax_crv=0
2804
2861
 
2805
2862
  for num,i in enumerate(results):
2863
+ getExtras(i.EntryId,extras)
2806
2864
  msg=f'{"*"*os.get_terminal_size().columns}\n{Fore.light_green}{num}{Fore.light_magenta}/{Fore.orange_3}{num+1} of {Fore.light_red}{ct}[{Fore.dark_slate_gray_1}EID{Fore.orange_3}]{Fore.dark_violet_1b}{i.EntryId}{Style.reset} |-| {Fore.light_yellow}{i.Name}|{Fore.light_salmon_1}[{Fore.light_red}BCD]{i.rebar()}{Fore.medium_violet_red}|[{Fore.light_red}CD{Fore.medium_violet_red}]{i.cfmt(i.Code)} {Style.reset}|-| '
2807
2865
  colormapped=[
2808
2866
  Fore.deep_sky_blue_4c,
@@ -1,6 +1,13 @@
1
1
  #MobileInventoryCLI is now radboy
2
2
  from . import *
3
+ from collections import OrderedDict
3
4
  from radboy.DB.db import ENGINE
5
+ import uuid,base64
6
+
7
+ #generated by google gemini
8
+ def generate_24_char_uuid():
9
+ return Entry.cfmt(None,str(uuid.uuid4()).replace("-",''))
10
+
4
11
  def get_bool(text):
5
12
  if text in (None,'',False,'n','N','NO','No','nO','False','false',0,'0'):
6
13
  return False
@@ -176,7 +183,382 @@ class EntryDataExtrasMenu:
176
183
  except Exception as e:
177
184
  print(e)
178
185
 
179
- nutrients={
186
+ def enable_all_diabetic_facts(self):
187
+ with Session(ENGINE) as session:
188
+ try:
189
+ toolid=-1
190
+ try:
191
+ diabetic_facts_placeholder=session.query(Entry).filter(Entry.EntryId==toolid).first()
192
+ if diabetic_facts_placeholder is None:
193
+ diabetic_facts_placeholder=Entry(Name="Diabetic_Facts_PlaceHolder",Barcode="Diabetic_Facts_PlaceHolder",Code="Diabetic_Facts_PlaceHolder",InList=False,EntryId=toolid)
194
+ session.add(diabetic_facts_placeholder)
195
+ session.commit()
196
+ session.flush()
197
+ session.refresh(diabetic_facts_placeholder)
198
+ except Exception as ee:
199
+ print(ee)
200
+
201
+ diabetic_fields=self.diabetic_fields
202
+ ct=len(diabetic_fields)
203
+ for num,k in enumerate(diabetic_fields):
204
+ check=session.query(EntryDataExtras).filter(and_(EntryDataExtras.field_name.icontains(k),EntryDataExtras.field_value.icontains(diabetic_fields[k]))).first()
205
+ if check is not None:
206
+ print(f"Skipping Pre-Existing {k}!")
207
+ continue
208
+ extra=EntryDataExtras(field_name=k,field_type="str",field_value=str(diabetic_fields[k]),EntryId=toolid)
209
+ session.add(extra)
210
+ session.commit()
211
+ session.flush()
212
+ session.refresh(extra)
213
+ print(f"{Fore.cyan}{num}/{Fore.light_cyan}{num+1} of {Fore.light_red}{ct} -> {Fore.orange_red_1}Adding -> {extra}!{Style.reset}")
214
+ session.commit()
215
+ except Exception as e:
216
+ print(e)
217
+
218
+
219
+ def delete_all_diabetic_facts(self):
220
+ code=''.join([str(random.randint(0,9)) for i in range(10)])
221
+ verification_protection=detectGetOrSet("Protect diabetic Facts From Delete",code,setValue=False,literal=True)
222
+ while True:
223
+ try:
224
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Do You really want to delete all diabetic facts fields?",helpText="yes or no boolean,default is NO",data="boolean")
225
+ if really in [None,]:
226
+ return
227
+ elif really in ['d',False]:
228
+ return
229
+ else:
230
+ pass
231
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"To {Fore.orange_red_1}Delete everything completely,{Fore.light_steel_blue} What is todays date?{Style.reset}",helpText="type y/yes for prompt or type as m.d.Y",data="datetime")
232
+ if really in [None,'d']:
233
+ return
234
+ today=datetime.today()
235
+ if really.day == today.day and really.month == today.month and really.year == today.year:
236
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Please type the verification code {Style.reset}'{DayLog.cfmt(None,verification_protection)}'?",helpText=f"type '{DayLog.cfmt(None,verification_protection)}' to finalize!",data="string")
237
+ if really in [None,]:
238
+ return
239
+ elif really in ['d',False]:
240
+ return
241
+ elif really == verification_protection:
242
+ break
243
+ else:
244
+ pass
245
+ except Exception as e:
246
+ print(e)
247
+ with Session(ENGINE) as session:
248
+ try:
249
+ toolid=-1
250
+ diabetic_facts_placeholder=session.query(Entry).filter(Entry.EntryId==toolid).all()
251
+ diabetic_facts_placeholder_extras=session.query(EntryDataExtras).filter(EntryDataExtras.EntryId==toolid).all()
252
+
253
+ print(f"{Fore.light_yellow}Deleting Diabetic_Facts_PlaceHolder{Style.reset}")
254
+ for i in diabetic_facts_placeholder:
255
+ print(f"{Fore.light_red}Deleting {i.seeShort()}{Style.reset}")
256
+ session.delete(i)
257
+ print(f"{Fore.light_yellow}Deleting Diabetic_Facts_PlaceHolder_Extras{Style.reset}")
258
+ for i in diabetic_facts_placeholder_extras:
259
+ print(f"{Fore.light_red}Deleting {i.field_name}{Style.reset}")
260
+ session.delete(i)
261
+ session.commit()
262
+ dependency=Prompt.__init2__(None,func=FormBuilderMkText,ptext="check to see if its not needed elsewhere and delete it if it is not needed[Y/n]",helpText="yes(default) or no",data="boolean")
263
+ if dependency is None:
264
+ return
265
+ elif dependency in [True,'d']:
266
+ results=session.query(EntryDataExtras).all()
267
+ ct=len(results)
268
+ for num,i in enumerate(results):
269
+ msg=f"{Fore.orange_red_1}DEPENDENCY CHECK{Fore.dark_goldenrod}-> {Fore.cyan}{num}/{Fore.light_cyan}{num+1} of {Fore.light_red}{ct} -> {i}"
270
+ print(msg)
271
+ check=session.query(Entry).filter(Entry.EntryId==i.EntryId).first()
272
+ check2=session.query(DayLog).filter(DayLog.EntryId==i.EntryId).first()
273
+ if not check and not check2:
274
+ session.delete(i)
275
+ if num % 100 == 0:
276
+ session.commit()
277
+ session.commit()
278
+ session.flush()
279
+ else:
280
+ print(f"{Fore.light_yellow}Deleting All nutrients facts entry data extras{Style.reset}")
281
+ for fieldname in self.diabetic_fields:
282
+ print(f"{Fore.light_red}Deleting{Fore.cyan} {fieldname}{Style.reset}")
283
+ allOthers=session.query(EntryDataExtras).filter(EntryDataExtras.field_name==fieldname).delete()
284
+ session.commit()
285
+ print(f"{Fore.light_red}Done!{Style.reset}")
286
+ except Exception as e:
287
+ print(e)
288
+
289
+ def enable_all_extraPresets_facts(self):
290
+ with Session(ENGINE) as session:
291
+ try:
292
+ toolid=-1
293
+ try:
294
+ extraPresets_facts_placeholder=session.query(Entry).filter(Entry.EntryId==toolid).first()
295
+ if extraPresets_facts_placeholder is None:
296
+ extraPresets_facts_placeholder=Entry(Name="Diabetic_Facts_PlaceHolder",Barcode="Diabetic_Facts_PlaceHolder",Code="Diabetic_Facts_PlaceHolder",InList=False,EntryId=toolid)
297
+ session.add(extraPresets_facts_placeholder)
298
+ session.commit()
299
+ session.flush()
300
+ session.refresh(extraPresets_facts_placeholder)
301
+ except Exception as ee:
302
+ print(ee)
303
+
304
+ extraPresets_fields=self.extraPresets_fields
305
+ ct=len(extraPresets_fields)
306
+ for num,k in enumerate(extraPresets_fields):
307
+ check=session.query(EntryDataExtras).filter(and_(EntryDataExtras.field_name.icontains(k),EntryDataExtras.field_value.icontains(extraPresets_fields[k]))).first()
308
+ if check is not None:
309
+ print(f"Skipping Pre-Existing {k}!")
310
+ continue
311
+ extra=EntryDataExtras(field_name=k,field_type="str",field_value=str(extraPresets_fields[k]),EntryId=toolid)
312
+ session.add(extra)
313
+ session.commit()
314
+ session.flush()
315
+ session.refresh(extra)
316
+ print(f"{Fore.cyan}{num}/{Fore.light_cyan}{num+1} of {Fore.light_red}{ct} -> {Fore.orange_red_1}Adding -> {extra}!{Style.reset}")
317
+ session.commit()
318
+ except Exception as e:
319
+ print(e)
320
+
321
+
322
+ def delete_all_extraPresets_facts(self):
323
+ code=''.join([str(random.randint(0,9)) for i in range(10)])
324
+ verification_protection=detectGetOrSet("Protect extraPresets Facts From Delete",code,setValue=False,literal=True)
325
+ while True:
326
+ try:
327
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Do You really want to delete all extraPresets facts fields?",helpText="yes or no boolean,default is NO",data="boolean")
328
+ if really in [None,]:
329
+ return
330
+ elif really in ['d',False]:
331
+ return
332
+ else:
333
+ pass
334
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"To {Fore.orange_red_1}Delete everything completely,{Fore.light_steel_blue} What is todays date?{Style.reset}",helpText="type y/yes for prompt or type as m.d.Y",data="datetime")
335
+ if really in [None,'d']:
336
+ return
337
+ today=datetime.today()
338
+ if really.day == today.day and really.month == today.month and really.year == today.year:
339
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Please type the verification code {Style.reset}'{DayLog.cfmt(None,verification_protection)}'?",helpText=f"type '{DayLog.cfmt(None,verification_protection)}' to finalize!",data="string")
340
+ if really in [None,]:
341
+ return
342
+ elif really in ['d',False]:
343
+ return
344
+ elif really == verification_protection:
345
+ break
346
+ else:
347
+ pass
348
+ except Exception as e:
349
+ print(e)
350
+ with Session(ENGINE) as session:
351
+ try:
352
+ toolid=-1
353
+ extraPresets_facts_placeholder=session.query(Entry).filter(Entry.EntryId==toolid).all()
354
+ extraPresets_facts_placeholder_extras=session.query(EntryDataExtras).filter(EntryDataExtras.EntryId==toolid).all()
355
+
356
+ print(f"{Fore.light_yellow}Deleting Diabetic_Facts_PlaceHolder{Style.reset}")
357
+ for i in extraPresets_facts_placeholder:
358
+ print(f"{Fore.light_red}Deleting {i.seeShort()}{Style.reset}")
359
+ session.delete(i)
360
+ print(f"{Fore.light_yellow}Deleting Diabetic_Facts_PlaceHolder_Extras{Style.reset}")
361
+ for i in extraPresets_facts_placeholder_extras:
362
+ print(f"{Fore.light_red}Deleting {i.field_name}{Style.reset}")
363
+ session.delete(i)
364
+ session.commit()
365
+ dependency=Prompt.__init2__(None,func=FormBuilderMkText,ptext="check to see if its not needed elsewhere and delete it if it is not needed[Y/n]",helpText="yes(default) or no",data="boolean")
366
+ if dependency is None:
367
+ return
368
+ elif dependency in [True,'d']:
369
+ results=session.query(EntryDataExtras).all()
370
+ ct=len(results)
371
+ for num,i in enumerate(results):
372
+ msg=f"{Fore.orange_red_1}DEPENDENCY CHECK{Fore.dark_goldenrod}-> {Fore.cyan}{num}/{Fore.light_cyan}{num+1} of {Fore.light_red}{ct} -> {i}"
373
+ print(msg)
374
+ check=session.query(Entry).filter(Entry.EntryId==i.EntryId).first()
375
+ check2=session.query(DayLog).filter(DayLog.EntryId==i.EntryId).first()
376
+ if not check and not check2:
377
+ session.delete(i)
378
+ if num % 100 == 0:
379
+ session.commit()
380
+ session.commit()
381
+ session.flush()
382
+ else:
383
+ print(f"{Fore.light_yellow}Deleting All nutrients facts entry data extras{Style.reset}")
384
+ for fieldname in self.extraPresets_fields:
385
+ print(f"{Fore.light_red}Deleting{Fore.cyan} {fieldname}{Style.reset}")
386
+ allOthers=session.query(EntryDataExtras).filter(EntryDataExtras.field_name==fieldname).delete()
387
+ session.commit()
388
+ print(f"{Fore.light_red}Done!{Style.reset}")
389
+ except Exception as e:
390
+ print(e)
391
+
392
+ extraPresets_fields=OrderedDict({
393
+ 'Radio-active':'Yes',
394
+ 'Carcinogen?':'Yes',
395
+ 'Toxic?':'Yes',
396
+ 'Poisonous?':'Yes',
397
+ 'Venomous?':'Yes',
398
+ 'Sharp Objects?':'Yes',
399
+ 'Bio-Hazard?':'Yes',
400
+ 'Pathogen Warning.':'N/A',
401
+ 'Caustic/Corrosive?':'Yes',
402
+
403
+ 'Hearing Protection Required?':'Yes',
404
+ 'Eye Protection Required?':'Yes',
405
+ 'PPE Required?':'Yes',
406
+ 'PPE Required Type?':'N/A',
407
+ 'PPE Required Name?':'N/A',
408
+
409
+ 'Explosive Under Pressure?':'Yes',
410
+ 'Hazmat Required??':'Yes',
411
+ 'Cut Level A1?':'Yes',
412
+ 'Cut Level A2?':'Yes',
413
+ 'Cut Level A3?':'Yes',
414
+
415
+ 'Contact Type Phone address/number/identifier':'N/A',
416
+ 'Contact Type Mobile/Cellular address/number/identifier':'N/A',
417
+ 'Contact Type Text Message address/number/identifier':'N/A',
418
+ 'Contact Type Email address/number/identifier':'N/A',
419
+ 'Contact Type Postal Mail address/number/identifier':'N/A',
420
+ 'Contact Type Mail Pigeon address/number/identifier':'N/A',
421
+ 'Contact Type Social address/number/identifier':'N/A',
422
+
423
+ "SURGEON GENERAL'S WARNING 1(Smoke Related Tobacco Products)":"Smoking Causes Lung Cancer, Heart Disease, Emphysema, and May Complicate Pregnancy.",
424
+ "SURGEON GENERAL'S WARNING 2(Smoke Related Tobacco Products)":"Quitting Smoking Now Greatly Reduces Serious Risks to Your Health.",
425
+ "SURGEON GENERAL'S WARNING 3(Smoke Related Tobacco Products)":"Smoking By Pregnant Women May Result in Fetal Injury, Premature Birth, and Low Birth Weight.",
426
+ "SURGEON GENERAL'S WARNING 4(Smoke Related Tobacco Products)":" Cigarette Smoke Contains Carbon Monoxide.",
427
+ "GOVERNMENT WARNING(Alcohol)":"(1) According to the Surgeon General, women should not drink alcoholic beverages during pregnancy because of the risk of birth defects. (2) Consumption of alcoholic beverages impairs your ability to drive a car or operate machinery, and may cause health problems.",
428
+ "GOVERNMENT WARNING(Cannabis[CA PROP 64])":"THIS PACKAGE CONTAINS CANNABIS, A SCHEDULE I CONTROLLED SUBSTANCE. KEEP OUT OF REACH OF CHILDREN AND ANIMALS. CANNABIS MAY ONLY BE POSSESSED OR CONSUMED BY PERSONS 21 YEARS OF AGE OR OLDER UNLESS THE PERSON IS A QUALIFIED PATIENT. CANNABIS USE WHILE PREGNANT OR BREASTFEEDING MAY BE HARMFUL. CONSUMPTION OF CANNABIS IMPAIRS YOUR ABILITY TO DRIVE AND OPERATE MACHINERY. PLEASE USE EXTREME CAUTION.",
429
+
430
+ 'Recycle Warning - Steel Can':'Steel Can; Please Recycle',
431
+ 'Recycle Warning - Plastic Bottle':'Plastic Bottle; Please Recycle',
432
+
433
+ 'Perishable Warning - Frozen':'Perishable; Keep Frozen',
434
+ 'Perishable Warning - Refrigerated':'Perishable; Keep Refrigerated',
435
+
436
+ 'Sharp Edge Warning':'Edges are Sharp when opened',
437
+ 'Suffocation Warning - Plastic Bag':'May Cause Suffocation if plastic bag clings to mouth and nose.',
438
+
439
+ 'Electrical Warning HV':'High Voltage',
440
+ 'Electrical Warning HA':'High Current',
441
+ 'Electrical Warning HAV':'High Current and Voltage',
442
+
443
+ 'Keep Out of Reach of Children under the age of':'6 years',
444
+
445
+ 'Alcohol! Age Restricted':'Yes',
446
+ 'Alcohol! Age Restriction':'18years',
447
+ 'Cannabis! Age Restricted':'Yes',
448
+ 'Cannabis! Age Restriction':'21y',
449
+
450
+ 'Controlled Substance':'Yes',
451
+ 'Smart Label':'',
452
+ 'URL':'https://www.google.com/',
453
+ 'Distributed By':'N/A',
454
+ 'Country Of Origin':'N/A/China/USA/etc',
455
+ 'CasePack/MasterPack Barcode':'N/A',
456
+
457
+ 'Total Cannabinoids %':'0%',
458
+ 'Total Cannabinoids mg':'0mg',
459
+ 'Total Cannabinoids %(mg)':'0%(0mg)',
460
+
461
+ 'THC Cannabinoids %':'0%',
462
+ 'THC Cannabinoids mg':'0mg',
463
+ 'THC Cannabinoids %(mg)':'0%(0mg)',
464
+
465
+ 'CBD Cannabinoids %':'0%',
466
+ 'CBD Cannabinoids mg':'0mg',
467
+ 'CBD Cannabinoids %(mg)':'0%(0mg)',
468
+
469
+ 'Manufactured By/Distributed By/Company':'SomeCorp inc., Mineapolis, MN 55440 USA',
470
+ 'Retailer':'',
471
+ 'Vendor':'',
472
+ 'Religious':'',
473
+ 'Genre':'',
474
+ 'Rating':'',
475
+
476
+ 'DDeC:000':'Generalities, Computer Science, Information & General Works',
477
+ 'DDeC:100':'Philosophy & Psychology.',
478
+ 'DDeC:200':'Religion',
479
+ 'DDeC:300':'Social Sciences',
480
+ 'DDeC:400':'Language',
481
+ 'DDeC:500':'Natural Sciences & Mathematics',
482
+ 'DDeC:600':'Technology (Applied Sciences)',
483
+ 'DDeC:700':'The Arts',
484
+ 'DDeC:800':'Literature & Rhetoric',
485
+ 'DDeC:900':'Geography & History',
486
+ 'DUI Decimal Number':'000.000',
487
+ '*DDeC:NUM':'DUI DEC:Number of Category',
488
+ 'Location':'from Google Maps or From other Coordinate providing app',
489
+ 'Related Search Terms For External Source':'',
490
+ 'External Search Source':'www.google.com',
491
+ 'Related Search Terms For Local Search':'',
492
+
493
+ 'BatchId':'D.PR42B.BLD.A06.A08',
494
+ 'UID':generate_24_char_uuid(),
495
+ 'Manufacture Date':'N/A',
496
+ 'Expiration Date(Not Associated with the Expiry System) Period(From Date of Manufacture to Date of Expiration)':'N/A',
497
+ 'Expiration Date(Not Associated with the Expiry System)':'N/A',
498
+
499
+ 'Serial #':'N/A',
500
+ 'Serial No.':'N/A',
501
+ 'Serial Number':'N/A',
502
+
503
+ 'MAC Address':'FF:FF:FF:FF:FF:FF',
504
+ 'IMEID':'N/A',
505
+ 'ICCID':'N/A',
506
+ 'IMSI':'N/A',
507
+ 'IMEI':'N/A',
508
+ 'Carrier Name':'N/A',
509
+ 'Carrier Type':'N/A',
510
+ 'Service Type':'N/A',
511
+ 'Service Name':'N/A',
512
+
513
+ 'Taxable @ Locale':'Yes @/At Seaside(93955)',
514
+ 'Tax Type @ Locale for Tax Rate %':'Sales Tax at Seaside(93955) for 0.0925',
515
+ 'Locale Where Taxed @/At Tax Rate %':'Seaside(93955) for 0.0925',
516
+ 'Locale Tax Rate % @ Locale':'0.0925 at/@ seaside(93955)',
517
+
518
+ 'Prescription Rx?':'Yes',
519
+ 'Prescription Text':'N/A',
520
+ 'Prescription Name':'N/A',
521
+ 'Prescription ID':'N/A',
522
+ 'Homeopathic?':'Yes',
523
+ 'Herbal?':'Yes',
524
+ })
525
+
526
+ diabetic_fields=OrderedDict({
527
+ 'Unit':'U',
528
+ 'Carbohydrate':'0g',
529
+ 'Hypoglycemia Response(How to Treat)':'Treat with 15 Grams of Carbs.; Chew three(3) -/to four(4) glucose tablets; Consume 1 Tbsp of Honey; Drink 1/2 cup of Juice or regular soda.',
530
+
531
+ 'Sweets?':'No',
532
+ 'Dairy(Milk & Yogurt)?':'No',
533
+ 'Fruit?':'No',
534
+ 'Starch Vegatable?':'No',
535
+ 'Protien?':'No',
536
+ 'High in Omega-3 Fat?':'No',
537
+ 'Non-Starchy Vegatable?':'No',
538
+
539
+ 'Suggested Fruit Consumption':'1 small apple',
540
+ 'Suggested Dairy Consumption':'1 cup milk',
541
+ 'Suggested Grains Consumption':'1/3 Cup Quinoa or/|| 1/4 Bagel',
542
+ 'Suggested Starch Vegatables Consumption':'1 Cup Beets or/|| 1/2 Cup Corn',
543
+ 'Suggested Combo Foods Consumption':'1/2 Slice Pizza or/|| 1/2 Cup Ice Cream',
544
+
545
+ '1 Serving':'15g',
546
+ '2 Serving':'30g',
547
+ '3 Serving':'45g',
548
+ 'Meals':'30g-60g(2 servings - 4 servings)',
549
+ 'Snacks':'>=(less than, or equal to)15 grams(>=[less than, or equal to]1 Serving)',
550
+
551
+ 'Insulin Type: Rapid Acting?':'No',
552
+ 'Insulin Type: Short Acting?':"No",
553
+ 'Insulin Type: Intermediate?':"No",
554
+ 'Insulin Type: Combination Intermediate/Rapid Acting?':"No",
555
+ 'Insulin Type: Long Acting?':'No',
556
+ 'Insulin Type: Combination Long Acting/Rapid Acting?':'No',
557
+ 'Insulin Type: Regular U-500?':'No',
558
+ })
559
+
560
+ nutrients=OrderedDict({
561
+ "Caffiene Content Per Fluid Qty (20mg/15floz)":"20mg/15floz",
180
562
  'Protien':'0g',
181
563
  "Added sugars": "50g",
182
564
  "Biotin": "30mcg",
@@ -229,7 +611,26 @@ class EntryDataExtrasMenu:
229
611
  "Calcium": "320mg",
230
612
  "Iron": "1.6mg",
231
613
  "Potassium": "510mg",
232
- }
614
+ })
615
+
616
+
617
+ def colorize(self,msg,num,ct):
618
+ return f"{Fore.light_green}{num}/{Fore.light_cyan}{num+1} {Fore.light_red}of {ct}{Fore.dark_goldenrod} -> {Fore.grey_70}{msg}{Style.reset}"
619
+
620
+ def list_nutrient_presets(self):
621
+ ct=len(self.nutrients)
622
+ for num,f in enumerate(self.nutrients):
623
+ print(self.colorize(f"{f} = {self.nutrients[f]}",num,ct))
624
+
625
+ def list_diabetic_presets(self):
626
+ ct=len(self.diabetic_fields)
627
+ for num,f in enumerate(self.diabetic_fields):
628
+ print(self.colorize(f"{f} = {self.diabetic_fields[f]}",num,ct))
629
+
630
+ def list_extraPresets_presets(self):
631
+ ct=len(self.extraPresets_fields)
632
+ for num,f in enumerate(self.extraPresets_fields):
633
+ print(self.colorize(f"{f} = {self.extraPresets_fields[f]}",num,ct))
233
634
 
234
635
  def delete_all_nutritional_facts(self):
235
636
  code=''.join([str(random.randint(0,9)) for i in range(10)])
@@ -304,12 +705,15 @@ class EntryDataExtrasMenu:
304
705
 
305
706
  def af2e(self,barcode=None):
306
707
  with Session(ENGINE) as session:
307
- if barcode != None:
308
- search=barcode
708
+ if self.code is None or not isinstance(self.code,str):
709
+ if barcode != None:
710
+ search=barcode
711
+ else:
712
+ search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
713
+ if search in [None]:
714
+ return
309
715
  else:
310
- search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
311
- if search in [None]:
312
- return
716
+ search=self.code
313
717
  results=session.query(Entry).filter(or_(Entry.Barcode==search,Entry.Code==search,Entry.Barcode.icontains(search),Entry.Code.icontains(search),Entry.Name.icontains(search))).all()
314
718
  ct=len(results)
315
719
  if ct == 0:
@@ -368,12 +772,15 @@ class EntryDataExtrasMenu:
368
772
 
369
773
  def sf2e(self,barcode=None):
370
774
  with Session(ENGINE) as session:
371
- if barcode != None:
372
- search=barcode
775
+ if self.code is None or not isinstance(self.code,str):
776
+ if barcode != None:
777
+ search=barcode
778
+ else:
779
+ search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
780
+ if search in [None]:
781
+ return
373
782
  else:
374
- search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
375
- if search in [None]:
376
- return
783
+ search=self.code
377
784
  results=session.query(Entry).filter(or_(Entry.Barcode==search,Entry.Code==search,Entry.Barcode.icontains(search),Entry.Code.icontains(search),Entry.Name.icontains(search))).all()
378
785
  ct=len(results)
379
786
  if ct == 0:
@@ -459,12 +866,15 @@ class EntryDataExtrasMenu:
459
866
  def sch_f2e(self,barcode=None):
460
867
  with Session(ENGINE) as session:
461
868
  while True:
462
- if barcode != None:
463
- search=barcode
869
+ if self.code is None or not isinstance(self.code,str):
870
+ if barcode != None:
871
+ search=barcode
872
+ else:
873
+ search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
874
+ if search in [None]:
875
+ return
464
876
  else:
465
- search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
466
- if search in [None]:
467
- return
877
+ search=self.code
468
878
 
469
879
  results=session.query(Entry).filter(or_(Entry.Barcode==search,Entry.Code==search,Entry.Barcode.icontains(search),Entry.Code.icontains(search),Entry.Name.icontains(search))).all()
470
880
  ct=len(results)
@@ -581,12 +991,15 @@ class EntryDataExtrasMenu:
581
991
 
582
992
  def sch_c2e(self,barcode=None):
583
993
  with Session(ENGINE) as session:
584
- if barcode != None:
585
- search=barcode
994
+ if self.code is None or not isinstance(self.code,str):
995
+ if barcode != None:
996
+ search=barcode
997
+ else:
998
+ search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
999
+ if search in [None]:
1000
+ return
586
1001
  else:
587
- search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
588
- if search in [None]:
589
- return
1002
+ search=self.code
590
1003
 
591
1004
  results=session.query(Entry).filter(or_(Entry.Barcode==search,Entry.Code==search,Entry.Barcode.icontains(search),Entry.Code.icontains(search),Entry.Name.icontains(search))).all()
592
1005
  ct=len(results)
@@ -753,9 +1166,12 @@ class EntryDataExtrasMenu:
753
1166
 
754
1167
  def lookup(self):
755
1168
  with Session(ENGINE) as session:
756
- search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
757
- if search in [None]:
758
- return
1169
+ if self.code is None or not isinstance(self.code,str):
1170
+ search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
1171
+ if search in [None]:
1172
+ return
1173
+ else:
1174
+ search=self.code
759
1175
  results=session.query(Entry).filter(or_(Entry.Barcode==search,Entry.Code==search,Entry.Barcode.icontains(search),Entry.Code.icontains(search),Entry.Name.icontains(search))).all()
760
1176
  ct=len(results)
761
1177
  if ct == 0:
@@ -790,9 +1206,57 @@ class EntryDataExtrasMenu:
790
1206
  print(product.seeShort())
791
1207
  print(mtext)
792
1208
 
1209
+ def list_all_fields_generator(self):
1210
+ print("laaf()")
1211
+ with Session(ENGINE) as session:
1212
+ fields=session.query(EntryDataExtras).group_by(EntryDataExtras.field_name,EntryDataExtras.field_type).order_by(EntryDataExtras.doe).all()
1213
+ ct=len(fields)
1214
+ for num,field in enumerate(fields):
1215
+ msg=f"""{Fore.light_green}{num}/{Fore.light_yellow}{num+1} of {Fore.light_red}{ct} -> {Fore.orange_red_1}EntryDataExtra{Fore.light_cyan}(
1216
+ ede_id={Fore.light_steel_blue}{field.ede_id}{Fore.light_cyan},
1217
+ doe={Fore.light_steel_blue}{field.doe}{Fore.light_cyan},
1218
+ field_name={Fore.light_steel_blue}{field.field_name}{Fore.light_cyan},
1219
+ field_value={Fore.light_steel_blue}{field.field_value}{Fore.light_cyan},
1220
+ ){Style.reset}"""
1221
+ yield num,ct,field,msg
1222
+
1223
+ def list_all_fields(self):
1224
+ with Session(ENGINE) as session:
1225
+ fields=session.query(EntryDataExtras).group_by(EntryDataExtras.field_name,EntryDataExtras.field_type).order_by(EntryDataExtras.doe).all()
1226
+ ct=len(fields)
1227
+ for num,field in enumerate(fields):
1228
+ msg=f"""{Fore.light_green}{num}/{Fore.light_yellow}{num+1} of {Fore.light_red}{ct} -> {Fore.orange_red_1}EntryDataExtra{Fore.light_cyan}(
1229
+ ede_id={Fore.light_steel_blue}{field.ede_id}{Fore.light_cyan},
1230
+ doe={Fore.light_steel_blue}{field.doe}{Fore.light_cyan},
1231
+ field_name={Fore.light_steel_blue}{field.field_name}{Fore.light_cyan},
1232
+ field_value={Fore.light_steel_blue}{field.field_value}{Fore.light_cyan},
1233
+ ){Style.reset}"""
1234
+
1235
+ print(msg)
793
1236
 
794
- def __init__(self):
795
- cmds={
1237
+ def __init__(self,code=None):
1238
+ self.code=code
1239
+ cmds=OrderedDict({
1240
+ 'list all extraPresets presets':{
1241
+ 'cmds':['la-xp','laxp','la xp','ls xtr prst','list extra preset'],
1242
+ 'exec':self.list_extraPresets_presets,
1243
+ 'desc':"list extra preset[These are hardcoded]."
1244
+ },
1245
+ 'list all diabetic presets':{
1246
+ 'cmds':['la-dp','ladp','la dp','ls dbtc prst','list diabetic presets'],
1247
+ 'exec':self.list_diabetic_presets,
1248
+ 'desc':"list diabetic presets[These are hardcoded]."
1249
+ },
1250
+ 'list all nutrients presets':{
1251
+ 'cmds':['la-np','lanp','la np','ls ntrnt prst','list nutrients presets'],
1252
+ 'exec':self.list_nutrient_presets,
1253
+ 'desc':"list nutrients presets[These are hardcoded]."
1254
+ },
1255
+ 'list all available fields':{
1256
+ 'cmds':['la-af','laaf','la af','ls al avlbl flds','ls * flds','ls*flds','lsalflds'],
1257
+ 'exec':self.list_all_fields,
1258
+ 'desc':"list all available fields."
1259
+ },
796
1260
  'enable all nutritional facts':{
797
1261
  'cmds':['eanf','enable all nutrional facts'],
798
1262
  'exec':self.enable_all_nutritional_facts,
@@ -803,6 +1267,26 @@ class EntryDataExtrasMenu:
803
1267
  'exec':self.delete_all_nutritional_facts,
804
1268
  'desc':"Delete Entry placeholder for nutritional facts and all of its EntryDataExtras, and all other nutritional facts fields. There is a triple prompt before proceeding!!!"
805
1269
  },
1270
+ 'enable all diabetic facts':{
1271
+ 'cmds':['eadf','enable all diabetic facts','enable diabetes'],
1272
+ 'exec':self.enable_all_diabetic_facts,
1273
+ 'desc':"add an Entry placeholder for diabetic facts and add all diabetic facts fields."
1274
+ },
1275
+ 'delete and disable all diabetic facts':{
1276
+ 'cmds':['dadadf','delete and disable all diabetic facts','disable diabetes'],
1277
+ 'exec':self.delete_all_diabetic_facts,
1278
+ 'desc':"Delete Entry placeholder for diabetic facts and all of its EntryDataExtras, and all other diabetic facts fields. There is a triple prompt before proceeding!!!"
1279
+ },
1280
+ 'enable all extraPresets facts':{
1281
+ 'cmds':['eaxpf','enable all extrapresets facts','enable extrapresets'],
1282
+ 'exec':self.enable_all_extraPresets_facts,
1283
+ 'desc':"add an Entry placeholder for extraPresets facts and add all extraPresets facts fields."
1284
+ },
1285
+ 'delete and disable all extraPresets facts':{
1286
+ 'cmds':['dadaxpf','delete and disable all extrapresets facts','disable extrapresets'],
1287
+ 'exec':self.delete_all_extraPresets_facts,
1288
+ 'desc':"Delete Entry placeholder for extraPresets facts and all of its EntryDataExtras, and all other extraPresets facts fields. There is a triple prompt before proceeding!!!"
1289
+ },
806
1290
  'af2e':{
807
1291
  'cmds':['af2e','add field to entry','add field 2 entry'],
808
1292
  'exec':self.af2e,
@@ -843,7 +1327,7 @@ class EntryDataExtrasMenu:
843
1327
  'exec':self.edee,
844
1328
  'desc':'ensures last used field is applied to all Entry\'s [SLOW!!!]',
845
1329
  }
846
- }
1330
+ })
847
1331
  '''
848
1332
  elif doWhat.lower() in "sch f2e,ssf2e".split(","):
849
1333
  self.sch_f2e()
@@ -862,8 +1346,9 @@ elif doWhat.lower() in "sch f2e,ssf2e".split(","):
862
1346
  break
863
1347
  '''
864
1348
  helpText=[]
865
- for m in cmds:
866
- helpText.append(f"{cmds[m]['cmds']} - {cmds[m]['desc']}")
1349
+ ct=len(cmds)
1350
+ for num,m in enumerate(cmds):
1351
+ helpText.append(self.colorize(f"{Fore.light_steel_blue}{cmds[m]['cmds']}{Fore.grey_70} - {Fore.light_steel_blue}{cmds[m]['desc']}{Style.reset}",num,ct))
867
1352
  helpText='\n'.join(helpText)
868
1353
  while True:
869
1354
  doWhat=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"EntryDataExtras@{Fore.light_green}Menu{Fore.light_yellow}",helpText=helpText,data="string")
radboy/TasksMode/Tasks.py CHANGED
@@ -1093,7 +1093,7 @@ so use {Fore.orange_red_1}ls-lq/ls Shelf {Fore.light_yellow}from {Fore.light_mag
1093
1093
  if doWhat in [None,]:
1094
1094
  return
1095
1095
  elif doWhat.lower() in ['em','extras menu']:
1096
- EntryDataExtrasMenu()
1096
+ EntryDataExtrasMenu(code=code)
1097
1097
  elif doWhat.lower() in ['nfa',f"nfa","new entry from all","new_entry_from_all","nefa"]:
1098
1098
  self.NewEntryAll()
1099
1099
  elif doWhat.lower() in ['edit entry',f"ee","ed en"]:
@@ -1863,6 +1863,70 @@ so use {Fore.orange_red_1}ls-lq/ls Shelf {Fore.light_yellow}from {Fore.light_mag
1863
1863
  entrySepStart=f'{Back.grey_30}{Fore.light_red}\\\\{Fore.light_green}{"*"*10}{Fore.light_yellow}|{Fore.light_steel_blue}#REPLACE#{Fore.light_magenta}|{Fore.orange_red_1}{"+"*10}{Fore.light_yellow}{Style.bold}({today()}){Fore.light_red}//{Style.reset}'
1864
1864
  entrySepEnd=f'{Back.grey_30}{Fore.light_red}\\\\{Fore.orange_red_1}{"+"*10}{Fore.light_yellow}|{Fore.light_steel_blue}#REPLACE#{Fore.light_magenta}|{Fore.light_green}{"*"*10}{Fore.light_yellow}{Style.bold}({today()}){Fore.light_red}//{Style.reset}'
1865
1865
  def setFieldInList(self,fieldname,load=False,repack_exec=None,barcode=None,only_select_qty=False):
1866
+ def hnf(resultx,fieldname,code):
1867
+ if isinstance(resultx,Entry):
1868
+ with Session(ENGINE) as session:
1869
+ result=session.query(Entry).filter(Entry.EntryId==resultx.EntryId).first()
1870
+
1871
+ if result.Price is None:
1872
+ result.Price=0
1873
+ if result.Tax is None:
1874
+ result.Tax=0
1875
+ if result.CRV is None:
1876
+ result.CRV=0
1877
+ for k in ['PalletCount','ShelfCount','LoadCount','CaseCount','Facings']:
1878
+ if getattr(result,k) < 1 or getattr(result,k) == None:
1879
+ setattr(result,k,1)
1880
+ session.commit()
1881
+ session.flush()
1882
+ session.refresh(result)
1883
+ palletcount=result.PalletCount
1884
+ facings=result.Facings
1885
+ shelfcount=result.ShelfCount
1886
+ loadcount=result.LoadCount
1887
+ casecount=result.CaseCount
1888
+ Name=result.Name
1889
+ BCD=result.Barcode
1890
+ CD=result.Code
1891
+ ABCD=result.ALT_Barcode
1892
+ ci=getattr(result,fieldname)
1893
+ code=result.Barcode
1894
+ mkTextStore=deepcopy(result)
1895
+ total_price=0
1896
+ if result.Tax == 0:
1897
+ total_price=round(result.Price+result.CRV,3)
1898
+ else:
1899
+ total_price=round(round(result.Price+result.Tax,3)+round(result.CRV,3),3)
1900
+
1901
+ hafnhaf_l=f'''{Fore.grey_70}[{Fore.light_steel_blue}ListMode Entry Info{Fore.grey_70}]{Style.reset}
1902
+ {Fore.orange_red_1}Cost({Fore.light_red}${Fore.light_green}{round(total_price,3)}({Fore.light_steel_blue}Price({round(result.Price,3)}),{Fore.light_sea_green}CRV({round(result.CRV,3)}),{Fore.spring_green_3a}Tax({round(result.Tax,3)}){Fore.light_green}){Style.reset}
1903
+ {Fore.light_green}CaseCount={Fore.cyan}{casecount}{Style.reset}|{Fore.medium_violet_red}ShelfCount={Fore.light_magenta}{shelfcount}{Style.reset}|{Fore.orange_red_1}Facings={Fore.turquoise_4}{facings}{Style.reset}
1904
+ {Fore.green_yellow}LoadCount={Fore.dark_goldenrod}{loadcount}{Style.reset}|{Fore.light_red}PalletCount={Fore.orange_red_1}{palletcount}|{Fore.spring_green_3a}{fieldname}={Fore.light_sea_green}{ci}{Style.reset}
1905
+ {Fore.cyan}Name{Fore.light_steel_blue}={Name}{Style.reset}
1906
+ {Fore.dark_goldenrod}Barcode={Fore.light_green}{result.rebar()}|{Style.reset}{Fore.light_sea_green}ALT_Barcode={Fore.turquoise_4}{ABCD}{Style.reset}
1907
+ {Style.bold}{Fore.light_sea_green}Code={Fore.spring_green_3a}{Entry.cfmt(None,CD)}{Style.reset}'''
1908
+ ptext=f'''{hafnhaf_l}
1909
+ {Fore.light_red}Enter {Style.bold}{Style.underline}{Fore.orange_red_1}Quantity/Formula{Style.reset} amount|+amount|-amount|a,+a,-a(advanced)|r,+r,-r(ReParseFormula) (Enter==1)|{Fore.light_green}ipcv={Fore.dark_goldenrod}PalletCount-value[{Fore.light_steel_blue}:-){Fore.dark_goldenrod}]|{Fore.light_green}iscv={Fore.dark_goldenrod}ShelfCount-value[{Fore.light_steel_blue}:-(){Fore.dark_goldenrod}]|{Fore.light_green}ilcv={Fore.dark_goldenrod}LoadCount-value[{Fore.light_steel_blue};-){Fore.dark_goldenrod}]|{Fore.light_green}iccv={Fore.dark_goldenrod}CaseCount-value[{Fore.light_steel_blue}:-P{Fore.dark_goldenrod}]|{Fore.light_green}ipcvc{Fore.dark_goldenrod}=(PalletCount-value)/CaseCount[{Fore.light_steel_blue}:-D{Fore.dark_goldenrod}]|{Fore.light_green}iscvc{Fore.dark_goldenrod}=(ShelfCount-value)/CaseCount[{Fore.light_steel_blue}:-|{Fore.dark_goldenrod}]|{Fore.light_green}ilcvc{Fore.dark_goldenrod}=(LoadCount-value)/CaseCount[{Fore.light_steel_blue}:-*{Fore.dark_goldenrod}]|{Fore.light_green}iccvc{Fore.dark_goldenrod}=(CaseCount-value)/CaseCount[{Fore.light_steel_blue}:O{Fore.dark_goldenrod}]{Style.reset}'''
1910
+ else:
1911
+ casecount=0
1912
+ shelfcount=0
1913
+ facings=0
1914
+ loadcount=0
1915
+ palletcount=0
1916
+ Name=code
1917
+ BCD=code
1918
+ ABCD=''
1919
+ CD=code
1920
+ ci=0
1921
+ hafnhaf_l=f'''{Fore.grey_70}[{Fore.light_steel_blue}ListMode Entry Info{Fore.grey_70}]{Style.reset}
1922
+ {Fore.light_green}CaseCount={Fore.cyan}{casecount}{Style.reset}|{Fore.medium_violet_red}ShelfCount={Fore.light_magenta}{shelfcount}{Style.reset}|{Fore.orange_red_1}Facings={Fore.turquoise_4}{facings}{Style.reset}
1923
+ {Fore.green_yellow}LoadCount={Fore.dark_goldenrod}{loadcount}{Style.reset}|{Fore.light_red}PalletCount={Fore.orange_red_1}{palletcount}|{Fore.spring_green_3a}{fieldname}={Fore.light_sea_green}{ci}{Style.reset}
1924
+ {Fore.cyan}Name{Fore.light_steel_blue}={Name}{Style.reset}
1925
+ {Fore.dark_goldenrod}Barcode={Fore.light_green}{BCD}|{Style.reset}{Fore.light_sea_green}ALT_Barcode={Fore.turquoise_4}{ABCD}{Style.reset}
1926
+ {Style.bold}{Fore.orange_red_1}Code={Fore.spring_green_3a}{CD}{Style.reset}'''
1927
+ ptext=f'''{hafnhaf_l}
1928
+ {Fore.light_red}Enter {Style.bold}{Style.underline}{Fore.orange_red_1}Quantity/Formula{Style.reset} amount|+amount|-amount|a,+a,-a(advanced)|r,+r,-r(ReParseFormula) (Enter==1)|{Fore.light_green}ipcv={Fore.dark_goldenrod}PalletCount-value[{Fore.light_steel_blue}:-){Fore.dark_goldenrod}]|{Fore.light_green}iscv={Fore.dark_goldenrod}ShelfCount-value[{Fore.light_steel_blue}:-(){Fore.dark_goldenrod}]|{Fore.light_green}ilcv={Fore.dark_goldenrod}LoadCount-value[{Fore.light_steel_blue};-){Fore.dark_goldenrod}]|{Fore.light_green}iccv={Fore.dark_goldenrod}CaseCount-value[{Fore.light_steel_blue}:-P{Fore.dark_goldenrod}]|{Fore.light_green}ipcvc{Fore.dark_goldenrod}=(PalletCount-value)/CaseCount[{Fore.light_steel_blue}:-D{Fore.dark_goldenrod}]|{Fore.light_green}iscvc{Fore.dark_goldenrod}=(ShelfCount-value)/CaseCount[{Fore.light_steel_blue}:-|{Fore.dark_goldenrod}]|{Fore.light_green}ilcvc{Fore.dark_goldenrod}=(LoadCount-value)/CaseCount[{Fore.light_steel_blue}:-*{Fore.dark_goldenrod}]|{Fore.light_green}iccvc{Fore.dark_goldenrod}=(CaseCount-value)/CaseCount[{Fore.light_steel_blue}:O{Fore.dark_goldenrod}]{Style.reset}'''
1929
+ return ptext
1866
1930
  default_quantity_action=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Set The Default Quantity to the quantity retrieved + this value? 'd'=1",helpText="a positive(+) or Negative(-) integer.",data="float")
1867
1931
 
1868
1932
  if default_quantity_action in [None,]:
@@ -2382,11 +2446,11 @@ Location Fields:
2382
2446
 
2383
2447
 
2384
2448
  hafnhaf=f'''{Fore.grey_70}[{Fore.light_steel_blue}ListMode Entry Info{Fore.grey_70}]{Style.reset}
2385
- {Fore.light_green}CaseCount={Fore.cyan}{casecount}{Style.reset}|{Fore.medium_violet_red}ShelfCount={Fore.light_magenta}{shelfcount}{Style.reset}|{Fore.orange_red_1}Facings={Fore.turquoise_4}{facings}{Style.reset}
2386
- {Fore.green_yellow}LoadCount={Fore.dark_goldenrod}{loadcount}{Style.reset}|{Fore.light_red}PalletCount={Fore.orange_red_1}{palletcount}|{Fore.spring_green_3a}{fieldname}={Fore.light_sea_green}{ci}{Style.reset}
2387
- {Fore.cyan}Name{Fore.light_steel_blue}={Name}{Style.reset}
2388
- {Fore.dark_goldenrod}Barcode={Fore.light_green}{BCD}|{Style.reset}{Fore.light_sea_green}ALT_Barcode={Fore.turquoise_4}{ABCD}{Style.reset}
2389
- {Style.bold}{Fore.orange_red_1}Code={Fore.spring_green_3a}{CD}{Style.reset}'''
2449
+ {Fore.light_green}CaseCount={Fore.cyan}{casecount}{Style.reset}|{Fore.medium_violet_red}ShelfCount={Fore.light_magenta}{shelfcount}{Style.reset}|{Fore.orange_red_1}Facings={Fore.turquoise_4}{facings}{Style.reset}
2450
+ {Fore.green_yellow}LoadCount={Fore.dark_goldenrod}{loadcount}{Style.reset}|{Fore.light_red}PalletCount={Fore.orange_red_1}{palletcount}|{Fore.spring_green_3a}{fieldname}={Fore.light_sea_green}{ci}{Style.reset}
2451
+ {Fore.cyan}Name{Fore.light_steel_blue}={Name}{Style.reset}
2452
+ {Fore.dark_goldenrod}Barcode={Fore.light_green}{BCD}|{Style.reset}{Fore.light_sea_green}ALT_Barcode={Fore.turquoise_4}{ABCD}{Style.reset}
2453
+ {Style.bold}{Fore.orange_red_1}Code={Fore.spring_green_3a}{CD}{Style.reset}'''
2390
2454
  if isinstance(result,Entry):
2391
2455
  if result.Price is None:
2392
2456
  result.Price=0
@@ -2417,12 +2481,12 @@ Location Fields:
2417
2481
  else:
2418
2482
  total_price=round(round(result.Price+result.Tax,3)+round(result.CRV,3),3)
2419
2483
  hafnhaf=f'''{Fore.grey_70}[{Fore.light_steel_blue}ListMode Entry Info{Fore.grey_70}]
2420
- {Fore.orange_red_1}Cost({Fore.light_red}${Fore.light_green}{round(total_price,3)}({Fore.light_steel_blue}Price({round(result.Price,3)}),{Fore.light_sea_green}CRV({round(result.CRV,3)}),{Fore.spring_green_3a}Tax({round(result.Tax,3)}){Fore.light_green}){Style.reset}
2421
- {Style.reset}{Fore.light_green}CaseCount={Fore.cyan}{casecount}{Style.reset}|{Fore.medium_violet_red}ShelfCount={Fore.light_magenta}{shelfcount}{Style.reset}|{Fore.orange_red_1}Facings={Fore.turquoise_4}{facings}{Style.reset}
2422
- {Fore.green_yellow}LoadCount={Fore.dark_goldenrod}{loadcount}{Style.reset}|{Fore.light_red}PalletCount={Fore.orange_red_1}{palletcount}|{Fore.spring_green_3a}{fieldname}={Fore.light_sea_green}{ci}{Style.reset}
2423
- {Fore.cyan}Name{Fore.light_steel_blue}={Name}{Style.reset}
2424
- {Fore.dark_goldenrod}Barcode={Fore.light_green}{result.rebar()}|{Style.reset}{Fore.light_sea_green}ALT_Barcode={Fore.turquoise_4}{ABCD}{Style.reset}
2425
- {Style.bold}{Fore.light_sea_green}Code={Fore.spring_green_3a}{Entry.cfmt(None,CD)}{Style.reset}'''
2484
+ {Fore.orange_red_1}Cost({Fore.light_red}${Fore.light_green}{round(total_price,3)}({Fore.light_steel_blue}Price({round(result.Price,3)}),{Fore.light_sea_green}CRV({round(result.CRV,3)}),{Fore.spring_green_3a}Tax({round(result.Tax,3)}){Fore.light_green}){Style.reset}
2485
+ {Style.reset}{Fore.light_green}CaseCount={Fore.cyan}{casecount}{Style.reset}|{Fore.medium_violet_red}ShelfCount={Fore.light_magenta}{shelfcount}{Style.reset}|{Fore.orange_red_1}Facings={Fore.turquoise_4}{facings}{Style.reset}
2486
+ {Fore.green_yellow}LoadCount={Fore.dark_goldenrod}{loadcount}{Style.reset}|{Fore.light_red}PalletCount={Fore.orange_red_1}{palletcount}|{Fore.spring_green_3a}{fieldname}={Fore.light_sea_green}{ci}{Style.reset}
2487
+ {Fore.cyan}Name{Fore.light_steel_blue}={Name}{Style.reset}
2488
+ {Fore.dark_goldenrod}Barcode={Fore.light_green}{result.rebar()}|{Style.reset}{Fore.light_sea_green}ALT_Barcode={Fore.turquoise_4}{ABCD}{Style.reset}
2489
+ {Style.bold}{Fore.light_sea_green}Code={Fore.spring_green_3a}{Entry.cfmt(None,CD)}{Style.reset}'''
2426
2490
 
2427
2491
  print(hafnhaf)
2428
2492
  results=session.query(Entry).filter(or_(Entry.Barcode==code,Entry.Barcode.icontains(code),Entry.Code.icontains(code),Entry.Code==code,Entry.ALT_Barcode==code)).all()
@@ -2525,70 +2589,7 @@ Location Fields:
2525
2589
 
2526
2590
  ptext=f'''{hafnhaf}
2527
2591
  {Fore.light_red}Enter {Style.bold}{Style.underline}{Fore.orange_red_1}Quantity/Formula{Style.reset} amount|+amount|-amount|a,+a,-a(advanced)|r,+r,-r(ReParseFormula) (Enter==1)|{Fore.light_green}ipcv={Fore.dark_goldenrod}PalletCount-value[{Fore.light_steel_blue}:-){Fore.dark_goldenrod}]|{Fore.light_green}iscv={Fore.dark_goldenrod}ShelfCount-value[{Fore.light_steel_blue}:-(){Fore.dark_goldenrod}]|{Fore.light_green}ilcv={Fore.dark_goldenrod}LoadCount-value[{Fore.light_steel_blue};-){Fore.dark_goldenrod}]|{Fore.light_green}iccv={Fore.dark_goldenrod}CaseCount-value[{Fore.light_steel_blue}:-P{Fore.dark_goldenrod}]|{Fore.light_green}ipcvc{Fore.dark_goldenrod}=(PalletCount-value)/CaseCount[{Fore.light_steel_blue}:-D{Fore.dark_goldenrod}]|{Fore.light_green}iscvc{Fore.dark_goldenrod}=(ShelfCount-value)/CaseCount[{Fore.light_steel_blue}:-|{Fore.dark_goldenrod}]|{Fore.light_green}ilcvc{Fore.dark_goldenrod}=(LoadCount-value)/CaseCount[{Fore.light_steel_blue}:-*{Fore.dark_goldenrod}]|{Fore.light_green}iccvc{Fore.dark_goldenrod}=(CaseCount-value)/CaseCount[{Fore.light_steel_blue}:O{Fore.dark_goldenrod}]{Style.reset}'''
2528
- def hnf(resultx,fieldname,code):
2529
- if isinstance(resultx,Entry):
2530
- with Session(ENGINE) as session:
2531
- result=session.query(Entry).filter(Entry.EntryId==resultx.EntryId).first()
2532
-
2533
- if result.Price is None:
2534
- result.Price=0
2535
- if result.Tax is None:
2536
- result.Tax=0
2537
- if result.CRV is None:
2538
- result.CRV=0
2539
- for k in ['PalletCount','ShelfCount','LoadCount','CaseCount','Facings']:
2540
- if getattr(result,k) < 1 or getattr(result,k) == None:
2541
- setattr(result,k,1)
2542
- session.commit()
2543
- session.flush()
2544
- session.refresh(result)
2545
- palletcount=result.PalletCount
2546
- facings=result.Facings
2547
- shelfcount=result.ShelfCount
2548
- loadcount=result.LoadCount
2549
- casecount=result.CaseCount
2550
- Name=result.Name
2551
- BCD=result.Barcode
2552
- CD=result.Code
2553
- ABCD=result.ALT_Barcode
2554
- ci=getattr(result,fieldname)
2555
- code=result.Barcode
2556
- mkTextStore=deepcopy(result)
2557
- total_price=0
2558
- if result.Tax == 0:
2559
- total_price=round(result.Price+result.CRV,3)
2560
- else:
2561
- total_price=round(round(result.Price+result.Tax,3)+round(result.CRV,3),3)
2562
-
2563
- hafnhaf_l=f'''{Fore.grey_70}[{Fore.light_steel_blue}ListMode Entry Info{Fore.grey_70}]{Style.reset}
2564
- {Fore.orange_red_1}Cost({Fore.light_red}${Fore.light_green}{round(total_price,3)}({Fore.light_steel_blue}Price({round(result.Price,3)}),{Fore.light_sea_green}CRV({round(result.CRV,3)}),{Fore.spring_green_3a}Tax({round(result.Tax,3)}){Fore.light_green}){Style.reset}
2565
- {Fore.light_green}CaseCount={Fore.cyan}{casecount}{Style.reset}|{Fore.medium_violet_red}ShelfCount={Fore.light_magenta}{shelfcount}{Style.reset}|{Fore.orange_red_1}Facings={Fore.turquoise_4}{facings}{Style.reset}
2566
- {Fore.green_yellow}LoadCount={Fore.dark_goldenrod}{loadcount}{Style.reset}|{Fore.light_red}PalletCount={Fore.orange_red_1}{palletcount}|{Fore.spring_green_3a}{fieldname}={Fore.light_sea_green}{ci}{Style.reset}
2567
- {Fore.cyan}Name{Fore.light_steel_blue}={Name}{Style.reset}
2568
- {Fore.dark_goldenrod}Barcode={Fore.light_green}{result.rebar()}|{Style.reset}{Fore.light_sea_green}ALT_Barcode={Fore.turquoise_4}{ABCD}{Style.reset}
2569
- {Style.bold}{Fore.light_sea_green}Code={Fore.spring_green_3a}{Entry.cfmt(None,CD)}{Style.reset}'''
2570
- ptext=f'''{hafnhaf_l}
2571
- {Fore.light_red}Enter {Style.bold}{Style.underline}{Fore.orange_red_1}Quantity/Formula{Style.reset} amount|+amount|-amount|a,+a,-a(advanced)|r,+r,-r(ReParseFormula) (Enter==1)|{Fore.light_green}ipcv={Fore.dark_goldenrod}PalletCount-value[{Fore.light_steel_blue}:-){Fore.dark_goldenrod}]|{Fore.light_green}iscv={Fore.dark_goldenrod}ShelfCount-value[{Fore.light_steel_blue}:-(){Fore.dark_goldenrod}]|{Fore.light_green}ilcv={Fore.dark_goldenrod}LoadCount-value[{Fore.light_steel_blue};-){Fore.dark_goldenrod}]|{Fore.light_green}iccv={Fore.dark_goldenrod}CaseCount-value[{Fore.light_steel_blue}:-P{Fore.dark_goldenrod}]|{Fore.light_green}ipcvc{Fore.dark_goldenrod}=(PalletCount-value)/CaseCount[{Fore.light_steel_blue}:-D{Fore.dark_goldenrod}]|{Fore.light_green}iscvc{Fore.dark_goldenrod}=(ShelfCount-value)/CaseCount[{Fore.light_steel_blue}:-|{Fore.dark_goldenrod}]|{Fore.light_green}ilcvc{Fore.dark_goldenrod}=(LoadCount-value)/CaseCount[{Fore.light_steel_blue}:-*{Fore.dark_goldenrod}]|{Fore.light_green}iccvc{Fore.dark_goldenrod}=(CaseCount-value)/CaseCount[{Fore.light_steel_blue}:O{Fore.dark_goldenrod}]{Style.reset}'''
2572
- else:
2573
- casecount=0
2574
- shelfcount=0
2575
- facings=0
2576
- loadcount=0
2577
- palletcount=0
2578
- Name=code
2579
- BCD=code
2580
- ABCD=''
2581
- CD=code
2582
- ci=0
2583
- hafnhaf_l=f'''{Fore.grey_70}[{Fore.light_steel_blue}ListMode Entry Info{Fore.grey_70}]{Style.reset}
2584
- {Fore.light_green}CaseCount={Fore.cyan}{casecount}{Style.reset}|{Fore.medium_violet_red}ShelfCount={Fore.light_magenta}{shelfcount}{Style.reset}|{Fore.orange_red_1}Facings={Fore.turquoise_4}{facings}{Style.reset}
2585
- {Fore.green_yellow}LoadCount={Fore.dark_goldenrod}{loadcount}{Style.reset}|{Fore.light_red}PalletCount={Fore.orange_red_1}{palletcount}|{Fore.spring_green_3a}{fieldname}={Fore.light_sea_green}{ci}{Style.reset}
2586
- {Fore.cyan}Name{Fore.light_steel_blue}={Name}{Style.reset}
2587
- {Fore.dark_goldenrod}Barcode={Fore.light_green}{BCD}|{Style.reset}{Fore.light_sea_green}ALT_Barcode={Fore.turquoise_4}{ABCD}{Style.reset}
2588
- {Style.bold}{Fore.orange_red_1}Code={Fore.spring_green_3a}{CD}{Style.reset}'''
2589
- ptext=f'''{hafnhaf_l}
2590
- {Fore.light_red}Enter {Style.bold}{Style.underline}{Fore.orange_red_1}Quantity/Formula{Style.reset} amount|+amount|-amount|a,+a,-a(advanced)|r,+r,-r(ReParseFormula) (Enter==1)|{Fore.light_green}ipcv={Fore.dark_goldenrod}PalletCount-value[{Fore.light_steel_blue}:-){Fore.dark_goldenrod}]|{Fore.light_green}iscv={Fore.dark_goldenrod}ShelfCount-value[{Fore.light_steel_blue}:-(){Fore.dark_goldenrod}]|{Fore.light_green}ilcv={Fore.dark_goldenrod}LoadCount-value[{Fore.light_steel_blue};-){Fore.dark_goldenrod}]|{Fore.light_green}iccv={Fore.dark_goldenrod}CaseCount-value[{Fore.light_steel_blue}:-P{Fore.dark_goldenrod}]|{Fore.light_green}ipcvc{Fore.dark_goldenrod}=(PalletCount-value)/CaseCount[{Fore.light_steel_blue}:-D{Fore.dark_goldenrod}]|{Fore.light_green}iscvc{Fore.dark_goldenrod}=(ShelfCount-value)/CaseCount[{Fore.light_steel_blue}:-|{Fore.dark_goldenrod}]|{Fore.light_green}ilcvc{Fore.dark_goldenrod}=(LoadCount-value)/CaseCount[{Fore.light_steel_blue}:-*{Fore.dark_goldenrod}]|{Fore.light_green}iccvc{Fore.dark_goldenrod}=(CaseCount-value)/CaseCount[{Fore.light_steel_blue}:O{Fore.dark_goldenrod}]{Style.reset}'''
2591
- return ptext
2592
+
2592
2593
  p=Prompt.__init2__(None,func=mkT,ptext=f"{ptext}",helpText=self.helpText_barcodes.replace('#CODE#',code_log),data=code,qc=lambda self=self,code=code:self.NewEntryMenu(code=code),replace_ptext=lambda result=result,fieldname=fieldname,code=code:hnf(resultx=result,fieldname=fieldname,code=code))
2593
2594
  if self.next_barcode():
2594
2595
  continue
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.349'
1
+ VERSION='0.0.351'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.349
3
+ Version: 0.0.351
4
4
  Summary: A small example package
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=XXy-o5Z_yOgrgHNju4iqM3h7xhRBkNIoHG1qePtBnGY,41316
7
7
  radboy/Run.py,sha256=JUoCTHnzQBv7n8PB2_i93ANdAC_iW__RkAge8esCnk4,76
8
- radboy/__init__.py,sha256=t0n9qI4V_etx69M9f11s19K3fzE645GvO1joBon4_A4,17
8
+ radboy/__init__.py,sha256=Rof_lEJXvW8euhOheSDBrewoLgLoNWnKLl-UI5eEBRY,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
@@ -83,7 +83,7 @@ radboy/DB/ExerciseTracker.py,sha256=CZ8jdKJiAE_QTAiJTRXi8ZOnS1NUiSvWVSKLHLpYVGk,
83
83
  radboy/DB/PayDay.py,sha256=H2kPGvBCDkMOz7lbxQhYtUt_oAInpxi37Q6MFrah98I,8710
84
84
  radboy/DB/PayModels.py,sha256=hjwWxP7PL33hmfzQl5YTf0HqzaMxXJxFknPdxFJXJc8,3499
85
85
  radboy/DB/PrintLogging.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
- radboy/DB/Prompt.py,sha256=fHmhlrwtWyehpsWnXWIOSE_WCJpk9i7jyYDfnjIjjVk,178666
86
+ radboy/DB/Prompt.py,sha256=-ACQTAGS11Xy-FL9HKxU42mqIXOzwyw92BewJjfDwUM,182297
87
87
  radboy/DB/RandomStringUtil.py,sha256=eZCpR907WStgfbk4Evcghjv9hOkUDXH-iMXIq0-kXq8,24386
88
88
  radboy/DB/ResetTools.py,sha256=RbI-Ua7UlsN0S9qLqtEkTWvzyTZ6R-hHR3CW4NHlUPE,6660
89
89
  radboy/DB/SMLabelImporter.py,sha256=eUoBDxVUUEKGL2g_PwkASM67ZB7FmXtSnn4bCagskhY,4013
@@ -107,7 +107,7 @@ radboy/DB/__pycache__/FormBuilder.cpython-312.pyc,sha256=p1o-5SMRL8OXP_XQ5liUpf-
107
107
  radboy/DB/__pycache__/PrintLogging.cpython-312.pyc,sha256=pIAFqTi6OiQQORSc-oMH1zAbsdH7sY1TifxrN_QOvnU,148
108
108
  radboy/DB/__pycache__/Prompt.cpython-311.pyc,sha256=P2uPRpeqfLFtxieZ0JHBG3X_HZzWUCsFSLb_fpRqky0,6407
109
109
  radboy/DB/__pycache__/Prompt.cpython-312.pyc,sha256=6CcQ1gE2hcz3cKPjo4f6d7xNM2PTDnl8NzQG0Pme5BE,142886
110
- radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=CNQwIh4wonLvnGmaxbappAbd5S8Cv9RoQ2-M6V3S1uc,261932
110
+ radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=0EaNIUpsufPXdLezWNCqsdbixkFe3HZT2ZJAm04l7Mc,265793
111
111
  radboy/DB/__pycache__/RandomStringUtil.cpython-312.pyc,sha256=TrbEY89MuLmNlvoo5d8vOE6Dyshh5_EMlTZvk8MDVN4,48597
112
112
  radboy/DB/__pycache__/RandomStringUtil.cpython-313.pyc,sha256=MCcgVwV2Y-9rAY2FVaJZCKcou3HDX70EZudoiCigT0o,49217
113
113
  radboy/DB/__pycache__/ResetTools.cpython-311.pyc,sha256=4Vyc57iAAF0yRPjjglnVKovnTn8OoFIi6Zok3Wpj_YM,9292
@@ -144,10 +144,10 @@ radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc,sha256=UC2v9eX_1UZNgIA9baQzr
144
144
  radboy/DayLog/__pycache__/__init__.cpython-311.pyc,sha256=Z5Y4DdVF77LZf6-Of92MDGFdi-IXik1ASQd4AdLNNfQ,231
145
145
  radboy/DayLog/__pycache__/__init__.cpython-312.pyc,sha256=lP_GHzSPt5JTrT1jLWiRMFGPmSdJYBn4eRV__OxgJ6s,269
146
146
  radboy/DayLog/__pycache__/__init__.cpython-313.pyc,sha256=UQw5v4r7yismC9qcqP0dEme6h-lawbOA5pXYpkqUwFk,148
147
- radboy/EntryExtras/Extras.py,sha256=oft3lI6REDQjw_SWzEClSl7hw8seOjGC5MvASZ29AGY,41228
147
+ radboy/EntryExtras/Extras.py,sha256=CzRiM3lbooG27QaqV_r2v56OtxpgbSKqEnB_x77yNXE,66339
148
148
  radboy/EntryExtras/__init__.py,sha256=K76Ku7o2DwTZU-Ya2mifH856KAcxb8MXdSaQMQLhu84,902
149
149
  radboy/EntryExtras/__pycache__/Extras.cpython-312.pyc,sha256=eHkeyKblMtG37lDhl38OEGQbvvKxXMriKK49kj2mg8o,34768
150
- radboy/EntryExtras/__pycache__/Extras.cpython-313.pyc,sha256=cYtyQMRPXymNtxQC2Pcv1L5RbyBeAcp37pi4AHiDVrs,51806
150
+ radboy/EntryExtras/__pycache__/Extras.cpython-313.pyc,sha256=kVsCdqeYlNOhGlnNUEPRwkTbnL8JKQeaT1OeJKn5Mmw,85985
151
151
  radboy/EntryExtras/__pycache__/__init__.cpython-312.pyc,sha256=0bBwhp_9PYvL-Nm_J0gsYf9yfKAFJMiMdpc6XzZrPzU,829
152
152
  radboy/EntryExtras/__pycache__/__init__.cpython-313.pyc,sha256=PqXXfBeREZI2pZc22BayKH7daLXbO7p3NozaXpnA3cQ,829
153
153
  radboy/EntryExtras/__pycache__/db.cpython-312.pyc,sha256=Qcqix5yi9h7fbsmGhJOWYdLHbHMTWixwolRRQYg8ISk,1781
@@ -330,7 +330,7 @@ radboy/SystemSettings/__pycache__/__init__.cpython-312.pyc,sha256=aIzp4Po0t8EhSA
330
330
  radboy/SystemSettings/__pycache__/__init__.cpython-313.pyc,sha256=QFDuoidxMWsGVLsy5lN-rDs6TP8nKJ4yyCyiamNOhwo,156
331
331
  radboy/TasksMode/ReFormula.py,sha256=REDRJYub-OEOE6g14oRQOLOQwv8pHqVJy4NQk3CCM90,2255
332
332
  radboy/TasksMode/SetEntryNEU.py,sha256=3nUNDUNyxq4zeMtmUQ7aS1o23P7KhDIMdUPNqPnYbRk,17343
333
- radboy/TasksMode/Tasks.py,sha256=jlBUFX5igwjLPtcEdnLs1kPRDid17SUsIv3FIMtMR84,300792
333
+ radboy/TasksMode/Tasks.py,sha256=DNPPnCth3tmV8dsvAdJrAp2187DRT1gMjxs78HWyhHg,300766
334
334
  radboy/TasksMode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
335
335
  radboy/TasksMode/__pycache__/ReFormula.cpython-311.pyc,sha256=QEG3PwVw-8HTd_Mf9XbVcxU56F1fC9yBqWXYPLC39DU,4865
336
336
  radboy/TasksMode/__pycache__/ReFormula.cpython-312.pyc,sha256=aX7BWm2PPjCTnxsbGUitR-2h9hq4AjaBiHMrUXvIl0Y,3967
@@ -339,7 +339,7 @@ radboy/TasksMode/__pycache__/SetEntryNEU.cpython-312.pyc,sha256=pCdFj61aPKkHL6Sv
339
339
  radboy/TasksMode/__pycache__/SetEntryNEU.cpython-313.pyc,sha256=leIelDzPrZE_YgKs0B99osmhyENYtYgi3ErgS2XqSPs,20088
340
340
  radboy/TasksMode/__pycache__/Tasks.cpython-311.pyc,sha256=6QOTJnLiXSKdF81hkhy3vyrz49PPhS20s5_0X52g3Hw,131120
341
341
  radboy/TasksMode/__pycache__/Tasks.cpython-312.pyc,sha256=hyJwdaYaaRLdcrNxgg36diJ5iijX5_3I0UAORsj-6LU,310295
342
- radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc,sha256=ZRYY6kvK-g6Xm3xnaeZzFWNmkhBqHLVtK1OCwk98LvE,366224
342
+ radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc,sha256=e2FO5tj68YvLyDMr7RHHzwBHOfHcq0Sm945tHHk1HcE,366197
343
343
  radboy/TasksMode/__pycache__/__init__.cpython-311.pyc,sha256=PKV1JbihEacm639b53bZozRQvcllSkjGP3q8STVMxF4,234
344
344
  radboy/TasksMode/__pycache__/__init__.cpython-312.pyc,sha256=ERgnEvRMiGSecWp1BpNzLdSq_SdKw7GvFWUvUM7bLVw,272
345
345
  radboy/TasksMode/__pycache__/__init__.cpython-313.pyc,sha256=lvsTxukyvGKB3C0rdF9dQi_bvVh6ceDVINfwcuIsd0s,151
@@ -386,7 +386,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
386
386
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
387
387
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
388
388
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
389
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=EfSISvhEChPd9OTxP6VXMYMWSsluIAVSs1V8ZfaCgaQ,165
389
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=WIgbGJm5sXuP4aKVCW7jPse4lWNgq3QO6tVTbP3-Nf4,165
390
390
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
391
391
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
392
392
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -411,7 +411,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
411
411
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
412
412
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
413
413
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
414
- radboy-0.0.349.dist-info/METADATA,sha256=RTZztCq1g62Ju0frTLJulBa5urq8DkYlhNJptKoMi_k,794
415
- radboy-0.0.349.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
- radboy-0.0.349.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
- radboy-0.0.349.dist-info/RECORD,,
414
+ radboy-0.0.351.dist-info/METADATA,sha256=tpw5FHvJbCi971RFYzmO7rw07wPIpvx2EAuF3dpfKZA,794
415
+ radboy-0.0.351.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
+ radboy-0.0.351.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
+ radboy-0.0.351.dist-info/RECORD,,