From fd0a62ab6e04848235d609db53ad90a39dc921c8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 22 Jan 2013 10:19:21 +0100 Subject: [PATCH] Rose-Order-Manager: Sortier-Spezifikation und Paginating --- SL/DB/Manager/Order.pm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/SL/DB/Manager/Order.pm b/SL/DB/Manager/Order.pm index ff8ece29f..3c76073e8 100644 --- a/SL/DB/Manager/Order.pm +++ b/SL/DB/Manager/Order.pm @@ -2,8 +2,10 @@ package SL::DB::Manager::Order; use strict; -use SL::DB::Helper::Manager; -use base qw(SL::DB::Helper::Manager); +use parent qw(SL::DB::Helper::Manager); + +use SL::DB::Helper::Paginated; +use SL::DB::Helper::Sorted; sub object_class { 'SL::DB::Order' } @@ -22,4 +24,22 @@ sub type_filter { die "Unknown type $type"; } +sub _sort_spec { + return ( + default => [ 'transdate', 1 ], + nulls => { + transaction_description => 'FIRST', + customer_name => 'FIRST', + default => 'LAST', + }, + columns => { + SIMPLE => 'ALL', + customer => 'customer.name', + globalprojectnumber => 'lower(globalproject.projectnumber)', + map { ( $_ => "lower(oe.$_)" ) } qw(ordnumber quonumber cusordnumber shippingpoint shipvia notes intnotes transaction_description), + }); +} + +sub default_objects_per_page { 40 } + 1; -- 2.20.1