use SL::DB::Unit;
use SL::Helper::Flash;
use SL::Locale::String qw(t8);
+use SL::PriceSource::ALL;
use SL::Template;
__PACKAGE__->run_before('check_auth');
use Rose::Object::MakeMethods::Generic (
- 'scalar --get_set_init' => [ qw(defaults all_warehouses all_weightunits all_languages all_currencies all_templates h_unit_name
+ 'scalar --get_set_init' => [ qw(defaults all_warehouses all_weightunits all_languages all_currencies all_templates all_price_sources h_unit_name
posting_options payment_options accounting_options inventory_options profit_options accounts balance_startdate_method_options) ],
);
my $defaults = delete($::form->{defaults}) || {};
my $entered_currencies = delete($::form->{currencies}) || [];
my $original_currency_id = $self->defaults->currency_id;
+ $defaults->{disabled_price_sources} ||= [];
# undef several fields if an empty value has been selected.
foreach (qw(warehouse_id bin_id warehouse_id_ignore_onhand bin_id_ignore_onhand)) {
return \%accounts;
}
+sub init_all_price_sources {
+ my @classes = SL::PriceSource::ALL->all_price_sources;
+
+ [ map { [ $_->name, $_->description ] } @classes ];
+}
+
#
# filters
#
sub edit_form {
my ($self) = @_;
+ $::request->layout->use_javascript("${_}.js") for qw(jquery.selectboxes jquery.multiselect2side);
+
$self->render('client_config/form', title => t8('Client Configuration'),
make_chart_title => sub { $_[0]->accno . '--' . $_[0]->description },
make_templates_value => sub { 'templates/' . $_[0] },
datev_check_on_sales_invoice => { type => 'boolean', default => 'true' },
delivery_plan_calculate_transferred_do => { type => 'boolean', default => 'false', not_null => 1 },
delivery_plan_show_value_of_goods => { type => 'boolean', default => 'false', not_null => 1 },
+ disabled_price_sources => { type => 'array' },
dunning_ar => { type => 'integer' },
dunning_ar_amount_fee => { type => 'integer' },
dunning_ar_amount_interest => { type => 'integer' },
return map {
$_->new(record_item => $self->record_item, record => $self->record)
- } SL::PriceSource::ALL->all_price_sources
+ } SL::PriceSource::ALL->all_enabled_price_sources
}
sub price_from_source {
makemodel
);
+sub all_enabled_price_sources {
+ my %disabled = map { $_ => 1 } @{ $::instance_conf->get_disabled_price_sources };
+
+ map { $price_sources_by_name{$_} } grep { !$disabled{$_} } @price_sources_order;
+}
+
sub all_price_sources {
map { $price_sources_by_name{$_} } @price_sources_order;
}
'All groups' => 'Alle Gruppen',
'All of the exports you have selected were already closed.' => 'Alle von Ihnen ausgewählten Exporte sind bereits abgeschlossen.',
'All partsgroups' => 'Alle Warengruppen',
+ 'All price sources' => 'Alle Preisquellen',
'All reports' => 'Alle Berichte (Kontenübersicht, Summen- u. Saldenliste, GuV, BWA, Bilanz, Projektbuchungen)',
'All the other clients will start with an empty set of WebDAV folders.' => 'Alle anderen Mandanten werden mit einem leeren Satz von WebDAV-Ordnern ausgestattet.',
'All the selected exports have already been closed, or all of their items have already been executed.' => 'Alle ausgewählten Exporte sind als abgeschlossen markiert, oder für alle Einträge wurden bereits Zahlungen verbucht.',
'Difference' => 'Differenz',
'Dimensions' => 'Abmessungen',
'Directory' => 'Verzeichnis',
+ 'Disabled Price Sources' => 'Deaktivierte Preisquellen',
'Discard duplicate entries in CSV file' => 'Doppelte Einträge in CSV-Datei verwerfen',
'Discard entries with duplicates in database or CSV file' => 'Einträge aus CSV-Datei verwerfen, die es bereits in der Datenbank oder der CSV-Datei gibt',
'Discount' => 'Rabatt',
'Price Factor' => 'Preisfaktor',
'Price Factors' => 'Preisfaktoren',
'Price Source' => 'Preisquelle',
+ 'Price Sources to be disabled in this client' => 'Preisquellen die in diesem Mandanten deaktiviert werden sollen',
'Price factor (database ID)' => 'Preisfaktor (Datenbank-ID)',
'Price factor (name)' => 'Preisfaktor (Name)',
'Price factor deleted!' => 'Preisfaktor gelöscht.',
'Price group (database ID)' => 'Preisgruppe (Datenbank-ID)',
'Price group (name)' => 'Preisgruppe (Name) ',
'Price information' => 'Preisinformation',
+ 'Price sources deactivated in this client' => 'Preisquellen die in diesem Mandanten deaktiviert sind',
'Pricegroup' => 'Preisgruppe',
'Pricegroup deleted!' => 'Preisgruppe gelöscht!',
'Pricegroup missing!' => 'Preisgruppe fehlt!',
--- /dev/null
+-- @tag: price_source_client_config
+-- @description: Preisquellen: Preisquellen ausschaltbar per Mandant
+-- @depends: release_3_1_0
+-- @encoding: utf-8
+
+ALTER TABLE defaults ADD disabled_price_sources TEXT[];
<td>[% L.part_picker('defaults.transport_cost_reminder_article_number_id', SELF.defaults.transport_cost_reminder_article_number_id, style=style) %]</td>
<td>[% LxERP.t8('Before saving a sales order, this article will be checked and a warning is generated.') %]</td>
</tr>
+
+ <tr><td class="listheading" colspan="4">[% LxERP.t8("Disabled Price Sources") %]</td></tr>
+ <tr>
+ <td align="right">[% 'Price Sources to be disabled in this client' | $T8 %]</td>
+ <td colspan=2>
+ <div class="clearfix">
+ [% L.select_tag("defaults.disabled_price_sources[]", SELF.all_price_sources, id="defaults_price_sources", multiple=1, default=SELF.defaults.disabled_price_sources) %]
+ [% L.multiselect2side("defaults_price_sources", labelsx=LxERP.t8("All price sources"), labeldx=LxERP.t8("Price sources deactivated in this client")) %]
+ </div>
+ </td>
+ </tr>
+
</table>
</div>