Merge pull request 'Changed the PO detail and the salesorder page' (#116) from frontend into main
Reviewed-on: #116
This commit is contained in:
commit
c2642fea78
@ -2554,6 +2554,15 @@ class CustomGroup(models.Model):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def set_default_permissions(self):
|
def set_default_permissions(self):
|
||||||
|
Permission.objects.get_or_create(name="Can approve estimate",codename="can_approve_estimatemodel",content_type=ContentType.objects.get_for_model(EstimateModel))
|
||||||
|
Permission.objects.get_or_create(name="Can approve bill",codename="can_approve_billmodel",content_type=ContentType.objects.get_for_model(BillModel))
|
||||||
|
|
||||||
|
Permission.objects.get_or_create(name="Can view inventory",codename="can_view_inventory",content_type=ContentType.objects.get_for_model(Car))
|
||||||
|
Permission.objects.get_or_create(name="Can view sales",codename="can_view_sales",content_type=ContentType.objects.get_for_model(EstimateModel))
|
||||||
|
Permission.objects.get_or_create(name="Can view crm",codename="can_view_crm",content_type=ContentType.objects.get_for_model(Lead))
|
||||||
|
Permission.objects.get_or_create(name="Can view financials",codename="can_view_financials",content_type=ContentType.objects.get_for_model(AccountModel))
|
||||||
|
Permission.objects.get_or_create(name="Can view reports",codename="can_view_reports",content_type=ContentType.objects.get_for_model(LedgerModel))
|
||||||
|
|
||||||
self.clear_permissions()
|
self.clear_permissions()
|
||||||
######################################
|
######################################
|
||||||
######################################
|
######################################
|
||||||
@ -2637,7 +2646,7 @@ class CustomGroup(models.Model):
|
|||||||
allowed_models=[],
|
allowed_models=[],
|
||||||
other_perms=[
|
other_perms=[
|
||||||
"view_purchaseordermodel",
|
"view_purchaseordermodel",
|
||||||
"can_view_financials",
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
######################################
|
######################################
|
||||||
@ -2658,6 +2667,7 @@ class CustomGroup(models.Model):
|
|||||||
"staff",
|
"staff",
|
||||||
"schedule",
|
"schedule",
|
||||||
"activity",
|
"activity",
|
||||||
|
"lead",
|
||||||
"opportunity",
|
"opportunity",
|
||||||
"customer",
|
"customer",
|
||||||
"organization",
|
"organization",
|
||||||
@ -2693,10 +2703,7 @@ class CustomGroup(models.Model):
|
|||||||
"carfinance",
|
"carfinance",
|
||||||
"notes",
|
"notes",
|
||||||
"tasks",
|
"tasks",
|
||||||
"activity",
|
"activity",],
|
||||||
"vendor",
|
|
||||||
"poitemsuploaded"
|
|
||||||
],
|
|
||||||
other_perms=[
|
other_perms=[
|
||||||
"view_car",
|
"view_car",
|
||||||
"view_carlocation",
|
"view_carlocation",
|
||||||
@ -2704,6 +2711,7 @@ class CustomGroup(models.Model):
|
|||||||
"view_carcolors",
|
"view_carcolors",
|
||||||
"view_cartransfer",
|
"view_cartransfer",
|
||||||
"view_saleorder",
|
"view_saleorder",
|
||||||
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
self.set_permissions(
|
self.set_permissions(
|
||||||
@ -2715,6 +2723,7 @@ class CustomGroup(models.Model):
|
|||||||
"itemmodel",
|
"itemmodel",
|
||||||
"invoicemodel",
|
"invoicemodel",
|
||||||
"vendormodel",
|
"vendormodel",
|
||||||
|
|
||||||
"journalentrymodel",
|
"journalentrymodel",
|
||||||
"purchaseordermodel",
|
"purchaseordermodel",
|
||||||
"estimatemodel",
|
"estimatemodel",
|
||||||
@ -2972,22 +2981,4 @@ class ExtraInfo(models.Model):
|
|||||||
verbose_name_plural = "Extra Info"
|
verbose_name_plural = "Extra Info"
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"ExtraInfo for {self.content_object} ({self.content_type})"
|
return f"ExtraInfo for {self.content_object} ({self.content_type})"
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_sale_orders(cls, staff=None,is_dealer=False):
|
|
||||||
if not staff and not is_dealer:
|
|
||||||
return []
|
|
||||||
if is_dealer:
|
|
||||||
qs = ExtraInfo.objects.filter(
|
|
||||||
content_type=ContentType.objects.get_for_model(EstimateModel),
|
|
||||||
related_content_type=ContentType.objects.get_for_model(Staff),
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
qs = ExtraInfo.objects.filter(
|
|
||||||
content_type=ContentType.objects.get_for_model(EstimateModel),
|
|
||||||
related_content_type=ContentType.objects.get_for_model(Staff),
|
|
||||||
related_object_id=staff.pk,
|
|
||||||
)
|
|
||||||
|
|
||||||
return [x.content_object.sale_orders.first for x in qs]
|
|
||||||
@ -963,7 +963,11 @@ def create_po_fulfilled_notification(sender,instance,created,**kwargs):
|
|||||||
@receiver(post_save, sender=models.Car)
|
@receiver(post_save, sender=models.Car)
|
||||||
def car_created_notification(sender, instance, created, **kwargs):
|
def car_created_notification(sender, instance, created, **kwargs):
|
||||||
if created:
|
if created:
|
||||||
|
<<<<<<< HEAD
|
||||||
|
accountants = models.CustomGroup.objects.filter(dealer=instance.dealer,name__in=["Manager","Accountant","Inventory"]).first().group.user_set.all().distinct()
|
||||||
|
=======
|
||||||
accountants = models.CustomGroup.objects.filter(dealer=instance.dealer,name__in=["Manager","Accountant"]).first().group.user_set.all().distinct()
|
accountants = models.CustomGroup.objects.filter(dealer=instance.dealer,name__in=["Manager","Accountant"]).first().group.user_set.all().distinct()
|
||||||
|
>>>>>>> b23e84331fbb3a8ce0814a04b68cd3380b93d3a2
|
||||||
for accountant in accountants:
|
for accountant in accountants:
|
||||||
models.Notification.objects.create(
|
models.Notification.objects.create(
|
||||||
user=accountant,
|
user=accountant,
|
||||||
@ -972,6 +976,9 @@ def car_created_notification(sender, instance, created, **kwargs):
|
|||||||
<a href="{instance.get_absolute_url()}" target="_blank">View</a>
|
<a href="{instance.get_absolute_url()}" target="_blank">View</a>
|
||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@receiver(post_save, sender=PurchaseOrderModel)
|
@receiver(post_save, sender=PurchaseOrderModel)
|
||||||
def po_fullfilled_notification(sender, instance, created, **kwargs):
|
def po_fullfilled_notification(sender, instance, created, **kwargs):
|
||||||
if instance.is_fulfilled():
|
if instance.is_fulfilled():
|
||||||
|
|||||||
@ -8678,9 +8678,8 @@ class LedgerModelCreateView(LedgerModelCreateViewBase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
dealer = get_user_type(self.request)
|
dealer = get_user_type(self.request)
|
||||||
instance = form.save(commit=False)
|
form.field["entity"] = dealer.entity
|
||||||
instance.entity = dealer.entity
|
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
@ -10052,7 +10051,6 @@ class BillModelActionForceMigrateView(BaseBillActionView):
|
|||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required("inventory.view_poitemsuploaded", raise_exception=True)
|
|
||||||
def view_items_inventory(request, dealer_slug, entity_slug, po_pk):
|
def view_items_inventory(request, dealer_slug, entity_slug, po_pk):
|
||||||
get_object_or_404(models.Dealer, slug=dealer_slug)
|
get_object_or_404(models.Dealer, slug=dealer_slug)
|
||||||
po = PurchaseOrderModel.objects.get(pk=po_pk)
|
po = PurchaseOrderModel.objects.get(pk=po_pk)
|
||||||
|
|||||||
@ -184,10 +184,12 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="align-items-start white-space-nowrap pe-2">
|
<td class="align-items-start white-space-nowrap pe-2">
|
||||||
{% if bill_item.po_model_id %}
|
{% if bill_item.po_model_id %}
|
||||||
|
{% if perms.django_ledger.view_purchaseordermodel%}
|
||||||
<a class="btn btn-sm btn-phoenix-primary"
|
<a class="btn btn-sm btn-phoenix-primary"
|
||||||
href="{% url 'purchase_order_detail' request.dealer.slug request.dealer.entity.slug bill_item.po_model_id %}">
|
href="{% url 'purchase_order_detail' request.dealer.slug request.dealer.entity.slug bill_item.po_model_id %}">
|
||||||
{% trans 'View PO' %}
|
{% trans 'View PO' %}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -231,9 +233,11 @@
|
|||||||
<h5 class="mb-0">{% trans 'Bill Notes' %}</h5>
|
<h5 class="mb-0">{% trans 'Bill Notes' %}</h5>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if perms.django_ledger.change_billmodel%}
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{% include 'bill/includes/card_markdown.html' with style='card_1' title='' notes_html=bill.notes_html %}
|
{% include 'bill/includes/card_markdown.html' with style='card_1' title='' notes_html=bill.notes_html %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -291,7 +291,7 @@
|
|||||||
<div class="tab-pane fade" id="tab-notes" role="tabpanel" aria-labelledby="notes-tab">
|
<div class="tab-pane fade" id="tab-notes" role="tabpanel" aria-labelledby="notes-tab">
|
||||||
<div class="mb-1 d-flex align-items-center justify-content-between">
|
<div class="mb-1 d-flex align-items-center justify-content-between">
|
||||||
<h3 class="mb-4" id="scrollspyNotes">{{ _("Notes") }}</h3>
|
<h3 class="mb-4" id="scrollspyNotes">{{ _("Notes") }}</h3>
|
||||||
{% if perms.inventory.change_lead%}
|
{% if perms.inventory.change_lead %}
|
||||||
<button class="btn btn-phoenix-primary btn-sm" type="button" onclick="reset_form()" data-bs-toggle="modal" data-bs-target="#noteModal"><span class="fas fa-plus me-1"></span>{{ _("Add Note") }}</button>
|
<button class="btn btn-phoenix-primary btn-sm" type="button" onclick="reset_form()" data-bs-toggle="modal" data-bs-target="#noteModal"><span class="fas fa-plus me-1"></span>{{ _("Add Note") }}</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -52,16 +52,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer d-flex ">
|
<div class="card-footer d-flex ">
|
||||||
|
{% if perms.django_ledger.change_bankaccountmodel%}
|
||||||
<a class="btn btn-sm btn-phoenix-primary me-1" href="{% url 'bank_account_update' request.dealer.slug bank_account.pk %}">
|
<a class="btn btn-sm btn-phoenix-primary me-1" href="{% url 'bank_account_update' request.dealer.slug bank_account.pk %}">
|
||||||
<!--<i class="bi bi-pencil-square"></i> -->
|
<!--<i class="bi bi-pencil-square"></i> -->
|
||||||
{{ _("Edit") }}
|
{{ _("Edit") }}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if perms.django_ledger.delete_bankaccountmodel%}
|
||||||
<a class="btn btn-sm btn-phoenix-danger me-1"
|
<a class="btn btn-sm btn-phoenix-danger me-1"
|
||||||
data-bs-toggle="modal"
|
data-bs-toggle="modal"
|
||||||
data-bs-target="#deleteModal">
|
data-bs-target="#deleteModal">
|
||||||
<!--<i class="bi bi-trash-fill"></i>-->
|
<!--<i class="bi bi-trash-fill"></i>-->
|
||||||
{{ _("Delete") }}
|
{{ _("Delete") }}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
<a class="btn btn-sm btn-phoenix-secondary"
|
<a class="btn btn-sm btn-phoenix-secondary"
|
||||||
href="{% url 'bank_account_list' request.dealer.slug %}">
|
href="{% url 'bank_account_list' request.dealer.slug %}">
|
||||||
<!--<i class="bi bi-arrow-left-square-fill"></i>-->
|
<!--<i class="bi bi-arrow-left-square-fill"></i>-->
|
||||||
|
|||||||
@ -96,12 +96,14 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle white-space-nowrap text-start">
|
<td class="align-middle white-space-nowrap text-start">
|
||||||
|
{% if perms.django_ledger.view_transactionmodel%}
|
||||||
<div class="btn-reveal-trigger position-static">
|
<div class="btn-reveal-trigger position-static">
|
||||||
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10" type="button" data-bs-toggle="dropdown" data-boundary="window" aria-haspopup="true" aria-expanded="false" data-bs-reference="parent"><span class="fas fa-ellipsis-h fs-10"></span></button>
|
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10" type="button" data-bs-toggle="dropdown" data-boundary="window" aria-haspopup="true" aria-expanded="false" data-bs-reference="parent"><span class="fas fa-ellipsis-h fs-10"></span></button>
|
||||||
<div class="dropdown-menu dropdown-menu-end py-2">
|
<div class="dropdown-menu dropdown-menu-end py-2">
|
||||||
<a class="dropdown-item text-success-dark" href="{% url 'payment_details' request.dealer.slug tx.journal_entry.pk %}">{% trans 'view Transactions'|capfirst %}</a>
|
<a class="dropdown-item text-success-dark" href="{% url 'payment_details' request.dealer.slug tx.journal_entry.pk %}">{% trans 'view Transactions'|capfirst %}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -135,17 +137,21 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-3 d-flex">
|
<div class="mt-3 d-flex">
|
||||||
|
{% if perms.django_ledger.change_chartofaccountmodel%}
|
||||||
<a class="btn btn-sm btn-phoenix-primary me-1" href="{% url 'account_update' request.dealer.slug account.pk %}">
|
<a class="btn btn-sm btn-phoenix-primary me-1" href="{% url 'account_update' request.dealer.slug account.pk %}">
|
||||||
<!-- <i class="bi bi-pencil-square"></i> -->
|
<!-- <i class="bi bi-pencil-square"></i> -->
|
||||||
<i class="fa-solid fa-pen-to-square"></i> {{ _('Edit') }}
|
<i class="fa-solid fa-pen-to-square"></i> {{ _('Edit') }}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if perms.django_ledger.delete_chartofaccountmodel%}
|
||||||
<a class="btn btn-sm btn-phoenix-danger me-1" data-bs-toggle="modal" data-bs-target="#deleteModal">
|
<a class="btn btn-sm btn-phoenix-danger me-1" data-bs-toggle="modal" data-bs-target="#deleteModal">
|
||||||
<!-- <i class="bi bi-trash-fill"></i> -->
|
<!-- <i class="bi bi-trash-fill"></i> -->
|
||||||
<i class="fa-solid fa-trash"></i> {{ _('Delete') }}
|
<i class="fa-solid fa-trash"></i> {{ _('Delete') }}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif%}
|
||||||
<a class="btn btn-sm btn-phoenix-secondary" href="{% url 'account_list' request.dealer.slug %}">
|
<a class="btn btn-sm btn-phoenix-secondary" href="{% url 'account_list' request.dealer.slug %}">
|
||||||
<!-- <i class="bi bi-arrow-left-square-fill"></i> -->
|
<!-- <i class="bi bi-arrow-left-square-fill"></i> -->
|
||||||
<i class="fa-regular fa-circle-left"></i> {% trans 'Back to List' %}
|
<i class="fa-regular fa-circle-left"></i> {% trans 'Back to COA List' %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,9 @@
|
|||||||
<div class="row mt-4">
|
<div class="row mt-4">
|
||||||
<div class="d-flex justify-content-between mb-2">
|
<div class="d-flex justify-content-between mb-2">
|
||||||
<h3 class=""><i class="fa-solid fa-book"></i> {% trans "Accounts" %}</h3>
|
<h3 class=""><i class="fa-solid fa-book"></i> {% trans "Accounts" %}</h3>
|
||||||
|
{% if perms.django_ledger.create_chartofaccountmodel %}
|
||||||
<a href="{% url 'account_create' request.dealer.slug %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans 'New Account' %}</a>
|
<a href="{% url 'account_create' request.dealer.slug %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans 'New Account' %}</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Account Type Tabs -->
|
<!-- Account Type Tabs -->
|
||||||
@ -105,10 +107,12 @@
|
|||||||
<div class="modal-dialog modal-sm">
|
<div class="modal-dialog modal-sm">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
{% if perms.django_ledger.delete_chartofaccountmodel %}
|
||||||
<h5 class="modal-title" id="deleteModalLabel">
|
<h5 class="modal-title" id="deleteModalLabel">
|
||||||
{% trans "Delete Account" %}
|
{% trans "Delete Account" %}
|
||||||
<span data-feather="alert-circle"></span>
|
<span data-feather="alert-circle"></span>
|
||||||
</h5>
|
</h5>
|
||||||
|
{% endif %}
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body text-center">
|
<div class="modal-body text-center">
|
||||||
|
|||||||
@ -10,7 +10,9 @@
|
|||||||
|
|
||||||
<div class="d-flex justify-content-between mb-2">
|
<div class="d-flex justify-content-between mb-2">
|
||||||
<h3 class="">{% trans "Ledger" %}</h3>
|
<h3 class="">{% trans "Ledger" %}</h3>
|
||||||
|
{% if perms.django_ledger.add_ledgermodel %}
|
||||||
<a href="{% url 'ledger_create' request.dealer.slug request.dealer.entity.slug %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans 'Create Ledger' %}</a>
|
<a href="{% url 'ledger_create' request.dealer.slug request.dealer.entity.slug %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans 'Create Ledger' %}</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive px-1 scrollbar mt-3">
|
<div class="table-responsive px-1 scrollbar mt-3">
|
||||||
<table class="table align-items-center table-flush">
|
<table class="table align-items-center table-flush">
|
||||||
@ -32,14 +34,19 @@
|
|||||||
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
|
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
|
||||||
<td class="align-middle product white-space-nowrap px-1">
|
<td class="align-middle product white-space-nowrap px-1">
|
||||||
{% if ledger.invoicemodel %}
|
{% if ledger.invoicemodel %}
|
||||||
|
{% if perms.django_ledger.view_invoicemodel%}
|
||||||
<a href="{% url 'invoice_detail' request.dealer.slug ledger.invoicemodel.pk %}">{{ ledger.get_wrapped_model_instance }}</a>
|
<a href="{% url 'invoice_detail' request.dealer.slug ledger.invoicemodel.pk %}">{{ ledger.get_wrapped_model_instance }}</a>
|
||||||
|
{% endif %}
|
||||||
{% elif ledger.billmodel %}
|
{% elif ledger.billmodel %}
|
||||||
|
{% if perms.django_ledger.view_billmodel %}
|
||||||
<a href="{% url 'bill-detail' request.dealer.slug request.dealer.entity.slug ledger.billmodel.pk %}">{{ ledger.get_wrapped_model_instance }}</a>
|
<a href="{% url 'bill-detail' request.dealer.slug request.dealer.entity.slug ledger.billmodel.pk %}">{{ ledger.get_wrapped_model_instance }}</a>
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="#">{{ ledger.name }}</a>
|
<a href="#">{{ ledger.name }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle product white-space-nowrap">
|
<td class="align-middle product white-space-nowrap">
|
||||||
|
{% if perms.django_ledger.view_journalentrymodel %}
|
||||||
<a class="btn btn-sm btn-phoenix-primary"
|
<a class="btn btn-sm btn-phoenix-primary"
|
||||||
href="{% url 'journalentry_list' request.dealer.slug ledger.pk %}">
|
href="{% url 'journalentry_list' request.dealer.slug ledger.pk %}">
|
||||||
<i class="fa-solid fa-right-left"></i>
|
<i class="fa-solid fa-right-left"></i>
|
||||||
@ -48,6 +55,7 @@
|
|||||||
<span>{{ _('Journal Entries') }}</span>
|
<span>{{ _('Journal Entries') }}</span>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle product white-space-nowrap">
|
<td class="align-middle product white-space-nowrap">
|
||||||
{{ ledger.created |date }}
|
{{ ledger.created |date }}
|
||||||
@ -79,6 +87,7 @@
|
|||||||
<span class="fas fa-ellipsis-h fs-10"></span>
|
<span class="fas fa-ellipsis-h fs-10"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu dropdown-menu-end py-2">
|
<div class="dropdown-menu dropdown-menu-end py-2">
|
||||||
|
{% if perms.django_ledger.change_ledgermodel%}
|
||||||
{% if ledger.can_lock %}
|
{% if ledger.can_lock %}
|
||||||
<a href="{% url 'ledger-action-lock' dealer_slug=request.dealer.slug entity_slug=entity_slug ledger_pk=ledger.uuid %}"
|
<a href="{% url 'ledger-action-lock' dealer_slug=request.dealer.slug entity_slug=entity_slug ledger_pk=ledger.uuid %}"
|
||||||
class="dropdown-item has-text-info has-text-weight-bold">{% trans 'Lock' %}</a>
|
class="dropdown-item has-text-info has-text-weight-bold">{% trans 'Lock' %}</a>
|
||||||
@ -109,6 +118,7 @@
|
|||||||
<a href="{% url 'ledger-delete' dealer_slug=request.dealer.slug entity_slug=entity_slug ledger_pk=ledger.uuid %}"
|
<a href="{% url 'ledger-delete' dealer_slug=request.dealer.slug entity_slug=entity_slug ledger_pk=ledger.uuid %}"
|
||||||
class="dropdown-item has-text-danger has-text-weight-bold text-danger">{% trans 'Delete' %}</a>
|
class="dropdown-item has-text-danger has-text-weight-bold text-danger">{% trans 'Delete' %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -8,45 +8,61 @@
|
|||||||
<div class="container-fluid mt-4">
|
<div class="container-fluid mt-4">
|
||||||
<div class="row g-1">
|
<div class="row g-1">
|
||||||
|
|
||||||
<div class="col-lg-12">
|
|
||||||
<div class="d-flex flex-column gap-3">
|
<div class="col-lg-12 mb-3 ">
|
||||||
<div class="card">
|
<div class="row">
|
||||||
<div class="card-body">
|
|
||||||
{% include 'purchase_orders/includes/card_po.html' with dealer_slug=request.dealer.slug po_model=po_model entity_slug=entity_slug style='po-detail' %}
|
<div class="col-9">
|
||||||
</div>
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
{% include 'purchase_orders/includes/card_po.html' with dealer_slug=request.dealer.slug po_model=po_model entity_slug=entity_slug style='po-detail' %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='col-3'>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row text-center">
|
||||||
|
<div class="col-md-6 border-end">
|
||||||
|
<div class="p-2">
|
||||||
|
<h6 class="text-muted mb-2">{% trans 'PO Amount' %}</h6>
|
||||||
|
<h3 class="fw-light mb-0">
|
||||||
|
<span class="currency">{{CURRENCY}}</span>{{ po_model.po_amount | absolute | currency_format }}
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="p-2">
|
||||||
|
<h6 class="text-muted mb-2">{% trans 'Amount Received' %}</h6>
|
||||||
|
<h3 class="fw-light mb-0 text-success">
|
||||||
|
<span class="currency">{{CURRENCY}}</span>{{ po_model.po_amount_received | currency_format }}
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-12">
|
||||||
|
<a class="btn btn-phoenix-primary w-100 py-2"
|
||||||
|
href="{% url 'purchase_order_list' request.dealer.slug request.dealer.entity.slug %}">
|
||||||
|
<i class="fas fa-list me-2"></i>{% trans 'PO List' %}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a class="btn btn-phoenix-primary w-100 py-2"
|
</div>
|
||||||
href="{% url 'purchase_order_list' request.dealer.slug request.dealer.entity.slug %}">
|
|
||||||
<i class="fas fa-list me-2"></i>{% trans 'PO List' %}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-12">
|
|
||||||
<div class="card mb-4">
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="row text-center">
|
|
||||||
<div class="col-md-6 border-end">
|
|
||||||
<div class="p-2">
|
|
||||||
<h6 class="text-muted mb-2">{% trans 'PO Amount' %}</h6>
|
|
||||||
<h3 class="fw-light mb-0">
|
|
||||||
<span class="currency">{{CURRENCY}}</span>{{ po_model.po_amount | absolute | currency_format }}
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="p-2">
|
|
||||||
<h6 class="text-muted mb-2">{% trans 'Amount Received' %}</h6>
|
|
||||||
<h3 class="fw-light mb-0 text-success">
|
|
||||||
<span class="currency">{{CURRENCY}}</span>{{ po_model.po_amount_received | currency_format }}
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
|
|||||||
@ -9,22 +9,22 @@
|
|||||||
<style>
|
<style>
|
||||||
/* Custom styling */
|
/* Custom styling */
|
||||||
.form-section {
|
.form-section {
|
||||||
background-color: #f8f9fa;
|
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-section-header {
|
.form-section-header {
|
||||||
border-bottom: 1px solid #dee2e6;
|
|
||||||
padding-bottom: 0.75rem;
|
padding-bottom: 0.75rem;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
color: #0d6efd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.required-field::after {
|
.required-field::after {
|
||||||
content: " *";
|
content: " *";
|
||||||
color: #dc3545;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-select {
|
.search-select {
|
||||||
@ -40,7 +40,7 @@
|
|||||||
right: 1rem;
|
right: 1rem;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
color: #6c757d;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.currency-input {
|
.currency-input {
|
||||||
@ -52,7 +52,7 @@
|
|||||||
left: 1rem;
|
left: 1rem;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
color: #6c757d;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.currency-input input {
|
.currency-input input {
|
||||||
@ -60,12 +60,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.form-actions {
|
.form-actions {
|
||||||
background-color: #f8f9fa;
|
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
position: sticky;
|
position:static;
|
||||||
bottom: 1rem;
|
bottom: 1rem;
|
||||||
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock customCSS %}
|
{% endblock customCSS %}
|
||||||
@ -75,7 +75,7 @@
|
|||||||
<div class="row justify-content-center mb-4">
|
<div class="row justify-content-center mb-4">
|
||||||
<div class="col-lg-10">
|
<div class="col-lg-10">
|
||||||
<div class="card shadow">
|
<div class="card shadow">
|
||||||
<div class="card-header bg-primary text-white">
|
<div class="card-header bg-primary ">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<h2 class="h4 mb-0">
|
<h2 class="h4 mb-0">
|
||||||
<i class="fas fa-file-invoice me-2"></i> New Sale Order
|
<i class="fas fa-file-invoice me-2"></i> New Sale Order
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user