radboy 0.0.376__py3-none-any.whl → 0.0.377__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
@@ -2181,1112 +2181,23 @@ last month = today-30d
2181
2181
  return func(result,data)
2182
2182
  elif cmd.lower() in ["bldls","build","buildls","build list","bld ls",'lsbld','list build','ls bld','bld']:
2183
2183
  bldls()
2184
- '''
2185
- extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2186
- if extras in [None,'d',False]:
2187
- extras=False
2188
-
2189
- with db.Session(db.ENGINE) as session:
2190
- results_query=session.query(db.Entry).filter(db.Entry.InList==True)
2191
- 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"]
2192
- z=Prompt.mkfield_list(None,location_fields)
2193
- if z in [[],None]:
2194
- z=location_fields
2195
- location_fields=z
2196
- tmp=[]
2197
- for f in location_fields:
2198
- tmp.append(or_(getattr(db.Entry,f)>=0.0001))
2199
- results_query=results_query.filter(or_(*tmp))
2200
-
2201
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
2202
- if not isinstance(LookUpState,bool):
2203
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
2204
- if LookUpState == True:
2205
- results=results_query.order_by(db.Entry.Timestamp.asc()).all()
2206
- else:
2207
- results=results_query.order_by(db.Entry.Timestamp.desc()).all()
2208
- ct=len(results)
2209
- if ct < 1:
2210
- print(f"{Fore.light_steel_blue}Nothing in {Fore.slate_blue_1}Bld{Fore.light_red}LS!{Style.reset}")
2211
- continue
2212
- ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
2213
- master_total=0
2214
- master_total_crv=0
2215
- master_total_tax=0
2216
- master_total_tax_crv=0
2217
-
2218
- for num,i in enumerate(results):
2219
- getExtras(i.EntryId,extras)
2220
- 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}|-| '
2221
- colormapped=[
2222
- Fore.deep_sky_blue_4c,
2223
- Fore.spring_green_4,
2224
- Fore.turquoise_4,
2225
- Fore.dark_cyan,
2226
- Fore.deep_sky_blue_2,
2227
- Fore.spring_green_2a,
2228
- Fore.medium_spring_green,
2229
- Fore.steel_blue,
2230
- Fore.cadet_blue_1,
2231
- Fore.aquamarine_3,
2232
- Fore.purple_1a,
2233
- Fore.medium_purple_3a,
2234
- Fore.slate_blue_1,
2235
- Fore.light_slate_grey,
2236
- Fore.dark_olive_green_3a,
2237
- Fore.deep_pink_4c,
2238
- Fore.orange_3,
2239
- ]
2240
- total=0
2241
- crv=0
2242
- tax=0
2243
- tax_crv=0
2244
- i.Tax=round(i.Tax,ROUNDTO)
2245
- i.CRV=round(i.CRV,ROUNDTO)
2246
- i.Price=round(i.Price,ROUNDTO)
2247
- session.commit()
2248
- for n2,f in enumerate(location_fields):
2249
- try:
2250
- if getattr(i,f) > 0:
2251
- total+=getattr(i,f)
2252
- except Exception as e:
2253
- print(e)
2254
- for n2,f in enumerate(location_fields):
2255
- if getattr(i,f) > 0:
2256
- msg2=f'{colormapped[n2]}{f} = {round(getattr(i,f),ROUNDTO)}{Style.reset}'
2257
- if n2 < len(location_fields):
2258
- msg2+=","
2259
- msg+=msg2
2260
- master_total+=total*round(i.Price,ROUNDTO)
2261
-
2262
- crv+=(round(i.CRV,ROUNDTO)*total)
2263
- tax+=(round(i.Tax,ROUNDTO)*total)
2264
- if tax == 0 and crv > 0:
2265
- tax_crv=(round(i.CRV,ROUNDTO)*total)
2266
- else:
2267
- tax_crv+=((round(i.Tax,ROUNDTO)*total)+(round(i.CRV,ROUNDTO)*total))
2268
- master_total_tax+=tax
2269
- master_total_crv+=crv
2270
- master_total_tax_crv+=tax_crv
2271
- tax_crv=round(tax_crv,ROUNDTO)
2272
- try:
2273
- super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
2274
- except Exception as e:
2275
- p1=round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO))
2276
- p2=getSuperTotal(results,location_fields,colormapped)['final total']
2277
- print(e)
2278
- print(p1,"p1")
2279
- print(p2,"p2")
2280
- super_total=0
2281
-
2282
- msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{round(total,ROUNDTO)}
2283
- {Fore.light_magenta}Price({i.Price}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({round(total,ROUNDTO)}):{round(i.Price*total,ROUNDTO)}
2284
- {Fore.grey_70}+CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TotalCRV({crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+crv,ROUNDTO)})
2285
- {Fore.grey_70}+Tax({i.Tax}) w/o CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxNoCRVTotal({tax})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax,ROUNDTO)})
2286
- {Fore.grey_70}+Tax({i.Tax}) w/ CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxCRVTotal({tax_crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)})
2287
- {Fore.medium_violet_red}PercentOfTotal({round(super_total,ROUNDTO)}) of Total({getSuperTotal(results,location_fields,colormapped)['final total']})
2288
- {'*'*os.get_terminal_size().columns}{Style.reset}"""
2289
- print(msg)
2290
- master_total=round(master_total,ROUNDTO)
2291
- master_total_crv=round(master_total_crv,ROUNDTO)
2292
- master_total_tax=round(master_total_tax,ROUNDTO)
2293
- master_total_tax_crv=round(master_total_tax_crv,ROUNDTO)
2294
- msg=f"""{Fore.light_green}Total Product Value:{Fore.slate_blue_1}{round(master_total,ROUNDTO)}
2295
- {Fore.light_green}Total Product Value w/CRV({master_total_crv}):{Fore.slate_blue_1}{round(master_total_crv+master_total,ROUNDTO)}
2296
- {Fore.light_green}Total Product Value Taxed w/o CRV({master_total_tax}):{Fore.slate_blue_1}{round(master_total_tax+master_total,ROUNDTO)}
2297
- {Fore.light_green}Total Product Value Taxed w/ CRV({master_total_tax_crv}):{Fore.slate_blue_1}{round(master_total_tax_crv+master_total,ROUNDTO)}
2298
- {Style.reset}"""
2299
- print(msg)'''
2300
2184
  elif cmd.lower() in ['quick price','qprc','price']:
2301
2185
  t=TM.Tasks.TasksMode.pricing(None)
2302
2186
  if t is not None:
2303
2187
  return func(str(t),data)
2304
2188
  elif cmd.lower() in ["bldlse","builde","buildlse","build list export ","bld ls exp",'elsbld','export list build','exp ls bld','ebld']:
