1 package SL::InstanceConfiguration;
10 return bless {}, $class;
16 $self->{data} = selectfirst_hashref_query($::form, $::form->get_standard_dbh, qq|SELECT * FROM defaults|);
18 #To get all currencies and the default currency:
19 ($self->{data}->{curr}) = selectrow_query($::form, $::form->get_standard_dbh, qq|SELECT name AS curr FROM currencies WHERE id = (SELECT currency_id FROM defaults)|);
20 $self->{currencies} = [ map { $_->{name} } selectall_hashref_query($::form, $::form->get_standard_dbh, qq|SELECT name FROM currencies ORDER BY id|) ];
25 sub get_default_currency {
28 return $self->{data}->{curr};
34 return @{ $self->{currencies} };
37 sub get_accounting_method {
39 return $self->{data}->{accounting_method};
42 sub get_inventory_system {
44 return $self->{data}->{inventory_system};
47 sub get_profit_determination {
49 return $self->{data}->{profit_determination};
52 sub get_is_changeable {
54 return $self->{data}->{is_changeable};
57 sub get_ir_changeable {
59 return $self->{data}->{ir_changeable};
62 sub get_ar_changeable {
64 return $self->{data}->{ar_changeable};
67 sub get_ap_changeable {
69 return $self->{data}->{ap_changeable};
72 sub get_gl_changeable {
74 return $self->{data}->{gl_changeable};
77 sub get_datev_check_on_sales_invoice {
79 return $self->{data}->{datev_check_on_sales_invoice};
82 sub get_datev_check_on_purchase_invoice {
84 return $self->{data}->{datev_check_on_purchase_invoice};
87 sub get_datev_check_on_ar_transaction {
89 return $self->{data}->{datev_check_on_ar_transaction};
92 sub get_datev_check_on_ap_transaction {
94 return $self->{data}->{datev_check_on_ap_transaction};
97 sub get_datev_check_on_gl_transaction {
99 return $self->{data}->{datev_check_on_gl_transaction};
102 sub get_show_bestbefore {
104 return $self->{data}->{show_bestbefore};
107 sub get_is_show_mark_as_paid {
109 return $self->{data}->{is_show_mark_as_paid};
112 sub get_ir_show_mark_as_paid {
114 return $self->{data}->{ir_show_mark_as_paid};
117 sub get_ar_show_mark_as_paid {
119 return $self->{data}->{ar_show_mark_as_paid};
122 sub get_ap_show_mark_as_paid {
124 return $self->{data}->{ap_show_mark_as_paid};
127 sub get_sales_order_show_delete {
129 return $self->{data}->{sales_order_show_delete};
132 sub get_purchase_order_show_delete {
134 return $self->{data}->{purchase_order_show_delete};
137 sub get_sales_delivery_order_show_delete {
139 return $self->{data}->{sales_delivery_order_show_delete};
142 sub get_purchase_delivery_order_show_delete {
144 return $self->{data}->{purchase_delivery_order_show_delete};
147 sub get_default_warehouse_id {
149 return ($self->{data}->{warehouse_id});
152 sub get_default_bin_id {
154 return ($self->{data}->{bin_id});
156 sub get_default_warehouse_id_ignore_onhand {
158 return ($self->{data}->{warehouse_id_ignore_onhand});
161 sub get_default_bin_id_ignore_onhand {
163 return ($self->{data}->{bin_id_ignore_onhand});
167 sub get_transfer_default {
169 return ($self->{data}->{transfer_default});
172 sub get_transfer_default_use_master_default_bin {
174 return ($self->{data}->{transfer_default_use_master_default_bin});
177 sub get_transfer_default_ignore_onhand {
179 return ($self->{data}->{transfer_default_ignore_onhand});
181 # currently unused - value is set via audit_control (Bücherkontrolle)
182 sub get_max_future_booking_interval {
184 return ($self->{data}->{max_future_booking_interval});
189 return ($self->{data}->{webdav});
192 sub get_webdav_documents {
194 return ($self->{data}->{webdav_documents});
199 return ($self->{data}->{vertreter});
202 sub get_parts_show_image {
204 return ($self->{data}->{parts_show_image});
207 sub get_parts_listing_images{
209 return ($self->{data}->{parts_listing_image});
212 sub get_parts_image_css {
214 return ($self->{data}->{parts_image_css});
228 SL::InstanceConfiguration - Provide instance-specific configuration data
232 kivitendo has two configuration levels: installation specific
233 (provided by the global variable C<%::lx_office_conf>) and instance
234 specific. The latter is provided by a global instance of this class,
243 Creates a new instance. Does not read the configuration.
247 Reads the configuration from the database. Returns C<$self>.
249 =item C<get_currencies>
251 Returns an array of configured currencies.
253 =item C<get_default_currency>
255 Returns the default currency or undef if no currency has been
258 =item C<get_accounting_method>
260 Returns the default accounting method, accrual or cash
262 =item C<get_inventory_system>
264 Returns the default inventory system, perpetual or periodic
266 =item C<get_profit_determination>
268 Returns the default profit determination method, balance or income
271 =item C<get_is_changeable>
273 =item C<get_ir_changeable>
275 =item C<get_ar_changeable>
277 =item C<get_ap_changeable>
279 =item C<get_gl_changeable>
281 Returns if and when these record types are changeable or deleteable after
282 posting. 0 means never, 1 means always and 2 means on the same day.
284 =item C<get_datev_check_on_sales_invoice>
286 Returns true if datev check should be performed on sales invoices
288 =item C<get_datev_check_on_purchase_invoice>
290 Returns true if datev check should be performed on purchase invoices
292 =item C<get_datev_check_on_ar_transaction>
294 Returns true if datev check should be performed on ar transactions
296 =item C<get_datev_check_on_ap_transaction>
298 Returns true if datev check should be performed on ap transactions
300 =item C<get_datev_check_on_gl_transaction>
302 Returns true if datev check should be performed on gl transactions
304 =item C<get_show_bestbefore>
306 Returns the default behavior for showing best before date, true or false
308 =item C<get_is_show_mark_as_paid>
310 =item C<get_ir_show_mark_as_paid>
312 =item C<get_ar_show_mark_as_paid>
314 =item C<get_ap_show_mark_as_paid>
316 Returns the default behavior for showing the mark as paid button for the
317 corresponding record type (true or false).
319 =item C<get_sales_order_show_delete>
321 =item C<get_purchase_order_show_delete>
323 =item C<get_sales_delivery_order_show_delete>
325 =item C<get_purchase_delivery_order_show_delete>
327 Returns the default behavior for showing the delete button for the
328 corresponding record type (true or false).
330 =item C<get_default_warehouse_id>
332 Returns the default warehouse_id
334 =item C<get_default_bin_id>
336 Returns the default bin_id
338 =item C<get_default_warehouse_id_ignore_onhand>
340 Returns the default warehouse_id for transfers without checking the
341 current stock quantity
343 =item C<get_default_bin_id_ignore_onhand>
345 Returns the default bin_id for transfers without checking the.
346 current stock quantity
350 =item C<get_transfer_default>
352 =item C<get_transfer_default_use_master_default_bin>
354 =item C<get_transfer_default_ignore_onhand>
356 Returns the default behavior for the transfer out default feature (true or false)
358 =item C<get_max_future_booking_interval>
360 Returns the maximum interval value for future bookings
364 Returns the configuration for webdav
366 =item C<get_webdav_documents>
368 Returns the configuration for storing documents in the corresponding webdav folder
370 =item C<get_vertreter>
372 Returns the configuration for "vertreter"
374 =item C<get_parts_show_image>
376 Returns the configuarion for show image in parts
378 =item C<get_parts_image_css>
380 Returns the css format string for images shown in parts
382 =item C<get_parts_listing_image>
384 Returns the configuartion for showing the picture in the results when you search for parts
390 Updates to the I<defaults> table require that the instance
391 configuration is re-read. This has not been implemented yet.
395 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>