Revision 508801bb
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub business {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my ($self, $myconfig, $form) = @_;
|
||
|
||
# connect to database
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
|
||
my $query = qq|SELECT id, description, discount, customernumberinit, salesman
|
||
FROM business
|
||
ORDER BY 2|;
|
||
|
||
my $sth = $dbh->prepare($query);
|
||
$sth->execute || $form->dberror($query);
|
||
|
||
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
||
push @{ $form->{ALL} }, $ref;
|
||
}
|
||
|
||
$sth->finish;
|
||
$dbh->disconnect;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub get_business {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my ($self, $myconfig, $form) = @_;
|
||
|
||
# connect to database
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
|
||
my $query =
|
||
qq|SELECT b.description, b.discount, b.customernumberinit, b.salesman
|
||
FROM business b
|
||
WHERE b.id = ?|;
|
||
my $sth = $dbh->prepare($query);
|
||
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
|
||
|
||
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
||
|
||
map { $form->{$_} = $ref->{$_} } keys %$ref;
|
||
|
||
$sth->finish;
|
||
|
||
$dbh->disconnect;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub save_business {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my ($self, $myconfig, $form) = @_;
|
||
my ($query);
|
||
|
||
# connect to database
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
|
||
my @values = ($form->{description}, $form->{discount}, $form->{customernumberinit}, $form->{salesman} ? 't' : 'f');
|
||
# id is the old record
|
||
if ($form->{id}) {
|
||
$query = qq|UPDATE business SET
|
||
description = ?,
|
||
discount = ?,
|
||
customernumberinit = ?,
|
||
salesman = ?
|
||
WHERE id = ?|;
|
||
push(@values, $form->{id});
|
||
} else {
|
||
$query = qq|INSERT INTO business
|
||
(description, discount, customernumberinit, salesman)
|
||
VALUES (?, ?, ?, ?)|;
|
||
}
|
||
do_query($form, $dbh, $query, @values);
|
||
|
||
$dbh->disconnect;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub delete_business {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my ($self, $myconfig, $form) = @_;
|
||
|
||
# connect to database
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
|
||
my $query = qq|DELETE FROM business
|
||
WHERE id = ?|;
|
||
do_query($form, $dbh, $query, $form->{id});
|
||
|
||
$dbh->disconnect;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
|
||
sub language {
|
||
$main::lxdebug->enter_sub();
|
||
|
SL/Controller/Business.pm | ||
---|---|---|
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'),
|
||
BUSINESSS => 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;
|
SL/DB/Business.pm | ||
---|---|---|
# This file has been auto-generated only because it didn't exist.
|
||
# Feel free to modify it at will; it will not be overwritten automatically.
|
||
|
||
package SL::DB::Business;
|
||
|
||
use strict;
|
||
|
||
use SL::DB::MetaSetup::Business;
|
||
use SL::DB::Manager::Business;
|
||
|
||
sub validate {
|
||
my ($self) = @_;
|
||
|
||
my @errors;
|
||
push @errors, $::locale->text('The description is missing.') if !$self->description;
|
||
push @errors, $::locale->text('The discount must not be negative.') if $self->discount < 0;
|
||
push @errors, $::locale->text('The discount must be less than 100%.') if $self->discount >= 1;
|
||
|
||
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
|
||
__PACKAGE__->meta->make_manager_class;
|
||
return @errors;
|
||
}
|
||
|
||
1;
|
SL/DB/Manager/Business.pm | ||
---|---|---|
package SL::DB::Manager::Business;
|
||
|
||
use strict;
|
||
|
||
use SL::DB::Helper::Manager;
|
||
use base qw(SL::DB::Helper::Manager);
|
||
|
||
use SL::DB::Helper::Sorted;
|
||
|
||
sub object_class { 'SL::DB::Business' }
|
||
|
||
__PACKAGE__->make_manager_methods;
|
||
|
||
sub _sort_spec {
|
||
return ( default => [ 'description', 1 ],
|
||
columns => { SIMPLE => 'ALL',
|
||
map { ( $_ => "lower(business.$_)" ) } qw(description)
|
||
});
|
||
}
|
||
|
||
1;
|
bin/mozilla/am.pl | ||
---|---|---|
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub add_business {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my $form = $main::form;
|
||
|
||
$main::auth->assert('config');
|
||
|
||
$form->{title} = "Add";
|
||
|
||
$form->{callback} = "am.pl?action=add_business" unless $form->{callback};
|
||
|
||
&business_header;
|
||
&form_footer;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub edit_business {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my $form = $main::form;
|
||
my %myconfig = %main::myconfig;
|
||
|
||
$form->{title} = "Edit";
|
||
|
||
AM->get_business(\%myconfig, \%$form);
|
||
|
||
&business_header;
|
||
|
||
$form->{orphaned} = 1;
|
||
&form_footer;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub list_business {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my $form = $main::form;
|
||
my %myconfig = %main::myconfig;
|
||
my $locale = $main::locale;
|
||
|
||
$main::auth->assert('config');
|
||
|
||
AM->business(\%myconfig, \%$form);
|
||
|
||
$form->{callback} = "am.pl?action=list_business";
|
||
|
||
my $callback = $form->escape($form->{callback});
|
||
|
||
$form->{title} = $locale->text('Type of Business');
|
||
|
||
my @column_index = qw(description discount customernumberinit);
|
||
push @column_index, 'salesman' if $::lx_office_conf{features}->{vertreter};
|
||
my %column_header;
|
||
$column_header{description} =
|
||
qq|<th class=listheading width=60%>|
|
||
. $locale->text('Description')
|
||
. qq|</th>|;
|
||
$column_header{discount} =
|
||
qq|<th class=listheading width=10%>|
|
||
. $locale->text('Discount')
|
||
. qq| %</th>|;
|
||
$column_header{customernumberinit} =
|
||
qq|<th class=listheading>|
|
||
. $locale->text('Customernumberinit')
|
||
. qq|</th>|;
|
||
$column_header{salesman} =
|
||
qq|<th class=listheading>|
|
||
. $locale->text('Representative')
|
||
. qq|</th>|;
|
||
|
||
$form->header;
|
||
|
||
print qq|
|
||
<body>
|
||
|
||
<table width=100%>
|
||
<tr>
|
||
<th class=listtop>$form->{title}</th>
|
||
</tr>
|
||
<tr height="5"></tr>
|
||
<tr>
|
||
<td>
|
||
<table width=100%>
|
||
<tr class=listheading>
|
||
|;
|
||
|
||
map { print "$column_header{$_}\n" } @column_index;
|
||
|
||
print qq|
|
||
</tr>
|
||
|;
|
||
|
||
my ($i, %column_data);
|
||
foreach my $ref (@{ $form->{ALL} }) {
|
||
|
||
$i++;
|
||
$i %= 2;
|
||
|
||
print qq|
|
||
<tr valign=top class=listrow$i>
|
||
|;
|
||
|
||
my $discount = $form->format_amount(\%myconfig, $ref->{discount} * 100);
|
||
my $description = $ref->{description};
|
||
$column_data{description} = qq|<td><a href="am.pl?action=edit_business&id=$ref->{id}&callback=$callback">$description</td>|;
|
||
$column_data{discount} = qq|<td align=right>$discount</td>|;
|
||
$column_data{customernumberinit} =
|
||
qq|<td align=right>$ref->{customernumberinit}</td>|;
|
||
$column_data{salesman} = '<td>' . ($ref->{salesman} ? $::locale->text('Yes') : $::locale->text('No')) . '</td>';
|
||
|
||
map { print "$column_data{$_}\n" } @column_index;
|
||
|
||
print qq|
|
||
</tr>
|
||
|;
|
||
}
|
||
|
||
print qq|
|
||
</table>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><hr size=3 noshade></td>
|
||
</tr>
|
||
</table>
|
||
|
||
<br>
|
||
<form method=post action=am.pl>
|
||
|
||
<input name=callback type=hidden value="$form->{callback}">
|
||
|
||
<input type=hidden name=type value=business>
|
||
|
||
<input class=submit type=submit name=action value="|
|
||
. $locale->text('Add') . qq|">
|
||
|
||
</form>
|
||
|
||
</body>
|
||
</html>
|
||
|;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub business_header {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my $form = $main::form;
|
||
my %myconfig = %main::myconfig;
|
||
my $locale = $main::locale;
|
||
|
||
$main::auth->assert('config');
|
||
|
||
$form->{title} = $locale->text("$form->{title} Business");
|
||
|
||
# $locale->text('Add Business')
|
||
# $locale->text('Edit Business')
|
||
|
||
$form->{description} =~ s/\"/"/g;
|
||
$form->{discount} =
|
||
$form->format_amount(\%myconfig, $form->{discount} * 100);
|
||
|
||
my $salesman_code;
|
||
if ($::lx_office_conf{features}->{vertreter}) {
|
||
$salesman_code = qq|
|
||
<tr>
|
||
<th align="right">| . $locale->text('Representative') . qq|</th>
|
||
<td>| . $::cgi->checkbox(-name => "salesman", -value => 1, -label => '', 'checked' => $form->{salesman} ? 1 : 0) . qq|</td>
|
||
</tr>
|
||
|;
|
||
} else {
|
||
$salesman_code = $::cgi->hidden(-name => 'salesman', -value => $form->{salesman} ? 1 : 0);
|
||
}
|
||
|
||
$form->header;
|
||
|
||
print qq|
|
||
<body>
|
||
|
||
<form method=post action=am.pl>
|
||
|
||
<input type=hidden name=id value=$form->{id}>
|
||
<input type=hidden name=type value=business>
|
||
|
||
<table width=100%>
|
||
<tr>
|
||
<th class=listtop colspan=2>$form->{title}</th>
|
||
</tr>
|
||
<tr height="5"></tr>
|
||
<tr>
|
||
<th align=right>| . $locale->text('Type of Business') . qq|</th>
|
||
<td><input name=description size=30 value="$form->{description}"></td>
|
||
<tr>
|
||
<tr>
|
||
<th align=right>| . $locale->text('Discount') . qq| %</th>
|
||
<td><input name=discount size=5 value=$form->{discount}></td>
|
||
</tr>
|
||
<tr>
|
||
<th align=right>| . $locale->text('Customernumberinit') . qq|</th>
|
||
<td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
|
||
</tr>
|
||
$salesman_code
|
||
<td colspan=2><hr size=3 noshade></td>
|
||
</tr>
|
||
</table>
|
||
|;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub save_business {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my $form = $main::form;
|
||
my %myconfig = %main::myconfig;
|
||
my $locale = $main::locale;
|
||
|
||
$main::auth->assert('config');
|
||
|
||
$form->isblank("description", $locale->text('Description missing!'));
|
||
$form->{discount} = $form->parse_amount(\%myconfig, $form->{discount}) / 100;
|
||
AM->save_business(\%myconfig, \%$form);
|
||
$form->redirect($locale->text('Business saved!'));
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub delete_business {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my $form = $main::form;
|
||
my %myconfig = %main::myconfig;
|
||
my $locale = $main::locale;
|
||
|
||
$main::auth->assert('config');
|
||
|
||
AM->delete_business(\%myconfig, \%$form);
|
||
$form->redirect($locale->text('Business deleted!'));
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub add_language {
|
||
$main::lxdebug->enter_sub();
|
||
|
locale/de/all | ||
---|---|---|
'Are you sure you want to delete Order Number' => 'Soll der Auftrag mit folgender Nummer wirklich gelöscht werden:',
|
||
'Are you sure you want to delete Quotation Number' => 'Sind Sie sicher, dass Angebotnummer gelöscht werden soll?',
|
||
'Are you sure you want to delete Transaction' => 'Buchung wirklich löschen?',
|
||
'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 department?' => 'Sind Sie sicher, dass Sie diese Abteilung löschen wollen?',
|
||
'Are you sure you want to delete this payment term?' => 'Wollen Sie diese Zahlungsbedingungen wirklich löschen?',
|
||
'Are you sure you want to remove the marked entries from the queue?' => 'Sind Sie sicher, dass die markierten Einträge von der Warteschlange gelöscht werden sollen?',
|
||
... | ... | |
'Buchungsnummer' => 'Buchungsnummer',
|
||
'Business Number' => 'Firmennummer',
|
||
'Business Volume' => 'Geschäftsvolumen',
|
||
'Business deleted!' => 'Firma gelöscht.',
|
||
'Business evaluation' => 'Betriebswirtschaftliche Auswertung',
|
||
'Business saved!' => 'Firma gespeichert.',
|
||
'Business type (database ID)' => 'Kunden-/Lieferantentyp (Datenbank-ID)',
|
||
'Business type (name)' => 'Kunden-/Lieferantentyp (Name)',
|
||
'Businesses' => 'Kunden-/Lieferantentypen',
|
||
'CANCELED' => 'Storniert',
|
||
'CB Transaction' => 'SB-Buchung',
|
||
'CR' => 'H',
|
||
... | ... | |
'Create Chart of Accounts' => 'Zu verwendender Kontenplan',
|
||
'Create Dataset' => 'Neue Datenbank anlegen',
|
||
'Create Date' => 'Erstelldatum',
|
||
'Create a new business' => 'Einen neuen Kunden-/Lieferantentyp erfassen',
|
||
'Create a new department' => 'Eine neue Abteilung erfassen',
|
||
'Create a new payment term' => 'Neue Zahlungsbedingungen anlegen',
|
||
'Create a standard group' => 'Eine Standard-Benutzergruppe anlegen',
|
||
... | ... | |
'Create bank transfer via SEPA XML' => 'Überweisung via SEPA XML erzeugen',
|
||
'Create invoice?' => 'Rechnung erstellen?',
|
||
'Create new' => 'Neu erfassen',
|
||
'Create new business' => 'Kunden-/Lieferantentyp erfassen',
|
||
'Create new department' => 'Neue Abteilung erfassen',
|
||
'Create new payment term' => 'Neue Zahlungsbedingung anlegen',
|
||
'Create tables' => 'Tabellen anlegen',
|
||
... | ... | |
'Edit Assembly' => 'Erzeugnis bearbeiten',
|
||
'Edit Bins' => 'Lagerplätze bearbeiten',
|
||
'Edit Buchungsgruppe' => 'Buchungsgruppe bearbeiten',
|
||
'Edit Business' => 'Kunden-/Lieferantentyp bearbeiten',
|
||
'Edit Credit Note' => 'Gutschrift bearbeiten',
|
||
'Edit Customer' => 'Kunde editieren',
|
||
'Edit Dunning' => 'Mahnungen konfigurieren',
|
||
... | ... | |
'Edit Warehouse' => 'Lager bearbeiten',
|
||
'Edit and delete a group' => 'Gruppen bearbeiten und löschen',
|
||
'Edit bank account' => 'Bankkonto bearbeiten',
|
||
'Edit business' => 'Kunden-/Lieferantentyp bearbeiten',
|
||
'Edit custom variable' => 'Benutzerdefinierte Variable bearbeiten',
|
||
'Edit department' => 'Abteilung bearbeiten',
|
||
'Edit file' => 'Datei bearbeiten',
|
||
... | ... | |
'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 customer has been selected yet.' => 'Es wurde noch kein Kunde ausgewählt.',
|
||
'No data was found.' => 'Es wurden keine Daten gefunden.',
|
||
'No databases have been found on this server.' => 'Auf diesem Server wurden keine Datenbanken gefunden.',
|
||
... | ... | |
'The base unit does not exist or it is about to be deleted in row %d.' => 'Die Basiseinheit in Zeile %d existiert nicht oder soll gelöscht werden.',
|
||
'The base unit does not exist.' => 'Die Basiseinheit existiert nicht.',
|
||
'The base unit relations must not contain loops (e.g. by saying that unit A\'s base unit is B, B\'s base unit is C and C\'s base unit is A) in row %d.' => 'Die Beziehungen der Einheiten dürfen keine Schleifen beinhalten (z.B. wenn gesagt wird, dass Einheit As Basiseinheit B, Bs Basiseinheit C und Cs Basiseinheit A ist) in Zeile %d.',
|
||
'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 columns "Dunning Duedate", "Total Fees" and "Interest" show data for the previous dunning created for this invoice.' => 'Die Spalten "Zahlbar bis", "Kumulierte Gebühren" und "Zinsen" zeigen Daten der letzten für diese Rechnung erzeugten Mahnung.',
|
||
'The connection to the LDAP server cannot be encrypted (SSL/TLS startup failure). Please check config/lx_office.conf.' => 'Die Verbindung zum LDAP-Server kann nicht verschlüsselt werden (Fehler bei SSL/TLS-Initialisierung). Bitte überprüfen Sie die Angaben in config/lx_office.conf.',
|
||
'The connection to the authentication database failed:' => 'Die Verbindung zur Authentifizierungsdatenbank schlug fehl:',
|
||
... | ... | |
'The directory "%s" could not be created:\n%s' => 'Das Verzeichnis "%s" konnte nicht erstellt werden:\n%s',
|
||
'The directory %s does not exist.' => 'Das Verzeichnis %s existiert nicht.',
|
||
'The discount in percent' => 'Der prozentuale Rabatt',
|
||
'The discount must be less than 100%.' => 'Der Rabatt muss kleiner als 100% sein.',
|
||
'The discount must not be negative.' => 'Der Rabatt darf nicht negativ sein.',
|
||
'The dunning process started' => 'Der Mahnprozess ist gestartet.',
|
||
'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.',
|
||
'The email address is missing.' => 'Die Emailadresse fehlt.',
|
menu.ini | ||
---|---|---|
submenu=1
|
||
|
||
[System--Type of Business--Add Business]
|
||
module=am.pl
|
||
action=add_business
|
||
module=controller.pl
|
||
action=Business/new
|
||
|
||
[System--Type of Business--List Businesses]
|
||
module=am.pl
|
||
action=list_business
|
||
module=controller.pl
|
||
action=Business/list
|
||
|
||
[System--Lead]
|
||
module=menu.pl
|
templates/webpages/business/form.html | ||
---|---|---|
[% USE HTML %][% USE L %][% USE LxERP %]
|
||
<body>
|
||
|
||
<form method="post" action="controller.pl">
|
||
<div class="listtop">[% FORM.title %]</div>
|
||
|
||
[%- 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>
|
||
</body>
|
||
</html>
|
templates/webpages/business/list.html | ||
---|---|---|
[% USE HTML %][% USE L %][% USE LxERP %]
|
||
|
||
<body>
|
||
<div class="listtop">[% FORM.title %]</div>
|
||
|
||
[%- INCLUDE 'common/flash.html' %]
|
||
|
||
<form method="post" action="controller.pl">
|
||
[% IF !BUSINESSS.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 = BUSINESSS %]
|
||
<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>
|
||
</body>
|
||
</html>
|
Auch abrufbar als: Unified diff
Verwaltung von Kunden-/Lieferantentypen auf Controller umgestellt