Add dialog to set opening amount (issue #1)
This commit is contained in:
parent
172e611a45
commit
5775599b4b
@ -64,6 +64,7 @@ define("PAGES", [
|
||||
"static/css/tables.css"
|
||||
],
|
||||
"scripts" => [
|
||||
"static/js/bsalert.js",
|
||||
"static/js/datatables.min.js",
|
||||
"static/js/registers.js"
|
||||
],
|
||||
|
@ -85,12 +85,7 @@ $registers = $database->select('registers', ['registerid (id)', 'registername (n
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<form action="action.php" method="POST" class="d-inline">
|
||||
<input type="hidden" name="action" value="opencash" />
|
||||
<input type="hidden" name="source" value="registers" />
|
||||
<input type="hidden" name="register" value="<?php echo $r['id']; ?>" />
|
||||
<button class="btn btn-success btn-sm" type="submit"><i class="fas fa-play"></i> <?php lang("open"); ?></button>
|
||||
</form>
|
||||
<button class="btn btn-success btn-sm btn-opencash" data-register="<?php echo $r['id']; ?>"><i class="fas fa-play"></i> <?php lang("open"); ?></button>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@ -114,4 +109,11 @@ $registers = $database->select('registers', ['registerid (id)', 'registername (n
|
||||
<th data-priority="3"><i class="fas fa-fw fa-stop d-none d-md-inline"></i> <?php lang('closed'); ?></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<form action="action.php" method="POST" class="d-none" id="opencashform">
|
||||
<input type="hidden" name="action" value="opencash" />
|
||||
<input type="hidden" name="source" value="registers" />
|
||||
<input type="hidden" name="startamount" value="" id="opencashstart" />
|
||||
<input type="hidden" name="register" value="" id="opencashregid" />
|
||||
</form>
|
@ -31,4 +31,20 @@ var registertable = $('#registertable').DataTable({
|
||||
order: [
|
||||
[2, 'asc']
|
||||
]
|
||||
});
|
||||
|
||||
$("#registertable").on('click', '.btn-opencash', function () {
|
||||
var regid = $(this).data("register");
|
||||
bsprompt(
|
||||
"Open Cash",
|
||||
"Enter the opening amount of cash in the drawer.",
|
||||
"Open Cash",
|
||||
"Cancel",
|
||||
"number",
|
||||
function (result) {
|
||||
$("#opencashform #opencashregid").val(regid);
|
||||
$("#opencashform #opencashstart").val(result);
|
||||
$("#opencashform").submit();
|
||||
}
|
||||
);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user