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

(-)a/acqui/acqui-home.pl (-1 / +1 lines)
Lines 135-141 foreach my $budget ( @{$budget_arr} ) { Link Here
135
    }
135
    }
136
136
137
    for my $field (qw( budget_amount budget_spent budget_ordered budget_avail ) ) {
137
    for my $field (qw( budget_amount budget_spent budget_ordered budget_avail ) ) {
138
        $budget->{$field} = $num_formatter->format_price( $budget->{$field} );
138
        $budget->{"formatted_$field"} = $num_formatter->format_price( $budget->{$field} );
139
    }
139
    }
140
140
141
    push @budget_loop, $budget;
141
    push @budget_loop, $budget;
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js (-1 / +29 lines)
Lines 495-500 jQuery.extend( jQuery.fn.dataTableExt.oSort, { Link Here
495
    }
495
    }
496
} );
496
} );
497
497
498
499
/* Plugin to allow sorting on numeric data stored in a span's title attribute
500
 *
501
 * Ex: <td><span title="[% decimal_number_that_JS_parseFloat_accepts %]">
502
 *              [% formatted currency %]
503
 *     </span></td>
504
 *
505
 * In DataTables config:
506
 *     "aoColumns": [
507
 *        { "sType": "title-numeric" },
508
 *      ]
509
 * http://datatables.net/plug-ins/sorting#hidden_title
510
 */
511
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
512
    "title-numeric-pre": function ( a ) {
513
        var x = a.match(/title="*(-?[0-9\.]+)/)[1];
514
        return parseFloat( x );
515
    },
516
517
    "title-numeric-asc": function ( a, b ) {
518
        return ((a < b) ? -1 : ((a > b) ? 1 : 0));
519
    },
520
521
    "title-numeric-desc": function ( a, b ) {
522
        return ((a < b) ? 1 : ((a > b) ? -1 : 0));
523
    }
524
} );
525
498
(function() {
526
(function() {
499
527
500
    /* Plugin to allow text sorting to ignore articles
528
    /* Plugin to allow text sorting to ignore articles
Lines 537-540 jQuery.extend( jQuery.fn.dataTableExt.oSort, { Link Here
537
        }
565
        }
538
    });
566
    });
539
567
540
}());
568
}());
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt (-13 / +12 lines)
Lines 32-41 $(document).ready(function() { Link Here
32
            null,
32
            null,
33
            null,
33
            null,
34
            null,
34
            null,
35
            null,
35
            { "sType": "title-numeric" },
36
            { "sType": "num-html" },
36
            { "sType": "title-numeric" },
37
            { "sType": "num-html" },
37
            { "sType": "title-numeric" },
38
            null
38
            { "sType": "title-numeric" }
39
        ],
39
        ],
40
        'sDom': 't',
40
        'sDom': 't',
41
        'bPaginate': false,
41
        'bPaginate': false,
Lines 154-163 $(document).ready(function() { Link Here
154
                    [% END %]
154
                    [% END %]
155
                </td>
155
                </td>
156
                <td>[% loop_budge.budget_branchname %]</td>
156
                <td>[% loop_budge.budget_branchname %]</td>
157
                <td class="data">[% loop_budge.budget_amount %]</td>
157
                <td class="data"><span title="[% loop_budge.budget_amount %]">[% loop_budge.formatted_budget_amount %]</span></td>
158
                <td class="data"><a href="ordered.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_ordered %]</a></td>
158
                <td class="data"><span title="[% loop_budge.budget_ordered %]"><a href="ordered.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_ordered %]</a></span></td>
159
                <td class="data"><a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_spent %]</a></td>
159
                <td class="data"><span title="[% loop_budge.budget_spent %]"><a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_spent %]</span></a></td>
160
                <td class="data">[% loop_budge.budget_avail %]</td>
160
                <td class="data"><span title="[% loop_budge.budget_avail %]">[% loop_budge.formatted_budget_avail %]</td>
161
            </tr>
161
            </tr>
162
        [% ELSE %]
162
        [% ELSE %]
163
            <tr class="b_inactive">
163
            <tr class="b_inactive">
Lines 177-186 $(document).ready(function() { Link Here
177
                    [% END %]
177
                    [% END %]
178
                </td>
178
                </td>
179
                <td>[% loop_budge.budget_branchname %]</td>
179
                <td>[% loop_budge.budget_branchname %]</td>
180
                <td class="data">[% loop_budge.budget_amount %]</td>
180
                <td class="data"><span title="[% loop_budge.budget_amount %]">[% loop_budge.formatted_budget_amount %]</span></td>
181
                <td class="data"><a href="ordered.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_ordered %]</a></td>
181
                <td class="data"><span title="[% loop_budge.budget_ordered %]"><a href="ordered.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_ordered %]</a></span></td>
182
                <td class="data"><a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_spent %]</a></td>
182
                <td class="data"><span title="[% loop_budge.budget_spent %]"><a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_spent %]</span></a></td>
183
                <td class="data">[% loop_budge.budget_avail %]</td>
183
                <td class="data"><span title="[% loop_budge.budget_avail %]">[% loop_budge.formatted_budget_avail %]</td>
184
            </tr>
184
            </tr>
185
        [% END %]
185
        [% END %]
186
        [% END %]
186
        [% END %]
187
- 

Return to bug 10792