alignment in the pdf print and alingment of buttons in bill_card
This commit is contained in:
parent
f10b9311bf
commit
07bd2a34fb
@ -1004,9 +1004,19 @@ def create_po_item_upload(sender, instance, created, **kwargs):
|
|||||||
for item in instance.get_itemtxs_data()[0]:
|
for item in instance.get_itemtxs_data()[0]:
|
||||||
dealer = models.Dealer.objects.get(entity=instance.entity)
|
dealer = models.Dealer.objects.get(entity=instance.entity)
|
||||||
if item.bill_model and item.bill_model.is_paid():
|
if item.bill_model and item.bill_model.is_paid():
|
||||||
models.PoItemsUploaded.objects.get_or_create(
|
models.PoItemsUploaded.objects.update_or_create(
|
||||||
dealer=dealer, po=instance, item=item, status=instance.po_status
|
dealer=dealer, po=instance, item=item,
|
||||||
)
|
defaults={
|
||||||
|
"status":instance.po_status
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
# po_item = models.PoItemsUploaded.objects.get_or_create(
|
||||||
|
# dealer=dealer, po=instance, item=item,
|
||||||
|
# defaults={
|
||||||
|
# "status":instance.po_status
|
||||||
|
# }
|
||||||
|
# )
|
||||||
|
|
||||||
|
|
||||||
# @receiver(post_save, sender=models.Staff)
|
# @receiver(post_save, sender=models.Staff)
|
||||||
|
|||||||
@ -50,7 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Modal Action -->
|
<!-- Modal Action -->
|
||||||
{% modal_action bill 'get' entity_slug %}
|
{% modal_action bill 'get' entity_slug %}
|
||||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
|
<div class="d-grid gap-2 d-md-flex justify-content-md-start">
|
||||||
<a href="{% url 'django_ledger:bill-detail' entity_slug=entity_slug bill_pk=bill.uuid %}"
|
<a href="{% url 'django_ledger:bill-detail' entity_slug=entity_slug bill_pk=bill.uuid %}"
|
||||||
class="btn btn-sm btn-phoenix-primary me-md-2">{% trans 'View' %}</a>
|
class="btn btn-sm btn-phoenix-primary me-md-2">{% trans 'View' %}</a>
|
||||||
{% if perms.django_ledger.change_billmodel %}
|
{% if perms.django_ledger.change_billmodel %}
|
||||||
@ -199,7 +199,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer p-0">
|
<div class="card-footer p-0">
|
||||||
<div class="d-flex flex-wrap gap-2 mt-2">
|
<div class="d-flex flex-wrap gap-2 mt-2 justify-content-end">
|
||||||
<!-- Update Button -->
|
<!-- Update Button -->
|
||||||
{% if perms.django_ledger.change_billmodel %}
|
{% if perms.django_ledger.change_billmodel %}
|
||||||
{% if "update" not in request.path %}
|
{% if "update" not in request.path %}
|
||||||
@ -296,6 +296,15 @@
|
|||||||
//document.addEventListener('htmx:afterSwap',processElements);
|
//document.addEventListener('htmx:afterSwap',processElements);
|
||||||
|
|
||||||
function processElements() {
|
function processElements() {
|
||||||
|
let bill_status = "{{bill.bill_status}}";
|
||||||
|
if(bill_status == 'draft'){
|
||||||
|
const formDiv = document.getElementById('bill-update-form');
|
||||||
|
if (formDiv) {
|
||||||
|
setTimeout(()=>{
|
||||||
|
formDiv.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
|
},500)
|
||||||
|
}
|
||||||
|
}
|
||||||
window.showPOModal = function(title, actionUrl, buttonText) {
|
window.showPOModal = function(title, actionUrl, buttonText) {
|
||||||
const modalEl = document.getElementById('POModal');
|
const modalEl = document.getElementById('POModal');
|
||||||
if (!modalEl) {
|
if (!modalEl) {
|
||||||
|
|||||||
@ -104,14 +104,14 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.text-right {
|
.text-right {
|
||||||
text-align: left; /* This is now for left alignment in an RTL context */
|
text-align: right; /* This is now for left alignment in an RTL context */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Footer Styles */
|
/* Footer Styles */
|
||||||
.document-footer {
|
.document-footer {
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 40px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
@ -205,12 +205,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="document-details" style="margin-top: 30px;">
|
|
||||||
<div class="section" style="width: 100%;">
|
|
||||||
<h2>ملاحظات:</h2>
|
|
||||||
<p>{{ po_model.notes|default:"لا توجد ملاحظات إضافية." }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="document-details" style="margin-top: 10px; border-top: 1px solid #ddd; padding-top: 10px;">
|
<div class="document-details" style="margin-top: 10px; border-top: 1px solid #ddd; padding-top: 10px;">
|
||||||
<div class="section text-right" style="width: 100%;">
|
<div class="section text-right" style="width: 100%;">
|
||||||
|
|||||||
@ -100,11 +100,15 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.text-right {
|
.text-right {
|
||||||
text-align: right;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Footer Styles */
|
/* Footer Styles */
|
||||||
.document-footer {
|
.document-footer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -112,17 +116,10 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
color: #888;
|
color: #888;
|
||||||
|
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
margin: 0 20mm;
|
margin: 0 auto; /* This change centers the footer container */
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
.footer-flex {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.footer-logo {
|
.footer-logo {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,7 +127,7 @@
|
|||||||
.document-footer {
|
.document-footer {
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 40px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
|
|||||||
@ -123,8 +123,12 @@
|
|||||||
font-weight: lighter;
|
font-weight: lighter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Footer Styles */
|
/* Footer Styles */
|
||||||
.document-footer {
|
.document-footer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -132,11 +136,10 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
color: #888;
|
color: #888;
|
||||||
|
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
margin: 0 20mm;
|
margin: 0 auto; /* This change centers the footer container */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-flex {
|
.footer-flex {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@ -129,7 +129,7 @@
|
|||||||
.document-footer {
|
.document-footer {
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 40px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
|
|||||||
@ -123,8 +123,12 @@
|
|||||||
font-weight: lighter;
|
font-weight: lighter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Footer Styles */
|
/* Footer Styles */
|
||||||
.document-footer {
|
.document-footer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -132,11 +136,11 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
color: #888;
|
color: #888;
|
||||||
|
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
margin: 0 20mm;
|
margin: 0 auto; /* This change centers the footer container */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.footer-flex {
|
.footer-flex {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user