From 93a320716a1cac80de261f4ab64878bac4431d39 Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Tue, 8 Jul 2025 13:10:05 +0300 Subject: [PATCH 1/2] permissions issue in invoice_detail --- templates/ledger/coa_accounts/account_list.html | 2 +- templates/sales/invoices/invoice_detail.html | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/ledger/coa_accounts/account_list.html b/templates/ledger/coa_accounts/account_list.html index 6923a48f..1f4450a6 100644 --- a/templates/ledger/coa_accounts/account_list.html +++ b/templates/ledger/coa_accounts/account_list.html @@ -11,7 +11,7 @@

{% trans "Accounts" %}

- {% if perms.django_ledger.create_chartofaccountmodel %} + {% if perms.django_ledger.add_chartofaccountmodel %} {% trans 'New Account' %} {% endif %}
diff --git a/templates/sales/invoices/invoice_detail.html b/templates/sales/invoices/invoice_detail.html index ed16bd65..2b9c616f 100644 --- a/templates/sales/invoices/invoice_detail.html +++ b/templates/sales/invoices/invoice_detail.html @@ -82,16 +82,23 @@
+ {% if perms.django_ledger.change_invoicemodel%} {% if invoice.invoice_status == 'in_review' %} {% endif %} {% if invoice.invoice_status == 'approved' %} + {% if perms.inventory.add_payment%} {% trans 'Record Payment' %} + {% endif %} {% endif %} {% if not invoice.is_paid %} + {% if perms.inventory.change_payment%} + {% endif %} {% endif %} + {% endif %} {% trans 'Preview' %} +
{{invoice.amount_owned}} From 00eec4d325b491a65cd06128c358c3638d60e2be Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Tue, 8 Jul 2025 17:53:53 +0300 Subject: [PATCH 2/2] update --- inventory/models.py | 3 +- templates/bill/bill_detail.html | 3 +- templates/bill/bill_update.html | 45 ++--- templates/bill/includes/card_bill.html | 30 ++- templates/bill/tags/bill_item_formset.html | 2 +- .../purchase_orders/includes/card_po.html | 189 +++++++----------- templates/purchase_orders/po_detail.html | 70 +------ 7 files changed, 129 insertions(+), 213 deletions(-) diff --git a/inventory/models.py b/inventory/models.py index 95a447e5..aecd91f0 100644 --- a/inventory/models.py +++ b/inventory/models.py @@ -2703,7 +2703,8 @@ class CustomGroup(models.Model): "carfinance", "notes", "tasks", - "activity",], + "activity", + "payment"], other_perms=[ "view_car", "view_carlocation", diff --git a/templates/bill/bill_detail.html b/templates/bill/bill_detail.html index 0ecab405..5de0d08e 100644 --- a/templates/bill/bill_detail.html +++ b/templates/bill/bill_detail.html @@ -43,8 +43,7 @@
{% include 'bill/includes/card_bill.html' with dealer_slug=request.dealer.slug bill=bill entity_slug=view.kwargs.entity_slug style='bill-detail' %} -
- {% include 'bill/includes/card_vendor.html' with vendor=bill.vendor %} +
diff --git a/templates/bill/bill_update.html b/templates/bill/bill_update.html index 80417b15..1e38b52e 100644 --- a/templates/bill/bill_update.html +++ b/templates/bill/bill_update.html @@ -7,30 +7,18 @@ {% block content %}
-
- -
- {% include 'bill/includes/card_vendor.html' with vendor=bill_model.vendor %} -
+
+ + + +
{% bill_item_formset_table itemtxs_formset %} diff --git a/templates/bill/includes/card_bill.html b/templates/bill/includes/card_bill.html index c70b13d2..90d9933c 100644 --- a/templates/bill/includes/card_bill.html +++ b/templates/bill/includes/card_bill.html @@ -90,7 +90,7 @@ {% elif style == 'bill-detail' %}
-
+

@@ -98,10 +98,14 @@

-
+
{% if bill.is_draft %}

{% trans 'This bill is' %} {{ bill.get_bill_status_display }}

-
+

+ {% trans 'Vendor Name' %}: + {{ bill.vendor.vendor_name }} +

+

{% trans 'Amount Due' %}: {% currency_symbol %}{{ bill.amount_due | currency_format }} @@ -121,7 +125,11 @@

{% elif bill.is_review %}

{% trans 'This bill is' %} {{ bill.get_bill_status_display }}

-
+

+ {% trans 'Vendor Name' %}: + {{ bill.vendor.vendor_name }} +

+

{% trans 'Amount Due' %}: {% currency_symbol %}{{ bill.amount_due | currency_format }} @@ -144,7 +152,11 @@ {% endif %} {% elif bill.is_approved %}

{% trans 'This bill is' %} {{ bill.get_bill_status_display }}

-
+

+ {% trans 'Vendor Name' %}: + {{ bill.vendor.vendor_name }} +

+

{% trans 'Amount Due' %}: {% currency_symbol %}{{ bill.amount_due | currency_format }} @@ -176,7 +188,11 @@ {% endif %} {% elif bill.is_paid %}

{% trans 'This bill is' %} {{ bill.get_bill_status_display }}

-
+

+ {% trans 'Vendor Name' %}: + {{ bill.vendor.vendor_name }} +

+

{% trans 'Amount Paid' %}: {% currency_symbol %}{{ bill.amount_paid | currency_format }} @@ -190,7 +206,7 @@

{% trans 'External Ref' %}: {{ bill.xref }}

{% endif %} {% else %} -
+

{% trans 'Bill Amount' %}: {% currency_symbol %}{{ bill.amount_due | currency_format }} diff --git a/templates/bill/tags/bill_item_formset.html b/templates/bill/tags/bill_item_formset.html index d7978ae6..5737e81a 100644 --- a/templates/bill/tags/bill_item_formset.html +++ b/templates/bill/tags/bill_item_formset.html @@ -140,7 +140,7 @@

-
+
{% if not item_formset.has_po %} diff --git a/templates/purchase_orders/includes/card_po.html b/templates/purchase_orders/includes/card_po.html index 8d718e0e..bca2e91f 100644 --- a/templates/purchase_orders/includes/card_po.html +++ b/templates/purchase_orders/includes/card_po.html @@ -32,134 +32,87 @@ {% if not create_po %} {% if style == 'po-detail' %}
-
-
- - {% icon 'uil:bill' 36 %} - -

- {{ po_model.po_number }} -

-
-
+
+
+ + {% icon 'uil:bill' 36 %} + +

+ {{ po_model.po_number }} +

+
+
-
-

+
+
+ +
+

{{ po_model.get_po_status_display }}

+
- {# Display PO Contract Information #} - {% if po_model.is_contract_bound %} -
+ +
+ {% if po_model.is_draft %} +
{% trans 'Draft Date' %}
+

{{ po_model.date_draft|date }}

{% endif %} -
- {% if po_model.is_draft %} -
-
-
-
{% trans 'Draft Date' %}
-

{{ po_model.date_draft|date }}

-
-
-
-
-
-
-
{% trans 'Purchase Order Amount' %}
-

{{CURRENCY}}{{ po_model.po_amount|currency_format }}

-
-
-
- {% endif %} + {% if po_model.is_review %} +
{% trans 'Review Date' %}
+

{{ po_model.date_in_review|date }}

+ {% endif %} - {% if po_model.is_review %} -
-
-
-
{% trans 'Review Date' %}
-

{{ po_model.date_in_review|date }}

-
-
-
-
-
-
-
{% trans 'Purchase Order Amount' %}
-

{{CURRENCY}}{{ po_model.po_amount|currency_format }}

-
-
-
- {% endif %} + {% if po_model.is_approved %} +
{% trans 'Approved Date' %}
+

{{ po_model.date_approved|date }}

+ {% endif %} - {% if po_model.is_approved %} -
-
-
-
{% trans 'Approved Date' %}
-

{{ po_model.date_approved|date }}

-
-
-
-
-
-
-
{% trans 'PO Amount' %}
-

{{ po_model.po_amount|currency_format }}{{CURRENCY}}

-
-
-
-
-
-
-
{% trans 'Received Amount' %}
-

{{ po_model.po_amount_received|currency_format }}{{CURRENCY}}

-
-
-
- {% endif %} + {% if po_model.is_fulfilled %} +
{% trans 'Fulfilled Date' %}
+

{{ po_model.date_fulfilled|date }}

+ {% endif %} +
- {% if po_model.is_fulfilled %} -
-
-
-
{% trans 'Fulfilled Date' %}
-

{{ po_model.date_fulfilled|date }}

-
-
+ +
+
+
+
+
{% trans 'PO Amount' %}
+

+ {{CURRENCY}}{{ po_model.po_amount | absolute | currency_format }} +

-
-
-
-
{% trans 'PO Amount' %}
-
-

{{CURRENCY}}{{ po_model.po_amount|currency_format }}

- - {% trans 'Fulfilled' %} - -
-
-
+
+
+
{% trans 'Amount Received' %}
+

+ {{CURRENCY}}{{ po_model.po_amount_received | currency_format }} +

- {% endif %} +
+ + +
+
+ + +