Bug 23354: Add ability to remove items

This patch adds the ability to remove items from a transactions on the
new Point of Sale pay page.

Test plan:
1) Populate a transaction with at least one item.
2) Note the new button to 'Remove item' on the items table.
3) Click the button and confirm the item is removed
4) Signoff

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2019-08-13 11:16:25 +01:00
parent dd9cfda29f
commit deb596a210
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -39,6 +39,7 @@
<th>Cost</th>
<th>Quantity</th>
<th>Total</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@ -47,6 +48,7 @@
<tr>
<td colspan="3">Total payable:</td>
<td></td>
<td></td>
</tr>
</tfoot>
</table>
@ -183,7 +185,8 @@
invoiceTitle,
invoicePrice,
1,
null
null,
'<button class="drop"><i class="fa fa-trash"></i> Remove</button>'
]
);
}
@ -263,7 +266,7 @@
"bSortable": false,
"bSearchable": false,
}, {
"aTargets": [-1],
"aTargets": [-2],
"mRender": function ( data, type, full ) {
var price = Number.parseFloat(data).toFixed(2);
return '£'+price;
@ -303,6 +306,10 @@
}
}));
$("#sale").on("click", "button.drop", function(){
sale_table.DataTable().row($(this).parents('tr')).remove().draw(false);
});
var items_table = $("#invoices").dataTable($.extend(true,{}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable":false },