2305
- '''extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2306
- if extras in [None,'d',False]:
2307
- extras=False
2308
- msg=''
2309
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file,clear_only=True)
2310
- with db.Session(db.ENGINE) as session:
2311
- results_query=session.query(db.Entry).filter(db.Entry.InList==True)
2312
- 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"]
2313
- z=Prompt.mkfield_list(None,location_fields)
2314
- if z in [[],None]:
2315
- z=location_fields
2316
- location_fields=z
2317
- tmp=[]
2318
- for f in location_fields:
2319
- tmp.append(or_(getattr(db.Entry,f)>=0.0001))
2320
- results_query=results_query.filter(or_(*tmp))
2321
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
2322
- if not isinstance(LookUpState,bool):
2323
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
2324
- if LookUpState == True:
2325
- results=results_query.order_by(db.Entry.Timestamp.asc()).all()
2326
- else:
2327
- results=results_query.order_by(db.Entry.Timestamp.desc()).all()
2328
- ct=len(results)
2329
- if ct < 1:
2330
- msg=f"{Fore.light_steel_blue}Nothing in {Fore.slate_blue_1}Bld{Fore.light_red}LS!{Style.reset}"
2331
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2332
- print(msg)
2333
- continue
2334
- #start
2335
- ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
2336
- master_total=0
2337
- master_total_crv=0
2338
- master_total_tax=0
2339
- master_total_tax_crv=0
2340
-
2341
- for num,i in enumerate(results):
2342
- getExtras(i.EntryId,extras)
2343
- 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}|-| '
2344
- colormapped=[
2345
- Fore.deep_sky_blue_4c,
2346
- Fore.spring_green_4,
2347
- Fore.turquoise_4,
2348
- Fore.dark_cyan,
2349
- Fore.deep_sky_blue_2,
2350
- Fore.spring_green_2a,
2351
- Fore.medium_spring_green,
2352
- Fore.steel_blue,
2353
- Fore.cadet_blue_1,
2354
- Fore.aquamarine_3,
2355
- Fore.purple_1a,
2356
- Fore.medium_purple_3a,
2357
- Fore.slate_blue_1,
2358
- Fore.light_slate_grey,
2359
- Fore.dark_olive_green_3a,
2360
- Fore.deep_pink_4c,
2361
- Fore.orange_3,
2362
- ]
2363
- total=0
2364
- crv=0
2365
- tax=0
2366
- tax_crv=0
2367
- i.Tax=round(i.Tax,ROUNDTO)
2368
- i.CRV=round(i.CRV,ROUNDTO)
2369
- i.Price=round(i.Price,ROUNDTO)
2370
- session.commit()
2371
- for n2,f in enumerate(location_fields):
2372
- try:
2373
- if getattr(i,f) > 0:
2374
- total+=getattr(i,f)
2375
- except Exception as e:
2376
- print(e)
2377
- for n2,f in enumerate(location_fields):
2378
- if getattr(i,f) > 0:
2379
- msg2=f'{colormapped[n2]}{f} = {round(getattr(i,f),ROUNDTO)}{Style.reset}'
2380
- if n2 < len(location_fields):
2381
- msg2+=","
2382
- msg+=msg2
2383
- master_total+=total*round(i.Price,ROUNDTO)
2384
-
2385
- crv+=(round(i.CRV,ROUNDTO)*total)
2386
- tax+=(round(i.Tax,ROUNDTO)*total)
2387
- if tax == 0 and crv > 0:
2388
- tax_crv=(round(i.CRV,ROUNDTO)*total)
2389
- else:
2390
- tax_crv+=((round(i.Tax,ROUNDTO)*total)+(round(i.CRV,ROUNDTO)*total))
2391
- master_total_tax+=tax
2392
- master_total_crv+=crv
2393
- master_total_tax_crv+=tax_crv
2394
- tax_crv=round(tax_crv,ROUNDTO)
2395
- try:
2396
- super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
2397
- except Exception as e:
2398
- p1=round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO))
2399
- p2=getSuperTotal(results,location_fields,colormapped)['final total']
2400
- print(e)
2401
- print(p1,"p1")
2402
- print(p2,"p2")
2403
- super_total=0
2404
- msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{round(total,ROUNDTO)}
2405
- {Fore.light_magenta}Price({i.Price}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({round(total,ROUNDTO)}):{round(i.Price*total,ROUNDTO)}
2406
- {Fore.grey_70}+CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TotalCRV({crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(total*i.Price,ROUNDTO)+crv})
2407
- {Fore.grey_70}+Tax({i.Tax}) w/o CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxNoCRVTotal({tax})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax,ROUNDTO)})
2408
- {Fore.grey_70}+Tax({i.Tax}) w/ CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxCRVTotal({tax_crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)})
2409
- {Fore.medium_violet_red}PercentOfTotal({round(super_total,ROUNDTO)}) of Total({getSuperTotal(results,location_fields,colormapped)['final total']})
2410
- {'*'*os.get_terminal_size().columns}{Style.reset}"""
2411
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2412
- print(msg)
2413
- master_total=round(master_total,ROUNDTO)
2414
- master_total_crv=round(master_total_crv,ROUNDTO)
2415
- master_total_tax=round(master_total_tax,ROUNDTO)
2416
- master_total_tax_crv=round(master_total_tax_crv,ROUNDTO)
2417
- msg=f"""{Fore.light_green}Total Product Value:{Fore.slate_blue_1}{round(master_total,ROUNDTO)}
2418
- {Fore.light_green}Total Product Value w/CRV({master_total_crv}):{Fore.slate_blue_1}{round(master_total_crv+master_total,ROUNDTO)}
2419
- {Fore.light_green}Total Product Value Taxed w/o CRV({master_total_tax}):{Fore.slate_blue_1}{round(master_total_tax+master_total,ROUNDTO)}
2420
- {Fore.light_green}Total Product Value Taxed w/ CRV({master_total_tax_crv}):{Fore.slate_blue_1}{round(master_total_tax_crv+master_total,ROUNDTO)}
2421
- {Style.reset}"""
2422
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2423
- print(msg)
2424
- '''
2425
- '''
2426
- lsbld - bldls()
2427
- lsbld- - bldls(minus=True)
2428
- bldlse - bldls(bldlse=True)
2429
- bldlse - bldls(bldlse=True,minus=True)
2430
-
2431
- sbld - bldls(sbld=True)
2432
- sbld- bldls(sbld=True,minus=True)
2433
- esbld - bldls(bldlse=True,sbld=True)
2434
- esblb- bldls(bldlse=True,sbld=True,minus=True)
2435
- '''
2436
2189
  bldls(bldlse=True)
2437
2190
  elif cmd.lower() in ['sbld','search build','search_build','scan build','scan_bld']:
2438
- '''
2439
- extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2440
- if extras in [None,'d',False]:
2441
- extras=False
2442
- end=False
2443
- while not end:
2444
- with db.Session(db.ENGINE) as session:
2445
- def mkT(text,data):
2446
- return text
2447
- code=Prompt.__init2__(None,func=mkT,ptext="Code|Barcode|Name: ",helpText="find by code,barcode,name",data='')
2448
- if code in [None,]:
2449
- end=True
2450
- break
2451
- elif code in ['d',]:
2452
- continue
2453
-
2454
- results_query=session.query(db.Entry).filter(db.Entry.InList==True)
2455
- results_query=results_query.filter(
2456
- db.or_(
2457
- db.Entry.Code==code,
2458
- db.Entry.Barcode==code,
2459
- db.Entry.Barcode.icontains(code),
2460
- db.Entry.Code.icontains(code),
2461
- db.Entry.Name.icontains(code)
2462
- )
2463
- )
2464
- 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"]
2465
- z=Prompt.mkfield_list(None,location_fields)
2466
- if z in [[],None]:
2467
- z=location_fields
2468
- location_fields=z
2469
- tmp=[]
2470
- for f in location_fields:
2471
- tmp.append(or_(getattr(db.Entry,f)>=0.0001))
2472
- results_query=results_query.filter(or_(*tmp))
2473
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
2474
- if not isinstance(LookUpState,bool):
2475
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
2476
- if LookUpState == True:
2477
- results=results_query.order_by(db.Entry.Timestamp.asc()).all()
2478
- else:
2479
- results=results_query.order_by(db.Entry.Timestamp.desc()).all()
2480
- ct=len(results)
2481
- if ct < 1:
2482
- print(f"{Fore.light_steel_blue}Nothing in {Fore.slate_blue_1}Bld{Fore.light_red}LS!{Style.reset}")
2483
- continue
2484
-
2485
- ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,set_value=False,literal=True))
2486
- #ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
2487
- master_total=0
2488
- master_total_crv=0
2489
- master_total_tax=0
2490
- master_total_tax_crv=0
2491
-
2492
- for num,i in enumerate(results):
2493
- getExtras(i.EntryId,extras)
2494
- 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}|-| '
2495
- colormapped=[
2496
- Fore.deep_sky_blue_4c,
2497
- Fore.spring_green_4,
2498
- Fore.turquoise_4,
2499
- Fore.dark_cyan,
2500
- Fore.deep_sky_blue_2,
2501
- Fore.spring_green_2a,
2502
- Fore.medium_spring_green,
2503
- Fore.steel_blue,
2504
- Fore.cadet_blue_1,
2505
- Fore.aquamarine_3,
2506
- Fore.purple_1a,
2507
- Fore.medium_purple_3a,
2508
- Fore.slate_blue_1,
2509
- Fore.light_slate_grey,
2510
- Fore.dark_olive_green_3a,
2511
- Fore.deep_pink_4c,
2512
- Fore.orange_3,
2513
- ]
2514
- total=0
2515
- crv=0
2516
- tax=0
2517
- tax_crv=0
2518
- i.Tax=round(i.Tax,ROUNDTO)
2519
- i.CRV=round(i.CRV,ROUNDTO)
2520
- i.Price=round(i.Price,ROUNDTO)
2521
- session.commit()
2522
- for n2,f in enumerate(location_fields):
2523
- try:
2524
- if getattr(i,f) > 0:
2525
- total+=getattr(i,f)
2526
- except Exception as e:
2527
- print(e)
2528
- for n2,f in enumerate(location_fields):
2529
- if getattr(i,f) > 0:
2530
- msg2=f'{colormapped[n2]}{f} = {round(getattr(i,f),ROUNDTO)}{Style.reset}'
2531
- if n2 < len(location_fields):
2532
- msg2+=","
2533
- msg+=msg2
2534
- master_total+=total*round(i.Price,ROUNDTO)
2535
-
2536
- crv+=(round(i.CRV,ROUNDTO)*total)
2537
- tax+=(round(i.Tax,ROUNDTO)*total)
2538
- if tax == 0 and crv > 0:
2539
- tax_crv=(round(i.CRV,ROUNDTO)*total)
2540
- else:
2541
- tax_crv+=((round(i.Tax,ROUNDTO)*total)+(round(i.CRV,ROUNDTO)*total))
2542
- master_total_tax+=tax
2543
- master_total_crv+=crv
2544
- master_total_tax_crv+=tax_crv
2545
- tax_crv=round(tax_crv,ROUNDTO)
2546
- try:
2547
- super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
2548
- except Exception as e:
2549
- p1=round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO))
2550
- p2=getSuperTotal(results,location_fields,colormapped)['final total']
2551
- print(e)
2552
- print(p1,"p1")
2553
- print(p2,"p2")
2554
- super_total=0
2555
- msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{round(total,ROUNDTO)}
2556
- {Fore.light_magenta}Price({i.Price}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({round(total,ROUNDTO)}):{round(i.Price*total,ROUNDTO)}
2557
- {Fore.grey_70}+CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TotalCRV({crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(total*i.Price,ROUNDTO)+crv})
2558
- {Fore.grey_70}+Tax({i.Tax}) w/o CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxNoCRVTotal({tax})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax,ROUNDTO)})
2559
- {Fore.grey_70}+Tax({i.Tax}) w/ CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxCRVTotal({tax_crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)})
2560
- {'*'*os.get_terminal_size().columns}{Style.reset}"""
2561
- print(msg)
2562
- master_total=round(master_total,ROUNDTO)
2563
- master_total_crv=round(master_total_crv,ROUNDTO)
2564
- master_total_tax=round(master_total_tax,ROUNDTO)
2565
- master_total_tax_crv=round(master_total_tax_crv,ROUNDTO)
2566
- msg=f"""{Fore.light_green}Total Product Value:{Fore.slate_blue_1}{round(master_total,ROUNDTO)}
2567
- {Fore.light_green}Total Product Value w/CRV({master_total_crv}):{Fore.slate_blue_1}{round(master_total_crv+master_total,ROUNDTO)}
2568
- {Fore.light_green}Total Product Value Taxed w/o CRV({master_total_tax}):{Fore.slate_blue_1}{round(master_total_tax+master_total,ROUNDTO)}
2569
- {Fore.light_green}Total Product Value Taxed w/ CRV({master_total_tax_crv}):{Fore.slate_blue_1}{round(master_total_tax_crv+master_total,ROUNDTO)}
2570
- {Fore.medium_violet_red}PercentOfTotal({round(super_total,ROUNDTO)}) of Total({getSuperTotal(results,location_fields,colormapped)['final total']})
2571
- {Style.reset}"""
2572
- print(msg)
2573
- '''
2574
- '''
2575
- lsbld - bldls()
2576
- lsbld- - bldls(minus=True)
2577
- bldlse - bldls(bldlse=True)
2578
- bldlse - bldls(bldlse=True,minus=True)
2579
-
2580
- sbld - bldls(sbld=True)
2581
- sbld- bldls(sbld=True,minus=True)
2582
- esbld - bldls(bldlse=True,sbld=True)
2583
- esblb- bldls(bldlse=True,sbld=True,minus=True)
2584
- '''
2585
2191
  bldls(sbld=True)
2586
2192
  elif cmd.lower() in ['esbld','export search build','export_search_build','exp scan build','exp_scan_bld']:
