View | Details | Raw Unified | Return to bug 19489
Collapse All | Expand All

(-)a/Koha/Account/Line.pm (+14 lines)
Lines 51-56 sub item { Link Here
51
    return Koha::Item->_new_from_dbic( $rs );
51
    return Koha::Item->_new_from_dbic( $rs );
52
}
52
}
53
53
54
=head3 issue
55
56
Return the issue linked to this account line if exists
57
58
=cut
59
60
sub issue {
61
    my ( $self ) = @_;
62
    my $rs = $self->_result->issue_id;
63
    my $issue = Koha::Checkouts->find( $rs );
64
    $issue = Koha::Old::Checkouts->find( $rs ) unless $issue;
65
    return $issue;
66
}
67
54
=head3 void
68
=head3 void
55
69
56
$payment_accountline->void();
70
$payment_accountline->void();
(-)a/admin/columns_settings.yml (+6 lines)
Lines 264-269 modules: Link Here
264
        -
264
        -
265
          columnname: description
265
          columnname: description
266
        -
266
        -
267
          columnname: barcode
268
        -
269
          columnname: date_due
270
        -
271
          columnname: returndate
272
        -
267
          columnname: note
273
          columnname: note
268
        -
274
        -
269
          columnname: amount
275
          columnname: amount
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt (+15 lines)
Lines 29-34 Link Here
29
                        <tr>
29
                        <tr>
30
                            <th class="title-string">Date</th>
30
                            <th class="title-string">Date</th>
31
                            <th>Description of charges</th>
31
                            <th>Description of charges</th>
32
                            <th>Barcode</th>
33
                            <th>Due date</th>
34
                            <th>Return date</th>
32
                            <th>Note</th>
35
                            <th>Note</th>
33
                            <th>Amount</th>
36
                            <th>Amount</th>
34
                            <th>Outstanding</th>
37
                            <th>Outstanding</th>
Lines 57-62 Link Here
57
                            </td>
60
                            </td>
58
61
59
                            <td>
62
                            <td>
63
                                [% IF ( accountline.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% accountline.itemnumber | uri %]#item[% accountline.itemnumber | uri %]">[% accountline.item.barcode | html %]</a>[% END %]
64
                            </td>
65
66
                            <td>
67
                                [% IF ( accountline.issue_id ) %][% accountline.issue.date_due | $KohaDates with_hours => 1 | html %][% END %]
68
                            </td>
69
70
                            <td>
71
                                [% IF ( accountline.issue_id ) %][% accountline.issue.returndate | $KohaDates with_hours => 1 | html %][% END %]
72
                            </td>
73
74
                            <td>
60
                                [% accountline.note | html_line_break %]
75
                                [% accountline.note | html_line_break %]
61
                            </td>
76
                            </td>
62
77
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-1 / +7 lines)
Lines 43-48 Link Here
43
      <tr>
43
      <tr>
44
          <th class="title-string">Date</th>
44
          <th class="title-string">Date</th>
45
          <th>Description of charges</th>
45
          <th>Description of charges</th>
46
          <th>Barcode</th>
47
          <th>Due date</th>
48
          <th>Return date</th>
46
          <th>Home library</th>
49
          <th>Home library</th>
47
          <th>Note</th>
50
          <th>Note</th>
48
          <th>Amount</th>
51
          <th>Amount</th>
Lines 65-70 Link Here
65
        [%- IF account.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %][% END %]
68
        [%- IF account.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %][% END %]
66
        [%- IF account.description %], [% account.description | html %][% END %]
69
        [%- IF account.description %], [% account.description | html %][% END %]
67
        &nbsp;[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | uri %]&amp;itemnumber=[% account.itemnumber | uri %]">[% account.item.biblio.title | html %]</a>[% END %]</td>
70
        &nbsp;[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | uri %]&amp;itemnumber=[% account.itemnumber | uri %]">[% account.item.biblio.title | html %]</a>[% END %]</td>
71
      <td>[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% account.itemnumber | uri %]&amp;biblionumber=[% account.item.biblionumber | uri %]#item[% account.itemnumber | uri %]">[% account.item.barcode | html %]</a>[% END %]</td>
72
      <td>[% IF ( account.issue_id ) %][% account.issue.date_due | $KohaDates with_hours => 1 | html %][% END %]</td>
