@@ -, +, @@
---
.../prog/en/modules/pos/register.tt | 148 ++++++++++++++++++
pos/register.pl | 27 ++++
2 files changed, 175 insertions(+)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt
@@ -123,6 +123,117 @@
[% END %]
+
+ [% IF trange_f %]
+
Older transactions
+
+
+
+ Receipt ID
+
+
+ Transaction
+
+
+ Account type
+
+
+ Description of charges
+
+
+ Item
+
+
+ Transaction
+
+
+ Actions
+
+
+
+ [% FOREACH accountline IN past_accountlines %]
+ [% IF accountline.is_credit %]
+ [% FOREACH credit IN accountline.credit_offsets %]
+ [% IF credit.debit %]
+
+ [% accountline.accountlines_id %]
+ { "type": "credit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }
+ [%- PROCESS account_type_description account=credit.debit -%]
+ [%- IF credit.debit.description %][% credit.debit.description | html %][% END %]
+ [% IF ( credit.debit.itemnumber ) %][% credit.debit.item.biblio.title | html %] [%- END -%]
+ [% credit.debit.amount | $Price %]
+
+
+ [% IF ( CAN_user_cash_management_refund_cash_registers ) %]
+ Issue refund
+ [% END %]
+
+
+ [% END %]
+ [% END %]
+ [% ELSE %]
+ [% FOREACH debit IN accountline.debit_offsets %]
+ [% IF debit.credit %]
+
+ [% accountline.accountlines_id %]
+ { "type": "debit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }
+ [%- PROCESS account_type_description account=debit.credit -%]
+ [%- IF debit.credit.description %][% debit.credit.description | html %][% END %]
+ [% IF ( debit.credit.itemnumber ) %][% debit.credit.item.biblio.title | html %] [% END %]
+ [% debit.credit.amount | $Price %]
+
+
+
+ [% END %]
+ [% END %]
+ [% END %]
+ [% END %]
+
+
+
+ Total income:
+ [% past_accountlines.total * -1 | $Price %]
+
+
+
+
+
+
+
+ Cashup date
+ Banked
+ Actions
+
+
+ [% FOREACH cashup IN register.cashups %]
+
+ [% cashup.timestamp | $KohaDates with_hours => 1 %]
+ [% cashup.amount | $Price %]
+ View transactions
+
+ [% END %]
+
+
+ [% ELSE %]
+ [% IF register.cashups %]
+ Older transactions
+
+ [% END %]
+ [% END %]
@@ -186,6 +297,7 @@
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
+ [% INCLUDE 'calendar.inc' %]
[% END %]
--- a/pos/register.pl
+++ a/pos/register.pl
@@ -27,6 +27,7 @@ use C4::Context;
use Koha::Account::Lines;
use Koha::Cash::Registers;
use Koha::Database;
+use Koha::DateUtils;
my $q = CGI->new();
@@ -71,6 +72,32 @@ $template->param(
accountlines => $accountlines
);
+my $transactions_range_from = $q->param('trange_f');
+my $last_cashup = $cash_register->last_cashup;
+my $transactions_range_to =
+ $q->param('trange_t') ? $q->param('trange_t')
+ : $last_cashup ? $last_cashup->timestamp
+ : '';
+$template->param( trange_t => $transactions_range_to );
+if ($transactions_range_from) {
+ $template->param( trange_f => $transactions_range_from );
+
+ my $dtf = Koha::Database->new->schema->storage->datetime_parser;
+ my $start = dt_from_string($transactions_range_from);
+ my $end = dt_from_string($transactions_range_to);
+ my $past_accountlines = Koha::Account::Lines->search(
+ {
+ register_id => $registerid,
+ timestamp => {
+ -between => [
+ $dtf->format_datetime($start), $dtf->format_datetime($end)
+ ]
+ }
+ }
+ );
+ $template->param( past_accountlines => $past_accountlines );
+}
+
my $op = $q->param('op') // '';
if ( $op eq 'cashup' ) {
$cash_register->add_cashup(
--