2587
- '''
2588
- extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2589
- if extras in [None,'d',False]:
2590
- extras=False
2591
- end=False
2592
- msg=''
2593
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file,clear_only=True)
2594
- while not end:
2595
- with db.Session(db.ENGINE) as session:
2596
- def mkT(text,data):
2597
- return text
2598
- code=Prompt.__init2__(None,func=mkT,ptext="Code|Barcode|Name: ",helpText="find by code,barcode,name",data='')
2599
- if code in [None,]:
2600
- end=True
2601
- break
2602
- elif code in ['d',]:
2603
- continue
2604
-
2605
- results_query=session.query(db.Entry).filter(db.Entry.InList==True)
2606
- results_query=results_query.filter(
2607
- db.or_(
2608
- db.Entry.Code==code,
2609
- db.Entry.Barcode==code,
2610
- db.Entry.Barcode.icontains(code),
2611
- db.Entry.Code.icontains(code),
2612
- db.Entry.Name.icontains(code)
2613
- )
2614
- )
2615
- 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"]
2616
- z=Prompt.mkfield_list(None,location_fields)
2617
- if z in [[],None]:
2618
- z=location_fields
2619
- location_fields=z
2620
- tmp=[]
2621
- for f in location_fields:
2622
- tmp.append(or_(getattr(db.Entry,f)>=0.0001))
2623
- results_query=results_query.filter(or_(*tmp))
2624
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
2625
- if not isinstance(LookUpState,bool):
2626
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
2627
- if LookUpState == True:
2628
- results=results_query.order_by(db.Entry.Timestamp.asc()).all()
2629
- else:
2630
- results=results_query.order_by(db.Entry.Timestamp.desc()).all()
2631
- ct=len(results)
2632
- if ct < 1:
2633
- msg=f"{Fore.light_steel_blue}Nothing in {Fore.slate_blue_1}Bld{Fore.light_red}LS!{Style.reset}"
2634
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2635
- print(msg)
2636
- continue
2637
-
2638
- #start
2639
- ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
2640
- master_total=0
2641
- master_total_crv=0
2642
- master_total_tax=0
2643
- master_total_tax_crv=0
2644
-
2645
- for num,i in enumerate(results):
2646
- getExtras(i.EntryId,extras)
2647
- 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}|-| '
2648
- colormapped=[
2649
- Fore.deep_sky_blue_4c,
2650
- Fore.spring_green_4,
2651
- Fore.turquoise_4,
2652
- Fore.dark_cyan,
2653
- Fore.deep_sky_blue_2,
2654
- Fore.spring_green_2a,
2655
- Fore.medium_spring_green,
2656
- Fore.steel_blue,
2657
- Fore.cadet_blue_1,
2658
- Fore.aquamarine_3,
2659
- Fore.purple_1a,
2660
- Fore.medium_purple_3a,
2661
- Fore.slate_blue_1,
2662
- Fore.light_slate_grey,
2663
- Fore.dark_olive_green_3a,
2664
- Fore.deep_pink_4c,
2665
- Fore.orange_3,
2666
- ]
2667
- total=0
2668
- crv=0
2669
- tax=0
2670
- tax_crv=0
2671
- i.Tax=round(i.Tax,ROUNDTO)
2672
- i.CRV=round(i.CRV,ROUNDTO)
2673
- i.Price=round(i.Price,ROUNDTO)
2674
- session.commit()
2675
- for n2,f in enumerate(location_fields):
2676
- try:
2677
- if getattr(i,f) > 0:
2678
- total+=getattr(i,f)
2679
- except Exception as e:
2680
- print(e)
2681
- for n2,f in enumerate(location_fields):
2682
- if getattr(i,f) > 0:
2683
- msg2=f'{colormapped[n2]}{f} = {round(getattr(i,f),ROUNDTO)}{Style.reset}'
2684
- if n2 < len(location_fields):
2685
- msg2+=","
2686
- msg+=msg2
2687
- master_total+=total*round(i.Price,ROUNDTO)
2688
-
2689
- crv+=(round(i.CRV,ROUNDTO)*total)
2690
- tax+=(round(i.Tax,ROUNDTO)*total)
2691
- if tax == 0 and crv > 0:
2692
- tax_crv=(round(i.CRV,ROUNDTO)*total)
2693
- else:
2694
- tax_crv+=((round(i.Tax,ROUNDTO)*total)+(round(i.CRV,ROUNDTO)*total))
2695
- master_total_tax+=tax
2696
- master_total_crv+=crv
2697
- master_total_tax_crv+=tax_crv
2698
- tax_crv=round(tax_crv,ROUNDTO)
2699
- try:
2700
- super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
2701
- except Exception as e:
2702
- p1=round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO))
2703
- p2=getSuperTotal(results,location_fields,colormapped)['final total']
2704
- print(e)
2705
- print(p1,"p1")
2706
- print(p2,"p2")
2707
- super_total=0
2708
- msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{round(total,ROUNDTO)}
2709
- {Fore.light_magenta}Price({i.Price}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({round(total,ROUNDTO)}):{round(i.Price*total,ROUNDTO)}
2710
- {Fore.grey_70}+CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TotalCRV({crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(total*i.Price,ROUNDTO)+crv})
2711
- {Fore.grey_70}+Tax({i.Tax}) w/o CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxNoCRVTotal({tax})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax,ROUNDTO)})
2712
- {Fore.grey_70}+Tax({i.Tax}) w/ CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxCRVTotal({tax_crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)})
2713
- {Fore.medium_violet_red}PercentOfTotal({round(super_total,ROUNDTO)}) of Total({getSuperTotal(results,location_fields,colormapped)['final total']})
2714
- {'*'*os.get_terminal_size().columns}{Style.reset}"""
2715
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2716
- print(msg)
2717
- master_total=round(master_total,ROUNDTO)
2718
- master_total_crv=round(master_total_crv,ROUNDTO)
2719
- master_total_tax=round(master_total_tax,ROUNDTO)
2720
- master_total_tax_crv=round(master_total_tax_crv,ROUNDTO)
2721
- msg=f"""{Fore.light_green}Total Product Value:{Fore.slate_blue_1}{round(master_total,ROUNDTO)}
2722
- {Fore.light_green}Total Product Value w/CRV({master_total_crv}):{Fore.slate_blue_1}{round(master_total_crv+master_total,ROUNDTO)}
2723
- {Fore.light_green}Total Product Value Taxed w/o CRV({master_total_tax}):{Fore.slate_blue_1}{round(master_total_tax+master_total,ROUNDTO)}
2724
- {Fore.light_green}Total Product Value Taxed w/ CRV({master_total_tax_crv}):{Fore.slate_blue_1}{round(master_total_tax_crv+master_total,ROUNDTO)}
2725
- {Style.reset}"""
2726
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2727
- print(msg)
2728
- '''
2729
- '''
2730
- lsbld - bldls()
2731
- lsbld- - bldls(minus=True)
2732
- bldlse - bldls(bldlse=True)
2733
- bldlse - bldls(bldlse=True,minus=True)
2734
-
2735
- sbld - bldls(sbld=True)
2736
- sbld- bldls(sbld=True,minus=True)
2737
- esbld - bldls(bldlse=True,sbld=True)
2738
- esblb- bldls(bldlse=True,sbld=True,minus=True)
2739
- '''
2740
2193
  bldls(bldlse=True,sbld=True)
2741
2194
  elif cmd.lower() in ["bldls-","build-","buildls-","build list -","bld ls -",'lsbld-','list build -','ls bld -','bld-']:
