mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Initialize target date for new PO line and SO line (#4170)
* Initialize date for new PO line or SO line Set new PO/SO line initial date to that of the PO/SO it belongs to. * Changed date formatting to render_date template tag * Reverted the change to format the date with the render_date template tag
This commit is contained in:
parent
385ed8277d
commit
49630e295d
@ -179,6 +179,9 @@ $('#new-po-line').click(function() {
|
|||||||
currency: '{{ order.supplier.currency }}',
|
currency: '{{ order.supplier.currency }}',
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if order.target_date %}
|
||||||
|
target_date: '{{ order.target_date|date:'Y-m-d' }}',
|
||||||
|
{% endif %}
|
||||||
onSuccess: function() {
|
onSuccess: function() {
|
||||||
$('#po-line-table').bootstrapTable('refresh');
|
$('#po-line-table').bootstrapTable('refresh');
|
||||||
}
|
}
|
||||||
|
@ -252,6 +252,9 @@
|
|||||||
|
|
||||||
var fields = soLineItemFields({
|
var fields = soLineItemFields({
|
||||||
order: {{ order.pk }},
|
order: {{ order.pk }},
|
||||||
|
{% if order.target_date %}
|
||||||
|
target_date: '{{ order.target_date|date:'Y-m-d' }}',
|
||||||
|
{% endif %}
|
||||||
});
|
});
|
||||||
|
|
||||||
constructForm('{% url "api-so-line-list" %}', {
|
constructForm('{% url "api-so-line-list" %}', {
|
||||||
|
@ -720,6 +720,7 @@ function createPurchaseOrderLineItem(order, options={}) {
|
|||||||
order: order,
|
order: order,
|
||||||
supplier: options.supplier,
|
supplier: options.supplier,
|
||||||
currency: options.currency,
|
currency: options.currency,
|
||||||
|
target_date: options.target_date,
|
||||||
});
|
});
|
||||||
|
|
||||||
constructForm('{% url "api-po-line-list" %}', {
|
constructForm('{% url "api-po-line-list" %}', {
|
||||||
@ -753,6 +754,10 @@ function soLineItemFields(options={}) {
|
|||||||
fields.order.value = options.order;
|
fields.order.value = options.order;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.target_date) {
|
||||||
|
fields.target_date.value = options.target_date;
|
||||||
|
}
|
||||||
|
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -905,6 +910,10 @@ function poLineItemFields(options={}) {
|
|||||||
fields.purchase_price_currency.value = options.currency;
|
fields.purchase_price_currency.value = options.currency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.target_date) {
|
||||||
|
fields.target_date.value = options.target_date;
|
||||||
|
}
|
||||||
|
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user