radboy 0.0.771__py3-none-any.whl → 0.0.854__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/Comm/RxTx.py +4 -493
- radboy/Comm/__pycache__/RxTx.cpython-313.pyc +0 -0
- radboy/CookBook/CookBook.py +4 -0
- radboy/DB/ExerciseTracker.py +64 -27
- radboy/DB/GEMINI.py +146 -0
- radboy/DB/Prompt.py +150 -7
- radboy/DB/__pycache__/ExerciseTracker.cpython-313.pyc +0 -0
- radboy/DB/__pycache__/Prompt.cpython-313.pyc +0 -0
- radboy/DB/__pycache__/db.cpython-313.pyc +0 -0
- radboy/DB/db.py +141 -10
- radboy/DayLog/DayLogger.py +1 -1
- radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc +0 -0
- radboy/FB/FBMTXT.py +48 -1
- radboy/FB/__pycache__/FBMTXT.cpython-313.pyc +0 -0
- radboy/HowDoYouDefineMe/CoreEmotions.py +268 -9
- radboy/Lookup2/Lookup2.py +31 -1
- radboy/Lookup2/__pycache__/Lookup2.cpython-313.pyc +0 -0
- radboy/RNE/RNE.py +7 -0
- radboy/RNE/__pycache__/RNE.cpython-313.pyc +0 -0
- radboy/TasksMode/SetEntryNEU.py +16 -2
- radboy/TasksMode/Tasks.py +546 -101
- radboy/TasksMode/__pycache__/SetEntryNEU.cpython-313.pyc +0 -0
- radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc +0 -0
- radboy/Unified/BACKUP.py +443 -0
- radboy/Unified/Unified.py +2 -321
- radboy/Unified/__pycache__/Unified.cpython-313.pyc +0 -0
- radboy/Unified/__pycache__/bareCA.cpython-313.pyc +0 -0
- radboy/Unified/__pycache__/clearalll.cpython-313.pyc +0 -0
- radboy/Unified/bareCA.py +26 -2
- radboy/Unified/clearalll.py +6 -0
- radboy/__init__.py +1 -1
- radboy/__pycache__/__init__.cpython-313.pyc +0 -0
- radboy/code.png +0 -0
- radboy/preloader/preloader.py +70 -0
- radboy/preloader/preloader_func.py +688 -2
- {radboy-0.0.771.dist-info → radboy-0.0.854.dist-info}/METADATA +1 -1
- {radboy-0.0.771.dist-info → radboy-0.0.854.dist-info}/RECORD +39 -37
- {radboy-0.0.771.dist-info → radboy-0.0.854.dist-info}/WHEEL +0 -0
- {radboy-0.0.771.dist-info → radboy-0.0.854.dist-info}/top_level.txt +0 -0
radboy/TasksMode/Tasks.py
CHANGED
|
@@ -51,6 +51,14 @@ from radboy.DB.SimpleScanner import SimpleScanner
|
|
|
51
51
|
from radboy.DB.NW.NetWorth import *
|
|
52
52
|
from decimal import Decimal as DEC
|
|
53
53
|
from radboy.DB.lsToday import *
|
|
54
|
+
from radboy.DB.GEMINI import *
|
|
55
|
+
from radboy.Unified.BACKUP import *
|
|
56
|
+
import scipy
|
|
57
|
+
import radboy.HealthLog as HL
|
|
58
|
+
|
|
59
|
+
UnitRegister=pint.UnitRegistry()
|
|
60
|
+
from pint import Quantity
|
|
61
|
+
|
|
54
62
|
def today():
|
|
55
63
|
dt=datetime.now()
|
|
56
64
|
return date(dt.year,dt.month,dt.day)
|
|
@@ -488,17 +496,20 @@ class Formulae:
|
|
|
488
496
|
return None
|
|
489
497
|
else:
|
|
490
498
|
returnTypes=["float","Decimal","string","string"]
|
|
491
|
-
returnActor=[lambda x:
|
|
499
|
+
returnActor=[lambda x:float(x),lambda x:Decimal(x),lambda x: f"{x:.4f}",lambda x:str(x)]
|
|
492
500
|
ct=len(returnTypes)
|
|
493
501
|
returnType=None
|
|
494
502
|
htext=[]
|
|
495
503
|
strOnly=False
|
|
504
|
+
tmp=[]
|
|
496
505
|
for num,i in enumerate(returnTypes):
|
|
497
506
|
try:
|
|
498
507
|
htext.append(std_colorize(f"{i} - {returnActor[num](result)} ",num,ct))
|
|
499
508
|
except Exception as e:
|
|
500
509
|
strOnly=True
|
|
501
|
-
print(e)
|
|
510
|
+
print(e,result,type(result))
|
|
511
|
+
if len(htext) < 2:
|
|
512
|
+
return str(result)
|
|
502
513
|
htext='\n'.join(htext)
|
|
503
514
|
while returnType not in range(0,ct+1):
|
|
504
515
|
print(htext)
|
|
@@ -871,6 +882,68 @@ SALES TAX ON APPLICABLE TANGIBLE ITEMS = (PRICE + CRV) * TTL TAX RATE
|
|
|
871
882
|
result=tax_rate
|
|
872
883
|
return result
|
|
873
884
|
|
|
885
|
+
def dollar_tree_multiprices():
|
|
886
|
+
prices=[
|
|
887
|
+
1.25,
|
|
888
|
+
3,
|
|
889
|
+
4,
|
|
890
|
+
5,
|
|
891
|
+
7,
|
|
892
|
+
]
|
|
893
|
+
htext=[]
|
|
894
|
+
cta=len(prices)
|
|
895
|
+
for num,i in enumerate(prices):
|
|
896
|
+
htext.append(std_colorize(i,num,cta))
|
|
897
|
+
|
|
898
|
+
htext='\n'.join(htext)
|
|
899
|
+
while True:
|
|
900
|
+
try:
|
|
901
|
+
print(htext)
|
|
902
|
+
idx=Control(func=FormBuilderMkText,ptext=f"which price's index[0({Fore.orange_red_1}d=default{Fore.light_yellow})]?",helpText=f"{htext}\nan integer between 0 and {cta-1}",data="integer")
|
|
903
|
+
if idx is None:
|
|
904
|
+
return None
|
|
905
|
+
elif idx in ['d',]:
|
|
906
|
+
return prices[0]
|
|
907
|
+
|
|
908
|
+
if idx in range(0,cta):
|
|
909
|
+
return prices[idx]
|
|
910
|
+
else:
|
|
911
|
+
print(f"{Fore.orange_red_1}use a number within 0-{cta-1}!")
|
|
912
|
+
continue
|
|
913
|
+
|
|
914
|
+
except Exception as e:
|
|
915
|
+
print(e)
|
|
916
|
+
return result
|
|
917
|
+
|
|
918
|
+
def dollar_tree_multiprices_GEMINI():
|
|
919
|
+
zta=GEMINI_SequencePredictor()
|
|
920
|
+
prices=list(set([zta.get_next_sequence_value(i) for i in range(-5,20)]))
|
|
921
|
+
prices.insert(0,1.25)
|
|
922
|
+
htext=[]
|
|
923
|
+
cta=len(prices)
|
|
924
|
+
for num,i in enumerate(prices):
|
|
925
|
+
htext.append(std_colorize(i,num,cta))
|
|
926
|
+
|
|
927
|
+
htext='\n'.join(htext)
|
|
928
|
+
while True:
|
|
929
|
+
try:
|
|
930
|
+
print(htext)
|
|
931
|
+
idx=Control(func=FormBuilderMkText,ptext=f"which price's index[0({Fore.orange_red_1}d=default{Fore.light_yellow})]?",helpText=f"{htext}\nan integer between 0 and {cta-1}",data="integer")
|
|
932
|
+
if idx is None:
|
|
933
|
+
return None
|
|
934
|
+
elif idx in ['d',]:
|
|
935
|
+
return prices[0]
|
|
936
|
+
|
|
937
|
+
if idx in range(0,cta):
|
|
938
|
+
return prices[idx]
|
|
939
|
+
else:
|
|
940
|
+
print(f"{Fore.orange_red_1}use a number within 0-{cta-1}!")
|
|
941
|
+
continue
|
|
942
|
+
|
|
943
|
+
except Exception as e:
|
|
944
|
+
print(e)
|
|
945
|
+
return result
|
|
946
|
+
|
|
874
947
|
def tax_rate_from_oldPriceAndNewPrice():
|
|
875
948
|
result=None
|
|
876
949
|
print('tax_rate_from_oldPriceAndNewPrice()')
|
|
@@ -955,6 +1028,16 @@ SALES TAX ON APPLICABLE TANGIBLE ITEMS = (PRICE + CRV) * TTL TAX RATE
|
|
|
955
1028
|
'desc':f'{Fore.light_yellow}tax rate{Fore.medium_violet_red} from old price and new price{Style.reset}',
|
|
956
1029
|
'exec':tax_rate_from_oldPriceAndNewPrice
|
|
957
1030
|
},
|
|
1031
|
+
f'{uuid1()}':{
|
|
1032
|
+
'cmds':generate_cmds(startcmd=['dt','dollar tree','$tree','dollar-tree'],endCmd=['prcs','prices','prces','mpc',]),
|
|
1033
|
+
'desc':f'{Fore.light_yellow}Dollar($tree) Tree {Fore.medium_violet_red}multi-price selector{Style.reset}',
|
|
1034
|
+
'exec':dollar_tree_multiprices
|
|
1035
|
+
},
|
|
1036
|
+
f'{uuid1()}':{
|
|
1037
|
+
'cmds':generate_cmds(startcmd=['dt g','dollar tree gemini','$tree gmni','dollar-tree-gemini'],endCmd=['prcs','prices','prces','mpc',]),
|
|
1038
|
+
'desc':f'{Fore.light_yellow}Dollar($tree) Tree {Fore.medium_violet_red}multi-price selector ; {Fore.orange_red_1}This bit was generated using GOOGLE GEMINI.{Style.reset}',
|
|
1039
|
+
'exec':dollar_tree_multiprices_GEMINI
|
|
1040
|
+
},
|
|
958
1041
|
f'{uuid1()}':{
|
|
959
1042
|
'cmds':generate_cmds(startcmd=['salary','sal','slry'],endCmd=['2hours','2hr','tohr','tohour','-hour','-hr']),
|
|
960
1043
|
'desc':f'{Fore.light_yellow}Annual Salary{Fore.medium_violet_red} from hourly wage rate and hours worked{Style.reset}',
|
|
@@ -1021,7 +1104,7 @@ SALES TAX ON APPLICABLE TANGIBLE ITEMS = (PRICE + CRV) * TTL TAX RATE
|
|
|
1021
1104
|
return None
|
|
1022
1105
|
else:
|
|
1023
1106
|
returnTypes=["float","Decimal","string","string"]
|
|
1024
|
-
returnActor=[lambda x:
|
|
1107
|
+
returnActor=[lambda x:float(x),lambda x:Decimal(x).quantize(Decimal("0.0000")),lambda x: f"{x:.4f}",lambda x:str(x)]
|
|
1025
1108
|
ct=len(returnTypes)
|
|
1026
1109
|
returnType=None
|
|
1027
1110
|
htext=[]
|
|
@@ -1031,7 +1114,10 @@ SALES TAX ON APPLICABLE TANGIBLE ITEMS = (PRICE + CRV) * TTL TAX RATE
|
|
|
1031
1114
|
htext.append(std_colorize(f"{i} - {returnActor[num](result)} ",num,ct))
|
|
1032
1115
|
except Exception as e:
|
|
1033
1116
|
strOnly=True
|
|
1034
|
-
print(e)
|
|
1117
|
+
print(e,result,type(result))
|
|
1118
|
+
if len(htext) < 2:
|
|
1119
|
+
return str(result)
|
|
1120
|
+
|
|
1035
1121
|
htext='\n'.join(htext)
|
|
1036
1122
|
while returnType not in range(0,ct+1):
|
|
1037
1123
|
print(htext)
|
|
@@ -1164,57 +1250,96 @@ def generateWhiteNoise():
|
|
|
1164
1250
|
print(e)
|
|
1165
1251
|
|
|
1166
1252
|
class TasksMode:
|
|
1167
|
-
def nanoid(self,auto=None):
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
'
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
'
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
'
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
'
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
if not auto:
|
|
1188
|
-
fd=FormBuilder(data=fields)
|
|
1189
|
-
if fd is None:
|
|
1190
|
-
return None
|
|
1191
|
-
else:
|
|
1192
|
-
fd={
|
|
1193
|
-
'chunk size':7,
|
|
1194
|
-
'size':21,
|
|
1195
|
-
'delim':'/',
|
|
1196
|
-
'alphabet':string.ascii_uppercase+string.digits,
|
|
1253
|
+
def nanoid(self,auto=None,check_dup=True):
|
|
1254
|
+
while True:
|
|
1255
|
+
with localcontext() as ctx:
|
|
1256
|
+
fields={
|
|
1257
|
+
'size':{
|
|
1258
|
+
'default':21,
|
|
1259
|
+
'type':'integer',
|
|
1260
|
+
},
|
|
1261
|
+
'alphabet':{
|
|
1262
|
+
'default':string.ascii_uppercase+string.digits,
|
|
1263
|
+
'type':'string',
|
|
1264
|
+
},
|
|
1265
|
+
'chunk size':{
|
|
1266
|
+
'default':7,
|
|
1267
|
+
'type':'integer',
|
|
1268
|
+
},
|
|
1269
|
+
'delim':{
|
|
1270
|
+
'default':'/',
|
|
1271
|
+
'type':'string',
|
|
1272
|
+
}
|
|
1197
1273
|
}
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1274
|
+
if not auto:
|
|
1275
|
+
fd=FormBuilder(data=fields)
|
|
1276
|
+
if fd is None:
|
|
1277
|
+
return None
|
|
1278
|
+
else:
|
|
1279
|
+
fd={
|
|
1280
|
+
'chunk size':7,
|
|
1281
|
+
'size':21,
|
|
1282
|
+
'delim':'/',
|
|
1283
|
+
'alphabet':string.ascii_uppercase+string.digits,
|
|
1284
|
+
}
|
|
1285
|
+
recieptidFile=detectGetOrSet("NanoIdFile","nanoid.txt",setValue=False,literal=True)
|
|
1286
|
+
idx=nanoid.generate(fd['alphabet'],fd['size'])
|
|
1287
|
+
idx=f'{fd["delim"]}'.join(stre(idx)/fd["chunk size"])
|
|
1201
1288
|
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1289
|
+
|
|
1290
|
+
if check_dup:
|
|
1291
|
+
idxx=str(idx)
|
|
1292
|
+
with Session(ENGINE) as session:
|
|
1293
|
+
f=[
|
|
1294
|
+
Entry.Name.icontains(idxx),
|
|
1295
|
+
Entry.Barcode.icontains(idxx),
|
|
1296
|
+
Entry.Code.icontains(idxx),
|
|
1297
|
+
Entry.Name.icontains(idxx),
|
|
1298
|
+
Entry.ALT_Barcode.icontains(idxx),
|
|
1299
|
+
Entry.DUP_Barcode.icontains(idxx),
|
|
1300
|
+
Entry.CaseID_BR.icontains(idxx),
|
|
1301
|
+
Entry.CaseID_LD.icontains(idxx),
|
|
1302
|
+
Entry.CaseID_6W.icontains(idxx),
|
|
1303
|
+
Entry.Tags.icontains(idxx),
|
|
1304
|
+
]
|
|
1305
|
+
check=session.query(Entry).filter(or_(*f)).first()
|
|
1306
|
+
if check is not None:
|
|
1307
|
+
print(f"{Fore.orange_red_1}A Collision may have occurred in Entry [{check}{Fore.orange_red_1},] ... trying {Fore.light_yellow}again!{Style.reset}")
|
|
1308
|
+
continue
|
|
1206
1309
|
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1310
|
+
f=[
|
|
1311
|
+
DayLog.Name.icontains(idxx),
|
|
1312
|
+
DayLog.Barcode.icontains(idxx),
|
|
1313
|
+
DayLog.Code.icontains(idxx),
|
|
1314
|
+
DayLog.Name.icontains(idxx),
|
|
1315
|
+
DayLog.ALT_Barcode.icontains(idxx),
|
|
1316
|
+
DayLog.DUP_Barcode.icontains(idxx),
|
|
1317
|
+
DayLog.CaseID_BR.icontains(idxx),
|
|
1318
|
+
DayLog.CaseID_LD.icontains(idxx),
|
|
1319
|
+
DayLog.CaseID_6W.icontains(idxx),
|
|
1320
|
+
DayLog.Tags.icontains(idxx),
|
|
1321
|
+
]
|
|
1322
|
+
check=session.query(DayLog).filter(or_(*f)).first()
|
|
1323
|
+
if check is not None:
|
|
1324
|
+
print(f"{Fore.orange_red_1}A Collision may have occurred in DayLog [{check}{Fore.orange_red_1},] ... trying {Fore.light_yellow}again!{Style.reset}")
|
|
1325
|
+
continue
|
|
1326
|
+
|
|
1327
|
+
if not auto:
|
|
1328
|
+
returnIDX=Control(func=FormBuilderMkText,ptext=f"return '{idx}'; it will be saved to {recieptidFile}",helpText=f"return '{idx}' as a string",data="boolean")
|
|
1329
|
+
else:
|
|
1330
|
+
returnIDX=None
|
|
1213
1331
|
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1332
|
+
if recieptidFile is not None:
|
|
1333
|
+
if auto:
|
|
1334
|
+
print(f"'{recieptidFile}' was updated with '{idx}'.")
|
|
1335
|
+
recieptidFile=Path(recieptidFile)
|
|
1336
|
+
with recieptidFile.open("w") as f:
|
|
1337
|
+
f.write(idx+"\n")
|
|
1338
|
+
|
|
1339
|
+
if returnIDX in [False,'NaN',None]:
|
|
1340
|
+
return None
|
|
1341
|
+
elif returnIDX in ['d',True]:
|
|
1342
|
+
return str(idx)
|
|
1218
1343
|
|
|
1219
1344
|
def mkRun(self):
|
|
1220
1345
|
rootdir=Control(func=FormBuilderMkText,ptext=f"Root Directory[d={ROOTDIR}/path|p=str(Path().cwd())]",helpText="root directory",data="string")
|
|
@@ -1422,6 +1547,9 @@ rmc.quikRn(rootdir=ROOTDIR)'''
|
|
|
1422
1547
|
def cookbook(self):
|
|
1423
1548
|
CookBookUi()
|
|
1424
1549
|
|
|
1550
|
+
def healthlog(self):
|
|
1551
|
+
HL.HealthLog.HealthLogUi()
|
|
1552
|
+
|
|
1425
1553
|
def phonebook(self):
|
|
1426
1554
|
PhoneBookUi()
|
|
1427
1555
|
|
|
@@ -1769,7 +1897,7 @@ Distress - ls Distress
|
|
|
1769
1897
|
else:
|
|
1770
1898
|
print(f"{Fore.light_red}{Style.bold}No such Barcode|Code with InList==True:{scanned}{Style.reset}\nLet's Try a Search[*]!")
|
|
1771
1899
|
#search_auto_insert
|
|
1772
|
-
idF=self.SearchAuto(InList=True,skipReturn=False)
|
|
1900
|
+
idF=self.SearchAuto(InList=True,skipReturn=False,use_search=use_search)
|
|
1773
1901
|
if idF:
|
|
1774
1902
|
result=session.query(Entry).filter(Entry.EntryId==idF).first()
|
|
1775
1903
|
if result:
|
|
@@ -1847,7 +1975,9 @@ Distress - ls Distress
|
|
|
1847
1975
|
print(f"{numColor}{num}{Style.reset} -> {color1}{result.Name}{Style.reset}|{color2}{result.rebar()}|{result.ALT_Barcode}{Style.reset}|{color3}{result.cfmt(result.Code)}{Style.reset}|{color4}{getattr(result,fieldname)}{Style.reset}|{eidColor}{getattr(result,'EntryId')}{Style.reset}")
|
|
1848
1976
|
print(f"{m}\n{hr}")
|
|
1849
1977
|
|
|
1850
|
-
def SearchAuto(self,InList=None,skipReturn=False):
|
|
1978
|
+
def SearchAuto(self,InList=None,skipReturn=False,use_search=True):
|
|
1979
|
+
if not use_search:
|
|
1980
|
+
return
|
|
1851
1981
|
state=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
|
|
1852
1982
|
while True:
|
|
1853
1983
|
try:
|
|
@@ -2741,7 +2871,8 @@ so use {Fore.orange_red_1}ls-lq/ls Shelf {Fore.light_yellow}from {Fore.light_mag
|
|
|
2741
2871
|
print(ne)
|
|
2742
2872
|
|
|
2743
2873
|
|
|
2744
|
-
def mkNew(self,code,data=None,extra=[],defaultEnter=True):
|
|
2874
|
+
def mkNew(self,code,data=None,extra=[],defaultEnter=True,use_name=True,use_code=True,use_casecount=True,use_price=True):
|
|
2875
|
+
#print("XMEN")
|
|
2745
2876
|
if data != None:
|
|
2746
2877
|
if 'Tags' in list(data.keys()):
|
|
2747
2878
|
data.pop('Tags')
|
|
@@ -2752,6 +2883,31 @@ so use {Fore.orange_red_1}ls-lq/ls Shelf {Fore.light_yellow}from {Fore.light_mag
|
|
|
2752
2883
|
'Price':0,
|
|
2753
2884
|
'CaseCount':1,
|
|
2754
2885
|
}
|
|
2886
|
+
if 'Name' in data:
|
|
2887
|
+
if not use_name:
|
|
2888
|
+
data.pop('Name')
|
|
2889
|
+
if 'Code' in data:
|
|
2890
|
+
if not use_code:
|
|
2891
|
+
data.pop('Code')
|
|
2892
|
+
|
|
2893
|
+
if 'CaseCount' in data:
|
|
2894
|
+
if not use_casecount:
|
|
2895
|
+
data.pop('CaseCount')
|
|
2896
|
+
|
|
2897
|
+
if 'Price' in data:
|
|
2898
|
+
if not use_price:
|
|
2899
|
+
data.pop('Price')
|
|
2900
|
+
|
|
2901
|
+
if len(data) < 1:
|
|
2902
|
+
#print(data)
|
|
2903
|
+
data={
|
|
2904
|
+
'Name':code,
|
|
2905
|
+
'Code':code,
|
|
2906
|
+
'Price':0,
|
|
2907
|
+
'CaseCount':1,
|
|
2908
|
+
}
|
|
2909
|
+
return data
|
|
2910
|
+
|
|
2755
2911
|
if len(extra) > 0:
|
|
2756
2912
|
for k in extra:
|
|
2757
2913
|
try:
|
|
@@ -2893,6 +3049,21 @@ so use {Fore.orange_red_1}ls-lq/ls Shelf {Fore.light_yellow}from {Fore.light_mag
|
|
|
2893
3049
|
break
|
|
2894
3050
|
if self.skipTo == None:
|
|
2895
3051
|
break
|
|
3052
|
+
if 'Name' not in data:
|
|
3053
|
+
if not use_name and 'Name' not in data:
|
|
3054
|
+
data['Name']=code
|
|
3055
|
+
if 'Code' not in data:
|
|
3056
|
+
if not use_code and 'Code' not in data:
|
|
3057
|
+
data['Code']=code
|
|
3058
|
+
|
|
3059
|
+
if 'CaseCount' not in data:
|
|
3060
|
+
if not use_casecount and 'CaseCount' not in data:
|
|
3061
|
+
data['CaseCount']=1
|
|
3062
|
+
|
|
3063
|
+
if 'Price' not in data:
|
|
3064
|
+
if not use_price and 'Price' not in data:
|
|
3065
|
+
data['Price']=0
|
|
3066
|
+
#print(data)
|
|
2896
3067
|
return data
|
|
2897
3068
|
|
|
2898
3069
|
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}'
|
|
@@ -2904,6 +3075,73 @@ so use {Fore.orange_red_1}ls-lq/ls Shelf {Fore.light_yellow}from {Fore.light_mag
|
|
|
2904
3075
|
print(e)
|
|
2905
3076
|
|
|
2906
3077
|
def setFieldInList_(self,fieldname,load=False,repack_exec=None,barcode=None,only_select_qty=False):
|
|
3078
|
+
auto=detectGetOrSet("list maker auto default",False,setValue=False,literal=False)
|
|
3079
|
+
ready=0
|
|
3080
|
+
auto_text=f" [a,auto] use current settings and set defaults for any unset settings from system storage."
|
|
3081
|
+
if not auto:
|
|
3082
|
+
ready+=1
|
|
3083
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3084
|
+
#extras that are not always necessary
|
|
3085
|
+
use_dflt_location=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}ask to search for {Fore.cyan}default Entry{Fore.light_yellow} Location ({Fore.light_sea_green}Where the Product was stored by you last){Fore.light_yellow}? [y/N({Fore.orange_red_1}d=default{Fore.light_yellow})]",helpText=f"a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False; {auto_text}",data="boolean")
|
|
3086
|
+
if use_dflt_location in [None,]:
|
|
3087
|
+
return
|
|
3088
|
+
elif use_dflt_location in ["auto","a","o","oneshot","1shot"]:
|
|
3089
|
+
if use_dflt_location in ["o","oneshot","1shot"]:
|
|
3090
|
+
one_shot=True
|
|
3091
|
+
auto=True
|
|
3092
|
+
use_dflt_location=False
|
|
3093
|
+
elif use_dflt_location in ['d',False,]:
|
|
3094
|
+
use_dflt_location=False
|
|
3095
|
+
else:
|
|
3096
|
+
use_dflt_location=True
|
|
3097
|
+
else:
|
|
3098
|
+
use_dflt_location=False
|
|
3099
|
+
|
|
3100
|
+
if use_dflt_location:
|
|
3101
|
+
dfltLctn=Control(func=FormBuilderMkText,ptext="Default Location?",helpText="where is this the contents of this list being stored",data="string")
|
|
3102
|
+
if dfltLctn in ['NaN',None]:
|
|
3103
|
+
return
|
|
3104
|
+
elif dfltLctn in ['d','',' ']:
|
|
3105
|
+
xdflt="Not/Ass/Ign/Ed"
|
|
3106
|
+
else:
|
|
3107
|
+
xdflt=dfltLctn
|
|
3108
|
+
else:
|
|
3109
|
+
xdflt="Not/Ass/Ign/Ed"
|
|
3110
|
+
|
|
3111
|
+
|
|
3112
|
+
if not auto:
|
|
3113
|
+
ready+=1
|
|
3114
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3115
|
+
#extras that are not always necessary
|
|
3116
|
+
use_employee=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}ask to for {Fore.cyan}default Entry{Fore.light_yellow} Employee Name/Initials/EmployeeId# ({Fore.light_sea_green}{Fore.light_blue}what ever you signed the box with){Fore.light_yellow}? [y/N({Fore.orange_red_1}d=default{Fore.light_yellow})]",helpText=f"a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False; {auto_text}",data="boolean")
|
|
3117
|
+
if use_employee in [None,]:
|
|
3118
|
+
return
|
|
3119
|
+
elif use_employee in ["auto","a","o","oneshot","1shot"]:
|
|
3120
|
+
if use_employee in ["o","oneshot","1shot"]:
|
|
3121
|
+
one_shot=True
|
|
3122
|
+
auto=True
|
|
3123
|
+
use_employee=False
|
|
3124
|
+
elif use_employee in ['d',False,]:
|
|
3125
|
+
use_employee=False
|
|
3126
|
+
else:
|
|
3127
|
+
use_employee=True
|
|
3128
|
+
else:
|
|
3129
|
+
use_employee=False
|
|
3130
|
+
|
|
3131
|
+
employee='DEFAULT EMPLOYEE/PERSONNEL'
|
|
3132
|
+
if use_employee:
|
|
3133
|
+
personnel=Control(func=FormBuilderMkText,ptext="Employee Name/Signature/EmployeeId?",helpText="how you are identified on your box",data="string")
|
|
3134
|
+
if personnel in ['NaN',None]:
|
|
3135
|
+
return
|
|
3136
|
+
elif personnel in ['d','',' ']:
|
|
3137
|
+
employee=""
|
|
3138
|
+
else:
|
|
3139
|
+
employee=personnel
|
|
3140
|
+
else:
|
|
3141
|
+
employee=detectGetOrSet("list maker default employee",'',setValue=False,literal=True)
|
|
3142
|
+
|
|
3143
|
+
|
|
3144
|
+
defaultLocation=detectGetOrSet("list maker default employee",xdflt,setValue=True,literal=True)
|
|
2907
3145
|
#determine if ascending or descending by
|
|
2908
3146
|
def hnf(resultx,fieldname,code):
|
|
2909
3147
|
if isinstance(resultx,Entry):
|
|
@@ -2987,29 +3225,177 @@ so use {Fore.orange_red_1}ls-lq/ls Shelf {Fore.light_yellow}from {Fore.light_mag
|
|
|
2987
3225
|
ptext=f'''{hafnhaf_l}
|
|
2988
3226
|
{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}'''
|
|
2989
3227
|
return ptext
|
|
2990
|
-
|
|
3228
|
+
|
|
3229
|
+
#ready+=1
|
|
3230
|
+
|
|
3231
|
+
use_code=detectGetOrSet("list maker use code default",False,setValue=False,literal=False)
|
|
3232
|
+
use_casecount=detectGetOrSet("list maker use casecount default",False,setValue=False,literal=False)
|
|
3233
|
+
use_price=detectGetOrSet("list maker use price default",True,setValue=False,literal=False)
|
|
3234
|
+
use_name=detectGetOrSet("list maker use name default",True,setValue=False,literal=False)
|
|
3235
|
+
use_notes=detectGetOrSet("list maker use notes default",False,setValue=False,literal=False)
|
|
3236
|
+
default_quantity_action=detectGetOrSet("list maker default qty",1,setValue=False,literal=False)
|
|
3237
|
+
barcode_might_be_number=detectGetOrSet("list maker might be a number default",False,setValue=False,literal=False)
|
|
3238
|
+
new_image=detectGetOrSet("list maker new item new image default",False,setValue=False,literal=False)
|
|
3239
|
+
ask_taxes=detectGetOrSet("list maker new item taxes default",False,setValue=False,literal=False)
|
|
3240
|
+
use_search=detectGetOrSet("list maker new item search default",False,setValue=False,literal=False)
|
|
3241
|
+
one_shot=detectGetOrSet("list maker one shot default",False,setValue=False,literal=False)
|
|
3242
|
+
|
|
3243
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3244
|
+
#names that are not always necessary
|
|
3245
|
+
if not auto:
|
|
3246
|
+
use_name=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}Ask for Entry {Fore.cyan}Name{Fore.light_yellow} For New Items? [y({Fore.orange_red_1}d=default{Fore.light_yellow})/N]",helpText=f"a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False; {auto_text}",data="boolean")
|
|
3247
|
+
if use_name in [None,]:
|
|
3248
|
+
return
|
|
3249
|
+
elif use_name in ["auto","a","o","oneshot","1shot"]:
|
|
3250
|
+
if use_name in ["o","oneshot","1shot"]:
|
|
3251
|
+
one_shot=True
|
|
3252
|
+
auto=True
|
|
3253
|
+
elif use_name in [False,]:
|
|
3254
|
+
use_name=False
|
|
3255
|
+
else:
|
|
3256
|
+
use_name=True
|
|
2991
3257
|
|
|
2992
|
-
if default_quantity_action in [None,]:
|
|
2993
|
-
return
|
|
2994
|
-
elif default_quantity_action in ['d',]:
|
|
2995
|
-
default_quantity_action=1
|
|
2996
3258
|
|
|
2997
|
-
#extras that are not always necessary
|
|
2998
|
-
use_notes=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Ask for Entry Notes after Quantity Input? [y/N]",helpText="a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False",data="boolean")
|
|
2999
|
-
if use_notes in [None,]:
|
|
3000
|
-
return
|
|
3001
|
-
elif use_notes in ['d',False]:
|
|
3002
|
-
use_notes=False
|
|
3003
|
-
else:
|
|
3004
|
-
use_notes=True
|
|
3005
3259
|
|
|
3006
|
-
|
|
3007
|
-
if
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3260
|
+
|
|
3261
|
+
if not auto:
|
|
3262
|
+
ready+=1
|
|
3263
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3264
|
+
#extras that are not always necessary
|
|
3265
|
+
use_code=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}Ask for Entry {Fore.cyan}Codes{Fore.light_yellow} For New Items? [y/N({Fore.orange_red_1}d=default{Fore.light_yellow})]",helpText=f"a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False; {auto_text}",data="boolean")
|
|
3266
|
+
if use_code in [None,]:
|
|
3267
|
+
return
|
|
3268
|
+
elif use_code in ["auto","a","o","oneshot","1shot"]:
|
|
3269
|
+
if use_code in ["o","oneshot","1shot"]:
|
|
3270
|
+
one_shot=True
|
|
3271
|
+
auto=True
|
|
3272
|
+
elif use_code in ['d',False,]:
|
|
3273
|
+
use_code=False
|
|
3274
|
+
else:
|
|
3275
|
+
use_code=True
|
|
3276
|
+
|
|
3277
|
+
if not auto:
|
|
3278
|
+
ready+=1
|
|
3279
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3280
|
+
#extras that are not always necessary
|
|
3281
|
+
use_search=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}ask to search for {Fore.cyan}Entry{Fore.light_yellow} For New Items? [y/N({Fore.orange_red_1}d=default{Fore.light_yellow})]",helpText=f"a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False; {auto_text}",data="boolean")
|
|
3282
|
+
if use_search in [None,]:
|
|
3283
|
+
return
|
|
3284
|
+
elif use_search in ["auto","a","o","oneshot","1shot"]:
|
|
3285
|
+
if use_search in ["o","oneshot","1shot"]:
|
|
3286
|
+
one_shot=True
|
|
3287
|
+
auto=True
|
|
3288
|
+
elif use_search in ['d',False,]:
|
|
3289
|
+
use_search=False
|
|
3290
|
+
else:
|
|
3291
|
+
use_search=True
|
|
3292
|
+
|
|
3293
|
+
if not auto:
|
|
3294
|
+
ready+=1
|
|
3295
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3296
|
+
#names that are not always necessary
|
|
3297
|
+
use_casecount=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}Ask for Entry {Fore.cyan}CaseCount{Fore.light_yellow} For New Items? [y/N({Fore.orange_red_1}d=default{Fore.light_yellow})]",helpText=f"a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False; {auto_text}",data="boolean")
|
|
3298
|
+
if use_casecount in [None,]:
|
|
3299
|
+
return
|
|
3300
|
+
elif use_casecount in ["auto","a","o","oneshot","1shot"]:
|
|
3301
|
+
if use_casecount in ["o","oneshot","1shot"]:
|
|
3302
|
+
one_shot=True
|
|
3303
|
+
auto=True
|
|
3304
|
+
elif use_casecount in ['d',False]:
|
|
3305
|
+
use_casecount=False
|
|
3306
|
+
else:
|
|
3307
|
+
use_casecount=True
|
|
3308
|
+
|
|
3309
|
+
if not auto:
|
|
3310
|
+
ready+=1
|
|
3311
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3312
|
+
#extras that are not always necessary
|
|
3313
|
+
use_price=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}Ask for Entry {Fore.cyan}Price{Fore.light_yellow} For New Items? [y({Fore.orange_red_1}d=default{Fore.light_yellow})/N]",helpText=f"a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False; {auto_text}",data="boolean")
|
|
3314
|
+
if use_price in [None,]:
|
|
3315
|
+
return
|
|
3316
|
+
elif use_price in ["auto","a","o","oneshot","1shot"]:
|
|
3317
|
+
if use_price in ["o","oneshot","1shot"]:
|
|
3318
|
+
one_shot=True
|
|
3319
|
+
auto=True
|
|
3320
|
+
elif use_price in [False,]:
|
|
3321
|
+
use_price=False
|
|
3322
|
+
else:
|
|
3323
|
+
use_price=True
|
|
3324
|
+
|
|
3325
|
+
if not auto:
|
|
3326
|
+
ready+=1
|
|
3327
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3328
|
+
#extras that are not always necessary
|
|
3329
|
+
use_notes=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}Ask for Entry {Fore.cyan}Notes{Fore.light_yellow} For New Items? [y/N({Fore.orange_red_1}d=default{Fore.light_yellow})]",helpText=f"a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False; {auto_text}",data="boolean")
|
|
3330
|
+
if use_notes in [None,]:
|
|
3331
|
+
return
|
|
3332
|
+
elif use_notes in ["auto","a","o","oneshot","1shot"]:
|
|
3333
|
+
if use_notes in ["o","oneshot","1shot"]:
|
|
3334
|
+
one_shot=True
|
|
3335
|
+
auto=True
|
|
3336
|
+
elif use_notes in ['d',False]:
|
|
3337
|
+
use_notes=False
|
|
3338
|
+
else:
|
|
3339
|
+
use_notes=True
|
|
3340
|
+
|
|
3341
|
+
if not auto:
|
|
3342
|
+
ready+=1
|
|
3343
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3344
|
+
default_quantity_action=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}Set The Default Quantity to the quantity retrieved + this value? 'd'=1",helpText="a positive(+) or Negative(-) integer.",data="float")
|
|
3345
|
+
|
|
3346
|
+
if default_quantity_action in [None,]:
|
|
3347
|
+
return
|
|
3348
|
+
elif default_quantity_action in ["auto","a","o","oneshot","1shot"]:
|
|
3349
|
+
if default_quantity_action in ["o","oneshot","1shot"]:
|
|
3350
|
+
one_shot=True
|
|
3351
|
+
auto=True
|
|
3352
|
+
elif default_quantity_action in ['d',]:
|
|
3353
|
+
default_quantity_action=1
|
|
3354
|
+
|
|
3355
|
+
if not auto:
|
|
3356
|
+
ready+=1
|
|
3357
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3358
|
+
barcode_might_be_number=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}might a barcode looking value be a number at Quantity Input [y/N]",helpText="a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False",data="boolean")
|
|
3359
|
+
if barcode_might_be_number in [None,]:
|
|
3360
|
+
return
|
|
3361
|
+
elif barcode_might_be_number in ["auto","a","o","oneshot","1shot"]:
|
|
3362
|
+
if barcode_might_be_number in ["o","oneshot","1shot"]:
|
|
3363
|
+
one_shot=True
|
|
3364
|
+
auto=True
|
|
3365
|
+
elif barcode_might_be_number in ['d',False]:
|
|
3366
|
+
barcode_might_be_number=False
|
|
3367
|
+
else:
|
|
3368
|
+
barcode_might_be_number=True
|
|
3369
|
+
|
|
3370
|
+
if not auto:
|
|
3371
|
+
ready+=1
|
|
3372
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3373
|
+
new_image=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}ask for new image path{Fore.light_yellow} For New Items? [y/N({Fore.orange_red_1}d=default{Fore.light_yellow})]",helpText="a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False",data="boolean")
|
|
3374
|
+
if new_image in [None,]:
|
|
3375
|
+
return
|
|
3376
|
+
elif new_image in ["auto","a","o","oneshot","1shot"]:
|
|
3377
|
+
if new_image in ["o","oneshot","1shot"]:
|
|
3378
|
+
one_shot=True
|
|
3379
|
+
auto=True
|
|
3380
|
+
elif new_image in ['d',False]:
|
|
3381
|
+
new_image=False
|
|
3382
|
+
else:
|
|
3383
|
+
new_image=True
|
|
3384
|
+
|
|
3385
|
+
if not auto:
|
|
3386
|
+
ready+=1
|
|
3387
|
+
m=f'{Fore.orange_red_1}INIT({ready}){Fore.light_yellow} -> '
|
|
3388
|
+
ask_taxes=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text=text,data=data,passThru=["auto","a","o","oneshot","1shot"],PassThru=True),ptext=f"{m}check if you want to fill out tax data{Fore.light_yellow} For New Items? [y({Fore.orange_red_1}d=default{Fore.light_yellow}/N)]",helpText="a boolean value from either of (0,f,n,no,false,False) or (1,t,true,True,yes,y) or formula that equates to a True or a False",data="boolean")
|
|
3389
|
+
if ask_taxes in [None,]:
|
|
3390
|
+
return
|
|
3391
|
+
elif ask_taxes in ["auto","a","o","oneshot","1shot"]:
|
|
3392
|
+
if ask_taxes in ["o","oneshot","1shot"]:
|
|
3393
|
+
one_shot=True
|
|
3394
|
+
auto=True
|
|
3395
|
+
elif ask_taxes in ['d',False,]:
|
|
3396
|
+
ask_taxes=False
|
|
3397
|
+
else:
|
|
3398
|
+
ask_taxes=True
|
|
3013
3399
|
|
|
3014
3400
|
tmp_fieldname=fieldname
|
|
3015
3401
|
while True:
|
|
@@ -3655,6 +4041,8 @@ Location Fields:
|
|
|
3655
4041
|
continue
|
|
3656
4042
|
|
|
3657
4043
|
if isinstance(result,Entry):
|
|
4044
|
+
result.location=defaultLocation
|
|
4045
|
+
result.Note+=f"Name|Signature|EmployeeId:{employee}\nToday: {datetime.now().ctime()}\n"
|
|
3658
4046
|
if result.Price is None:
|
|
3659
4047
|
result.Price=0
|
|
3660
4048
|
if result.Tax is None:
|
|
@@ -3716,7 +4104,11 @@ Location Fields:
|
|
|
3716
4104
|
ptext=f'''{hafnhaf}
|
|
3717
4105
|
{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}'''
|
|
3718
4106
|
|
|
3719
|
-
|
|
4107
|
+
if not one_shot:
|
|
4108
|
+
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))
|
|
4109
|
+
else:
|
|
4110
|
+
p=int(detectGetOrSet("list maker oneshot qty dflt",1,setValue=False,literal=False)),f'+{detectGetOrSet("list maker oneshot qty dflt",1,setValue=False,literal=False)}',''
|
|
4111
|
+
#float(1),text,''
|
|
3720
4112
|
if self.next_barcode():
|
|
3721
4113
|
continue
|
|
3722
4114
|
if p in [None,]:
|
|
@@ -3727,21 +4119,25 @@ Location Fields:
|
|
|
3727
4119
|
continue
|
|
3728
4120
|
def mkLT(text,data):
|
|
3729
4121
|
return text
|
|
3730
|
-
note=
|
|
4122
|
+
note=f""
|
|
3731
4123
|
if use_notes:
|
|
3732
|
-
|
|
3733
|
-
if
|
|
4124
|
+
nte=Prompt.__init2__(None,func=mkLT,ptext=f"Note's? ",helpText="temporary note about item, if any.",data=code)
|
|
4125
|
+
if nte in [None,]:
|
|
3734
4126
|
continue
|
|
4127
|
+
note+=nte
|
|
3735
4128
|
|
|
3736
4129
|
try:
|
|
3737
4130
|
color1=Fore.light_red
|
|
3738
4131
|
color2=Fore.orange_red_1
|
|
3739
4132
|
color3=Fore.cyan
|
|
3740
4133
|
color4=Fore.green_yellow
|
|
4134
|
+
result.Note+=f"\n{fieldname} = '{text}'\n"
|
|
3741
4135
|
if text.startswith("-") or text.startswith("+"):
|
|
3742
4136
|
#result=session.query(Entry).filter(or_(Entry.Barcode==code,Entry.Code==code,Entry.ALT_Barcode==code)).first()
|
|
3743
4137
|
#sore
|
|
3744
4138
|
if result:
|
|
4139
|
+
result.Location=defaultLocation
|
|
4140
|
+
#result.Note+=f"Name|Signature|EmployeeId:{employee}\nToday: {datetime.now().ctime()}\n"
|
|
3745
4141
|
if suffix.lower() in ['c',]:
|
|
3746
4142
|
if result.CaseCount in [None,]:
|
|
3747
4143
|
result.CaseCount=1
|
|
@@ -3753,8 +4149,8 @@ Location Fields:
|
|
|
3753
4149
|
session.commit()
|
|
3754
4150
|
session.flush()
|
|
3755
4151
|
session.refresh(result)
|
|
3756
|
-
value=float(value)*result.CaseCount
|
|
3757
|
-
setattr(result,fieldname,getattr(result,fieldname)+float(value))
|
|
4152
|
+
value=decc(float(value))*result.CaseCount
|
|
4153
|
+
setattr(result,fieldname,decc(getattr(result,fieldname))+decc(float(value)))
|
|
3758
4154
|
setattr(result,'Note',getattr(result,"Note")+"\n"+note)
|
|
3759
4155
|
result.InList=True
|
|
3760
4156
|
session.commit()
|
|
@@ -3767,7 +4163,7 @@ Location Fields:
|
|
|
3767
4163
|
print(self.entrySepEnd.replace('#REPLACE#',f'{code}@{fieldname}'))
|
|
3768
4164
|
else:
|
|
3769
4165
|
if only_select_qty:
|
|
3770
|
-
replacement=self.SearchAuto()
|
|
4166
|
+
replacement=self.SearchAuto(use_search=use_search)
|
|
3771
4167
|
else:
|
|
3772
4168
|
replacement=None
|
|
3773
4169
|
|
|
@@ -3776,6 +4172,8 @@ Location Fields:
|
|
|
3776
4172
|
if isinstance(replacement,int):
|
|
3777
4173
|
result=session.query(Entry).filter(Entry.EntryId==replacement).first()
|
|
3778
4174
|
if result:
|
|
4175
|
+
result.Location=defaultLocation
|
|
4176
|
+
result.Note+=f"Name|Signature|EmployeeId:{employee}\nToday: {datetime.now().ctime()}\n"
|
|
3779
4177
|
setattr(result,fieldname,getattr(result,fieldname)+float(value))
|
|
3780
4178
|
result.InList=True
|
|
3781
4179
|
session.commit()
|
|
@@ -3790,7 +4188,7 @@ Location Fields:
|
|
|
3790
4188
|
raise Exception(f"result is {result}")
|
|
3791
4189
|
else:
|
|
3792
4190
|
if only_select_qty:
|
|
3793
|
-
data=self.mkNew(code=code)
|
|
4191
|
+
data=self.mkNew(code=code,use_name=use_name,use_code=use_code,use_price=use_price,use_casecount=use_casecount)
|
|
3794
4192
|
if self.next_barcode():
|
|
3795
4193
|
continue
|
|
3796
4194
|
if data in [None,]:
|
|
@@ -3807,15 +4205,29 @@ Location Fields:
|
|
|
3807
4205
|
icode="UNASSIGNED_TO_NEW_ITEM"
|
|
3808
4206
|
iprice=0
|
|
3809
4207
|
icc=1
|
|
3810
|
-
|
|
3811
|
-
|
|
4208
|
+
if ask_taxes:
|
|
4209
|
+
tax,crv=self.calculate_tax_crv(iprice)
|
|
4210
|
+
else:
|
|
4211
|
+
tax=0
|
|
4212
|
+
crv=0
|
|
4213
|
+
if not use_name:
|
|
4214
|
+
name=code
|
|
4215
|
+
if not use_code:
|
|
4216
|
+
icode=code
|
|
4217
|
+
if not use_casecount:
|
|
4218
|
+
icc=1
|
|
4219
|
+
if not use_price:
|
|
4220
|
+
iprice=0
|
|
4221
|
+
note+=f"Name|Signature|EmployeeId:{employee}\nToday: {datetime.now().ctime()}\n"
|
|
4222
|
+
n=Entry(Barcode=code,Code=icode,Price=iprice,Note=note+"\nNew Item",Location=defaultLocation,Tax=tax,CRV=crv,Name=name,CaseCount=icc,InList=True)
|
|
3812
4223
|
setattr(n,fieldname,value)
|
|
3813
4224
|
session.add(n)
|
|
3814
4225
|
session.commit()
|
|
3815
4226
|
session.flush()
|
|
3816
4227
|
session.refresh(n)
|
|
3817
4228
|
if only_select_qty:
|
|
3818
|
-
|
|
4229
|
+
if new_image:
|
|
4230
|
+
n.copySrc()
|
|
3819
4231
|
result=n
|
|
3820
4232
|
print(f"{Fore.light_red}0{Style.reset} -> {color1}{result.Name}{Style.reset}|{color2}{result.rebar()}|{result.ALT_Barcode}{Style.reset}|{color3}{result.cfmt(result.Code)}{Style.reset}|{color4}{getattr(result,fieldname)}{Style.reset}|{color4}{getattr(result,'EntryId')}{Style.reset}")
|
|
3821
4233
|
|
|
@@ -3827,6 +4239,8 @@ Location Fields:
|
|
|
3827
4239
|
#result=session.query(Entry).filter(or_(Entry.Barcode==code,Entry.Code==code,Entry.ALT_Barcode==code)).first()
|
|
3828
4240
|
#sore
|
|
3829
4241
|
if result:
|
|
4242
|
+
result.Location=defaultLocation
|
|
4243
|
+
#result.Note+=f"Name|Signature|EmployeeId:{employee}\nToday: {datetime.now().ctime()}\n"
|
|
3830
4244
|
if suffix.lower() in ['c',]:
|
|
3831
4245
|
if result.CaseCount in [None,]:
|
|
3832
4246
|
result.CaseCount=1
|
|
@@ -3855,7 +4269,7 @@ Location Fields:
|
|
|
3855
4269
|
|
|
3856
4270
|
else:
|
|
3857
4271
|
if only_select_qty:
|
|
3858
|
-
replacement=self.SearchAuto()
|
|
4272
|
+
replacement=self.SearchAuto(use_search=use_search)
|
|
3859
4273
|
if self.next_barcode():
|
|
3860
4274
|
continue
|
|
3861
4275
|
else:
|
|
@@ -3863,6 +4277,8 @@ Location Fields:
|
|
|
3863
4277
|
if isinstance(replacement,int):
|
|
3864
4278
|
result=session.query(Entry).filter(Entry.EntryId==replacement).first()
|
|
3865
4279
|
if result:
|
|
4280
|
+
result.Location=defaultLocation
|
|
4281
|
+
result.Note+=f"Name|Signature|EmployeeId:{employee}\nToday: {datetime.now().ctime()}\n"
|
|
3866
4282
|
setattr(result,fieldname,getattr(result,fieldname)+float(value))
|
|
3867
4283
|
result.InList=True
|
|
3868
4284
|
session.commit()
|
|
@@ -3877,7 +4293,7 @@ Location Fields:
|
|
|
3877
4293
|
raise Exception(f"result is {result}")
|
|
3878
4294
|
else:
|
|
3879
4295
|
if only_select_qty:
|
|
3880
|
-
data=self.mkNew(code=code)
|
|
4296
|
+
data=self.mkNew(code=code,use_name=use_name,use_code=use_code,use_price=use_price,use_casecount=use_casecount)
|
|
3881
4297
|
#print(data)
|
|
3882
4298
|
if self.next_barcode():
|
|
3883
4299
|
continue
|
|
@@ -3894,8 +4310,22 @@ Location Fields:
|
|
|
3894
4310
|
icode="UNASSIGNED_TO_NEW_ITEM"
|
|
3895
4311
|
iprice=0
|
|
3896
4312
|
icc=1
|
|
3897
|
-
|
|
3898
|
-
|
|
4313
|
+
if ask_taxes:
|
|
4314
|
+
tax,crv=self.calculate_tax_crv(iprice)
|
|
4315
|
+
else:
|
|
4316
|
+
tax=0
|
|
4317
|
+
crv=0
|
|
4318
|
+
|
|
4319
|
+
if not use_name:
|
|
4320
|
+
name=code
|
|
4321
|
+
if not use_code:
|
|
4322
|
+
icode=code
|
|
4323
|
+
if not use_casecount:
|
|
4324
|
+
icc=1
|
|
4325
|
+
if not use_price:
|
|
4326
|
+
iprice=0
|
|
4327
|
+
note+=f"Name|Signature|EmployeeId:{employee}\nToday: {datetime.now().ctime()}\n"
|
|
4328
|
+
n=Entry(Barcode=code,Code=icode,Price=iprice,Note=note+"\nNew Item",Location=defaultLocation,Tax=tax,CRV=crv,Name=name,CaseCount=icc,InList=True)
|
|
3899
4329
|
#n=Entry(Barcode=code,Code=icode,Note=note+"\nNew Item",Name=name,Price=iprice,CaseCount=icc,InList=True)
|
|
3900
4330
|
setattr(n,fieldname,value)
|
|
3901
4331
|
session.add(n)
|
|
@@ -3903,7 +4333,8 @@ Location Fields:
|
|
|
3903
4333
|
session.flush()
|
|
3904
4334
|
session.refresh(n)
|
|
3905
4335
|
if only_select_qty:
|
|
3906
|
-
|
|
4336
|
+
if new_image:
|
|
4337
|
+
n.copySrc()
|
|
3907
4338
|
session.commit()
|
|
3908
4339
|
session.flush()
|
|
3909
4340
|
session.refresh(n)
|
|
@@ -5789,6 +6220,7 @@ where:
|
|
|
5789
6220
|
'''
|
|
5790
6221
|
self.clear_all=lambda self=self:clear_all(self)
|
|
5791
6222
|
if not init_only:
|
|
6223
|
+
BACKUP.daemon(None)
|
|
5792
6224
|
while True:
|
|
5793
6225
|
def mkT(text,self):
|
|
5794
6226
|
return text
|
|
@@ -6239,26 +6671,35 @@ Do What? [rms,rma,edit/e,<ENTER>/next,prev]"""
|
|
|
6239
6671
|
else:
|
|
6240
6672
|
print(f"{Fore.light_steel_blue}Qty was still {Fore.orange_red_1}{Qty}{Style.reset}")
|
|
6241
6673
|
|
|
6242
|
-
def bcd_img(self):
|
|
6674
|
+
def bcd_img(self,cp2=None):
|
|
6243
6675
|
SUPPORTEDOUT=barcode.PROVIDED_BARCODES
|
|
6244
6676
|
final_out=detectGetOrSet("IMG_GEN_OUT","GENERATED_BCD",literal=True)
|
|
6245
6677
|
ct=len(SUPPORTEDOUT)
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6678
|
+
if cp2 is None:
|
|
6679
|
+
for num,i in enumerate(SUPPORTEDOUT):
|
|
6680
|
+
msg=f'''{Fore.medium_violet_red}{num}{Fore.light_magenta}/{num+1} of {Fore.dark_goldenrod}{ct} -> {Fore.light_green}{i}{Style.reset}'''
|
|
6681
|
+
print(msg)
|
|
6682
|
+
which=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Which {Fore.medium_violet_red}index? {Fore.light_yellow}",helpText="which {Fore.medium_violet_red}index? {Fore.light_yellow}",data="integer")
|
|
6683
|
+
if which in [None,'d']:
|
|
6684
|
+
which=SUPPORTEDOUT.index("code128")
|
|
6252
6685
|
try:
|
|
6253
6686
|
data=Prompt.__init2__(None,func=FormBuilderMkText,ptext="What data do you wish to encode?",helpText="its just text.",data="string")
|
|
6254
6687
|
options={}
|
|
6255
6688
|
options['writer']=barcode.writer.ImageWriter()
|
|
6256
6689
|
if data in ['d',None]:
|
|
6257
6690
|
return
|
|
6258
|
-
if
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6691
|
+
if cp2 is None:
|
|
6692
|
+
if SUPPORTEDOUT[which] == 'code39':
|
|
6693
|
+
options['add_checksum']=False
|
|
6694
|
+
else:
|
|
6695
|
+
if cp2 == "code39":
|
|
6696
|
+
options['add_checksum']=False
|
|
6697
|
+
|
|
6698
|
+
if cp2 is None:
|
|
6699
|
+
bcd_class=barcode.get_class(SUPPORTEDOUT[which])
|
|
6700
|
+
else:
|
|
6701
|
+
bcd_class=barcode.get_class(cp2)
|
|
6702
|
+
|
|
6262
6703
|
cde=bcd_class(data,**options)
|
|
6263
6704
|
cde.save(final_out)
|
|
6264
6705
|
print(f"Saved to '{final_out}'!")
|
|
@@ -6392,6 +6833,10 @@ CD4E(str_code_or_id,shrt=True/False) -> Retrieves the Entry for an Entry(s) Code
|
|
|
6392
6833
|
if no item is found, then an un-commited Entry is returned; Entry('NOT FOUND','ERROR 404').
|
|
6393
6834
|
if no item is selected, then an un-commited Entry is returned; Entry('No Selection','Nothing Selected').
|
|
6394
6835
|
if an exception prevents operation, then an un-commited Entry is returned; Entry('EXCEPTION','Exception').
|
|
6836
|
+
|
|
6837
|
+
CVT(value,str_in,str_out) - specifically a part of evaluateFormula()
|
|
6838
|
+
UnitRegistry - pint.UnitRegistry
|
|
6839
|
+
Quantity() - pint.Quantity for normalized values
|
|
6395
6840
|
{Style.reset}'''
|
|
6396
6841
|
def mkValue(text,self):
|
|
6397
6842
|
try:
|