2742
- '''
2743
- extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2744
- if extras in [None,'d',False]:
2745
- extras=False
2746
- with db.Session(db.ENGINE) as session:
2747
- results_query=session.query(db.Entry).filter(db.Entry.InList==True)
2748
- 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"]
2749
- z=Prompt.mkfield_list(None,location_fields)
2750
- if z in [[],None]:
2751
- z=location_fields
2752
- location_fields=z
2753
- tmp=[]
2754
- for f in location_fields:
2755
- tmp.append(or_(getattr(db.Entry,f)!=0,getattr(db.Entry,f)!=None))
2756
- results_query=results_query.filter(or_(*tmp))
2757
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
2758
- if not isinstance(LookUpState,bool):
2759
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
2760
- if LookUpState == True:
2761
- results=results_query.order_by(db.Entry.Timestamp.asc()).all()
2762
- else:
2763
- results=results_query.order_by(db.Entry.Timestamp.desc()).all()
2764
- ct=len(results)
2765
- if ct < 1:
2766
- print(f"{Fore.light_steel_blue}Nothing in {Fore.slate_blue_1}Bld{Fore.light_red}LS!{Style.reset}")
2767
- continue
2768
- ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
2769
- master_total=0
2770
- master_total_crv=0
2771
- master_total_tax=0
2772
- master_total_tax_crv=0
2773
-
2774
- for num,i in enumerate(results):
2775
- getExtras(i.EntryId,extras)
2776
- 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}|-| '
2777
- colormapped=[
2778
- Fore.deep_sky_blue_4c,
2779
- Fore.spring_green_4,
2780
- Fore.turquoise_4,
2781
- Fore.dark_cyan,
2782
- Fore.deep_sky_blue_2,
2783
- Fore.spring_green_2a,
2784
- Fore.medium_spring_green,
2785
- Fore.steel_blue,
2786
- Fore.cadet_blue_1,
2787
- Fore.aquamarine_3,
2788
- Fore.purple_1a,
2789
- Fore.medium_purple_3a,
2790
- Fore.slate_blue_1,
2791
- Fore.light_slate_grey,
2792
- Fore.dark_olive_green_3a,
2793
- Fore.deep_pink_4c,
2794
- Fore.orange_3,
2795
- ]
2796
- total=0
2797
- crv=0
2798
- tax=0
2799
- tax_crv=0
2800
- for n2,f in enumerate(location_fields):
2801
- try:
2802
- if getattr(i,f) != 0:
2803
- total+=getattr(i,f)
2804
- except Exception as e:
2805
- print(e)
2806
- for n2,f in enumerate(location_fields):
2807
- if getattr(i,f) != 0:
2808
- msg2=f'{colormapped[n2]}{f} = {round(getattr(i,f),3)}{Style.reset}'
2809
- if n2 < len(location_fields):
2810
- msg2+=","
2811
- msg+=msg2
2812
- master_total+=total*round(i.Price,ROUNDTO)
2813
-
2814
- crv+=(round(i.CRV,ROUNDTO)*total)
2815
- tax+=(round(i.Tax,ROUNDTO)*total)
2816
- if tax == 0 and crv > 0:
2817
- tax_crv=(round(i.CRV,ROUNDTO)*total)
2818
- else:
2819
- tax_crv+=((round(i.Tax,ROUNDTO)*total)+(round(i.CRV,ROUNDTO)*total))
2820
- master_total_tax+=tax
2821
- master_total_crv+=crv
2822
- master_total_tax_crv+=tax_crv
2823
- tax_crv=round(tax_crv,ROUNDTO)
2824
- try:
2825
- super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
2826
- except Exception as e:
2827
- p1=round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO))
2828
- p2=getSuperTotal(results,location_fields,colormapped)['final total']
2829
- print(e)
2830
- print(p1,"p1")
2831
- print(p2,"p2")
2832
- super_total=0
2833
-
2834
- msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{round(total,ROUNDTO)}
2835
- {Fore.light_magenta}Price({i.Price}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({round(total,ROUNDTO)}):{round(i.Price*total,ROUNDTO)}
2836
- {Fore.grey_70}+CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TotalCRV({crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(total*i.Price,ROUNDTO)+crv})
2837
- {Fore.grey_70}+Tax({i.Tax}) w/o CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxNoCRVTotal({tax})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax,ROUNDTO)})
2838
- {Fore.grey_70}+Tax({i.Tax}) w/ CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxCRVTotal({tax_crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)})
2839
- {Fore.medium_violet_red}PercentOfTotal({round(super_total,ROUNDTO)}) of Total({getSuperTotal(results,location_fields,colormapped)['final total']})
2840
- {'*'*os.get_terminal_size().columns}{Style.reset}"""
2841
- print(msg)
2842
- master_total=round(master_total,ROUNDTO)
2843
- master_total_crv=round(master_total_crv,ROUNDTO)
2844
- master_total_tax=round(master_total_tax,ROUNDTO)
2845
- master_total_tax_crv=round(master_total_tax_crv,ROUNDTO)
2846
- msg=f"""{Fore.light_green}Total Product Value:{Fore.slate_blue_1}{round(master_total,ROUNDTO)}
2847
- {Fore.light_green}Total Product Value w/CRV({master_total_crv}):{Fore.slate_blue_1}{round(master_total_crv+master_total,ROUNDTO)}
2848
- {Fore.light_green}Total Product Value Taxed w/o CRV({master_total_tax}):{Fore.slate_blue_1}{round(master_total_tax+master_total,ROUNDTO)}
2849
- {Fore.light_green}Total Product Value Taxed w/ CRV({master_total_tax_crv}):{Fore.slate_blue_1}{round(master_total_tax_crv+master_total,ROUNDTO)}
2850
- {Style.reset}"""
2851
- print(msg)
2852
- '''
2853
- '''
2854
- lsbld - bldls()
2855
- lsbld- - bldls(minus=True)
2856
- bldlse - bldls(bldlse=True)
2857
- bldlse - bldls(bldlse=True,minus=True)
2858
-
2859
- sbld - bldls(sbld=True)
2860
- sbld- bldls(sbld=True,minus=True)
2861
- esbld - bldls(bldlse=True,sbld=True)
2862
- esblb- bldls(bldlse=True,sbld=True,minus=True)
2863
- '''
2864
2195
  bldls(minus=True)
2865
2196
  elif cmd.lower() in ["bldlse-","builde-","buildlse-","build list export -","bld ls exp -",'elsbld-','export list build -','exp ls bld -','ebld-']:
2866
- '''
2867
- extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2868
- if extras in [None,'d',False]:
2869
- extras=False
2870
- msg=''
2871
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file,clear_only=True)
2872
- with db.Session(db.ENGINE) as session:
2873
- results_query=session.query(db.Entry).filter(db.Entry.InList==True)
2874
- 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"]
2875
- z=Prompt.mkfield_list(None,location_fields)
2876
- if z in [[],None]:
2877
- z=location_fields
2878
- location_fields=z
2879
- tmp=[]
2880
- for f in location_fields:
2881
- tmp.append(or_(getattr(db.Entry,f)!=0,getattr(db.Entry,f)!=None))
2882
- results_query=results_query.filter(or_(*tmp))
2883
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
2884
- if not isinstance(LookUpState,bool):
2885
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
2886
- if LookUpState == True:
2887
- results=results_query.order_by(db.Entry.Timestamp.asc()).all()
2888
- else:
2889
- results=results_query.order_by(db.Entry.Timestamp.desc()).all()
2890
- ct=len(results)
2891
- if ct < 1:
2892
- msg=f"{Fore.light_steel_blue}Nothing in {Fore.slate_blue_1}Bld{Fore.light_red}LS!{Style.reset}"
2893
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2894
- print(msg)
2895
- continue
2896
- ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
2897
- master_total=0
2898
- master_total_crv=0
2899
- master_total_tax=0
2900
- master_total_tax_crv=0
2901
-
2902
- for num,i in enumerate(results):
2903
- getExtras(i.EntryId,extras)
2904
- 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}|-| '
2905
- colormapped=[
2906
- Fore.deep_sky_blue_4c,
2907
- Fore.spring_green_4,
2908
- Fore.turquoise_4,
2909
- Fore.dark_cyan,
2910
- Fore.deep_sky_blue_2,
2911
- Fore.spring_green_2a,
2912
- Fore.medium_spring_green,
2913
- Fore.steel_blue,
2914
- Fore.cadet_blue_1,
2915
- Fore.aquamarine_3,
2916
- Fore.purple_1a,
2917
- Fore.medium_purple_3a,
2918
- Fore.slate_blue_1,
2919
- Fore.light_slate_grey,
2920
- Fore.dark_olive_green_3a,
2921
- Fore.deep_pink_4c,
2922
- Fore.orange_3,
2923
- ]
2924
- total=0
2925
- crv=0
2926
- tax=0
2927
- tax_crv=0
2928
- for n2,f in enumerate(location_fields):
2929
- try:
2930
- if getattr(i,f) != 0:
2931
- total+=getattr(i,f)
2932
- except Exception as e:
2933
- print(e)
2934
- for n2,f in enumerate(location_fields):
2935
- if getattr(i,f) != 0:
2936
- msg2=f'{colormapped[n2]}{f} = {round(getattr(i,f),ROUNDTO)}{Style.reset}'
2937
- if n2 < len(location_fields):
2938
- msg2+=","
2939
- msg+=msg2
2940
- master_total+=total*round(i.Price,ROUNDTO)
2941
-
2942
- crv+=(round(i.CRV,ROUNDTO)*total)
2943
- tax+=(round(i.Tax,ROUNDTO)*total)
2944
- if tax == 0 and crv > 0:
2945
- tax_crv=(round(i.CRV,ROUNDTO)*total)
2946
- else:
2947
- tax_crv+=((round(i.Tax,ROUNDTO)*total)+(round(i.CRV,ROUNDTO)*total))
2948
- master_total_tax+=tax
2949
- master_total_crv+=crv
2950
- master_total_tax_crv+=tax_crv
2951
- tax_crv=round(tax_crv,ROUNDTO)
2952
- try:
2953
- super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
2954
- except Exception as e:
2955
- p1=round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO))
2956
- p2=getSuperTotal(results,location_fields,colormapped)['final total']
2957
- print(e)
2958
- print(p1,"p1")
2959
- print(p2,"p2")
2960
- super_total=0
2961
-
2962
- msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{round(total,ROUNDTO)}
2963
- {Fore.light_magenta}Price({i.Price}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({round(total,ROUNDTO)}):{round(i.Price*total,ROUNDTO)}
2964
- {Fore.grey_70}+CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TotalCRV({crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(total*i.Price,ROUNDTO)+crv})
2965
- {Fore.grey_70}+Tax({i.Tax}) w/o CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxNoCRVTotal({tax})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax,ROUNDTO)})
2966
- {Fore.grey_70}+Tax({i.Tax}) w/ CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxCRVTotal({tax_crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)})
2967
- {Fore.medium_violet_red}PercentOfTotal({round(super_total,ROUNDTO)}) of Total({getSuperTotal(results,location_fields,colormapped)['final total']})
2968
- {'*'*os.get_terminal_size().columns}{Style.reset}"""
2969
- print(msg)
2970
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2971
-
2972
- master_total=round(master_total,ROUNDTO)
2973
- master_total_crv=round(master_total_crv,ROUNDTO)
2974
- master_total_tax=round(master_total_tax,ROUNDTO)
2975
- master_total_tax_crv=round(master_total_tax_crv,ROUNDTO)
2976
- msg=f"""{Fore.light_green}Total Product Value:{Fore.slate_blue_1}{round(master_total,ROUNDTO)}
2977
- {Fore.light_green}Total Product Value w/CRV({master_total_crv}):{Fore.slate_blue_1}{round(master_total_crv+master_total,ROUNDTO)}
2978
- {Fore.light_green}Total Product Value Taxed w/o CRV({master_total_tax}):{Fore.slate_blue_1}{round(master_total_tax+master_total,ROUNDTO)}
2979
- {Fore.light_green}Total Product Value Taxed w/ CRV({master_total_tax_crv}):{Fore.slate_blue_1}{round(master_total_tax_crv+master_total,ROUNDTO)}
2980
- {Style.reset}"""
2981
- print(msg)
2982
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
2983
- '''
2984
- '''
2985
- lsbld - bldls()
2986
- lsbld- - bldls(minus=True)
2987
- bldlse - bldls(bldlse=True)
2988
- bldlse- - bldls(bldlse=True,minus=True)
2989
-
2990
- sbld - bldls(sbld=True)
2991
- sbld- bldls(sbld=True,minus=True)
2992
- esbld - bldls(bldlse=True,sbld=True)
2993
- esblb- bldls(bldlse=True,sbld=True,minus=True)
2994
- '''
2995
2197
  bldls(bldlse=True,minus=True)
