|
Lines 27-35
Link Here
|
| 27 |
You must have at least one cash register associated with this branch before you can record payments. |
27 |
You must have at least one cash register associated with this branch before you can record payments. |
| 28 |
</div> |
28 |
</div> |
| 29 |
[% ELSE %] |
29 |
[% ELSE %] |
|
|
30 |
[% IF ( CAN_user_cash_management_cashup_cash_registers ) %] |
| 30 |
<div id="toolbar" class="btn-toolbar"> |
31 |
<div id="toolbar" class="btn-toolbar"> |
| 31 |
<a id="cashup" href="/cgi-bin/koha/pos/register.pl?op=cashup" class="btn btn-default"><i class="fa fa-money"></i> Record cashup</a> |
32 |
<a id="cashup" href="/cgi-bin/koha/pos/register.pl?op=cashup" class="btn btn-default"><i class="fa fa-money"></i> Record cashup</a> |
| 32 |
</div> |
33 |
</div> |
|
|
34 |
[% END %] |
| 33 |
|
35 |
|
| 34 |
<h1>Register transaction details for [% register.name | html %]</h1> |
36 |
<h1>Register transaction details for [% register.name | html %]</h1> |
| 35 |
|
37 |
|
|
Lines 57-62
Link Here
|
| 57 |
<th> |
59 |
<th> |
| 58 |
Transaction |
60 |
Transaction |
| 59 |
</th> |
61 |
</th> |
|
|
62 |
<th> |
| 63 |
Account type |
| 64 |
</th> |
| 60 |
<th> |
65 |
<th> |
| 61 |
Description of charges |
66 |
Description of charges |
| 62 |
</th> |
67 |
</th> |
|
Lines 74-94
Link Here
|
| 74 |
[% FOREACH accountline IN accountlines %] |
79 |
[% FOREACH accountline IN accountlines %] |
| 75 |
[% IF accountline.is_credit %] |
80 |
[% IF accountline.is_credit %] |
| 76 |
[% FOREACH credit IN accountline.credit_offsets %] |
81 |
[% FOREACH credit IN accountline.credit_offsets %] |
|
|
82 |
[% IF credit.debit %] |
| 77 |
<tr> |
83 |
<tr> |
| 78 |
<td>[% accountline.accountlines_id %]</td> |
84 |
<td>[% accountline.accountlines_id %]</td> |
| 79 |
<td>{ "type": "credit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }</td> |
85 |
<td>{ "type": "credit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }</td> |
| 80 |
<td>[%- PROCESS account_type_description account=credit.debit -%]</td> |
86 |
<td>[%- PROCESS account_type_description account=credit.debit -%]</td> |
|
|
87 |
<td>[%- IF credit.debit.description %][% credit.debit.description | html %][% END %] |
| 88 |
[% IF ( credit.debit.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% credit.debit.item.biblionumber | uri %]&itemnumber=[% credit.debit.itemnumber | uri %]">[% credit.debit.item.biblio.title | html %]</a>[%- END -%]</td> |
| 81 |
<td>[% credit.debit.amount | $Price %]</td> |
89 |
<td>[% credit.debit.amount | $Price %]</td> |
| 82 |
<td></td> |
90 |
<td></td> |
|
|
91 |
<td> |
| 92 |
[% IF ( CAN_user_cash_management_refund_cash_registers ) %] |
| 93 |
<button type="button" data-toggle="modal" data-target="#issueRefundModal" data-item="[%- PROCESS account_type_description account=credit.debit -%]" data-accountline="[% credit.debit.accountlines_id | html %]" data-amount="[% credit.debit.amount | $Price %]" data-quantity="[% credit.debit.note | html %]"><i class="fa fa-plus"></i> Issue refund</button> |
| 94 |
[% END %] |
| 95 |
</td> |
| 96 |
</tr> |
| 97 |
[% END %] |
| 98 |
[% END %] |
| 99 |
[% ELSE %] |
| 100 |
[% FOREACH debit IN accountline.debit_offsets %] |
| 101 |
[% IF debit.credit %] |
| 102 |
<tr> |
| 103 |
<td>[% accountline.accountlines_id %]</td> |
| 104 |
<td>{ "type": "debit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }</td> |
| 105 |
<td>[%- PROCESS account_type_description account=debit.credit -%]</td> |
| 106 |
<td>[%- IF debit.credit.description %][% debit.credit.description | html %][% END %] |
| 107 |
[% IF ( debit.credit.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% debit.credit.item.biblionumber | uri %]&itemnumber=[% debit.credit.itemnumber | uri %]">[% debit.credit.item.biblio.title | html %]</a>[% END %]</td> |
| 108 |
<td>[% debit.credit.amount | $Price %]</td> |
| 109 |
<td></td> |
| 83 |
<td></td> |
110 |
<td></td> |
| 84 |
</tr> |
111 |
</tr> |
| 85 |
[% END %] |
112 |
[% END %] |
|
|
113 |
[% END %] |
| 86 |
[% END %] |
114 |
[% END %] |
| 87 |
[% END %] |
115 |
[% END %] |
| 88 |
</tbody> |
116 |
</tbody> |
| 89 |
<tfoot> |
117 |
<tfoot> |
| 90 |
<tr> |
118 |
<tr> |
| 91 |
<td colspan="4">Total income: </td> |
119 |
<td colspan="5">Total income: </td> |
| 92 |
<td>[% accountlines.total * -1 | $Price %]</td> |
120 |
<td>[% accountlines.total * -1 | $Price %]</td> |
| 93 |
<td></td> |
121 |
<td></td> |
| 94 |
</tr> |
122 |
</tr> |
|
Lines 104-109
Link Here
|
| 104 |
</div> |
132 |
</div> |
| 105 |
</div><!-- /.row --> |
133 |
</div><!-- /.row --> |
| 106 |
|
134 |
|
|
|
135 |
<!-- Issue refund modal --> |
| 136 |
<div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel"> |
| 137 |
<form id="refund_form" method="post" enctype="multipart/form-data" class="validated"> |
| 138 |
<input type="hidden" name="accountline" value="" id="refundline"> |
| 139 |
<div class="modal-dialog" role="document"> |
| 140 |
<div class="modal-content"> |
| 141 |
<div class="modal-header"> |
| 142 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
| 143 |
<h4 class="modal-title" id="issueRefundLabel">Issue refund from <em>[% register.name | html %]</em></h4> |
| 144 |
</div> |
| 145 |
<div class="modal-body"> |
| 146 |
<fieldset class="rows"> |
| 147 |
<ol> |
| 148 |
<li> |
| 149 |
<span id="item" class="label">Item: </span><span></span> |
| 150 |
</li> |
| 151 |
<li> |
| 152 |
<label class="required" for="amount">Amount:</label> |
| 153 |
<input type="text" id="amount" name="amount" value="[% refund.amount | html %]" required="required"> |
| 154 |
<span class="required">Required</span> |
| 155 |
</li> |
| 156 |
<li> |
| 157 |
<label class="required" for="quantity">Quantity:</label> |
| 158 |
<input type="text" id="quantity" name="quantity" value="[% refund.quantity | html %]" required="required"> |
| 159 |
<span class="required">Required</span> |
| 160 |
</li> |
| 161 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
| 162 |
[% IF payment_types %] |
| 163 |
<li> |
| 164 |
<label for="transaction_type">Transaction type: </label> |
| 165 |
<select name="transaction_type" id="transaction_type"> |
| 166 |
[% FOREACH pt IN payment_types %] |
| 167 |
<option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> |
| 168 |
[% END %] |
| 169 |
</select> |
| 170 |
</li> |
| 171 |
[% END %] |
| 172 |
</ol> |
| 173 |
</fieldset> <!-- /.rows --> |
| 174 |
</div> <!-- /.modal-body --> |
| 175 |
<div class="modal-footer"> |
| 176 |
<input type="hidden" name="registerid" value="[% register.id | html %]"> |
| 177 |
<input type="hidden" name="op" value="refund"> |
| 178 |
<button type="submit" class="btn btn-default">Confirm</button> |
| 179 |
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
| 180 |
</div> <!-- /.modal-footer --> |
| 181 |
</div> <!-- /.modal-content --> |
| 182 |
</div> <!-- /.modal-dialog --> |
| 183 |
</form> <!-- /#refund_form --> |
| 184 |
</div> <!-- /#issueRefundModal --> |
| 185 |
|
| 107 |
[% MACRO jsinclude BLOCK %] |
186 |
[% MACRO jsinclude BLOCK %] |
| 108 |
[% INCLUDE 'datatables.inc' %] |
187 |
[% INCLUDE 'datatables.inc' %] |
| 109 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
188 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
|
Lines 119-125
Link Here
|
| 119 |
startRender: function ( rows, group ) { |
198 |
startRender: function ( rows, group ) { |
| 120 |
var details = JSON.parse(rows.data().pluck(1).pop()); |
199 |
var details = JSON.parse(rows.data().pluck(1).pop()); |
| 121 |
return $('<tr class="'+details.type+'"/>') |
200 |
return $('<tr class="'+details.type+'"/>') |
| 122 |
.append( '<td colspan="2">'+group+' '+details.description+'</td>' ) |
201 |
.append( '<td colspan="3">'+group+' '+details.description+'</td>' ) |
| 123 |
.append( '<td>'+details.amount+'</td>' ) |
202 |
.append( '<td>'+details.amount+'</td>' ) |
| 124 |
.append( '<td><button class="printReceipt" data-accountline="'+group+'"><i class="fa fa-print"></i> Print receipt</button></td>'); |
203 |
.append( '<td><button class="printReceipt" data-accountline="'+group+'"><i class="fa fa-print"></i> Print receipt</button></td>'); |
| 125 |
}, |
204 |
}, |
|
Lines 127-132
Link Here
|
| 127 |
} |
206 |
} |
| 128 |
})); |
207 |
})); |
| 129 |
|
208 |
|
|
|
209 |
$("#issueRefundModal").on("shown.bs.modal", function(e){ |
| 210 |
var button = $(e.relatedTarget); |
| 211 |
var item = button.data('item'); |
| 212 |
$("#item + span").replaceWith(item); |
| 213 |
var accountline = button.data('accountline'); |
| 214 |
$('#refundline').val(accountline); |
| 215 |
var amount = button.data('amount'); |
| 216 |
$("#amount").val(amount); |
| 217 |
var quantity = button.data('quantity'); |
| 218 |
$("#quantity").val(quantity); |
| 219 |
$("#amount, #quantity, #transaction_type").focus(); |
| 220 |
}); |
| 221 |
|
| 130 |
$(".printReceipt").click(function() { |
222 |
$(".printReceipt").click(function() { |
| 131 |
var accountlines_id = $(this).data('accountline'); |
223 |
var accountlines_id = $(this).data('accountline'); |
| 132 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank'); |
224 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank'); |