+++ /dev/null
-package SL::Controller::Business;
-
-use strict;
-
-use parent qw(SL::Controller::Base);
-
-use SL::DB::Business;
-use SL::Helper::Flash;
-
-use Rose::Object::MakeMethods::Generic
-(
- scalar => [ qw(business) ],
-);
-
-__PACKAGE__->run_before('check_auth');
-__PACKAGE__->run_before('load_business', only => [ qw(edit update destroy) ]);
-
-#
-# actions
-#
-
-sub action_list {
- my ($self) = @_;
-
- $self->render('business/list',
- title => $::locale->text('Businesses'),
- BUSINESSES => SL::DB::Manager::Business->get_all_sorted);
-}
-
-sub action_new {
- my ($self) = @_;
-
- $self->{business} = SL::DB::Business->new;
- $self->render('business/form', title => $::locale->text('Create a new business'));
-}
-
-sub action_edit {
- my ($self) = @_;
- $self->render('business/form', title => $::locale->text('Edit business'));
-}
-
-sub action_create {
- my ($self) = @_;
-
- $self->{business} = SL::DB::Business->new;
- $self->create_or_update;
-}
-
-sub action_update {
- my ($self) = @_;
- $self->create_or_update;
-}
-
-sub action_destroy {
- my ($self) = @_;
-
- if (eval { $self->{business}->delete; 1; }) {
- flash_later('info', $::locale->text('The business has been deleted.'));
- } else {
- flash_later('error', $::locale->text('The business is in use and cannot be deleted.'));
- }
-
- $self->redirect_to(action => 'list');
-}
-
-#
-# filters
-#
-
-sub check_auth {
- $::auth->assert('config');
-}
-
-#
-# helpers
-#
-
-sub create_or_update {
- my $self = shift;
- my $is_new = !$self->{business}->id;
- my $params = delete($::form->{business}) || { };
-
- $self->{business}->assign_attributes(%{ $params });
-
- my @errors = $self->{business}->validate;
-
- if (@errors) {
- flash('error', @errors);
- $self->render('business/form', title => $is_new ? $::locale->text('Create a new business') : $::locale->text('Edit business'));
- return;
- }
-
- $self->{business}->save;
-
- flash_later('info', $is_new ? $::locale->text('The business has been created.') : $::locale->text('The business has been saved.'));
- $self->redirect_to(action => 'list');
-}
-
-sub load_business {
- my ($self) = @_;
- $self->{business} = SL::DB::Business->new(id => $::form->{id})->load;
-}
-
-1;
],
},
+ business => {
+ # Make locales.pl happy: $self->render("simple_system_setting/_business_form")
+ class => 'Business',
+ titles => {
+ list => t8('Businesses'),
+ add => t8('Add business'),
+ edit => t8('Edit business'),
+ },
+ list_attributes => [
+ { method => 'description', title => t8('Description'), },
+ { title => t8('Discount'), formatter => sub { $_[0]->discount_as_percent . ' %' }, align => 'right' },
+ { method => 'customernumberinit', title => t8('Customernumberinit'), },
+ ],
+ },
+
department => {
class => 'Department',
titles => {
'Add and edit units' => 'Einheiten erfassen und bearbeiten',
'Add bank account' => 'Bankkonto erfassen',
'Add booking group' => 'Buchungsgruppe erfassen',
+ 'Add business' => 'Kunden-/Lieferantentyp hinzufügen',
'Add custom variable' => 'Benutzerdefinierte Variable erfassen',
'Add department' => 'Abteilung hinzufügen',
'Add empty line (csv_import)' => 'Leere Zeile einfügen',
'Are you sure you want to delete Invoice Number' => 'Soll die Rechnung mit folgender Nummer wirklich gelöscht werden:',
'Are you sure you want to delete Transaction' => 'Buchung wirklich löschen?',
'Are you sure you want to delete this background job?' => 'Sind Sie sicher, dass Sie diesen Hintergrund-Job löschen möchten?',
- 'Are you sure you want to delete this business?' => 'Sind Sie sicher, dass Sie diesen Kunden-/Lieferantentyp löschen wollen?',
'Are you sure you want to delete this delivery term?' => 'Wollen Sie diese Lieferbedingungen wirklich löschen?',
'Are you sure you want to delete this letter?' => 'Sind Sie sicher, dass Sie diesen Brief löschen wollen?',
'Are you sure you want to delete this payment term?' => 'Wollen Sie diese Zahlungsbedingungen wirklich löschen?',
'Create PDF' => 'PDF erzeugen',
'Create a new acceptance status' => 'Einen neuen Abnahmestatus anlegen',
'Create a new background job' => 'Einen neuen Hintergrund-Job anlegen',
- 'Create a new business' => 'Einen neuen Kunden-/Lieferantentyp erfassen',
'Create a new client' => 'Einen neuen Mandanten anlegen',
'Create a new complexity' => 'Einen Komplexitätsgrad anlegen',
'Create a new delivery term' => 'Neue Lieferbedingungen anlegen',
'Create invoices' => 'Rechnungen erzeugen',
'Create new' => 'Neu erfassen',
'Create new background job' => 'Neuen Hintergrund-Job anlegen',
- 'Create new business' => 'Kunden-/Lieferantentyp erfassen',
'Create new client #1' => 'Neuen Mandanten #1 anlegen',
'Create new delivery term' => 'Neue Lieferbedingungen anlegen',
'Create new payment term' => 'Neue Zahlungsbedingung anlegen',
'No bank information has been entered in this customer\'s master data entry. You cannot create bank collections unless you enter bank information.' => 'Für diesen Kunden wurden in seinen Stammdaten keine Kontodaten hinterlegt. Solange dies nicht geschehen ist, können Sie keine Überweisungen für den Lieferanten anlegen.',
'No bank information has been entered in this vendor\'s master data entry. You cannot create bank transfers unless you enter bank information.' => 'Für diesen Lieferanten wurden in seinen Stammdaten keine Kontodaten hinterlegt. Solange dies nicht geschehen ist, können Sie keine Überweisungen für den Lieferanten anlegen.',
'No bins have been added to this warehouse yet.' => 'Es wurden zu diesem Lager noch keine Lagerplätze angelegt.',
- 'No business has been created yet.' => 'Es wurden noch kein Kunden-/Lieferantentyp erfasst.',
'No changes since previous version.' => 'Keine Änderungen seit der letzten Version.',
'No clients have been created yet.' => 'Es wurden noch keine Mandanten angelegt.',
'No complexities has been created yet.' => 'Es wurden noch keine Komplexitätsgrade angelegt.',
'The booking group is in use and cannot be deleted.' => 'Die Buchungsgruppe wird benutzt und kann daher nicht gelöscht werden.',
'The booking group needs an inventory account.' => 'Die Buchungsgruppe braucht ein Warenbestandskonto.',
'The buchungsgruppe is missing.' => 'Die Buchungsgruppe fehlt.',
- 'The business has been created.' => 'Der Kunden-/Lieferantentyp wurde erfasst.',
- 'The business has been deleted.' => 'Der Kunden-/Lieferantentyp wurde gelöscht.',
- 'The business has been saved.' => 'Der Kunden-/Lieferantentyp wurde gespeichert.',
- 'The business is in use and cannot be deleted.' => 'Der Kunden-/Lieferantentyp wird benutzt und kann nicht gelöscht werden.',
'The changing of tax-o-matic account is NOT recommended, but if you do so please also (re)configure booking groups and reconfigure ALL charts which point to this tax-o-matic account. ' => 'Es wird nicht empfohlen Steuerkonten (Umsatzsteuer oder Vorsteuer) "umzuhängen", aber falls es gemacht wird, bitte auch entsprechend konsequent die Buchungsgruppen und die Konten die mit dieser Steuer verknüpft sind umkonfigurieren.',
'The chart is not valid.' => 'Das Konto ist nicht gültig.',
'The client could not be deleted.' => 'Der Mandant konnte nicht gelöscht werden.',
name: Types of Business
order: 1400
params:
- action: Business/list
+ action: SimpleSystemSetting/list
+ type: business
- parent: system
id: system_project_types
name: Project Types
+++ /dev/null
-[% USE HTML %][% USE L %][% USE LxERP %]
-<h1>[% FORM.title %]</h1>
-
- <form method="post" action="controller.pl">
-
-[%- INCLUDE 'common/flash.html' %]
-
- <table>
- <tr>
- <td>[%- LxERP.t8('Description') %]</td>
- <td>[% L.input_tag("business.description", SELF.business.description, "size", 30) %]</td>
- </tr>
-
- <tr>
- <td>[%- LxERP.t8('Discount') %]</td>
- <td>[% L.input_tag("business.discount_as_percent", SELF.business.discount_as_percent, "size", 5) %]%</td>
- </tr>
-
- <tr>
- <td>[%- LxERP.t8('Customernumberinit') %]</td>
- <td>[% L.input_tag("business.customernumberinit", SELF.business.customernumberinit, "size", 10) %]</td>
- </tr>
-
- [%- IF LXCONFIG.features.vertreter %]
- <tr>
- <td>[%- LxERP.t8('Representative') %]</td>
- <td>[% L.checkbox_tag("business.salesman", "value", 1, "checked", SELF.business.salesman) %]</td>
- </tr>
- [%- END %]
- </table>
-
- <p>
- [% L.hidden_tag("id", SELF.business.id) %]
- [% L.hidden_tag("action", "Business/dispatch") %]
- [% L.submit_tag("action_" _ (SELF.business.id ? "update" : "create"), LxERP.t8('Save')) %]
- [%- IF SELF.business.id %]
- [% L.submit_tag("action_destroy", LxERP.t8("Delete"), "confirm", LxERP.t8("Are you sure you want to delete this business?")) %]
- [%- END %]
- <a href="[% SELF.url_for(action => 'list') %]">[%- LxERP.t8('Abort') %]</a>
- </p>
- </form>
+++ /dev/null
-[% USE HTML %][% USE L %][% USE LxERP %]
-<h1>[% FORM.title %]</h1>
-
-[%- INCLUDE 'common/flash.html' %]
-
- <form method="post" action="controller.pl">
- [% IF !BUSINESSES.size %]
- <p>
- [%- LxERP.t8('No business has been created yet.') %]
- </p>
-
- [%- ELSE %]
- <table id="business_list" width="100%">
- <thead>
- <tr class="listheading">
- <th width="80%">[%- LxERP.t8('Description') %]</th>
- <th>[%- LxERP.t8('Discount') %]</th>
- <th>[%- LxERP.t8('Customernumberinit') %]</th>
- [%- IF LXCONFIG.features.vertreter %]
- <th>[%- LxERP.t8('Representative') %]</th>
- [%- END %]
- </tr>
- </thead>
-
- <tbody>
- [%- FOREACH business = BUSINESSES %]
- <tr class="listrow[% loop.count % 2 %]" id="business_id_[% business.id %]">
- <td>
- <a href="[% SELF.url_for(action => 'edit', id => business.id) %]">
- [%- HTML.escape(business.description) %]
- </a>
- </td>
- <td align="right">[% LxERP.format_amount(business.discount * 100) %] %</td>
- <td align="right">[%- HTML.escape(business.customernumberinit) %]</td>
- [%- IF LXCONFIG.features.vertreter %]
- <td>[%- IF business.salesman %][%- LxERP.t8('Yes') %][%- ELSE %][%- LxERP.t8('No') %][%- END %]</td>
- [%- END %]
- </tr>
- [%- END %]
- </tbody>
- </table>
- [%- END %]
-
- <hr size="3" noshade>
-
- <p>
- <a href="[% SELF.url_for(action => 'new') %]">[%- LxERP.t8('Create new business') %]</a>
- </p>
- </form>
--- /dev/null
+[%- USE LxERP -%][%- USE L -%]
+[% SET style="width: 200px" %]
+<table>
+ <tr>
+ <td>[%- LxERP.t8("Description") %]</td>
+ <td>[% L.input_tag("object.description", SELF.object.description, style=style, "data-validate"="required", "data-title"=LxERP.t8("Description")) %]</td>
+ </tr>
+
+ <tr>
+ <td>[%- LxERP.t8("Discount") %]</td>
+ <td>[% L.input_tag("object.discount_as_percent", SELF.object.discount_as_percent, style=style) %]%</td>
+ </tr>
+
+ <tr>
+ <td>[%- LxERP.t8("Customernumberinit") %]</td>
+ <td>[% L.input_tag("object.customernumberinit", SELF.object.customernumberinit, style=style) %]</td>
+ </tr>
+
+ [%- IF LXCONFIG.features.vertreter %]
+ <tr>
+ <td>[%- LxERP.t8("Representative") %]</td>
+ <td>[% L.checkbox_tag("object.salesman", "value", 1, "checked", SELF.object.salesman, for_submit=1) %]</td>
+ </tr>
+ [%- END %]
+</table>