2996
2198
  elif cmd.lower() in ['sbld-','search build -','search_build-','scan build-','scan_bld-']:
2997
- '''
2998
- extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
2999
- if extras in [None,'d',False]:
3000
- extras=False
3001
- end=False
3002
- while not end:
3003
- with db.Session(db.ENGINE) as session:
3004
- def mkT(text,data):
3005
- return text
3006
- code=Prompt.__init2__(None,func=mkT,ptext="Code|Barcode|Name: ",helpText="find by code,barcode,name",data='')
3007
- if code in [None,]:
3008
- end=True
3009
- break
3010
- elif code in ['d',]:
3011
- continue
3012
-
3013
- results_query=session.query(db.Entry).filter(db.Entry.InList==True)
3014
- results_query=results_query.filter(
3015
- db.or_(
3016
- db.Entry.Code==code,
3017
- db.Entry.Barcode==code,
3018
- db.Entry.Barcode.icontains(code),
3019
- db.Entry.Code.icontains(code),
3020
- db.Entry.Name.icontains(code)
3021
- )
3022
- )
3023
- 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"]
3024
- z=Prompt.mkfield_list(None,location_fields)
3025
- if z in [[],None]:
3026
- z=location_fields
3027
- location_fields=z
3028
- tmp=[]
3029
- for f in location_fields:
3030
- tmp.append(or_(getattr(db.Entry,f)!=0,getattr(db.Entry,f)!=None))
3031
- results_query=results_query.filter(or_(*tmp))
3032
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
3033
- if not isinstance(LookUpState,bool):
3034
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
3035
- if LookUpState == True:
3036
- results=results_query.order_by(db.Entry.Timestamp.asc()).all()
3037
- else:
3038
- results=results_query.order_by(db.Entry.Timestamp.desc()).all()
3039
- ct=len(results)
3040
- if ct < 1:
3041
- print(f"{Fore.light_steel_blue}Nothing in {Fore.slate_blue_1}Bld{Fore.light_red}LS!{Style.reset}")
3042
- continue
3043
-
3044
- ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
3045
- master_total=0
3046
- master_total_crv=0
3047
- master_total_tax=0
3048
- master_total_tax_crv=0
3049
-
3050
- for num,i in enumerate(results):
3051
- getExtras(i.EntryId,extras)
3052
- 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}|-| '
3053
- colormapped=[
3054
- Fore.deep_sky_blue_4c,
3055
- Fore.spring_green_4,
3056
- Fore.turquoise_4,
3057
- Fore.dark_cyan,
3058
- Fore.deep_sky_blue_2,
3059
- Fore.spring_green_2a,
3060
- Fore.medium_spring_green,
3061
- Fore.steel_blue,
3062
- Fore.cadet_blue_1,
3063
- Fore.aquamarine_3,
3064
- Fore.purple_1a,
3065
- Fore.medium_purple_3a,
3066
- Fore.slate_blue_1,
3067
- Fore.light_slate_grey,
3068
- Fore.dark_olive_green_3a,
3069
- Fore.deep_pink_4c,
3070
- Fore.orange_3,
3071
- ]
3072
- total=0
3073
- crv=0
3074
- tax=0
3075
- tax_crv=0
3076
- for n2,f in enumerate(location_fields):
3077
- try:
3078
- if getattr(i,f) != 0:
3079
- total+=getattr(i,f)
3080
- except Exception as e:
3081
- print(e)
3082
- for n2,f in enumerate(location_fields):
3083
- if getattr(i,f) != 0:
3084
- msg2=f'{colormapped[n2]}{f} = {round(getattr(i,f),ROUNDTO)}{Style.reset}'
3085
- if n2 < len(location_fields):
3086
- msg2+=","
3087
- msg+=msg2
3088
- master_total+=total*round(i.Price,3)
3089
-
3090
- crv+=(round(i.CRV,ROUNDTO)*total)
3091
- tax+=(round(i.Tax,ROUNDTO)*total)
3092
- if tax == 0 and crv > 0:
3093
- tax_crv=(round(i.CRV,ROUNDTO)*total)
3094
- else:
3095
- tax_crv+=((round(i.Tax,ROUNDTO)*total)+(round(i.CRV,ROUNDTO)*total))
3096
- master_total_tax+=tax
3097
- master_total_crv+=crv
3098
- master_total_tax_crv+=tax_crv
3099
- tax_crv=round(tax_crv,ROUNDTO)
3100
- try:
3101
- super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
3102
- except Exception as e:
3103
- p1=round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO))
3104
- p2=getSuperTotal(results,location_fields,colormapped)['final total']
3105
- print(e)
3106
- print(p1,"p1")
3107
- print(p2,"p2")
3108
- super_total=0
3109
-
3110
- msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{round(total,ROUNDTO)}
3111
- {Fore.light_magenta}Price({i.Price}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({round(total,ROUNDTO)}):{round(i.Price*total,ROUNDTO)}
3112
- {Fore.grey_70}+CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TotalCRV({crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(total*i.Price,ROUNDTO)+crv})
3113
- {Fore.grey_70}+Tax({i.Tax}) w/o CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxNoCRVTotal({tax})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax,ROUNDTO)})
3114
- {Fore.grey_70}+Tax({i.Tax}) w/ CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxCRVTotal({tax_crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)})
3115
- {Fore.medium_violet_red}PercentOfTotal({round(super_total,ROUNDTO)}) of Total({getSuperTotal(results,location_fields,colormapped)['final total']})
3116
- {'*'*os.get_terminal_size().columns}{Style.reset}"""
3117
- print(msg)
3118
- master_total=round(master_total,ROUNDTO)
3119
- master_total_crv=round(master_total_crv,ROUNDTO)
3120
- master_total_tax=round(master_total_tax,ROUNDTO)
3121
- master_total_tax_crv=round(master_total_tax_crv,ROUNDTO)
3122
- msg=f"""{Fore.light_green}Total Product Value:{Fore.slate_blue_1}{round(master_total,ROUNDTO)}
3123
- {Fore.light_green}Total Product Value w/CRV({master_total_crv}):{Fore.slate_blue_1}{round(master_total_crv+master_total,ROUNDTO)}
3124
- {Fore.light_green}Total Product Value Taxed w/o CRV({master_total_tax}):{Fore.slate_blue_1}{round(master_total_tax+master_total,ROUNDTO)}
3125
- {Fore.light_green}Total Product Value Taxed w/ CRV({master_total_tax_crv}):{Fore.slate_blue_1}{round(master_total_tax_crv+master_total,ROUNDTO)}
3126
- {Style.reset}"""
3127
- print(msg)
3128
- '''
3129
- '''
3130
- lsbld - bldls()
3131
- lsbld- - bldls(minus=True)
3132
- bldlse - bldls(bldlse=True)
3133
- bldlse - bldls(bldlse=True,minus=True)
3134
-
3135
- sbld - bldls(sbld=True)
3136
- sbld- bldls(sbld=True,minus=True)
3137
- esbld - bldls(bldlse=True,sbld=True)
3138
- esblb- bldls(bldlse=True,sbld=True,minus=True)
3139
- '''
3140
2199
  bldls(sbld=True,minus=True)
