diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index f34b198..9998128 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 09e0de8..7d3121c 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 82f9e48..97afd4a 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/migrations/0013_heldsale.py b/core/migrations/0013_heldsale.py new file mode 100644 index 0000000..3850c0a --- /dev/null +++ b/core/migrations/0013_heldsale.py @@ -0,0 +1,28 @@ +# Generated by Django 5.2.7 on 2026-02-02 16:38 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0012_systemsetting_decimal_places'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='HeldSale', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('cart_data', models.JSONField(verbose_name='Cart Data')), + ('total_amount', models.DecimalField(decimal_places=3, max_digits=15, verbose_name='Total Amount')), + ('notes', models.TextField(blank=True, verbose_name='Notes')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='held_sales', to=settings.AUTH_USER_MODEL)), + ('customer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='held_sales', to='core.customer')), + ], + ), + ] diff --git a/core/migrations/__pycache__/0013_heldsale.cpython-311.pyc b/core/migrations/__pycache__/0013_heldsale.cpython-311.pyc new file mode 100644 index 0000000..6e6f10f Binary files /dev/null and b/core/migrations/__pycache__/0013_heldsale.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 09650ba..71a240b 100644 --- a/core/models.py +++ b/core/models.py @@ -268,6 +268,17 @@ class PurchaseReturnItem(models.Model): def __str__(self): return f"{self.product.name_en} x {self.quantity}" +class HeldSale(models.Model): + customer = models.ForeignKey(Customer, on_delete=models.SET_NULL, null=True, blank=True, related_name="held_sales") + cart_data = models.JSONField(_("Cart Data")) + total_amount = models.DecimalField(_("Total Amount"), max_digits=15, decimal_places=3) + notes = models.TextField(_("Notes"), blank=True) + created_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True, related_name="held_sales") + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f"Held Sale #{self.id} - {self.created_at.strftime('%Y-%m-%d %H:%M')}" + class SystemSetting(models.Model): business_name = models.CharField(_("Business Name"), max_length=200, default="Meezan Accounting") address = models.TextField(_("Address"), blank=True) @@ -281,4 +292,4 @@ class SystemSetting(models.Model): registration_number = models.CharField(_("Registration Number"), max_length=50, blank=True) def __str__(self): - return self.business_name + return self.business_name \ No newline at end of file diff --git a/core/templates/core/inventory.html b/core/templates/core/inventory.html index 8f20e80..265af33 100644 --- a/core/templates/core/inventory.html +++ b/core/templates/core/inventory.html @@ -78,7 +78,7 @@ @@ -118,13 +118,14 @@ {% endif %}
-
{% if LANGUAGE_CODE == 'ar' %}{{ product.name_ar }}{% else %}{{ product.name_en }}{% endif %}
- {{ product.unit.name_en|default:"" }} +
{{ product.name_ar }}
+
{{ product.name_en }}
+ {{ product.unit.name_ar|default:"" }} / {{ product.unit.name_en|default:"" }}
{{ product.sku }} - {% if LANGUAGE_CODE == 'ar' %}{{ product.category.name_ar }}{% else %}{{ product.category.name_en }}{% endif %} + {{ product.category.name_ar }} / {{ product.category.name_en }} {{ product.stock_quantity }} {{ product.unit.short_name|default:"" }} @@ -348,7 +349,7 @@ @@ -357,7 +358,7 @@ diff --git a/core/templates/core/invoice_detail.html b/core/templates/core/invoice_detail.html index 36373ff..9cd927a 100644 --- a/core/templates/core/invoice_detail.html +++ b/core/templates/core/invoice_detail.html @@ -112,8 +112,8 @@ {% for item in sale.items.all %} -
{{ item.product.name_en }}
-
{{ item.product.name_ar }}
+
{{ item.product.name_ar }}
+
{{ item.product.name_en }}
{{ settings.currency_symbol }}{{ item.unit_price|floatformat:3 }} {{ item.quantity }} @@ -189,7 +189,7 @@ {{ payment.payment_date|date:"Y-m-d" }} {% if payment.payment_method %} - {% if LANGUAGE_CODE == 'ar' %}{{ payment.payment_method.name_ar }}{% else %}{{ payment.payment_method.name_en }}{% endif %} + {{ payment.payment_method.name_ar }} / {{ payment.payment_method.name_en }} {% else %} {{ payment.payment_method_name }} {% endif %} diff --git a/core/templates/core/pos.html b/core/templates/core/pos.html index ed920ca..7e2d2b4 100644 --- a/core/templates/core/pos.html +++ b/core/templates/core/pos.html @@ -48,11 +48,14 @@ .product-name { font-size: 0.75rem; line-height: 1.2; - height: 2.4em; + height: auto; overflow: hidden; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; + } + + .payment-method-btn.active { + background-color: var(--bs-primary); + color: white; + border-color: var(--bs-primary); } /* Invoice Print Styles */ @@ -127,7 +130,7 @@
{% trans "All" %}
{% for category in categories %}
- {% if LANGUAGE_CODE == 'ar' %}{{ category.name_ar }}{% else %}{{ category.name_en }}{% endif %} + {{ category.name_ar }} / {{ category.name_en }}
{% endfor %} @@ -145,7 +148,8 @@ {% endif %}
- {% if LANGUAGE_CODE == 'ar' %}{{ product.name_ar }}{% else %}{{ product.name_en }}{% endif %} +
{{ product.name_ar }}
+
{{ product.name_en }}

{{ site_settings.currency_symbol }}{{ product.price|floatformat:decimal_places }}

{% trans "Stock" %}: {{ product.stock_quantity }} @@ -161,9 +165,15 @@
{% trans "Current Order" %}
- +
+ + +
@@ -207,18 +217,18 @@ {{ site_settings.currency_symbol }}0.000
-
- - +
+
+ +
+
+ +
- -
@@ -257,6 +267,109 @@ + + + + + +
@@ -336,6 +449,7 @@