diff --git a/car_inventory/__pycache__/settings.cpython-311.pyc b/car_inventory/__pycache__/settings.cpython-311.pyc index 1180ee0d..be89bf12 100644 Binary files a/car_inventory/__pycache__/settings.cpython-311.pyc and b/car_inventory/__pycache__/settings.cpython-311.pyc differ diff --git a/generate.py b/generate.py new file mode 100644 index 00000000..dfca8a4e --- /dev/null +++ b/generate.py @@ -0,0 +1,128 @@ +from inventory.models import * +from rich import print +import random +import datetime + +from inventory.services import decodevin + + +def run(): + # car = Car.objects.filter(vin='2C3HD46R4WH170267') + vin_list = [ + "1B3ES56C13D120225", + "1GB4KYC86FF131536", + "1HSHXAHR15J136217", + "1G1ZT52845F231124", + "1J4GK48K43W721617", + "JTDBE32K430163717", + "1J4FA69S05P331572", + "2FMGK5D86EBD28496", + "KNADE243696530337", + "1N4AL21EX8N499928", + "1N4AL21E49N400571", + "1G2NW12E54C145398", + "LGJE1EE09SM333542", + "LGJE1EE0XSM333551", + "LGJE1EE02SM333561", + "LGJE1EE0XSM333565", + "LGJE1EE01SM333549", + "LGJE1EE06SM333563", + "LGJE1EE04SM333562", + "LGJE1EE08SM333564", + "LFB1E6078P1Y01338", + "LGJE5EE02PM046815", + "LFB1E6074P1Y01742", + "LGJE5EE07PM132850", + "LGJE1EE08SM311094", + "LFPH4ACP4P2A00123", + "LFB1E6075R1Y00117", + "ZAMPP56F0J1282425", + "LGJE1EE06RM292314", + "LGJE1EE00NM013594", + "LFB1E6075M1Y00272", + "LFB1E6670P1Y00224", + "LFB1E6079N1Y00275", + "LGJE3FE00MM804819", + "LGJE3FE0XMM804844", + "LGJE1EE01RM200767", + "LGJE1EE08RM200703", + "ZAMXS57F7L1341373", + "LGJE5EE06SM330781", + "LFB1E6077P1Y02643", + "LFB1E6074M1Y00151", + "LGJE1EE07RM292323", + "LGJE1EE01RM200171", + "LGJE1EE04SM311545", + "LGJE1EE04RM292859", + "LGJE1EE02RM292861", + "LFB1E607XP1Y01454", + "LFB1E6073P1Y00081", + "LGJE1EE03PM129391", + "LGJE1EE03RM200639", + "LGJE1EE02PM128393", + "LGJE1EE03NM964436", + "LGJE1EE06RM211599", + "LGJE1EE06NM014104", + "LGJE1EE05NM014272", + "LGJE5EE06SM331641", + "LGJE1EE09NM013528", + "LGJE5EE0XPM048196", + "LGJE1EE01RM212935", + "LGJE1EE05RM200433", + "LGJE1EE05SM311909", + "LGJE5EE02SM346914", + "LGJE1EE08SM306753", + "LGJE1EE02SM312001", + "LFPH4ACP6R2A02586", + "LGJE1EE00PM048445", + "LGJE1EE02SM311902", + "LGJE1EE03SM312573", + "LGJE1EE00SM306813", + "LFB1E6674N1Y00577", + "LGJE1EE00SM306875", + "LGJE1EE04SM306863", + "LFB1E6079P1Y00389", + "LGJE1EE04SM311562", + "LGJE1EE01SM312006", + "LGJE1EE08SM312486", + "LFB1E6676P1Y00941", + "LFPH4ACP1M1B00116", + "LGJE1EE02SM312564", + "LFPH4BCPXS2L00051", + "LGJE1EE06SM306864", + ] + for vin in vin_list: + try: + for _ in range(15): + dealer = Dealer.objects.get(user__email="ismail.mosa.ibrahim@gmail.com") + vin = f"{vin[:-4]}{random.randint(0, 9)}{random.randint(0, 9)}{random.randint(0, 9)}{random.randint(0, 9)}" + result = decodevin(vin) + make = CarMake.objects.get(name=result["maker"]) + model = make.carmodel_set.filter(name__contains=result["model"]).first() + if not model or model == "": + model = random.choice(make.carmodel_set.all()) + year = result["modelYear"] + serie = random.choice(model.carserie_set.all()) + trim = random.choice(serie.cartrim_set.all()) + + car = Car.objects.create( + vin=vin, + id_car_make=make, + id_car_model=model, + id_car_serie=serie, + id_car_trim=trim, + year=(int(year) or 2025), + receiving_date=datetime.datetime.now(), + dealer=dealer, + ) + car_finance = CarFinance.objects.create( + car=car, cost_price=10000, selling_price=20000 + ) + car_color = CarColors.objects.create( + car=car, + interior=random.choice(InteriorColors.objects.all()), + exterior=random.choice(ExteriorColors.objects.all()), + ) + print(make, model, serie, trim) + except Exception as e: + print(e) diff --git a/inventory/__pycache__/mixins.cpython-311.pyc b/inventory/__pycache__/mixins.cpython-311.pyc index 96746b95..83a38ab9 100644 Binary files a/inventory/__pycache__/mixins.cpython-311.pyc and b/inventory/__pycache__/mixins.cpython-311.pyc differ diff --git a/inventory/__pycache__/models.cpython-311.pyc b/inventory/__pycache__/models.cpython-311.pyc index 1882156b..1b4cb585 100644 Binary files a/inventory/__pycache__/models.cpython-311.pyc and b/inventory/__pycache__/models.cpython-311.pyc differ diff --git a/inventory/__pycache__/urls.cpython-311.pyc b/inventory/__pycache__/urls.cpython-311.pyc index 8c9d0f07..21aaa983 100644 Binary files a/inventory/__pycache__/urls.cpython-311.pyc and b/inventory/__pycache__/urls.cpython-311.pyc differ diff --git a/inventory/__pycache__/views.cpython-311.pyc b/inventory/__pycache__/views.cpython-311.pyc index 6efbd1f1..1b46c40b 100644 Binary files a/inventory/__pycache__/views.cpython-311.pyc and b/inventory/__pycache__/views.cpython-311.pyc differ diff --git a/inventory/mixins.py b/inventory/mixins.py index 520decc6..95c215a8 100644 --- a/inventory/mixins.py +++ b/inventory/mixins.py @@ -41,26 +41,3 @@ class LocalizedNameMixin: # return super().form_valid(form) # else: # return form.errors -class BaseDateNavigationUrlMixIn: - BASE_DATE_URL_KWARGS = ( - 'entity_slug', - 'unit_slug', - 'ledger_pk', - 'account_pk', - 'coa_slug' - ) - - def get_context_data(self, **kwargs): - context = super(BaseDateNavigationUrlMixIn, self).get_context_data(**kwargs) - self.get_base_date_nav_url(context) - return context - - def get_base_date_nav_url(self, context, **kwargs): - view_name = context['view'].request.resolver_match.url_name - view_name_base = '-'.join(view_name.split('-')[:2]) - context['date_navigation_url'] = reverse( - view_name_base, - kwargs={ - k: v for k, v in self.kwargs.items() if - k in self.BASE_DATE_URL_KWARGS - }) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index b0deca83..c2d803d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,6 +33,7 @@ ctranslate2==4.5.0 cycler==0.12.1 Cython==3.1.0a1 decorator==5.1.1 +defusedxml==0.7.1 desert==2020.11.18 dill==0.3.9 distro==1.9.0 @@ -84,6 +85,8 @@ filelock==3.17.0 fire==0.7.0 Flask==3.1.0 fonttools==4.55.7 +fpdf==1.7.2 +fpdf2==2.8.2 frozenlist==1.5.0 fsspec==2024.12.0 gprof2dot==2024.6.6 @@ -171,6 +174,7 @@ pyobjc-core==11.0 pyobjc-framework-Cocoa==11.0 pyobjc-framework-Quartz==11.0 pyparsing==3.2.1 +pypdf==5.3.0 pyperclip==1.9.0 pyphen==0.17.2 pypng==0.20220715.0 diff --git a/static/.DS_Store b/static/.DS_Store index ef151623..71c17b68 100644 Binary files a/static/.DS_Store and b/static/.DS_Store differ diff --git a/static/css/custom.css b/static/css/custom.css index 4a74f6b8..1111ec26 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,6 @@ - .color-div { + + +.color-div { width: 64px; height: 16px; padding: 2px 4px; diff --git a/static/css/theme-rtl.css b/static/css/theme-rtl.css index 190a9ce5..e04ec3a9 100644 --- a/static/css/theme-rtl.css +++ b/static/css/theme-rtl.css @@ -76,7 +76,7 @@ --phoenix-dark-border-subtle: #8a94ad; --phoenix-white-rgb: 255, 255, 255; --phoenix-black-rgb: 0, 0, 0; - --phoenix-font-sans-serif: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + --phoenix-font-sans-serif: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important; --phoenix-font-monospace: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --phoenix-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0)); --phoenix-body-font-family: var(--phoenix-font-sans-serif); diff --git a/static/css/theme.css b/static/css/theme.css index 1f3d1dac..124fd47a 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -76,7 +76,7 @@ --phoenix-dark-border-subtle: #8a94ad; --phoenix-white-rgb: 255, 255, 255; --phoenix-black-rgb: 0, 0, 0; - --phoenix-font-sans-serif: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + --phoenix-font-sans-serif: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important; --phoenix-font-monospace: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --phoenix-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0)); --phoenix-body-font-family: var(--phoenix-font-sans-serif); diff --git a/static/css/fonts/bootstrap-icons.woff2 b/static/font/bootstrap-icons.woff2 similarity index 100% rename from static/css/fonts/bootstrap-icons.woff2 rename to static/font/bootstrap-icons.woff2 diff --git a/static/images/logos/Logo-all.png b/static/images/logos/Logo-all.png new file mode 100644 index 00000000..ecfd638b Binary files /dev/null and b/static/images/logos/Logo-all.png differ