3141
2200
  elif cmd.lower() in ['esbld-','export search build -','export_search_build-','exp scan build-','exp_scan_bld-']:
3142
- '''
3143
- extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
3144
- if extras in [None,'d',False]:
3145
- extras=False
3146
- end=False
3147
- msg=''
3148
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file,clear_only=True)
3149
- while not end:
3150
- with db.Session(db.ENGINE) as session:
3151
- def mkT(text,data):
3152
- return text
3153
- code=Prompt.__init2__(None,func=mkT,ptext="Code|Barcode|Name: ",helpText="find by code,barcode,name",data='')
3154
- if code in [None,]:
3155
- end=True
3156
- break
3157
- elif code in ['d',]:
3158
- continue
3159
-
3160
- results_query=session.query(db.Entry).filter(db.Entry.InList==True)
3161
- results_query=results_query.filter(
3162
- db.or_(
3163
- db.Entry.Code==code,
3164
- db.Entry.Barcode==code,
3165
- db.Entry.Barcode.icontains(code),
3166
- db.Entry.Code.icontains(code),
3167
- db.Entry.Name.icontains(code)
3168
- )
3169
- )
3170
- 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"]
3171
- z=Prompt.mkfield_list(None,location_fields)
3172
- if z in [[],None]:
3173
- z=location_fields
3174
- location_fields=z
3175
- tmp=[]
3176
- for f in location_fields:
3177
- tmp.append(or_(getattr(db.Entry,f)!=0,getattr(db.Entry,f)!=None))
3178
- results_query=results_query.filter(or_(*tmp))
3179
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
3180
- if not isinstance(LookUpState,bool):
3181
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
3182
- if LookUpState == True:
3183
- results=results_query.order_by(db.Entry.Timestamp.asc()).all()
3184
- else:
3185
- results=results_query.order_by(db.Entry.Timestamp.desc()).all()
3186
- ct=len(results)
3187
- if ct < 1:
3188
- msg=f"{Fore.light_steel_blue}Nothing in {Fore.slate_blue_1}Bld{Fore.light_red}LS!{Style.reset}"
3189
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
3190
- print(msg)
3191
- continue
3192
- ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
3193
- master_total=0
3194
- master_total_crv=0
3195
- master_total_tax=0
3196
- master_total_tax_crv=0
3197
-
3198
- for num,i in enumerate(results):
3199
- getExtras(i.EntryId,extras)
3200
- 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}|-| '
3201
- colormapped=[
3202
- Fore.deep_sky_blue_4c,
3203
- Fore.spring_green_4,
3204
- Fore.turquoise_4,
3205
- Fore.dark_cyan,
3206
- Fore.deep_sky_blue_2,
3207
- Fore.spring_green_2a,
3208
- Fore.medium_spring_green,
3209
- Fore.steel_blue,
3210
- Fore.cadet_blue_1,
3211
- Fore.aquamarine_3,
3212
- Fore.purple_1a,
3213
- Fore.medium_purple_3a,
3214
- Fore.slate_blue_1,
3215
- Fore.light_slate_grey,
3216
- Fore.dark_olive_green_3a,
3217
- Fore.deep_pink_4c,
3218
- Fore.orange_3,
3219
- ]
3220
- total=0
3221
- crv=0
3222
- tax=0
3223
- tax_crv=0
3224
- for n2,f in enumerate(location_fields):
3225
- try:
3226
- if getattr(i,f) != 0:
3227
- total+=getattr(i,f)
3228
- except Exception as e:
3229
- print(e)
3230
- for n2,f in enumerate(location_fields):
3231
- if getattr(i,f) != 0:
3232
- msg2=f'{colormapped[n2]}{f} = {round(getattr(i,f),ROUNDTO)}{Style.reset}'
3233
- if n2 < len(location_fields):
3234
- msg2+=","
3235
- msg+=msg2
3236
- master_total+=total*round(i.Price,ROUNDTO)
3237
-
3238
- crv+=(round(i.CRV,ROUNDTO)*total)
3239
- tax+=(round(i.Tax,ROUNDTO)*total)
3240
- if tax == 0 and crv > 0:
3241
- tax_crv=(round(i.CRV,ROUNDTO)*total)
3242
- else:
3243
- tax_crv+=((round(i.Tax,ROUNDTO)*total)+(round(i.CRV,ROUNDTO)*total))
3244
- master_total_tax+=tax
3245
- master_total_crv+=crv
3246
- master_total_tax_crv+=tax_crv
3247
- tax_crv=round(tax_crv,ROUNDTO)
3248
- try:
3249
- super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
3250
- except Exception as e:
3251
- p1=round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO))
3252
- p2=getSuperTotal(results,location_fields,colormapped)['final total']
3253
- print(e)
3254
- print(p1,"p1")
3255
- print(p2,"p2")
3256
- super_total=0
3257
- msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{round(total,ROUNDTO)}
3258
- {Fore.light_magenta}Price({i.Price}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({round(total,ROUNDTO)}):{round(i.Price*total,ROUNDTO)}
3259
- {Fore.grey_70}+CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TotalCRV({crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(total*i.Price,ROUNDTO)+crv})
3260
- {Fore.grey_70}+Tax({i.Tax}) w/o CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxNoCRVTotal({tax})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax,ROUNDTO)})
3261
- {Fore.grey_70}+Tax({i.Tax}) w/ CRV({i.CRV})*Total({round(total,ROUNDTO)}){Fore.slate_blue_1}\n=TaxCRVTotal({tax_crv})+TotalPrice({round(total*i.Price,ROUNDTO)})=NetPrice({round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)})
3262
- {Fore.medium_violet_red}PercentOfTotal({round(super_total,ROUNDTO)}) of Total({getSuperTotal(results,location_fields,colormapped)['final total']})
3263
- {'*'*os.get_terminal_size().columns}{Style.reset}"""
3264
- print(msg)
3265
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
3266
- master_total=round(master_total,ROUNDTO)
3267
- master_total_crv=round(master_total_crv,ROUNDTO)
3268
- master_total_tax=round(master_total_tax,ROUNDTO)
3269
- master_total_tax_crv=round(master_total_tax_crv,ROUNDTO)
3270
- msg=f"""{Fore.light_green}Total Product Value:{Fore.slate_blue_1}{round(master_total,ROUNDTO)}
3271
- {Fore.light_green}Total Product Value w/CRV({master_total_crv}):{Fore.slate_blue_1}{round(master_total_crv+master_total,ROUNDTO)}
3272
- {Fore.light_green}Total Product Value Taxed w/o CRV({master_total_tax}):{Fore.slate_blue_1}{round(master_total_tax+master_total,ROUNDTO)}
3273
- {Fore.light_green}Total Product Value Taxed w/ CRV({master_total_tax_crv}):{Fore.slate_blue_1}{round(master_total_tax_crv+master_total,ROUNDTO)}
3274
- {Style.reset}"""
3275
- print(msg)
3276
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
3277
- #end#
3278
- '''
3279
- '''
3280
- lsbld - bldls()
3281
- lsbld- - bldls(minus=True)
3282
- bldlse - bldls(bldlse=True)
3283
- bldlse - bldls(bldlse=True,minus=True)
3284
-
3285
- sbld - bldls(sbld=True)
3286
- sbld- bldls(sbld=True,minus=True)
3287
- esbld - bldls(bldlse=True,sbld=True)
3288
- esblb- bldls(bldlse=True,sbld=True,minus=True)
3289
- '''
3290
2201
  bldls(bldlse=True,sbld=True,minus=True)
