diff --git a/core/__pycache__/context_processors.cpython-311.pyc b/core/__pycache__/context_processors.cpython-311.pyc index 268182e..98f88ae 100644 Binary files a/core/__pycache__/context_processors.cpython-311.pyc and b/core/__pycache__/context_processors.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index a26b97d..f34b198 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index f373a8f..09e0de8 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index b8fac4d..82f9e48 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/context_processors.py b/core/context_processors.py index 33b1942..5ce8c85 100644 --- a/core/context_processors.py +++ b/core/context_processors.py @@ -22,6 +22,9 @@ def global_settings(request): settings = SystemSetting.objects.first() if not settings: settings = SystemSetting.objects.create() - return {'site_settings': settings} + return { + 'site_settings': settings, + 'decimal_places': settings.decimal_places if settings else 3 + } except: - return {} \ No newline at end of file + return {'decimal_places': 3} \ No newline at end of file diff --git a/core/migrations/0012_systemsetting_decimal_places.py b/core/migrations/0012_systemsetting_decimal_places.py new file mode 100644 index 0000000..8a2c11a --- /dev/null +++ b/core/migrations/0012_systemsetting_decimal_places.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.7 on 2026-02-02 16:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0011_paymentmethod_purchasepayment_payment_method_name_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='systemsetting', + name='decimal_places', + field=models.PositiveSmallIntegerField(default=3, verbose_name='Decimal Places'), + ), + ] diff --git a/core/migrations/__pycache__/0012_systemsetting_decimal_places.cpython-311.pyc b/core/migrations/__pycache__/0012_systemsetting_decimal_places.cpython-311.pyc new file mode 100644 index 0000000..4e228af Binary files /dev/null and b/core/migrations/__pycache__/0012_systemsetting_decimal_places.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 697ec63..09650ba 100644 --- a/core/models.py +++ b/core/models.py @@ -275,9 +275,10 @@ class SystemSetting(models.Model): email = models.EmailField(_("Email"), blank=True) currency_symbol = models.CharField(_("Currency Symbol"), max_length=10, default="OMR") tax_rate = models.DecimalField(_("Tax Rate (%)"), max_digits=5, decimal_places=2, default=0) + decimal_places = models.PositiveSmallIntegerField(_("Decimal Places"), default=3) logo = models.ImageField(_("Logo"), upload_to="business_logos/", blank=True, null=True) vat_number = models.CharField(_("VAT Number"), max_length=50, blank=True) registration_number = models.CharField(_("Registration Number"), max_length=50, blank=True) def __str__(self): - return self.business_name \ No newline at end of file + return self.business_name diff --git a/core/templates/core/customers.html b/core/templates/core/customers.html index 85d777d..f32865c 100644 --- a/core/templates/core/customers.html +++ b/core/templates/core/customers.html @@ -34,7 +34,7 @@
| {% trans "Name" %} | @@ -65,89 +65,6 @@||||
|---|---|---|---|---|
|
-
- {% trans "No customers found." %} - |
- ||||