diff --git a/car_inventory/__pycache__/settings.cpython-311.pyc b/car_inventory/__pycache__/settings.cpython-311.pyc index 88dcf16b..e5697c41 100644 Binary files a/car_inventory/__pycache__/settings.cpython-311.pyc and b/car_inventory/__pycache__/settings.cpython-311.pyc differ diff --git a/car_inventory/settings.py b/car_inventory/settings.py index 2208e95c..8d907648 100644 --- a/car_inventory/settings.py +++ b/car_inventory/settings.py @@ -232,9 +232,17 @@ CRISPY_TEMPLATE_PACK = "bootstrap5" OPENAI_API_KEY = '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' # ELM API KEYS -APP_ID = '367974ed' -APP_KEY = '046b0412c1b4d3f8c39ec6375d6f3030' -CLIENT_ID = '94142c27-2536-47e9-8e28-9ca7728b9442' +# vehicle-info +# c2729afb +# 6d397471920412d672af1b8a02ca52ea + +# option-info +# 367974ed +# 046b0412c1b4d3f8c39ec6375d6f3030 + +ELM_APP_ID = 'c2729afb' +ELM_APP_KEY = '6d397471920412d672af1b8a02ca52ea' +ELM_CLIENT_ID = '94142c27-2536-47e9-8e28-9ca7728b9442' LOGGING = { 'version': 1, diff --git a/inventory/__pycache__/admin.cpython-311.pyc b/inventory/__pycache__/admin.cpython-311.pyc index ec214091..baf10033 100644 Binary files a/inventory/__pycache__/admin.cpython-311.pyc and b/inventory/__pycache__/admin.cpython-311.pyc differ diff --git a/inventory/__pycache__/forms.cpython-311.pyc b/inventory/__pycache__/forms.cpython-311.pyc index 38100be1..dd97ca99 100644 Binary files a/inventory/__pycache__/forms.cpython-311.pyc and b/inventory/__pycache__/forms.cpython-311.pyc differ diff --git a/inventory/__pycache__/models.cpython-311.pyc b/inventory/__pycache__/models.cpython-311.pyc index 8b2e5241..95a5332a 100644 Binary files a/inventory/__pycache__/models.cpython-311.pyc and b/inventory/__pycache__/models.cpython-311.pyc differ diff --git a/inventory/__pycache__/services.cpython-311.pyc b/inventory/__pycache__/services.cpython-311.pyc index 96ef9d45..183f2152 100644 Binary files a/inventory/__pycache__/services.cpython-311.pyc and b/inventory/__pycache__/services.cpython-311.pyc differ diff --git a/inventory/__pycache__/urls.cpython-311.pyc b/inventory/__pycache__/urls.cpython-311.pyc index 078b0821..13d57da6 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 736e0f77..18a4db15 100644 Binary files a/inventory/__pycache__/views.cpython-311.pyc and b/inventory/__pycache__/views.cpython-311.pyc differ diff --git a/inventory/admin.py b/inventory/admin.py index ae51de84..aaf2fdf5 100644 --- a/inventory/admin.py +++ b/inventory/admin.py @@ -16,6 +16,7 @@ admin.site.register(models.CarSpecificationValue) admin.site.register(models.ExteriorColors) admin.site.register(models.InteriorColors) admin.site.register(models.CarLocation) +admin.site.register(models.CarReservation) @admin.register(models.CarMake) class CarMakeAdmin(admin.ModelAdmin): diff --git a/inventory/forms.py b/inventory/forms.py index 597dac6d..b5d5ddfb 100644 --- a/inventory/forms.py +++ b/inventory/forms.py @@ -53,14 +53,22 @@ class CarForm(forms.ModelForm, AddClassMixin, ): def __init__(self, *args, **kwargs): dealer = kwargs.pop('dealer', None) super().__init__(*args, **kwargs) - # if dealer: - # self.fields['branch'].queryset = Branch.objects.filter(dealer=dealer) if 'id_car_make' in self.fields: - queryset = self.fields['id_car_make'].queryset + queryset = self.fields['id_car_make'].queryset.filter(is_sa_import=True) self.fields['id_car_make'].choices = [ (obj.id_car_make, obj.get_local_name()) for obj in queryset ] + if 'id_car_model' in self.fields: + queryset = self.fields['id_car_model'].queryset + self.fields['id_car_model'].choices = [ + (obj.id_car_model, obj.get_local_name()) for obj in queryset + ] + if 'vendor' in self.fields: + queryset = self.fields['vendor'].queryset + self.fields['vendor'].choices = [ + (obj.pk, obj.get_local_name()) for obj in queryset + ] class CarUpdateForm(forms.ModelForm, AddClassMixin): diff --git a/inventory/models.py b/inventory/models.py index 52590e10..69f4bcd1 100644 --- a/inventory/models.py +++ b/inventory/models.py @@ -204,25 +204,52 @@ class Car(models.Model): @property def selling_price(self): - finance = self.finances.first() + finance = self.finances return finance.selling_price if finance else Decimal('0.00') @property def discount_amount(self): - finance = self.finances.first() + finance = self.finances return finance.discount_amount if finance else Decimal('0.00') @property def vat_amount(self): - finance = self.finances.first() + finance = self.finances return finance.vat_amount if finance else Decimal('0.00') @property def total(self): - finance = self.finances.first() + finance = self.finances return finance.total if finance else Decimal('0.00') +# class CarData(models.Model): +# vin = models.CharField(max_length=17, unique=True, verbose_name=_("VIN")) +# make = models.CharField(max_length=255, verbose_name=_("Make")) +# make_ar = models.CharField(max_length=255, verbose_name=_("Make Arabic")) +# model = models.CharField(max_length=255, verbose_name=_("Model")) +# model_ar = models.CharField(max_length=255, verbose_name=_("Model Arabic")) +# year = models.IntegerField(verbose_name=_("Year")) +# series = models.CharField(max_length=255,verbose_name=_("Series")) +# trim = models.CharField(max_length=255,verbose_name=_("Trim")) +# status = models.CharField( +# max_length=10, +# choices=CarStatusChoices, +# default=CarStatusChoices.AVAILABLE, +# verbose_name=_("Status") +# ) +# stock_type = models.CharField( +# max_length=10, +# choices=CarStockTypeChoices, +# default=CarStockTypeChoices.NEW, +# verbose_name=_("Stock Type") +# ) +# remarks = models.TextField(blank=True, null=True, verbose_name=_("Remarks")) +# mileage = models.IntegerField(blank=True, null=True, verbose_name=_("Mileage")) +# receiving_date = models.DateTimeField(verbose_name=_("Receiving Date")) + + + class CarReservation(models.Model): car = models.ForeignKey('Car', on_delete=models.CASCADE, related_name='reservations', verbose_name=_("Car")) reserved_by = models.ForeignKey(User, on_delete=models.CASCADE, related_name='reservations', verbose_name=_("Reserved By")) diff --git a/inventory/services.py b/inventory/services.py index c94f148c..4052c387 100644 --- a/inventory/services.py +++ b/inventory/services.py @@ -12,8 +12,9 @@ from .models import Car,CarMake,CarModel def get_make(item): - data = CarMake.objects.filter(name__iexact=item).first() + data = CarMake.objects.filter(name__iexact=item).first() return data + def get_model(item,make): data = make.carmodel_set.filter(name__iexact=item).first() if not data: @@ -37,7 +38,6 @@ def decodevin(vin): return None - def decode_vin(vin): v = VIN(vin) data = {} @@ -51,20 +51,12 @@ def decode_vin(vin): return data if all([x for x in data.values()]) else None -# vehicle-info -# c2729afb -# 6d397471920412d672af1b8a02ca52ea - - -# option-info -# 367974ed -# 046b0412c1b4d3f8c39ec6375d6f3030 def elm(vin): headers = { "Content-Type": "application/json", - "app-id": "c2729afb", - "app-key": "6d397471920412d672af1b8a02ca52ea", - "client-id": "94142c27-2536-47e9-8e28-9ca7728b9442", + "app-id": settings.ELM_APP_ID, + "app-key": settings.ELM_APP_KEY, + "client-id": settings.ELM_CLIENT_ID, } url = ( "https://vehicle-maintenance.api.elm.sa/api/v1/vehicles/vehicle-info?vin=" + vin @@ -83,25 +75,3 @@ def elm(vin): return data if all([x for x in data.values()]) else None - -def translate(content, *args, **kwargs): - client = OpenAI(api_key=settings.OPENAI_API_KEY) - completion = client.chat.completions.create( - model="gpt-4", - messages=[ - { - "role": "system", - "content": "You are a translation assistant that translates English to Arabic.", - }, - {"role": "user", "content": content}, - ], - temperature=0.3, - ) - translation = completion.choices[0].message.content.strip() - return translation - - -def calculate_stock_value(): - cars = Car.objects.all() - total_value = sum(car.selling_price for car in cars) - return total_value diff --git a/inventory/signals.py b/inventory/signals.py index f6973c97..9ad173ac 100644 --- a/inventory/signals.py +++ b/inventory/signals.py @@ -11,16 +11,22 @@ from . import models @receiver(post_save, sender=models.Car) def create_car_location(sender, instance, created, **kwargs): """ - Signal to create or update the car's location when a car instance is saved. - """ - if created: - models.CarLocation.objects.create( - car=instance, - owner=instance.dealer, - showroom=instance.dealer, - description=f"Initial location set for car {instance.vin}." - ) - print("Car Location created") + Signal to create or update the car's location when a car instance is saved. + """ + try: + if created: + if instance.dealer is None: + raise ValueError(f"Cannot create CarLocation for car {instance.vin}: dealer is missing.") + + models.CarLocation.objects.create( + car=instance, + owner=instance.dealer, + showroom=instance.dealer, + description=f"Initial location set for car {instance.vin}." + ) + print("Car Location created") + except Exception as e: + print(f"Failed to create CarLocation for car {instance.vin}: {e}") @receiver(post_save, sender=models.CarReservation) @@ -34,7 +40,7 @@ def update_car_status_on_reservation(sender, instance, created, **kwargs): @receiver(post_delete, sender=models.CarReservation) def update_car_status_on_reservation_delete(sender, instance, **kwargs): car = instance.car - if not car.get_current_reservation(): + if not car.is_reserved(): car.status = models.CarStatusChoices.AVAILABLE car.save() diff --git a/inventory/urls.py b/inventory/urls.py index 03bb9a9a..edd77d08 100644 --- a/inventory/urls.py +++ b/inventory/urls.py @@ -52,7 +52,7 @@ urlpatterns = [ path('cars//update/', views.CarUpdateView.as_view(), name='car_update'), path('cars//delete/', views.CarDeleteView.as_view(), name='car_delete'), path('cars//finance/create/', views.CarFinanceCreateView.as_view(), name='car_finance_create'), - path('cars/finance/update//', views.CarFinanceUpdateView.as_view(), name='car_finance_update'), + path('cars/finance//update/', views.CarFinanceUpdateView.as_view(), name='car_finance_update'), path('cars/add/', views.CarCreateView.as_view(), name='car_add'), path('ajax/', views.AjaxHandlerView.as_view(), name='ajax_handler'), path('cars//add-color/', views.CarColorCreate.as_view(), name='add_color'), diff --git a/inventory/views.py b/inventory/views.py index b3df66e1..7daa6e7f 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -138,7 +138,7 @@ class AjaxHandlerView(LoginRequiredMixin, View): vin_data = {} decoding_method = '' - manufacturer_name = model_name = year_model = None + # manufacturer_name = model_name = year_model = None if not (result :=decodevin(vin_no)): return JsonResponse({'success': False, 'error': 'VIN not found in all sources.'}, status=404) diff --git a/locale/ar/LC_MESSAGES/django.po b/locale/ar/LC_MESSAGES/django.po index a482433e..03f649d8 100644 --- a/locale/ar/LC_MESSAGES/django.po +++ b/locale/ar/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-11 21:41+0300\n" +"POT-Creation-Date: 2024-12-12 01:35+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,8 +20,8 @@ msgstr "" "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" #: api/models.py:6 inventory/models.py:126 -#: templates/inventory/car_detail.html:61 templates/inventory/car_form.html:83 -#: templates/inventory/car_inventory.html:53 +#: templates/inventory/car_detail.html:85 templates/inventory/car_form.html:83 +#: templates/inventory/car_inventory.html:51 #: templates/inventory/car_list.html:67 templates/inventory/car_list.html:69 msgid "VIN" msgstr "رقم الهيكل" @@ -42,7 +42,7 @@ msgid "SAR" msgstr "ريال سعودي" #: inventory/forms.py:114 inventory/models.py:341 -#: templates/inventory/car_detail.html:135 +#: templates/inventory/car_detail.html:158 msgid "Custom Date" msgstr "تاريخ البطاقة الجمركية" @@ -72,10 +72,8 @@ msgid "Damaged" msgstr "تالف" #: inventory/models.py:117 -#, fuzzy -#| msgid "Reserve" msgid "Reserved" -msgstr "حجز" +msgstr "محجوزة" #: inventory/models.py:121 msgid "New" @@ -90,7 +88,7 @@ msgid "Dealer" msgstr "المعرض" #: inventory/models.py:140 inventory/models.py:458 -#: templates/inventory/car_detail.html:108 +#: templates/inventory/car_detail.html:131 #: templates/inventory/car_form.html:230 #: venv/lib/python3.11/site-packages/django_ledger/models/bill.py:359 #: venv/lib/python3.11/site-packages/django_ledger/models/vendor.py:191 @@ -99,16 +97,16 @@ msgstr "المعرض" msgid "Vendor" msgstr "المورد" -#: inventory/models.py:148 templates/inventory/car_inventory.html:55 +#: inventory/models.py:148 msgid "Make" msgstr "الصانع" -#: inventory/models.py:156 templates/inventory/car_inventory.html:56 +#: inventory/models.py:156 msgid "Model" msgstr "الموديل" #: inventory/models.py:158 templates/inventory/car_form.html:118 -#: templates/inventory/car_inventory.html:54 +#: templates/inventory/car_inventory.html:52 msgid "Year" msgstr "السنة" @@ -121,7 +119,8 @@ msgid "Trim" msgstr "الفئة" #: inventory/models.py:179 inventory/models.py:500 -#: templates/inventory/car_detail.html:86 templates/inventory/car_list.html:163 +#: templates/inventory/car_detail.html:109 +#: templates/inventory/car_list.html:163 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/tags/bill_table.html:10 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/estimate/includes/card_estimate.html:12 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/estimate/includes/estimate_table.html:12 @@ -131,25 +130,25 @@ msgstr "الفئة" msgid "Status" msgstr "الحالة" -#: inventory/models.py:185 templates/inventory/car_detail.html:90 +#: inventory/models.py:185 templates/inventory/car_detail.html:113 #: templates/inventory/car_form.html:248 templates/inventory/car_list.html:177 msgid "Stock Type" msgstr "نوع المخزون" #: inventory/models.py:187 inventory/models.py:499 -#: templates/inventory/car_detail.html:113 +#: templates/inventory/car_detail.html:136 #: templates/inventory/car_form.html:301 templates/inventory/car_list.html:200 #: templates/sales/quotation_detail.html:23 msgid "Remarks" msgstr "ملاحظات" -#: inventory/models.py:188 templates/inventory/car_detail.html:94 +#: inventory/models.py:188 templates/inventory/car_detail.html:117 #: templates/inventory/car_form.html:265 templates/inventory/car_list.html:191 #: templates/inventory/car_list.html:192 msgid "Mileage" msgstr "عدد الكيلومترات" -#: inventory/models.py:189 templates/inventory/car_detail.html:98 +#: inventory/models.py:189 templates/inventory/car_detail.html:121 #: templates/inventory/car_form.html:283 msgid "Receiving Date" msgstr "تاريخ الاستلام" @@ -164,39 +163,31 @@ msgstr "السيارة" msgid "Cars" msgstr "السيارات" -#: inventory/models.py:228 templates/inventory/car_detail.html:277 +#: inventory/models.py:228 templates/inventory/car_detail.html:304 msgid "Reserved By" msgstr "محجوز بواسطة" #: inventory/models.py:229 -#, fuzzy -#| msgid "Reserved By" msgid "Reserved At" -msgstr "محجوز بواسطة" +msgstr "تاريخ الحجز" #: inventory/models.py:230 -#, fuzzy -#| msgid "Reserved By" msgid "Reserved Until" -msgstr "محجوز بواسطة" +msgstr "محجوز حتى" -#: inventory/models.py:238 -#, fuzzy -#| msgid "Registration" +#: inventory/models.py:238 templates/inventory/car_detail.html:38 msgid "Car Reservation" -msgstr "التسجيل" +msgstr "حجز السيارة" #: inventory/models.py:239 -#, fuzzy -#| msgid "Registrations" msgid "Car Reservations" -msgstr "تسجيل السيارات" +msgstr "حجوزات السيارات" -#: inventory/models.py:245 templates/inventory/car_detail.html:179 +#: inventory/models.py:245 templates/inventory/car_detail.html:204 msgid "Cost Price" msgstr "سعر التكلفة" -#: inventory/models.py:246 templates/inventory/car_detail.html:183 +#: inventory/models.py:246 templates/inventory/car_detail.html:208 #: templates/sales/sales_order_detail.html:25 msgid "Selling Price" msgstr "سعر البيع" @@ -206,28 +197,26 @@ msgid "Profit Margin" msgstr "هامش الربح" #: inventory/models.py:253 -#, fuzzy -#| msgid "VAT Amount" msgid "Vat Amount" msgstr "مبلغ ضريبة القيمة المضافة" -#: inventory/models.py:255 templates/inventory/car_detail.html:203 +#: inventory/models.py:255 templates/inventory/car_detail.html:228 msgid "Discount Amount" msgstr "مبلغ الخصم" -#: inventory/models.py:257 templates/inventory/car_detail.html:191 +#: inventory/models.py:257 templates/inventory/car_detail.html:216 msgid "Registration Fee" msgstr "رسوم التسجيل" -#: inventory/models.py:259 templates/inventory/car_detail.html:187 +#: inventory/models.py:259 templates/inventory/car_detail.html:212 msgid "Administration Fee" msgstr "الرسوم الادارية" -#: inventory/models.py:261 templates/inventory/car_detail.html:195 +#: inventory/models.py:261 templates/inventory/car_detail.html:220 msgid "Transportation Fee" msgstr "رسوم النقل" -#: inventory/models.py:263 templates/inventory/car_detail.html:199 +#: inventory/models.py:263 templates/inventory/car_detail.html:224 msgid "Custom Card Fee" msgstr "رسوم البطاقة الجمركية" @@ -276,12 +265,12 @@ msgstr "اللون" msgid "Colors" msgstr "الألوان" -#: inventory/models.py:340 templates/inventory/car_detail.html:131 +#: inventory/models.py:340 templates/inventory/car_detail.html:154 msgid "Custom Number" msgstr "رقم البطاقة الجمركية" -#: inventory/models.py:344 templates/inventory/car_detail.html:16 -#: templates/inventory/car_detail.html:141 +#: inventory/models.py:344 templates/inventory/car_detail.html:23 +#: templates/inventory/car_detail.html:164 msgid "Custom Card" msgstr "البطاقة الجمركية" @@ -324,28 +313,20 @@ msgstr "وصف اختياري حول وضع السيارة في صالة الع #: inventory/models.py:380 inventory/models.py:501 inventory/models.py:563 #: templates/sales/quotation_list.html:17 -#, fuzzy -#| msgid "Created" msgid "Created At" msgstr "تاريخ الإنشاء" #: inventory/models.py:384 -#, fuzzy -#| msgid "Updated" msgid "Last Updated" -msgstr "تم التحديث" +msgstr "آخر تحديث" #: inventory/models.py:388 -#, fuzzy -#| msgid "actions" msgid "Car Location" -msgstr "الإجراءات" +msgstr "موقع السيارة" #: inventory/models.py:389 -#, fuzzy -#| msgid "actions" msgid "Car Locations" -msgstr "الإجراءات" +msgstr "مواقف السيارات" #: inventory/models.py:403 msgid "Plate Number" @@ -484,10 +465,8 @@ msgid "Draft" msgstr "مسودة" #: inventory/models.py:493 -#, fuzzy -#| msgid "Confirm" msgid "Confirmed" -msgstr "تأكيد" +msgstr "مؤكد" #: inventory/models.py:494 #: venv/lib/python3.11/site-packages/django_ledger/models/bill.py:342 @@ -506,8 +485,6 @@ msgid "Amount" msgstr "المبلغ" #: inventory/models.py:502 -#, fuzzy -#| msgid "Updated" msgid "Updated At" msgstr "تم التحديث" @@ -520,10 +497,8 @@ msgid "Cannot cancel a confirmed quotation." msgstr "لا يمكن إلغاء عرض تقديري تم تأكيده." #: inventory/models.py:527 inventory/models.py:562 -#, fuzzy -#| msgid "Duration" msgid "Quotation" -msgstr "المدة" +msgstr "عزرص سعر" #: inventory/models.py:535 #: venv/lib/python3.11/site-packages/django_ledger/models/items.py:1068 @@ -561,7 +536,7 @@ msgid "You are not associated with any dealer." msgstr "أنت غير مرتبط بأي معرض." #: inventory/views.py:221 templates/header.html:33 templates/index.html:20 -#: templates/inventory/car_inventory.html:5 +#: templates/inventory/car_inventory.html:4 #: templates/inventory/car_inventory.html:7 msgid "inventory" msgstr "المخزون" @@ -784,7 +759,7 @@ msgstr "حفظ" #: templates/inventory/add_colors.html:56 #: templates/inventory/add_custom_card.html:8 #: templates/inventory/car_confirm_delete.html:14 -#: templates/inventory/car_detail.html:301 +#: templates/inventory/car_detail.html:328 #: templates/inventory/car_finance_form.html:41 #: templates/inventory/color_palette.html:107 #: templates/inventory/reserve_car.html:30 @@ -800,7 +775,7 @@ msgid "Cancel" msgstr "إلغاء" #: templates/customers/customer_list.html:20 -#: templates/inventory/car_inventory.html:31 +#: templates/inventory/car_inventory.html:30 #: templates/inventory/car_list.html:70 msgid "search" msgstr "بحث" @@ -826,8 +801,8 @@ msgid "actions" msgstr "الإجراءات" #: templates/customers/customer_list.html:59 -#: templates/inventory/car_detail.html:124 -#: templates/inventory/car_inventory.html:75 +#: templates/inventory/car_detail.html:147 +#: templates/inventory/car_inventory.html:78 msgid "view" msgstr "عرض" @@ -840,7 +815,7 @@ msgid "Are you sure you want to delete this customer?" msgstr "هل أنت متأكد أنك تريد حذف هذا العميل؟" #: templates/customers/view_customer.html:26 -#: templates/vendors/view_vendor.html:29 +#: templates/inventory/car_detail.html:47 templates/vendors/view_vendor.html:29 #: venv/lib/python3.11/site-packages/django/forms/widgets.py:802 msgid "No" msgstr "لا" @@ -857,7 +832,7 @@ msgid "Customer Details" msgstr "تفاصيل العميل" #: templates/customers/view_customer.html:61 -#: templates/inventory/car_detail.html:329 +#: templates/inventory/car_detail.html:359 #: templates/vendors/view_vendor.html:66 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/customer/includes/card_customer.html:28 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/journal_entry/tags/je_table.html:83 @@ -899,7 +874,7 @@ msgid "Delete" msgstr "حذف" #: templates/customers/view_customer.html:72 -#: templates/inventory/car_detail.html:331 +#: templates/inventory/car_detail.html:361 msgid "Back to List" msgstr "العودة إلى القائمة" @@ -1107,7 +1082,7 @@ msgstr "أفضل السيارات مبيعاً" msgid "View your best-selling cars." msgstr "عرض السيارات الأكثر مبيعاً." -#: templates/index.html:151 templates/inventory/car_detail.html:74 +#: templates/index.html:151 templates/inventory/car_detail.html:97 #: templates/inventory/car_form.html:159 templates/inventory/car_list.html:97 msgid "model" msgstr "الموديل" @@ -1175,70 +1150,86 @@ msgstr "إضافة لون" msgid "Select exterior and interior colors for" msgstr "اختر الألوان الخارجية والداخلية لـ" -#: templates/inventory/car_detail.html:6 templates/inventory/car_detail.html:58 +#: templates/inventory/car_detail.html:5 templates/inventory/car_detail.html:82 #: templates/sales/quotation_detail.html:27 msgid "Car Details" msgstr "تفاصيل السيارة" -#: templates/inventory/car_detail.html:37 -#: templates/inventory/car_detail.html:117 templates/inventory/car_form.html:37 +#: templates/inventory/car_detail.html:42 +msgid "Are you sure you want to reserve this car?" +msgstr "هل أنت متأكد أنك تريد حجز هذه السيارة؟" + +#: templates/inventory/car_detail.html:51 +#: templates/inventory/car_detail.html:346 +#: templates/inventory/reserve_car.html:29 +msgid "Reserve" +msgstr "حجز" + +#: templates/inventory/car_detail.html:65 +#: templates/inventory/car_detail.html:140 templates/inventory/car_form.html:37 #: templates/inventory/car_form.html:322 templates/inventory/car_list.html:47 #: templates/inventory/car_list.html:221 msgid "specifications" msgstr "المواصفات" -#: templates/inventory/car_detail.html:65 templates/inventory/car_list.html:119 +#: templates/inventory/car_detail.html:89 templates/inventory/car_list.html:119 msgid "year" msgstr "السنة" -#: templates/inventory/car_detail.html:69 templates/inventory/car_form.html:140 +#: templates/inventory/car_detail.html:93 templates/inventory/car_form.html:140 #: templates/inventory/car_list.html:79 msgid "make" msgstr "الصانع" -#: templates/inventory/car_detail.html:78 templates/inventory/car_list.html:130 +#: templates/inventory/car_detail.html:101 +#: templates/inventory/car_list.html:130 msgid "series" msgstr "السلسلة" -#: templates/inventory/car_detail.html:82 templates/inventory/car_form.html:204 -#: templates/inventory/car_list.html:141 +#: templates/inventory/car_detail.html:105 +#: templates/inventory/car_form.html:204 templates/inventory/car_list.html:141 msgid "trim" msgstr "الفئة" -#: templates/inventory/car_detail.html:103 +#: templates/inventory/car_detail.html:126 msgid "Branch" msgstr "الفرع" -#: templates/inventory/car_detail.html:147 -#: templates/inventory/car_detail.html:166 +#: templates/inventory/car_detail.html:170 +#: templates/inventory/car_detail.html:191 msgid "Add" msgstr "إضافة" -#: templates/inventory/car_detail.html:153 +#: templates/inventory/car_detail.html:176 +#: templates/inventory/car_inventory.html:55 msgid "Showroom Location" msgstr "موقع صالة العرض" -#: templates/inventory/car_detail.html:157 +#: templates/inventory/car_detail.html:180 +#: templates/inventory/car_inventory.html:72 msgid "Our Showroom" msgstr "معرضنا" -#: templates/inventory/car_detail.html:163 -#, fuzzy -#| msgid "No options available." -msgid "No location available." -msgstr "لا توجد سيارات متاحة." +#: templates/inventory/car_detail.html:186 +#: templates/inventory/transfer_car.html:23 +msgid "transfer" +msgstr "نقل" -#: templates/inventory/car_detail.html:175 +#: templates/inventory/car_detail.html:188 +msgid "No location available." +msgstr "لا يوجد موقع متاح." + +#: templates/inventory/car_detail.html:199 msgid "Financial Details" msgstr "التفاصيل المالية" -#: templates/inventory/car_detail.html:207 +#: templates/inventory/car_detail.html:232 #: templates/sales/quotation_detail.html:66 #: templates/sales/sales_order_detail.html:26 msgid "VAT Amount" msgstr "مبلغ ضريبة القيمة المضافة" -#: templates/inventory/car_detail.html:211 +#: templates/inventory/car_detail.html:236 #: templates/inventory/inventory_stats.html:61 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/bill_detail.html:98 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/bill_detail.html:127 @@ -1257,48 +1248,48 @@ msgstr "مبلغ ضريبة القيمة المضافة" msgid "Total" msgstr "الإجمالي" -#: templates/inventory/car_detail.html:218 +#: templates/inventory/car_detail.html:243 msgid "Edit Finance Details" msgstr "تعديل التفاصيل المالية" -#: templates/inventory/car_detail.html:222 +#: templates/inventory/car_detail.html:247 msgid "No finance details available." msgstr "لا توجد تفاصيل مالية متاحة." -#: templates/inventory/car_detail.html:225 +#: templates/inventory/car_detail.html:250 msgid "Add Finance Details" msgstr "إضافة التفاصيل المالية" -#: templates/inventory/car_detail.html:231 +#: templates/inventory/car_detail.html:256 msgid "Colors Details" msgstr "تفاصيل الألوان" -#: templates/inventory/car_detail.html:237 +#: templates/inventory/car_detail.html:262 msgid "Exterior" msgstr "الخارجي" -#: templates/inventory/car_detail.html:246 +#: templates/inventory/car_detail.html:273 msgid "Interior" msgstr "الداخلي" -#: templates/inventory/car_detail.html:258 +#: templates/inventory/car_detail.html:286 msgid "No colors available for this car." msgstr "لا تتوفر ألوان لهذه السيارة." -#: templates/inventory/car_detail.html:265 +#: templates/inventory/car_detail.html:292 msgid "Get Colors" msgstr "الحصول على الألوان" -#: templates/inventory/car_detail.html:272 +#: templates/inventory/car_detail.html:299 msgid "Reservations Details" msgstr "تفاصيل الحجز" -#: templates/inventory/car_detail.html:278 +#: templates/inventory/car_detail.html:305 msgid "Expires At" msgstr "ينتهي في" -#: templates/inventory/car_detail.html:279 -#: templates/inventory/car_inventory.html:57 +#: templates/inventory/car_detail.html:306 +#: templates/inventory/car_inventory.html:56 #: templates/sales/quotation_list.html:18 #: templates/vendors/vendors_list.html:37 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/account/tags/account_txs_table.html:29 @@ -1327,31 +1318,21 @@ msgstr "ينتهي في" msgid "Actions" msgstr "الإجراءات" -#: templates/inventory/car_detail.html:295 +#: templates/inventory/car_detail.html:322 msgid "Renew" msgstr "تجديد" -#: templates/inventory/car_detail.html:305 +#: templates/inventory/car_detail.html:334 msgid "Expired" msgstr "ينتهي في" -#: templates/inventory/car_detail.html:315 -#: templates/inventory/reserve_car.html:29 -msgid "Reserve" -msgstr "حجز" - -#: templates/inventory/car_detail.html:327 -#: templates/inventory/transfer_car.html:23 -msgid "transfer" -msgstr "نقل" - -#: templates/inventory/car_detail.html:416 +#: templates/inventory/car_detail.html:440 #: templates/inventory/car_list.html:542 #: templates/partials/specifications_modal.html:11 msgid "No specifications available." msgstr "لا توجد مواصفات متاحة." -#: templates/inventory/car_detail.html:420 +#: templates/inventory/car_detail.html:444 #: templates/inventory/car_list.html:546 msgid "Error loading specifications." msgstr "حدث خطأ أثناء تحميل المواصفات." @@ -1427,7 +1408,15 @@ msgstr "فشل في فك تشفير رقم الهيكل" msgid "An error occurred while decoding the VIN." msgstr "حدث خطأ أثناء فك تشفير الهيكل" -#: templates/inventory/car_inventory.html:80 +#: templates/inventory/car_inventory.html:53 +msgid "Exterior Color" +msgstr "اللون الخارجي" + +#: templates/inventory/car_inventory.html:54 +msgid "Interior Color" +msgstr "اللون الداخلي" + +#: templates/inventory/car_inventory.html:84 msgid "No cars available." msgstr "لا توجد سيارات متاحة." @@ -1487,10 +1476,8 @@ msgstr "خطأ في تحميل الخيارات." #: templates/inventory/car_location_form.html:4 #: templates/inventory/car_location_form.html:12 -#, fuzzy -#| msgid "actions" msgid "Manage Car Location" -msgstr "الإجراءات" +msgstr "إدارة موقع السيارة" #: templates/inventory/color_palette.html:74 msgid "Update Color" @@ -6989,10 +6976,3 @@ msgid "" "Message Django's middlewares" msgstr "" -#~ msgid "Location" -#~ msgstr "الموقع" - -#, fuzzy -#~| msgid "Net Income" -#~ msgid "Sales Income" -#~ msgstr "صافي الدخل" diff --git a/templates/base.html b/templates/base.html index 162254c8..7ada0762 100644 --- a/templates/base.html +++ b/templates/base.html @@ -36,6 +36,7 @@ small, .small { } .btn { text-transform: uppercase; + border-radius: 5px; } @@ -47,11 +48,7 @@ small, .small { {% block content %} {% endblock %} - - - -