diff --git a/inventory/__pycache__/forms.cpython-311.pyc b/inventory/__pycache__/forms.cpython-311.pyc index 72d6831d..9f8cab61 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 86e40de5..6d58fdc5 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 5dcc25a1..4a49f5cb 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 b3449f27..46468501 100644 Binary files a/inventory/__pycache__/views.cpython-311.pyc and b/inventory/__pycache__/views.cpython-311.pyc differ diff --git a/inventory/forms.py b/inventory/forms.py index b31e1c39..c3455d4f 100644 --- a/inventory/forms.py +++ b/inventory/forms.py @@ -161,3 +161,7 @@ class CarRegistrationForm(forms.ModelForm): ] +class VendorForm(forms.ModelForm): + class Meta: + model = Vendor + exclude = ['dealer'] diff --git a/inventory/models.py b/inventory/models.py index da337e40..8b30724c 100644 --- a/inventory/models.py +++ b/inventory/models.py @@ -376,72 +376,72 @@ class Customer(models.Model): return f"{self.first_name}{middle} {self.last_name}" -# # Create Entity -# @receiver(post_save, sender=Dealer) -# def create_ledger_entity(sender, instance, created, **kwargs): -# if created: -# entity = EntityModel.objects.create( -# name=instance.name, -# admin=instance.user, -# address_1=instance.address, -# fy_start_month=1, -# accrual_method=True, -# depth=0, -# ) -# -# default_coa = entity.create_chart_of_accounts(assign_as_default=True, -# commit=True, -# coa_name=_("Chart of Accounts")) -# if default_coa: -# entity.populate_default_coa(activate_accounts=True, coa_model=default_coa) -# print(f"Ledger entity created for Dealer: {instance.name}") -# -# -# # # Create Vendor -# @receiver(post_save, sender=Vendor) -# def create_ledger_vendor(sender, instance, created, **kwargs): -# -# if created: -# entity = EntityModel.objects.filter(name=instance.dealer.name).first() -# -# vendor = VendorModel.objects.create( -# entity_model=entity, -# vendor_name=instance.name, -# vendor_number=instance.crn, -# address_1=instance.address, -# phone=instance.phone_number, -# tax_id_number=instance.vrn, -# active=True, -# hidden=False, -# additional_info={ -# "arabic_name": instance.arabic_name, -# "contact_person": instance.contact_person, -# }, -# ) -# -# print(f"VendorModel created for Vendor: {instance.name}") -# -# -# @receiver(post_save, sender=Customer) -# def create_customer(sender, instance, created, **kwargs): -# -# if created: -# entity = EntityModel.objects.filter(name=instance.dealer.name).first() -# name = f"{instance.first_name} {instance.middle_name} {instance.last_name}" -# -# customer = CustomerModel.objects.create( -# entity_model=entity, -# customer_name=name, -# customer_number=instance.national_id, -# address_1=instance.address, -# phone=instance.phone_number, -# email=instance.email, -# sales_tax_rate=0.15, -# ) -# -# print(f"Customer created: {name}") -# -# +# Create Entity +@receiver(post_save, sender=Dealer) +def create_ledger_entity(sender, instance, created, **kwargs): + if created: + entity = EntityModel.objects.create( + name=instance.name, + admin=instance.user, + address_1=instance.address, + fy_start_month=1, + accrual_method=True, + depth=0, + ) + + default_coa = entity.create_chart_of_accounts(assign_as_default=True, + commit=True, + coa_name=_("Chart of Accounts")) + if default_coa: + entity.populate_default_coa(activate_accounts=True, coa_model=default_coa) + print(f"Ledger entity created for Dealer: {instance.name}") + + +# # Create Vendor +@receiver(post_save, sender=Vendor) +def create_ledger_vendor(sender, instance, created, **kwargs): + + if created: + entity = EntityModel.objects.filter(name=instance.dealer.name).first() + + vendor = VendorModel.objects.update_or_create( + entity_model=entity, + vendor_name=instance.name, + vendor_number=instance.crn, + address_1=instance.address, + phone=instance.phone_number, + tax_id_number=instance.vrn, + active=True, + hidden=False, + additional_info={ + "arabic_name": instance.arabic_name, + "contact_person": instance.contact_person, + }, + ) + + print(f"VendorModel created for Vendor: {instance.name}") + + +@receiver(post_save, sender=Customer) +def create_customer(sender, instance, created, **kwargs): + + if created: + entity = EntityModel.objects.filter(name=instance.dealer.name).first() + name = f"{instance.first_name} {instance.middle_name} {instance.last_name}" + + customer = CustomerModel.objects.create( + entity_model=entity, + customer_name=name, + customer_number=instance.national_id, + address_1=instance.address, + phone=instance.phone_number, + email=instance.email, + sales_tax_rate=0.15, + ) + + print(f"Customer created: {name}") + + # # Create Item # @receiver(post_save, sender=Car) # def create_item_model(sender, instance, created, **kwargs): diff --git a/inventory/urls.py b/inventory/urls.py index 67f74e54..28a3f3dd 100644 --- a/inventory/urls.py +++ b/inventory/urls.py @@ -35,6 +35,13 @@ urlpatterns = [ path('customers/create/', views.CustomerCreateView.as_view(), name='customer_create'), path('customers//update/', views.CustomerUpdateView.as_view(), name='customer_update'), path('customers//delete/', views.delete_customer, name='customer_delete'), + # Vendor URLs + path('vendors', views.VendorListView.as_view(), name='vendor_list'), + path('vendors//', views.VendorDetailView.as_view(), name='vendor_detail'), + path('vendors/create/', views.VendorCreateView.as_view(), name='vendor_create'), + path('vendors//update/', views.VendorUpdateView.as_view(), name='vendor_update'), + path('vendors//delete/', views.delete_vendor, name='vendor_delete'), + # Car URLs path('cars/inventory////', diff --git a/inventory/views.py b/inventory/views.py index 93830db5..016c3bb0 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -724,3 +724,57 @@ def delete_customer(request, pk): messages.success(request, _('Customer deleted successfully.')) return redirect('customer_list') + +class VendorListView(LoginRequiredMixin, ListView): + model = models.Vendor + context_object_name = 'vendors' + paginate_by = 10 + template_name = "vendors/vendors_list.html" + + +class VendorDetailView(LoginRequiredMixin, DetailView): + model = models.Vendor + template_name = "vendors/view_vendor.html" + + +class VendorCreateView(LoginRequiredMixin, CreateView): + model = models.Vendor + form_class = forms.VendorForm + template_name = 'vendors/vendor_form.html' + success_url = reverse_lazy('vendor_list') + + def form_valid(self, form): + if form.is_valid(): + form.instance.dealer = self.request.user.dealer + form.save() + messages.success(self.request, _('Vendor created successfully.')) + return super().form_valid(form) + else: + return form.errors + + +class VendorUpdateView(LoginRequiredMixin, UpdateView): + model = models.Vendor + form_class = forms.VendorForm + template_name = 'vendors/vendor_form.html' + success_url = reverse_lazy('vendor_list') + + def form_valid(self, form): + if form.is_valid(): + form.instance.dealer = self.request.user.dealer + form.save() + messages.success(self.request, _('Vendor updated successfully.')) + return super().form_valid(form) + else: + return form.errors + + +@login_required +def delete_vendor(request, pk): + vendor = get_object_or_404(models.Vendor, pk=pk) + vendor.delete() + messages.success(request, _('Vendor deleted successfully.')) + return redirect('vendor_list') + + + diff --git a/locale/ar/LC_MESSAGES/django.mo b/locale/ar/LC_MESSAGES/django.mo index eacb5b7c..606e56c9 100644 Binary files a/locale/ar/LC_MESSAGES/django.mo and b/locale/ar/LC_MESSAGES/django.mo differ diff --git a/locale/ar/LC_MESSAGES/django.po b/locale/ar/LC_MESSAGES/django.po index 0e3add6c..54a99afe 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-06 19:45+0300\n" +"POT-Creation-Date: 2024-12-08 16:18+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,7 +20,7 @@ msgstr "" "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" #: api/models.py:6 inventory/models.py:122 -#: templates/inventory/car_detail.html:44 templates/inventory/car_form.html:83 +#: templates/inventory/car_detail.html:61 templates/inventory/car_form.html:83 #: templates/inventory/car_inventory.html:40 #: templates/inventory/car_list.html:67 templates/inventory/car_list.html:69 msgid "VIN" @@ -34,7 +34,12 @@ msgstr "الإنجليزية" msgid "Arabic" msgstr "العربية" -#: inventory/models.py:30 templates/vendors/vendors_list.html:30 +#: inventory/forms.py:147 inventory/models.py:284 +#: templates/inventory/car_detail.html:135 +msgid "Custom Date" +msgstr "تاريخ البطاقة الجمركية" + +#: inventory/models.py:30 templates/vendors/vendors_list.html:44 msgid "logo" msgstr "الشعار" @@ -68,7 +73,8 @@ msgid "Dealer" msgstr "المعرض" #: inventory/models.py:136 inventory/models.py:351 -#: templates/inventory/car_detail.html:91 templates/inventory/car_form.html:225 +#: templates/inventory/car_detail.html:108 +#: templates/inventory/car_form.html:225 #: venv/lib/python3.11/site-packages/django_ledger/models/bill.py:359 #: venv/lib/python3.11/site-packages/django_ledger/models/vendor.py:191 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/tags/bill_table.html:12 @@ -97,7 +103,7 @@ msgstr "السلسلة" msgid "Trim" msgstr "الفئة" -#: inventory/models.py:175 templates/inventory/car_detail.html:69 +#: inventory/models.py:175 templates/inventory/car_detail.html:86 #: 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 @@ -108,23 +114,23 @@ msgstr "الفئة" msgid "Status" msgstr "الحالة" -#: inventory/models.py:181 templates/inventory/car_detail.html:73 +#: inventory/models.py:181 templates/inventory/car_detail.html:90 #: templates/inventory/car_form.html:243 templates/inventory/car_list.html:177 msgid "Stock Type" msgstr "نوع المخزون" -#: inventory/models.py:183 templates/inventory/car_detail.html:96 +#: inventory/models.py:183 templates/inventory/car_detail.html:113 #: templates/inventory/car_form.html:296 templates/inventory/car_list.html:200 msgid "Remarks" msgstr "ملاحظات" -#: inventory/models.py:184 templates/inventory/car_detail.html:77 +#: inventory/models.py:184 templates/inventory/car_detail.html:94 #: templates/inventory/car_form.html:260 templates/inventory/car_list.html:191 #: templates/inventory/car_list.html:192 msgid "Mileage" msgstr "عدد الكيلومترات" -#: inventory/models.py:185 templates/inventory/car_detail.html:81 +#: inventory/models.py:185 templates/inventory/car_detail.html:98 #: templates/inventory/car_form.html:278 msgid "Receiving Date" msgstr "تاريخ الاستلام" @@ -137,32 +143,32 @@ msgstr "السيارة" msgid "Cars" msgstr "السيارات" -#: inventory/models.py:234 templates/inventory/car_detail.html:123 -#: templates/inventory/car_finance_form.html:38 +#: inventory/models.py:234 templates/inventory/car_detail.html:160 +#: templates/inventory/car_finance_form.html:33 msgid "Cost Price" msgstr "سعر التكلفة" -#: inventory/models.py:235 templates/inventory/car_detail.html:127 -#: templates/inventory/car_finance_form.html:46 +#: inventory/models.py:235 templates/inventory/car_detail.html:164 +#: templates/inventory/car_finance_form.html:40 msgid "Profit Margin" msgstr "هامش الربح" -#: inventory/models.py:236 templates/inventory/car_detail.html:131 -#: templates/inventory/car_finance_form.html:62 +#: inventory/models.py:236 templates/inventory/car_detail.html:168 +#: templates/inventory/car_finance_form.html:54 msgid "Selling Price" msgstr "سعر البيع" -#: inventory/models.py:237 templates/inventory/car_detail.html:135 -#: templates/inventory/car_finance_form.html:54 +#: inventory/models.py:237 templates/inventory/car_detail.html:172 +#: templates/inventory/car_finance_form.html:47 msgid "VAT Rate" msgstr "نسبة ضريبة القيمة المضافة" -#: inventory/models.py:238 templates/inventory/car_detail.html:139 -#: templates/inventory/car_finance_form.html:66 +#: inventory/models.py:238 templates/inventory/car_detail.html:176 +#: templates/inventory/car_finance_form.html:58 msgid "VAT Amount" msgstr "مبلغ ضريبة القيمة المضافة" -#: inventory/models.py:239 templates/inventory/car_finance_form.html:70 +#: inventory/models.py:239 templates/inventory/car_finance_form.html:62 msgid "Total Amount" msgstr "المبلغ الإجمالي" @@ -179,7 +185,7 @@ msgid "Interior" msgstr "الداخلي" #: inventory/models.py:262 templates/dealers/dealer_detail.html:26 -#: templates/vendors/view_vendor.html:8 +#: templates/vendors/view_vendor.html:39 #: venv/lib/python3.11/site-packages/django_ledger/forms/coa.py:16 #: venv/lib/python3.11/site-packages/django_ledger/forms/coa.py:37 msgid "Name" @@ -193,7 +199,7 @@ msgstr "الاسم بالعربية" msgid "RGB" msgstr "آر جي بي" -#: inventory/models.py:269 templates/inventory/color_palette.html:66 +#: inventory/models.py:269 templates/inventory/color_palette.html:83 msgid "Color Type" msgstr "نوع اللون" @@ -205,15 +211,12 @@ msgstr "اللون" msgid "Colors" msgstr "الألوان" -#: inventory/models.py:283 +#: inventory/models.py:283 templates/inventory/car_detail.html:131 msgid "Custom Number" msgstr "رقم البطاقة الجمركية" -#: inventory/models.py:284 -msgid "Custom Date" -msgstr "تاريخ البطاقة الجمركية" - -#: inventory/models.py:287 +#: inventory/models.py:287 templates/inventory/car_detail.html:16 +#: templates/inventory/car_detail.html:141 msgid "Custom Card" msgstr "البطاقة الجمركية" @@ -278,7 +281,7 @@ msgstr "الاسم بالإنجليزية" #: inventory/models.py:327 inventory/models.py:347 inventory/models.py:366 #: templates/customers/view_customer.html:53 #: templates/dealers/dealer_detail.html:38 -#: templates/vendors/view_vendor.html:17 +#: templates/vendors/view_vendor.html:44 #: venv/lib/python3.11/site-packages/django_ledger/models/mixins.py:113 msgid "Phone Number" msgstr "رقم الهاتف" @@ -286,7 +289,7 @@ msgstr "رقم الهاتف" #: inventory/models.py:328 inventory/models.py:348 inventory/models.py:367 #: templates/customers/view_customer.html:54 #: templates/dealers/dealer_detail.html:42 -#: templates/vendors/view_vendor.html:19 +#: templates/vendors/view_vendor.html:46 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/customer/tags/customer_table.html:10 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/vendor/tags/vendor_table.html:11 msgid "Address" @@ -300,11 +303,13 @@ msgstr "الشعار" msgid "Dealers" msgstr "المعارض" -#: inventory/models.py:346 templates/vendors/view_vendor.html:16 +#: inventory/models.py:346 templates/vendors/view_vendor.html:43 msgid "Contact Person" msgstr "الشخص المسؤول" -#: inventory/models.py:352 +#: inventory/models.py:352 templates/header.html:85 templates/header.html:100 +#: templates/vendors/vendor_form.html:4 templates/vendors/vendors_list.html:4 +#: templates/vendors/vendors_list.html:5 msgid "Vendors" msgstr "الموردين" @@ -321,7 +326,7 @@ msgid "Last Name" msgstr "اسم العائلة" #: inventory/models.py:364 templates/customers/view_customer.html:51 -#: templates/vendors/view_vendor.html:18 +#: templates/vendors/view_vendor.html:45 #: venv/lib/python3.11/site-packages/django_ledger/models/mixins.py:111 msgid "Email" msgstr "البريد الإلكتروني" @@ -343,6 +348,12 @@ msgstr "العميل" msgid "Customers" msgstr "العملاء" +#: inventory/models.py:394 +#: venv/lib/python3.11/site-packages/django_ledger/models/accounts.py:436 +#: venv/lib/python3.11/site-packages/django_ledger/models/coa.py:152 +msgid "Chart of Accounts" +msgstr "قائمة الحسابات" + #: inventory/utils.py:25 msgid "success" msgstr "ناجحة" @@ -355,109 +366,125 @@ msgstr "خطأ" msgid "Forgot Password?" msgstr "نسيت كلمة المرور؟" -#: inventory/views.py:69 +#: inventory/views.py:68 msgid "You are not associated with any dealer." msgstr "أنت غير مرتبط بأي معرض." -#: inventory/views.py:251 templates/header.html:33 templates/index.html:20 +#: inventory/views.py:248 templates/header.html:33 templates/index.html:20 #: templates/inventory/car_inventory.html:5 #: templates/inventory/car_inventory.html:7 msgid "inventory" msgstr "المخزون" -#: inventory/views.py:373 +#: inventory/views.py:370 msgid "Car finance details saved successfully." msgstr "تم حفظ تفاصيل المالية للسيارة بنجاح." -#: inventory/views.py:391 +#: inventory/views.py:388 msgid "Car finance updated successfully." msgstr "تم تحديث التفاصيل المالية للسيارة بنجاح." -#: inventory/views.py:404 +#: inventory/views.py:401 msgid "Car updated successfully." msgstr "تم تحديث السيارة بنجاح" -#: inventory/views.py:417 +#: inventory/views.py:414 msgid "Car deleted successfully." msgstr "تم حذف السيارة بنجاح." -#: inventory/views.py:435 inventory/views.py:504 +#: inventory/views.py:434 +msgid "Custom Card added successfully." +msgstr "تم إضافة البطاقة الجمركية بنجاح." + +#: inventory/views.py:452 inventory/views.py:521 msgid "Select a Color" msgstr "اختر اللون" -#: inventory/views.py:440 +#: inventory/views.py:457 msgid "Select Color Type" msgstr "حدد نوع اللون" -#: inventory/views.py:468 inventory/views.py:532 +#: inventory/views.py:485 inventory/views.py:548 msgid "Invalid color selection." msgstr "تحديد اللون غير صالح." -#: inventory/views.py:478 +#: inventory/views.py:495 msgid "Color added successfully." msgstr "تمت إضافة اللون بنجاح." -#: inventory/views.py:539 +#: inventory/views.py:555 msgid "Exterior color updated successfully." msgstr "تم تحديث اللون الخارجي بنجاح." -#: inventory/views.py:556 +#: inventory/views.py:572 msgid "This car is already reserved." msgstr "هذه السيارة محجوزة بالفعل." -#: inventory/views.py:566 +#: inventory/views.py:582 msgid "Car reserved successfully." msgstr "تم حجز السيارة بنجاح." -#: inventory/views.py:583 +#: inventory/views.py:599 msgid "Reservation renewed successfully." msgstr "تم تجديد الحجز بنجاح" -#: inventory/views.py:588 +#: inventory/views.py:604 msgid "Reservation canceled successfully." msgstr "تم إلغاء الحجز بنجاح." -#: inventory/views.py:592 +#: inventory/views.py:608 msgid "Invalid action." msgstr "إجراء غير صالح." -#: inventory/views.py:594 +#: inventory/views.py:610 msgid "Invalid request method." msgstr "طريقة الطلب غير صالحة" -#: inventory/views.py:616 +#: inventory/views.py:632 msgid "Dealer created successfully." msgstr "تم إنشاء المعرض بنجاح." -#: inventory/views.py:627 +#: inventory/views.py:643 msgid "Dealer updated successfully." msgstr "تم تحديث المعرض بنجاح." -#: inventory/views.py:637 +#: inventory/views.py:653 msgid "Dealer deleted successfully." msgstr "تم حذف المعرض بنجاح." -#: inventory/views.py:643 templates/customers/customer_form.html:4 +#: inventory/views.py:659 templates/customers/customer_form.html:4 #: templates/customers/customer_list.html:5 #: templates/customers/customer_list.html:6 templates/header.html:59 #: templates/header.html:74 msgid "customers" msgstr "العملاء" -#: inventory/views.py:682 +#: inventory/views.py:698 msgid "Customer created successfully." msgstr "تم إنشاء العميل بنجاح." -#: inventory/views.py:698 +#: inventory/views.py:714 msgid "Customer updated successfully." msgstr "تم تحديث العميل بنجاح." -#: inventory/views.py:708 +#: inventory/views.py:724 msgid "Customer deleted successfully." msgstr "تم حذف العميل بنجاح." +#: inventory/views.py:750 +msgid "Vendor created successfully." +msgstr "تم إنشاء المورد بنجاح." + +#: inventory/views.py:766 +msgid "Vendor updated successfully." +msgstr "تم تحديث المورد بنجاح" + +#: inventory/views.py:776 +msgid "Vendor deleted successfully." +msgstr "تم حذف المورد بنجاح." + #: templates/accounts/login.html:6 templates/accounts/login.html:14 -#: templates/accounts/login.html:31 templates/header.html:105 +#: templates/accounts/login.html:31 templates/header.html:131 msgid "Sign In" msgstr "تسجيل الدخول" @@ -480,7 +507,7 @@ msgstr "أرسل لي رمز تسجيل الدخول عبر البريد الإ #: templates/accounts/logout.html:3 templates/accounts/logout.html:11 #: templates/accounts/logout.html:21 templates/dealers/dealer_detail.html:63 -#: templates/header.html:99 +#: templates/header.html:125 msgid "Sign Out" msgstr "تسجيل الخروج" @@ -547,19 +574,19 @@ msgstr "إنشاء حساب باستخدام مفتاح المرور" msgid "HAIKAL" msgstr "هيكل" -#: templates/customers/customer_form.html:15 +#: templates/customers/customer_form.html:14 msgid "Edit Customer" msgstr "تحديث العميل" -#: templates/customers/customer_form.html:18 +#: templates/customers/customer_form.html:17 msgid "Add Customer" msgstr "إضافة عميل" -#: templates/customers/customer_form.html:32 -#: templates/inventory/car_edit.html:43 templates/inventory/car_form.html:320 -#: templates/inventory/color_palette.html:85 -#: templates/inventory/color_palette_update.html:78 -#: templates/vendors/edit_vendor.html:10 +#: templates/customers/customer_form.html:31 +#: templates/inventory/add_custom_card.html:7 +#: templates/inventory/car_edit.html:41 templates/inventory/car_form.html:320 +#: templates/inventory/color_palette.html:106 +#: templates/vendors/vendor_form.html:31 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/tags/bill_item_formset.html:81 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/closing_entry/closing_entry_update.html:19 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/data_import/tags/data_import_job_txs_table.html:78 @@ -570,16 +597,27 @@ msgstr "إضافة عميل" msgid "Save" msgstr "حفظ" -#: templates/customers/customer_form.html:37 -#: templates/customers/view_customer.html:72 -#: templates/inventory/car_detail.html:248 -msgid "Back to List" -msgstr "العودة إلى القائمة" +#: templates/customers/customer_form.html:33 +#: templates/inventory/add_custom_card.html:8 +#: templates/inventory/car_confirm_delete.html:14 +#: templates/inventory/car_detail.html:266 +#: templates/inventory/car_finance_form.html:68 +#: templates/inventory/color_palette.html:107 +#: templates/inventory/reserve_car.html:30 +#: templates/vendors/vendor_form.html:33 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/bill_create.html:37 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/includes/card_bill.html:205 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/components/modals.html:11 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/components/modals_v2.html:9 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/invoice/includes/card_invoice.html:188 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/invoice/invoice_create.html:42 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/purchase_order/includes/card_po.html:121 +msgid "Cancel" +msgstr "إلغاء" #: templates/customers/customer_list.html:20 #: templates/inventory/car_inventory.html:29 -#: templates/inventory/car_list.html:70 templates/vendors/vendors_list.html:19 -#: templates/vendors/vendors_list.html:21 +#: templates/inventory/car_list.html:70 templates/vendors/vendors_list.html:21 msgid "search" msgstr "بحث" @@ -600,14 +638,14 @@ msgid "national ID" msgstr "رقم الهوية الوطنية" #: templates/customers/customer_list.html:46 -#: templates/vendors/vendors_list.html:32 +#: templates/vendors/vendors_list.html:46 msgid "actions" msgstr "الإجراءات" #: templates/customers/customer_list.html:59 -#: templates/inventory/car_detail.html:107 +#: templates/inventory/car_detail.html:124 #: templates/inventory/car_inventory.html:62 -#: templates/vendors/vendors_list.html:55 +#: templates/vendors/vendors_list.html:65 msgid "view" msgstr "عرض" @@ -620,11 +658,13 @@ msgid "Are you sure you want to delete this customer?" msgstr "هل أنت متأكد أنك تريد حذف هذا العميل؟" #: templates/customers/view_customer.html:26 +#: templates/vendors/view_vendor.html:25 #: venv/lib/python3.11/site-packages/django/forms/widgets.py:802 msgid "No" msgstr "لا" #: templates/customers/view_customer.html:31 +#: templates/vendors/view_vendor.html:30 #: venv/lib/python3.11/site-packages/django/forms/widgets.py:801 msgid "Yes" msgstr "نعم" @@ -634,9 +674,9 @@ msgid "Customer Details" msgstr "تفاصيل العميل" #: templates/customers/view_customer.html:61 -#: templates/inventory/car_detail.html:115 -#: templates/inventory/car_detail.html:178 -#: templates/vendors/view_vendor.html:21 +#: templates/inventory/car_detail.html:217 +#: templates/inventory/car_detail.html:291 +#: templates/vendors/view_vendor.html:48 #: 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 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/ledger/tags/ledgers_table.html:101 @@ -645,8 +685,7 @@ msgid "Edit" msgstr "تحديث" #: templates/customers/view_customer.html:67 -#: templates/vendors/delete_vendor.html:11 -#: templates/vendors/view_vendor.html:22 +#: templates/vendors/view_vendor.html:53 #: venv/lib/python3.11/site-packages/django/forms/formsets.py:499 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/bill_delete.html:28 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/tags/bill_item_formset.html:25 @@ -677,6 +716,11 @@ msgstr "تحديث" msgid "Delete" msgstr "حذف" +#: templates/customers/view_customer.html:72 +#: templates/inventory/car_detail.html:293 +msgid "Back to List" +msgstr "العودة إلى القائمة" + #: templates/dealers/dealer_detail.html:5 #: templates/dealers/dealer_detail.html:14 msgid "Dealer Details" @@ -734,7 +778,7 @@ msgstr "تحديث معلومات المعرض" msgid "Save Changes" msgstr "حفظ تغيير" -#: templates/dealers/dealer_form.html:36 templates/inventory/car_edit.html:40 +#: templates/dealers/dealer_form.html:36 templates/inventory/car_edit.html:39 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bank_account/bank_account_create.html:25 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bank_account/bank_account_update.html:26 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/data_import/data_import_job_list.html:13 @@ -764,7 +808,7 @@ msgstr "جميع الحقوق محفوظة" msgid "Tenhal" msgstr "تنحل" -#: templates/header.html:25 templates/header.html:82 templates/index.html:5 +#: templates/header.html:25 templates/header.html:108 templates/index.html:5 msgid "home" msgstr "الرئيسية" @@ -784,11 +828,15 @@ msgstr "المخزون" msgid "add customer" msgstr "إضافة عميل" -#: templates/header.html:96 +#: templates/header.html:92 templates/vendors/vendor_form.html:17 +msgid "Add Vendor" +msgstr "المورد" + +#: templates/header.html:122 msgid "profile" msgstr "الملف الشخصي" -#: templates/header.html:128 +#: templates/header.html:154 msgid "Theme" msgstr "السمة" @@ -892,7 +940,7 @@ msgstr "أفضل السيارات مبيعاً" msgid "View your best-selling cars." msgstr "عرض السيارات الأكثر مبيعاً." -#: templates/index.html:151 templates/inventory/car_detail.html:57 +#: templates/index.html:151 templates/inventory/car_detail.html:74 #: templates/inventory/car_form.html:155 templates/inventory/car_list.html:97 msgid "model" msgstr "الموديل" @@ -952,65 +1000,48 @@ msgstr "الجمعة" msgid "Sat" msgstr "السبت" -#: templates/inventory/car_confirm_delete.html:14 -#: templates/inventory/car_detail.html:230 -#: templates/inventory/color_palette.html:86 -#: templates/inventory/color_palette_update.html:79 -#: templates/inventory/reserve_car.html:30 -#: templates/vendors/delete_vendor.html:12 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/bill_create.html:37 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/includes/card_bill.html:205 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/components/modals.html:11 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/components/modals_v2.html:9 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/invoice/includes/card_invoice.html:188 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/invoice/invoice_create.html:42 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/purchase_order/includes/card_po.html:121 -msgid "Cancel" -msgstr "إلغاء" - -#: templates/inventory/car_detail.html:6 templates/inventory/car_detail.html:41 +#: templates/inventory/car_detail.html:6 templates/inventory/car_detail.html:58 msgid "Car Details" msgstr "تفاصيل السيارة" -#: templates/inventory/car_detail.html:21 -#: templates/inventory/car_detail.html:100 templates/inventory/car_form.html:37 +#: templates/inventory/car_detail.html:37 +#: templates/inventory/car_detail.html:117 templates/inventory/car_form.html:37 #: templates/inventory/car_form.html:316 templates/inventory/car_list.html:47 #: templates/inventory/car_list.html:221 msgid "specifications" msgstr "المواصفات" -#: templates/inventory/car_detail.html:48 templates/inventory/car_list.html:119 +#: templates/inventory/car_detail.html:65 templates/inventory/car_list.html:119 msgid "year" msgstr "السنة" -#: templates/inventory/car_detail.html:52 templates/inventory/car_form.html:137 +#: templates/inventory/car_detail.html:69 templates/inventory/car_form.html:137 #: templates/inventory/car_list.html:79 msgid "make" msgstr "الصانع" -#: templates/inventory/car_detail.html:61 templates/inventory/car_list.html:130 +#: templates/inventory/car_detail.html:78 templates/inventory/car_list.html:130 msgid "series" msgstr "السلسلة" -#: templates/inventory/car_detail.html:65 templates/inventory/car_form.html:199 +#: templates/inventory/car_detail.html:82 templates/inventory/car_form.html:199 #: templates/inventory/car_list.html:141 msgid "trim" msgstr "الفئة" -#: templates/inventory/car_detail.html:86 +#: templates/inventory/car_detail.html:103 msgid "Branch" msgstr "الفرع" -#: templates/inventory/car_detail.html:113 -#: templates/inventory/transfer_car.html:23 -msgid "transfer" -msgstr "نقل" +#: templates/inventory/car_detail.html:147 +msgid "Add" +msgstr "إضافة" -#: templates/inventory/car_detail.html:119 +#: templates/inventory/car_detail.html:156 msgid "Financial Details" msgstr "التفاصيل المالية" -#: templates/inventory/car_detail.html:143 +#: templates/inventory/car_detail.html:180 #: 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 @@ -1029,43 +1060,43 @@ msgstr "التفاصيل المالية" msgid "Total" msgstr "الإجمالي" -#: templates/inventory/car_detail.html:149 +#: templates/inventory/car_detail.html:187 msgid "Edit Finance Details" msgstr "تعديل التفاصيل المالية" -#: templates/inventory/car_detail.html:153 +#: templates/inventory/car_detail.html:191 msgid "No finance details available." msgstr "لا توجد تفاصيل مالية متاحة." -#: templates/inventory/car_detail.html:156 +#: templates/inventory/car_detail.html:194 msgid "Add Finance Details" msgstr "إضافة التفاصيل المالية" -#: templates/inventory/car_detail.html:159 +#: templates/inventory/car_detail.html:200 msgid "Colors Details" msgstr "تفاصيل الألوان" -#: templates/inventory/car_detail.html:185 +#: templates/inventory/car_detail.html:224 msgid "No colors available for this car." msgstr "لا تتوفر ألوان لهذه السيارة." -#: templates/inventory/car_detail.html:192 +#: templates/inventory/car_detail.html:231 msgid "Get Colors" msgstr "الحصول على الألوان" -#: templates/inventory/car_detail.html:199 +#: templates/inventory/car_detail.html:238 msgid "Reservations Details" msgstr "تفاصيل الحجز" -#: templates/inventory/car_detail.html:206 +#: templates/inventory/car_detail.html:243 msgid "Reserved By" msgstr "محجوز بواسطة" -#: templates/inventory/car_detail.html:207 +#: templates/inventory/car_detail.html:244 msgid "Expires At" msgstr "ينتهي في" -#: templates/inventory/car_detail.html:208 +#: templates/inventory/car_detail.html:245 #: templates/inventory/car_inventory.html:44 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/account/tags/account_txs_table.html:29 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/account/tags/accounts_table.html:29 @@ -1093,22 +1124,27 @@ msgstr "ينتهي في" msgid "Actions" msgstr "الإجراءات" -#: templates/inventory/car_detail.html:224 +#: templates/inventory/car_detail.html:260 msgid "renew" msgstr "تجديد" -#: templates/inventory/car_detail.html:239 +#: templates/inventory/car_detail.html:277 #: templates/inventory/reserve_car.html:29 msgid "Reserve" msgstr "حجز" -#: templates/inventory/car_detail.html:305 +#: templates/inventory/car_detail.html:289 +#: templates/inventory/transfer_car.html:23 +msgid "transfer" +msgstr "نقل" + +#: templates/inventory/car_detail.html:378 #: templates/inventory/car_list.html:542 #: templates/partials/specifications_modal.html:11 msgid "No specifications available." msgstr "لا توجد مواصفات متاحة." -#: templates/inventory/car_detail.html:309 +#: templates/inventory/car_detail.html:382 #: templates/inventory/car_list.html:546 msgid "Error loading specifications." msgstr "حدث خطأ أثناء تحميل المواصفات." @@ -1125,19 +1161,19 @@ msgstr "التفاصيل المالية السيارة" msgid "Finance Details for" msgstr "التفاصيل المالية لـ" -#: templates/inventory/car_finance_form.html:41 +#: templates/inventory/car_finance_form.html:36 msgid "Please provide a valid cost price." msgstr "يرجى تقديم سعر تكلفة صالح." -#: templates/inventory/car_finance_form.html:49 +#: templates/inventory/car_finance_form.html:43 msgid "Please provide a profit margin between 0 and 100." msgstr "يجب أن يكون هامش الربح بين 0 و 100" -#: templates/inventory/car_finance_form.html:57 +#: templates/inventory/car_finance_form.html:50 msgid "Please provide a valid VAT rate." msgstr "يرجى تقديم معدل صالح لضريبة القيمة المضافة." -#: templates/inventory/car_finance_form.html:77 +#: templates/inventory/car_finance_form.html:67 msgid "Save Finance Details" msgstr "حفظ التفاصيل المالية" @@ -1250,18 +1286,13 @@ msgstr "لا توجد سيارات متاحة." msgid "Error loading options." msgstr "خطأ في تحميل الخيارات." -#: templates/inventory/color_palette.html:55 -msgid "Add Color for" -msgstr "إضافة لون الى" - -#: templates/inventory/color_palette_update.html:4 -#: templates/inventory/color_palette_update.html:54 +#: templates/inventory/color_palette.html:74 msgid "Update Color" msgstr "تحديث اللون" -#: templates/inventory/color_palette_update.html:86 -msgid "Select Color" -msgstr "اختر اللون" +#: templates/inventory/color_palette.html:77 +msgid "Add Color for" +msgstr "إضافة لون الى" #: templates/inventory/inventory_stats.html:5 msgid "Inventory Statistics" @@ -1325,69 +1356,48 @@ msgstr "الماسح الضوئي" msgid "Specifications" msgstr "المواصفات" -#: templates/vendors/add_vendor.html:3 templates/vendors/add_vendor.html:6 -msgid "Add Supplier" -msgstr "إضافة مورد" +#: templates/vendors/vendor_form.html:14 +msgid "Edit Vendor" +msgstr "تحديث المورد" -#: templates/vendors/add_vendor.html:16 -msgid "Add" -msgstr "إضافة" - -#: templates/vendors/delete_vendor.html:3 -#: templates/vendors/delete_vendor.html:6 -msgid "Delete Supplier" -msgstr "حذف المورد" - -#: templates/vendors/delete_vendor.html:7 -msgid "Are you sure you want to delete this supplier?" -msgstr "هل أنت متأكد أنك تريد حذف هذا المورد؟" - -#: templates/vendors/edit_vendor.html:3 templates/vendors/edit_vendor.html:6 -msgid "Edit Supplier" -msgstr "تعديل المورد" - -#: templates/vendors/vendors_list.html:4 templates/vendors/vendors_list.html:5 -msgid "suppliers" -msgstr "الموردون" - -#: templates/vendors/vendors_list.html:15 -msgid "add supplier" -msgstr "إضافة مورد" - -#: templates/vendors/vendors_list.html:28 +#: templates/vendors/vendors_list.html:42 msgid "name" msgstr "الاسم" -#: templates/vendors/vendors_list.html:31 +#: templates/vendors/vendors_list.html:45 msgid "address" msgstr "العنوان" -#: templates/vendors/vendors_list.html:63 -msgid "no suppliers found" +#: templates/vendors/vendors_list.html:72 +msgid "no vendors found" msgstr "لم يتم العثور على موردين" -#: templates/vendors/vendors_list.html:73 +#: templates/vendors/vendors_list.html:82 msgid "first" msgstr "الأول" -#: templates/vendors/vendors_list.html:78 +#: templates/vendors/vendors_list.html:87 msgid "previous" msgstr "السابق" -#: templates/vendors/vendors_list.html:103 +#: templates/vendors/vendors_list.html:112 msgid "next" msgstr "التالي" -#: templates/vendors/vendors_list.html:108 +#: templates/vendors/vendors_list.html:117 msgid "last" msgstr "الأخير" #: templates/vendors/view_vendor.html:3 -msgid "View Supplier" +msgid "View Vendor" msgstr "عرض المورد" -#: templates/vendors/view_vendor.html:6 -msgid "Supplier Details" +#: templates/vendors/view_vendor.html:18 +msgid "Are you sure you want to delete this vendor?" +msgstr "هل أنت متأكد أنك تريد حذف هذا المورد؟" + +#: templates/vendors/view_vendor.html:37 +msgid "Vendor Details" msgstr "تفاصيل المورد" #: templates/welcome.html:4 @@ -3554,11 +3564,6 @@ msgstr "مقفل" msgid "Active" msgstr "نشط" -#: venv/lib/python3.11/site-packages/django_ledger/models/accounts.py:436 -#: venv/lib/python3.11/site-packages/django_ledger/models/coa.py:152 -msgid "Chart of Accounts" -msgstr "قائمة الحسابات" - #: venv/lib/python3.11/site-packages/django_ledger/models/accounts.py:443 #: venv/lib/python3.11/site-packages/django_ledger/models/transactions.py:485 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bank_account/bank_account_update.html:13 diff --git a/templates/customers/view_customer.html b/templates/customers/view_customer.html index 140e9b61..00956114 100644 --- a/templates/customers/view_customer.html +++ b/templates/customers/view_customer.html @@ -4,7 +4,7 @@ {% block title %}{{ _("View Customer") }}{% endblock title %} {% block content %} - +
-{% trans "add supplier"|capfirst %} -
-
- -
- -
+
+ +
+ + + + {% if request.GET.q %} + + + + {% endif %} +
+ +
- @@ -37,11 +51,7 @@ {% for vendor in page_obj.object_list %} {% endfor %} {% else %} - + {% endif %} diff --git a/templates/vendors/view_vendor.html b/templates/vendors/view_vendor.html index aa71cb0e..cd7299bc 100644 --- a/templates/vendors/view_vendor.html +++ b/templates/vendors/view_vendor.html @@ -1,24 +1,56 @@ {% extends 'base.html' %} {% load i18n %} -{% block title %}{% trans "View Supplier" %}{% endblock title %} +{% block title %}{% trans "View Vendor" %}{% endblock title %} {% block content %} + + +
-