3291
2202
  elif cmd.lower() in ['cdp','clipboard_default_paste','clipboard default paste']:
3292
2203
  with db.Session(db.ENGINE) as session:
@@ -760,6 +760,7 @@ fxtbl - update table with correct columns
760
760
  return query
761
761
 
762
762
  def TotalSpent(self):
763
+ local_start=datetime.now()
763
764
  LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
764
765
  if not isinstance(LookUpState,bool):
765
766
  LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
@@ -1167,8 +1168,13 @@ fxtbl - update table with correct columns
1167
1168
  if export:
1168
1169
  logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=text_cr_export)
1169
1170
  print(msg)
1170
- reverse_state={False:'False - Desc. (First Line Oldest/Biggest,Last Line Newest/Smallest)',True:'True - Asc. (Firt Line Newest/Smallest,Last Line Newest/Biggest)'}
1171
- msg3=f"{Fore.light_cyan}Final Results Reverse:{reverse_state[reverse]}|{Fore.orange_red_1}Total Expense:{Fore.light_magenta}{total_expense}{Style.reset}"
1171
+ ex=f"{Fore.light_red}Duration:{Fore.light_steel_blue}{datetime.now()-local_start}|{Fore.light_cyan}OrderByFinalValue[{Fore.deep_pink_4c}{orderByTotalValue}{Fore.light_cyan}]|GraphIt[{Fore.deep_pink_4c}{graph_it}{Fore.light_cyan}]|Export[{Fore.deep_pink_4c}{export}{Fore.light_cyan}]"
1172
+ if orderByTotalValue:
1173
+ reverse_state={False:'False - Desc. (First Line Oldest/Biggest,Last Line Newest/Smallest)',True:'True - Asc. (Firt Line Newest/Smallest,Last Line Newest/Biggest)'}
1174
+ ex+=f": Final Results Reverse:{reverse_state[reverse]}|{Fore.orange_red_1}\n"
1175
+ else:
1176
+ ex+=f'{Fore.orange_red_1}\n'
1177
+ msg3=f"{ex}Total Expense:{Fore.light_magenta}{total_expense}{Style.reset}"
1172
1178
  print(msg3)
1173
1179
  if export:
1174
1180
  logInput(msg3,user=False,filter_colors=True,maxed_hfl=False,ofile=text_cr_export)
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.376'
1
+ VERSION='0.0.377'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.376
3
+ Version: 0.0.377
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=TfgMJOI-srmu2Qo5T_-rw8Dl8KQNAJyqzQBkLAdv6Es,17
8
+ radboy/__init__.py,sha256=6SkN9qoqB_YgPoIWOj2Ytlek7CbdqLySbh-KQ8IOmew,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=H8kVdEYImkJyurqopvfo30wzRd1KpfbhkEnprdSWSUQ,205091
86
+ radboy/DB/Prompt.py,sha256=kCS0mYLw4MJStNyyman3pd9g0SXfcJQHJ6w1kxA7cb4,126396
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=rZD1O8jsEo-uy41QlO1F6mi3Klcs2m8nt97BNUdW9Nc,196540
110
+ radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=dx9ljTBr8do18B3UgQgYWzUFNiBP1bs3eB23GHQSDzM,196399
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
@@ -134,13 +134,13 @@ radboy/DB/__pycache__/renderText2Png.cpython-311.pyc,sha256=ivSzvyAeWhsS-a_RcFF8
134
134
  radboy/DB/__pycache__/renderText2Png.cpython-312.pyc,sha256=1CUGjOhJw_vC4DNMQ-W5jBXEKp7HzDrq7--x9VyBTo8,8991
135
135
  radboy/DB/__pycache__/renderText2Png.cpython-313.pyc,sha256=LDJOo7uFztlxw3ptN8QuHrLkr0GKiAArBu34QiE15iQ,9096
136
136
  radboy/DB/__pycache__/testClass.cpython-311.pyc,sha256=nkWap8RuBsWWOB_ZhGbR3ELbnL1F1CHZCi0dpepqw-0,1225
137
- radboy/DayLog/DayLogger.py,sha256=63N1oJ_5tq1QJPCSLMffhFQgrg4gW8tFOi2Ftb5rSs8,101456
137
+ radboy/DayLog/DayLogger.py,sha256=w5zfDAXzjPJCZPp9ij6kP0G06mOOTHpDc3QItWfdT5M,101883
138
138
  radboy/DayLog/TaxiFares.py,sha256=3slYjtBcTnRe8IeneJ-_iZJJ3E7alW09f6GWYXPxhOo,10882
139
139
  radboy/DayLog/Wavelength4Freq.py,sha256=MfN2EATrN3bbEDgP1qOPjV1Fk8sVnkc_4tgX6sKfSE0,2054
140
140
  radboy/DayLog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
141
  radboy/DayLog/__pycache__/DayLogger.cpython-311.pyc,sha256=TmRnRZHp5tMTokSEB8hWTxnasi-iJdh6TmYcb_nXGoY,29557
142
142
  radboy/DayLog/__pycache__/DayLogger.cpython-312.pyc,sha256=bfDCQZrIhgQYzoUle7roicRE_bhGPYZtIbCRIiDrsxU,68240
143
- radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc,sha256=kRcVAtHpS_R-XMHGw5mvx9xtMMJ5s2PY4hZHV4CQumc,149602
143
+ radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc,sha256=rqbsaNxuK6p1yIMBq_ZWx9AgFJxFEW8Tu7a_oqJRPew,150428
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
@@ -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=5vrXGFs2V8LeNLfLIzdqbGvpekeZHWk8_qK8VDjsiVA,165
389
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=vKo9IkJYYOBk7LwJrb644uKPzG2jUjBjSO04SdiSE3I,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.376.dist-info/METADATA,sha256=wHoK_Yw45nTZj0iotrud9mPBgdh1E0JC59l_3yrnfpU,794
415
- radboy-0.0.376.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
- radboy-0.0.376.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
- radboy-0.0.376.dist-info/RECORD,,
414
+ radboy-0.0.377.dist-info/METADATA,sha256=OLwSosYv06cLPjyeIuv82ApChwhGcdtHnnBshTmYPdY,794
415
+ radboy-0.0.377.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
+ radboy-0.0.377.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
+ radboy-0.0.377.dist-info/RECORD,,