2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Set default value for SupplierPriceBreak

Edit or Delete a SupplierPriceBreak
This commit is contained in:
Oliver Walters
2019-05-18 17:35:39 +10:00
parent fc3072a459
commit 5043c354b1
5 changed files with 61 additions and 5 deletions

View File

@ -85,7 +85,12 @@ InvenTree | {{ company.name }} - Parts
{% for pb in part.price_breaks.all %}
<tr>
<td>{{ pb.quantity }}</td>
<td>{{ pb.cost }}</td>
<td>{{ pb.cost }}
<div class='btn-group' style='float: right;'>
<button title='Edit Price Break' class='btn btn-primary pb-edit-button btn-sm' type='button' url="{% url 'price-break-edit' pb.id %}"><span class='glyphicon glyphicon-small glyphicon-pencil'></span></button>
<button title='Delete Price Break' class='btn btn-danger pb-delete-button btn-sm' type='button' url="{% url 'price-break-delete' pb.id %}"><span class='glyphicon glyphicon-small glyphicon-trash'></span></button>
</div>
</td>
</tr>
{% endfor %}
{% else %}
@ -138,4 +143,24 @@ InvenTree | {{ company.name }} - Parts
);
});
$('.pb-edit-button').click(function() {
var button = $(this);
launchModalForm(button.attr('url'),
{
reload: true,
}
);
});
$('.pb-delete-button').click(function() {
var button = $(this);
launchModalForm(button.attr('url'),
{
reload: true,
}
);
});
{% endblock %}