SelfTest: Transactions: Stornosumme -> copy/paste-Fehler ar statt ap
[kivitendo-erp.git] / SL / Helper / UserPreferences / PartPickerSearch.pm
1 package SL::Helper::UserPreferences::PartPickerSearch;
2
3 use strict;
4 use parent qw(Rose::Object);
5
6 use Carp;
7 use List::MoreUtils qw(none);
8
9 use SL::Helper::UserPreferences;
10
11 use Rose::Object::MakeMethods::Generic (
12   'scalar --get_set_init' => [ qw(user_prefs) ],
13 );
14
15 sub get_sales_search_customer_partnumber {
16   !!$_[0]->user_prefs->get('sales_search_customer_partnumber');
17 }
18
19 sub get_purchase_search_makemodel {
20   !!$_[0]->user_prefs->get('purchase_search_makemodel');
21 }
22
23 sub store_sales_search_customer_partnumber {
24   $_[0]->user_prefs->store('sales_search_customer_partnumber', $_[1]);
25 }
26
27 sub store_purchase_search_makemodel {
28   $_[0]->user_prefs->store('purchase_search_makemodel', $_[1]);
29 }
30
31 sub init_user_prefs {
32   SL::Helper::UserPreferences->new(
33     namespace => $_[0]->namespace,
34   )
35 }
36
37 # read only stuff
38 sub namespace     { 'PartPickerSearch' }
39 sub version       { 1 }
40
41 1;
42
43 __END__
44
45 =pod
46
47 =encoding utf-8
48
49 =head1 NAME
50
51 SL::Helper::UserPreferences::PartPickerSearch - preferences intended
52 to store user settings for the behavior of a partpicker search.
53
54 =head1 SYNOPSIS
55
56   use SL::Helper::UserPreferences::PartPickerSearch;
57   my $prefs = SL::Helper::UserPreferences::PartPickerSearch->new();
58
59   $prefs->store_purchase_search_makemodel(1);
60   my $value = $prefs->get_purchase_search_makemodel;
61
62 =head1 DESCRIPTION
63
64 This module manages storing the settings for the part picker to search for
65 customer/vendor partnumber in sales/purchase forms (new order controller).
66
67 =head1 BUGS
68
69 None yet :)
70
71 =head1 AUTHOR
72
73 Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt>
74
75 =cut