73
      <td>[% IF ( account.issue_id ) %][% account.issue.returndate | $KohaDates with_hours => 1 | html %][% END %]</td>
68
      <td>[% IF account.itemnumber %][% Branches.GetName( account.item.homebranch ) | html %][% END %]</td>
74
      <td>[% IF account.itemnumber %][% Branches.GetName( account.item.homebranch ) | html %][% END %]</td>
69
      <td>[% account.note | html_line_break %]</td>
75
      <td>[% account.note | html_line_break %]</td>
70
      [% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td>
76
      [% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td>
Lines 94-100 Link Here
94
  [% END %]
100
  [% END %]
95
<tfoot>
101
<tfoot>
96
  <tr>
102
  <tr>
97
    <td colspan="5">Total due</td>
103
    <td colspan="8">Total due</td>
98
    [% IF ( totalcredit ) %]
104
    [% IF ( totalcredit ) %]
99
        <td class="credit" style="text-align: right;">[% total | $Price %]</td>
105
        <td class="credit" style="text-align: right;">[% total | $Price %]</td>
100
    [% ELSE %]
106
    [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (-1 / +11 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE KohaDates %]
4
[% USE AuthorisedValues %]
5
[% USE AuthorisedValues %]
5
[% USE Branches %]
6
[% USE Branches %]
6
[% USE Price %]
7
[% USE Price %]
Lines 43-48 Link Here
43
    <th>&nbsp;</th>
44
    <th>&nbsp;</th>
44
    <th>Fines &amp; charges</th>
45
    <th>Fines &amp; charges</th>
45
    <th>Description</th>
46
    <th>Description</th>
47
    <th>Barcode</th>
48
    <th>Due date</th>
49
    <th>Return date</th>
46
    <th>Payment note</th>
50
    <th>Payment note</th>
47
    <th>Account type</th>
51
    <th>Account type</th>
48
    <th>Amount</th>
52
    <th>Amount</th>
Lines 51-57 Link Here
51
</thead>
55
</thead>
52
<tfoot>
56
<tfoot>
53
<tr>
57
<tr>
54
    <td class="total" colspan="6">Total due:</td>
58
    <td class="total" colspan="9">Total due:</td>
55
    <td style="text-align: right;">[% total | $Price %]</td>
59
    <td style="text-align: right;">[% total | $Price %]</td>
56
</tr>
60
</tr>
57
</tfoot>
61
</tfoot>
Lines 70-75 Link Here
70
    [% END %]
74
    [% END %]
71
    <input type="hidden" name="itemnumber[% line.accountlines_id | html %]" value="[% line.itemnumber | html %]" />
75
    <input type="hidden" name="itemnumber[% line.accountlines_id | html %]" value="[% line.itemnumber | html %]" />
72
    <input type="hidden" name="description[% line.accountlines_id | html %]" value="[% line.description | html %]" />
76
    <input type="hidden" name="description[% line.accountlines_id | html %]" value="[% line.description | html %]" />
77
    <input type="hidden" name="barcode[% line.accountlines_id | html %]" value="[% line.item.barcode | html %]" />
78
    <input type="hidden" name="date_due[% line.accountlines_id | html %]" value="[% line.issue.date_due | html %]" />
79
    <input type="hidden" name="returndate[% line.accountlines_id | html %]" value="[% line.issue.returndate | html %]" />
73
    <input type="hidden" name="accounttype[% line.accountlines_id | html %]" value="[% line.accounttype | html %]" />
80
    <input type="hidden" name="accounttype[% line.accountlines_id | html %]" value="[% line.accounttype | html %]" />
74
    <input type="hidden" name="amount[% line.accountlines_id | html %]" value="[% line.amount | html %]" />
81
    <input type="hidden" name="amount[% line.accountlines_id | html %]" value="[% line.amount | html %]" />
75
    <input type="hidden" name="accountlines_id[% line.accountlines_id | html %]" value="[% line.accountlines_id | html %]" />
82
    <input type="hidden" name="accountlines_id[% line.accountlines_id | html %]" value="[% line.accountlines_id | html %]" />
Lines 103-108 Link Here
103
        [%- IF line.description %], [% line.description | html %][% END %]
110
        [%- IF line.description %], [% line.description | html %][% END %]
104
        [% IF line.title %]([% line.title | html %])[% END %]
111
        [% IF line.title %]([% line.title | html %])[% END %]
105
    </td>
112
    </td>
113
    <td>[% IF line.itemnumber %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% line.itemnumber | uri %]&amp;biblionumber=[% line.biblionumber | uri %]#item[% line.itemnumber | uri %]">[% line.item.barcode | html %]</a>[% END %]</td>
114
    <td>[% IF line.issue_id %][% line.issue.date_due | $KohaDates with_hours => 1 | html %][% END %]</td>
115
    <td>[% IF line.issue_id %][% line.issue.returndate | $KohaDates with_hours => 1 | html %][% END %]</td>
106
    <td><input type="text" name="payment_note_[% line.accountlines_id | html %]" /></td>
116
    <td><input type="text" name="payment_note_[% line.accountlines_id | html %]" /></td>
107
    <td>[% line.accounttype | html %]</td>
117
    <td>[% line.accounttype | html %]</td>
108
    <td class="debit" style="text-align: right;">[% line.amount | $Price %]</td>
118
    <td class="debit" style="text-align: right;">[% line.amount | $Price %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt (-5 / +11 lines)
Lines 18-40 Link Here
18
<table>
18
<table>
19
[% IF ( LibraryName ) %]
19
[% IF ( LibraryName ) %]
20
  <tr>
20
  <tr>
21
    <th colspan="5" class="centerednames">
21
    <th colspan="8" class="centerednames">
22
		<h3>[% LibraryName | html %]</h3>
22
		<h3>[% LibraryName | html %]</h3>
23
	</th>
23
	</th>
24
  </tr>
24
  </tr>
25
[% END %]
25
[% END %]
26
  <tr>
26
  <tr>
27
    <th colspan="5" class="centerednames">
27
    <th colspan="8" class="centerednames">
28
		<h2><u>INVOICE</u></h2>
28
		<h2><u>INVOICE</u></h2>
29
	</th>
29
	</th>
30
  </tr>
30
  </tr>
31
  <tr>
31
  <tr>
32
    <th colspan="5" class="centerednames">
32
    <th colspan="8" class="centerednames">
33
        <h2>[% Branches.GetName( patron.branchcode ) | html %]</h2>
33
        <h2>[% Branches.GetName( patron.branchcode ) | html %]</h2>
34
	</th>
34
	</th>
35
  </tr>
35
  </tr>
36
  <tr>
36
  <tr>
37
    <th colspan="5" >
37
    <th colspan="8" >
38
        Bill to: [% patron.firstname | html %] [% patron.surname | html %] <br />
38
        Bill to: [% patron.firstname | html %] [% patron.surname | html %] <br />
39
        Card number: [% patron.cardnumber | html %]<br />
39
        Card number: [% patron.cardnumber | html %]<br />
40
	</th>
40
	</th>
Lines 42-47 Link Here
42
  <tr>
42
  <tr>
43
	<th>Date</th>
43
	<th>Date</th>
44
    <th>Description of charges</th>
44
    <th>Description of charges</th>
45
	<th>Barcode</th>
46
	<th>Due date</th>
47
	<th>Return date</th>
45
    <th>Note</th>
48
    <th>Note</th>
46
    <th style="text-align:right;">Amount</th>
49
    <th style="text-align:right;">Amount</th>
47
    <th style="text-align:right;">Amount outstanding</th>
50
    <th style="text-align:right;">Amount outstanding</th>
Lines 54-59 Link Here
54
        [% INCLUDE 'accounttype.inc' account => account %]
57
        [% INCLUDE 'accounttype.inc' account => account %]
55
        [%- IF account.description %], [% account.description | html %][% END %]
58
        [%- IF account.description %], [% account.description | html %][% END %]
56
      </td>
59
      </td>
60
      <td>[% account.item.barcode | html %]</td>
61
      <td>[% account.issue.date_due | $KohaDates with_hours => 1 | html %]</td>
62
      <td>[% account.issue.returndate | $KohaDates with_hours => 1 | html %]</td>
57
      <td>[% account.note | html %]</td>
63
      <td>[% account.note | html %]</td>
58
      [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td>
64
      [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td>
59
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td>
65
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td>
Lines 62-68 Link Here
62
  [% END %]
68
  [% END %]
63
<tfoot>
69
<tfoot>
64
  <tr>
70
  <tr>
65
    <td colspan="4">Total outstanding dues as on date: </td>
71
    <td colspan="7">Total outstanding dues as on date: </td>
66
    [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td>
72
    [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td>
67
  </tr>
73
  </tr>
68
  </tfoot>
74
  </tfoot>
(-)a/members/boraccount.pl (+5 lines)
Lines 109-114 while ( my $line = $accts->next ) { Link Here
109
        # Because we will not have access to the object from the template
109
        # Because we will not have access to the object from the template
110
        $accountline->{item} = $line->item;
110
        $accountline->{item} = $line->item;
111
    }
111
    }
112
113
    if ( $accountline->{issue_id} ) {
114
        # Because we will not have access to the object from the template
115
        $accountline->{issue} = $line->issue;
116
    }
112
    push @accountlines, $accountline;
117
    push @accountlines, $accountline;
113
}
118
}
114
119
(-)a/members/pay.pl (-3 / +10 lines)
Lines 141-153 sub add_accounts_to_template { Link Here
141
    my $account_lines = $patron->account->outstanding_debits;
141
    my $account_lines = $patron->account->outstanding_debits;
142
    my $total = $account_lines->total_outstanding;
142
    my $total = $account_lines->total_outstanding;
143
    my @accounts;
143
    my @accounts;
144
    while ( my $account_line = $account_lines->next ) {
144
    while ( my $account_line_object = $account_lines->next ) {
145
        $account_line = $account_line->unblessed;
145
        my $account_line = $account_line_object->unblessed;
146
        if ( $account_line->{itemnumber} ) {
146
        if ( $account_line->{itemnumber} ) {
147
            my $item = Koha::Items->find( $account_line->{itemnumber} );
147
            my $item = $account_line_object->item;
148
            my $biblio = $item->biblio;
148
            my $biblio = $item->biblio;
149
            $account_line->{biblionumber} = $biblio->biblionumber;
149
            $account_line->{biblionumber} = $biblio->biblionumber;
150
            $account_line->{title}        = $biblio->title;
150
            $account_line->{title}        = $biblio->title;
151
            $account_line->{item}         = $item;
152
        }
153
        if ( $account_line->{issue_id} ) {
154
            $account_line->{issue} = $account_line_object->issue;
151
        }
155
        }
152
        push @accounts, $account_line;
156
        push @accounts, $account_line;
153
    }
157
    }
Lines 191-196 sub redirect_to_paycollect { Link Here
191
    $redirect .=
195
    $redirect .=
192
      get_for_redirect( 'amountoutstanding', "amountoutstanding$line_no", 1 );
196
      get_for_redirect( 'amountoutstanding', "amountoutstanding$line_no", 1 );
193
    $redirect .= get_for_redirect( 'description', "description$line_no", 0 );
197
    $redirect .= get_for_redirect( 'description', "description$line_no", 0 );
198
    $redirect .= get_for_redirect( 'barcode', "barcode$line_no", 0 );
199
    $redirect .= get_for_redirect( 'date_due', "date_due$line_no", 0 );
200
    $redirect .= get_for_redirect( 'returndate', "returndate$line_no", 0 );
194
    $redirect .= get_for_redirect( 'title', "title$line_no", 0 );
201
    $redirect .= get_for_redirect( 'title', "title$line_no", 0 );
195
    $redirect .= get_for_redirect( 'itemnumber',   "itemnumber$line_no",   0 );
202
    $redirect .= get_for_redirect( 'itemnumber',   "itemnumber$line_no",   0 );
196
    $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 );
203
    $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 );
(-)a/members/printinvoice.pl (-2 / +4 lines)
Lines 55-61 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log Link Here
55
55
56
#get account details
56
#get account details
57
my $total = $patron->account->balance;
57
my $total = $patron->account->balance;
58
my $accountline = Koha::Account::Lines->find($accountlines_id)->unblessed;
58
my $accountline_object = Koha::Account::Lines->find($accountlines_id);
59
my $accountline = $accountline_object->unblessed;
60
$accountline->{'item'} = $accountline_object->item;
61
$accountline->{'issue'} = $accountline_object->issue;
59
62
60
my $totalcredit;
63
my $totalcredit;
61
if ( $total <= 0 ) {
64
if ( $total <= 0 ) {
62
- 

Return to bug 19489