Merge pull request 'alignment in the pdf print and alingment of buttons in bill_card' (#271) from frontend into main
Reviewed-on: #271
This commit is contained in:
commit
530d797b8e
@ -1004,9 +1004,19 @@ def create_po_item_upload(sender, instance, created, **kwargs):
|
||||
for item in instance.get_itemtxs_data()[0]:
|
||||
dealer = models.Dealer.objects.get(entity=instance.entity)
|
||||
if item.bill_model and item.bill_model.is_paid():
|
||||
models.PoItemsUploaded.objects.get_or_create(
|
||||
dealer=dealer, po=instance, item=item, status=instance.po_status
|
||||
)
|
||||
models.PoItemsUploaded.objects.update_or_create(
|
||||
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)
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
</div>
|
||||
<!-- Modal Action -->
|
||||
{% 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 %}"
|
||||
class="btn btn-sm btn-phoenix-primary me-md-2">{% trans 'View' %}</a>
|
||||
{% if perms.django_ledger.change_billmodel %}
|
||||
@ -199,7 +199,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<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 -->
|
||||
{% if perms.django_ledger.change_billmodel %}
|
||||
{% if "update" not in request.path %}
|
||||
@ -296,6 +296,15 @@
|
||||
//document.addEventListener('htmx:afterSwap',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) {
|
||||
const modalEl = document.getElementById('POModal');
|
||||
if (!modalEl) {
|
||||
|
||||
@ -104,14 +104,14 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
.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 */
|
||||
.document-footer {
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
left: 40px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
@ -205,12 +205,7 @@
|
||||
</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="section text-right" style="width: 100%;">
|
||||
|
||||
@ -100,11 +100,15 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
.text-right {
|
||||
text-align: right;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* Footer Styles */
|
||||
/* Footer Styles */
|
||||
.document-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
@ -112,17 +116,10 @@
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
color: #888;
|
||||
|
||||
padding-top: 15px;
|
||||
margin: 0 20mm;
|
||||
|
||||
}
|
||||
.footer-flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin: 0 auto; /* This change centers the footer container */
|
||||
}
|
||||
|
||||
.footer-logo {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@
|
||||
.document-footer {
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
left: 40px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
|
||||
@ -123,8 +123,12 @@
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
/* Footer Styles */
|
||||
/* Footer Styles */
|
||||
.document-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
@ -132,11 +136,10 @@
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
color: #888;
|
||||
|
||||
padding-top: 15px;
|
||||
margin: 0 20mm;
|
||||
|
||||
margin: 0 auto; /* This change centers the footer container */
|
||||
}
|
||||
|
||||
.footer-flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
@ -129,7 +129,7 @@
|
||||
.document-footer {
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
left: 40px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
|
||||
@ -123,8 +123,12 @@
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
/* Footer Styles */
|
||||
/* Footer Styles */
|
||||
.document-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
@ -132,11 +136,11 @@
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
color: #888;
|
||||
|
||||
padding-top: 15px;
|
||||
margin: 0 20mm;
|
||||
|
||||
margin: 0 auto; /* This change centers the footer container */
|
||||
}
|
||||
|
||||
|
||||
.footer-flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user