Compare commits

..

No commits in common. "530d797b8edc0b037178447a806e20fe7e04a717" and "a09ef862488f1f431c059d0e70848f4093905fb9" have entirely different histories.

8 changed files with 34 additions and 52 deletions

View File

@ -1004,19 +1004,9 @@ 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.update_or_create( models.PoItemsUploaded.objects.get_or_create(
dealer=dealer, po=instance, item=item, dealer=dealer, po=instance, item=item, status=instance.po_status
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)

View File

@ -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-start"> <div class="d-grid gap-2 d-md-flex justify-content-md-end">
<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 justify-content-end"> <div class="d-flex flex-wrap gap-2 mt-2">
<!-- 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,15 +296,6 @@
//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) {

View File

@ -104,14 +104,14 @@
font-weight: bold; font-weight: bold;
} }
.text-right { .text-right {
text-align: right; /* This is now for left alignment in an RTL context */ text-align: left; /* 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: 40px; left: 0;
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 10px; font-size: 10px;
@ -205,7 +205,12 @@
</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%;">

View File

@ -100,15 +100,11 @@
font-weight: bold; font-weight: bold;
} }
.text-right { .text-right {
text-align: left; text-align: right;
} }
/* 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;
@ -116,10 +112,17 @@
text-align: center; text-align: center;
font-size: 10px; font-size: 10px;
color: #888; color: #888;
padding-top: 15px;
margin: 0 auto; /* This change centers the footer container */
}
padding-top: 15px;
margin: 0 20mm;
}
.footer-flex {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.footer-logo { .footer-logo {
text-align: center; text-align: center;
} }

View File

@ -127,7 +127,7 @@
.document-footer { .document-footer {
position: relative; position: relative;
bottom: 0; bottom: 0;
left: 40px; left: 0;
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 10px; font-size: 10px;

View File

@ -123,12 +123,8 @@
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;
@ -136,10 +132,11 @@
text-align: center; text-align: center;
font-size: 10px; font-size: 10px;
color: #888; color: #888;
padding-top: 15px;
margin: 0 auto; /* This change centers the footer container */
}
padding-top: 15px;
margin: 0 20mm;
}
.footer-flex { .footer-flex {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@ -129,7 +129,7 @@
.document-footer { .document-footer {
position: relative; position: relative;
bottom: 0; bottom: 0;
left: 40px; left: 0;
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 10px; font-size: 10px;

View File

@ -123,12 +123,8 @@
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;
@ -136,11 +132,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 auto; /* This change centers the footer container */ margin: 0 20mm;
} }
.footer-flex { .footer-flex {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;