{% trans "Supplier Details" %}

+

{% trans "Vendor Details" %}

  • {% trans "Name" %}: - {% if request.LANGUAGE_CODE == 'ar' %} - {{ vendor.name }} - {% else %} - {{ vendor.english_name }} - {% endif %} -
  • + {{ vendor.get_local_name }} +
  • {% trans "Contact Person" %}: {{ vendor.contact_person }}
  • {% trans "Phone Number" %}: {{ vendor.phone_number }}
  • {% trans "Email" %}: {{ vendor.email }}
  • {% trans "Address" %}: {{ vendor.address }}
- {% trans "Edit" %} - {% trans "Delete" %} + {% trans "Edit" %} + + + {{ _("Delete") }} +
{% endblock %}
- {% if request.LANGUAGE_CODE == 'ar' %} - {{ vendor.name }} - {% else %} - {{ vendor.english_name }} - {% endif %} + {{ vendor.get_local_name }} {% if vendor.logo %} @@ -52,15 +62,14 @@ {{ vendor.address }} - {% trans 'view'|capfirst %} -{# {% trans 'Edit' %}#} -{# {% trans 'Delete' %}#} + {% trans 'view'|capfirst %} +
{% trans 'no suppliers found'|capfirst %}{% trans 'no vendors found'|capfirst %}