1 package SL::InstanceConfiguration;
9 use parent qw(Rose::Object);
10 use Rose::Object::MakeMethods::Generic (
11 'scalar --get_set_init' => [ qw(data currencies) ],
15 my $default = SL::DB::Default->get;
16 my $data = { map { $_ => $default->$_ } $default->meta->columns };
17 $data->{default_currency} = $default->currency ? $default->currency->name : undef;
23 return [ map { $_->name } @{ SL::DB::Manager::Currency->get_all_sorted } ];
28 $self->{data} = $self->init_data;
29 $self->{currencies} = $self->init_currencies;
35 return @{ $self->currencies };
42 my $method = $AUTOLOAD;
45 if ($method =~ m/^get_/) {
46 $method = substr $method, 4;
47 return $self->data->{$method} if exists $self->data->{$method};
48 croak "Invalid method 'get_${method}'";
51 croak "Invalid method '${method}'" if !$self->can($method);
52 return $self->$method(@_);
65 SL::InstanceConfiguration - Provide instance-specific configuration data
69 kivitendo has two configuration levels: installation specific
70 (provided by the global variable C<%::lx_office_conf>) and instance
71 specific. The latter is provided by a global instance of this class,
80 Creates a new instance. Does not read the configuration.
84 Reads the configuration from the database. Returns C<$self>.
86 =item C<get_currencies>
88 Returns an array of configured currencies.
90 =item C<get_default_currency>
92 Returns the default currency or undef if no currency has been
95 =item C<get_accounting_method>
97 Returns the default accounting method, accrual or cash
99 =item C<get_inventory_system>
101 Returns the default inventory system, perpetual or periodic
103 =item C<get_profit_determination>
105 Returns the default profit determination method, balance or income
108 =item C<get_is_changeable>
110 =item C<get_ir_changeable>
112 =item C<get_ar_changeable>
114 =item C<get_ap_changeable>
116 =item C<get_gl_changeable>
118 Returns if and when these record types are changeable or deleteable after
119 posting. 0 means never, 1 means always and 2 means on the same day.
121 =item C<get_datev_check_on_sales_invoice>
123 Returns true if datev check should be performed on sales invoices
125 =item C<get_datev_check_on_purchase_invoice>
127 Returns true if datev check should be performed on purchase invoices
129 =item C<get_datev_check_on_ar_transaction>
131 Returns true if datev check should be performed on ar transactions
133 =item C<get_datev_check_on_ap_transaction>
135 Returns true if datev check should be performed on ap transactions
137 =item C<get_datev_check_on_gl_transaction>
139 Returns true if datev check should be performed on gl transactions
141 =item C<get_show_bestbefore>
143 Returns the default behavior for showing best before date, true or false
145 =item C<get_is_show_mark_as_paid>
147 =item C<get_ir_show_mark_as_paid>
149 =item C<get_ar_show_mark_as_paid>
151 =item C<get_ap_show_mark_as_paid>
153 Returns the default behavior for showing the mark as paid button for the
154 corresponding record type (true or false).
156 =item C<get_sales_order_show_delete>
158 =item C<get_purchase_order_show_delete>
160 =item C<get_sales_delivery_order_show_delete>
162 =item C<get_purchase_delivery_order_show_delete>
164 Returns the default behavior for showing the delete button for the
165 corresponding record type (true or false).
167 =item C<get_default_warehouse_id>
169 Returns the default warehouse_id
171 =item C<get_default_bin_id>
173 Returns the default bin_id
175 =item C<get_default_warehouse_id_ignore_onhand>
177 Returns the default warehouse_id for transfers without checking the
178 current stock quantity
180 =item C<get_default_bin_id_ignore_onhand>
182 Returns the default bin_id for transfers without checking the.
183 current stock quantity
187 =item C<get_transfer_default>
189 =item C<get_transfer_default_use_master_default_bin>
191 =item C<get_transfer_default_ignore_onhand>
193 Returns the default behavior for the transfer out default feature (true or false)
195 =item C<get_max_future_booking_interval>
197 Returns the maximum interval value for future bookings
201 Returns the configuration for webdav
203 =item C<get_webdav_documents>
205 Returns the configuration for storing documents in the corresponding webdav folder
207 =item C<get_vertreter>
209 Returns the configuration for "vertreter"
211 =item C<get_parts_show_image>
213 Returns the configuarion for show image in parts
215 =item C<get_parts_image_css>
217 Returns the css format string for images shown in parts
219 =item C<get_parts_listing_image>
221 Returns the configuartion for showing the picture in the results when you search for parts
227 Updates to the I<defaults> table require that the instance
228 configuration is re-read. This has not been implemented yet.
232 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>