Revision 63cb5b41
Von Moritz Bunkus vor fast 5 Jahren hinzugefügt
SL/DB/Default.pm | ||
---|---|---|
2 | 2 |
|
3 | 3 |
use strict; |
4 | 4 |
|
5 |
use Carp; |
|
5 | 6 |
use SL::DB::MetaSetup::Default; |
6 | 7 |
|
7 | 8 |
__PACKAGE__->meta->initialize; |
... | ... | |
21 | 22 |
return SL::DB::Manager::Default->get_all(limit => 1)->[0]; |
22 | 23 |
} |
23 | 24 |
|
25 |
sub address { |
|
26 |
# Compatibility function: back in the day there was only a single |
|
27 |
# address field. |
|
28 |
my $self = shift; |
|
29 |
|
|
30 |
croak("SL::DB::Default::address is a read-only accessor") if @_; |
|
31 |
|
|
32 |
my $zipcode_city = join ' ', grep { $_ } ($self->address_zipcode, $self->address_city); |
|
33 |
|
|
34 |
return join "\n", grep { $_ } ($self->address_street1, $self->address_street2, $zipcode_city, $self->address_country); |
|
35 |
} |
|
36 |
|
|
24 | 37 |
1; |
SL/DB/MetaSetup/Default.pm | ||
---|---|---|
10 | 10 |
|
11 | 11 |
__PACKAGE__->meta->columns( |
12 | 12 |
accounting_method => { type => 'text' }, |
13 |
address => { type => 'text' }, |
|
13 |
address_city => { type => 'text' }, |
|
14 |
address_country => { type => 'text' }, |
|
15 |
address_street1 => { type => 'text' }, |
|
16 |
address_street2 => { type => 'text' }, |
|
17 |
address_zipcode => { type => 'text' }, |
|
14 | 18 |
allow_new_purchase_delivery_order => { type => 'boolean', default => 'true', not_null => 1 }, |
15 | 19 |
allow_new_purchase_invoice => { type => 'boolean', default => 'true', not_null => 1 }, |
16 | 20 |
allow_sales_invoice_from_sales_order => { type => 'boolean', default => 'true', not_null => 1 }, |
SL/InstanceConfiguration.pm | ||
---|---|---|
52 | 52 |
return @{ $self->currencies }; |
53 | 53 |
} |
54 | 54 |
|
55 |
sub get_address { |
|
56 |
# Compatibility function: back in the day there was only a single |
|
57 |
# address field. |
|
58 |
my ($self) = @_; |
|
59 |
|
|
60 |
my $zipcode_city = join ' ', grep { $_ } ($self->get_address_zipcode, $self->get_address_city); |
|
61 |
|
|
62 |
return join "\n", grep { $_ } ($self->get_address_street1, $self->get_address_street2, $zipcode_city, $self->get_address_country); |
|
63 |
} |
|
64 |
|
|
55 | 65 |
sub AUTOLOAD { |
56 | 66 |
our $AUTOLOAD; |
57 | 67 |
|
locale/de/all | ||
---|---|---|
651 | 651 |
'Company' => 'Firma', |
652 | 652 |
'Company Name' => 'Firmenname', |
653 | 653 |
'Company name' => 'Firmenname', |
654 |
'Company name and address' => 'Firmenname und -adresse', |
|
654 | 655 |
'Company settings' => 'Firmeneinstellungen', |
655 | 656 |
'Compare to' => 'Gegenüberstellen zu', |
656 | 657 |
'Complexities' => 'Komplexitätsgrade', |
... | ... | |
3050 | 3051 |
'Storno (one letter abbreviation)' => 'S', |
3051 | 3052 |
'Storno Invoice' => 'Stornorechnung', |
3052 | 3053 |
'Street' => 'Straße', |
3054 |
'Street 1' => 'Straße 1', |
|
3055 |
'Street 2' => 'Straße 2', |
|
3053 | 3056 |
'Strict and halt' => 'Strikt und Abbruch', |
3054 | 3057 |
'Strict but replace' => 'Strikt mit Ersetzungen', |
3055 | 3058 |
'Style the picture with the following CSS code' => 'Bildeigenschaft mit folgendem CSS-Style versehen', |
... | ... | |
3980 | 3983 |
'Zip' => 'PLZ', |
3981 | 3984 |
'Zip, City' => 'PLZ, Ort', |
3982 | 3985 |
'Zipcode' => 'PLZ', |
3986 |
'Zipcode and city' => 'PLZ und Stadt', |
|
3983 | 3987 |
'[email]' => '[email]', |
3984 | 3988 |
'absolute' => 'absolut', |
3985 | 3989 |
'account_description' => 'Beschreibung', |
sql/Pg-upgrade2/defaults_split_address.pl | ||
---|---|---|
1 |
# @tag: defaults_split_address |
|
2 |
# @description: Adress-Feld in Mandantenkonfiguration in einzelne Bestandteile aufteilen |
|
3 |
# @depends: release_3_5_4 |
|
4 |
package SL::DBUpgrade2::defaults_split_address; |
|
5 |
|
|
6 |
use strict; |
|
7 |
use utf8; |
|
8 |
|
|
9 |
use parent qw(SL::DBUpgrade2::Base); |
|
10 |
|
|
11 |
sub run { |
|
12 |
my ($self) = @_; |
|
13 |
|
|
14 |
my ($address) = $self->dbh->selectrow_array("SELECT address FROM defaults"); |
|
15 |
|
|
16 |
my (@street, $zipcode, $city, $country); |
|
17 |
my @lines = grep { $_ } split m{\r*\n+}, $address // ''; |
|
18 |
|
|
19 |
foreach my $line (@lines) { |
|
20 |
if ($line =~ m{^(?:[a-z]+[ -])?(\d+) +(.+)}i) { |
|
21 |
($zipcode, $city) = ($1, $2); |
|
22 |
|
|
23 |
} elsif ($zipcode) { |
|
24 |
$country = $line; |
|
25 |
|
|
26 |
} else { |
|
27 |
push @street, $line; |
|
28 |
} |
|
29 |
} |
|
30 |
|
|
31 |
$self->db_query(<<SQL); |
|
32 |
ALTER TABLE defaults |
|
33 |
ADD COLUMN address_street1 TEXT, |
|
34 |
ADD COLUMN address_street2 TEXT, |
|
35 |
ADD COLUMN address_zipcode TEXT, |
|
36 |
ADD COLUMN address_city TEXT, |
|
37 |
ADD COLUMN address_country TEXT, |
|
38 |
DROP COLUMN address |
|
39 |
SQL |
|
40 |
|
|
41 |
$self->db_query(<<SQL, bind => [ map { $_ // '' } ($street[0], $street[1], $zipcode, $city, $country) ]); |
|
42 |
UPDATE defaults |
|
43 |
SET address_street1 = ?, |
|
44 |
address_street2 = ?, |
|
45 |
address_zipcode = ?, |
|
46 |
address_city = ?, |
|
47 |
address_country = ? |
|
48 |
SQL |
|
49 |
|
|
50 |
return 1; |
|
51 |
} |
|
52 |
|
|
53 |
1; |
templates/webpages/client_config/_miscellaneous.html | ||
---|---|---|
2 | 2 |
[% SET style="width: 400px" %] |
3 | 3 |
<div id="miscellaneous"> |
4 | 4 |
<table> |
5 |
<tr><td class="listheading" colspan="4">[% LxERP.t8("Company settings") %]</td></tr>
|
|
5 |
<tr><td class="listheading" colspan="4">[% LxERP.t8("Company name and address") %]</td></tr>
|
|
6 | 6 |
|
7 | 7 |
<tr> |
8 | 8 |
<td align="right">[% LxERP.t8("Company name") %]</td> |
... | ... | |
10 | 10 |
</tr> |
11 | 11 |
|
12 | 12 |
<tr> |
13 |
<td align="right" valign="top">[% LxERP.t8("Address") %]</td> |
|
14 |
<td valign="top">[% L.textarea_tag('defaults.address', SELF.defaults.address, style=style, rows=4) %]</td> |
|
13 |
<td align="right" valign="top">[% LxERP.t8("Street 1") %]</td> |
|
14 |
<td>[% L.input_tag('defaults.address_street1', SELF.defaults.address_street1, style=style) %]</td> |
|
15 |
</tr> |
|
16 |
|
|
17 |
<tr> |
|
18 |
<td align="right" valign="top">[% LxERP.t8("Street 2") %]</td> |
|
19 |
<td>[% L.input_tag('defaults.address_street2', SELF.defaults.address_street2, style=style) %]</td> |
|
15 | 20 |
</tr> |
16 | 21 |
|
22 |
<tr> |
|
23 |
<td align="right" valign="top">[% LxERP.t8("Zipcode and city") %]</td> |
|
24 |
<td> |
|
25 |
[% L.input_tag('defaults.address_zipcode', SELF.defaults.address_zipcode, size=8) %] |
|
26 |
[% L.input_tag('defaults.address_city', SELF.defaults.address_city, size=30) %] |
|
27 |
</td> |
|
28 |
</tr> |
|
29 |
|
|
30 |
<tr> |
|
31 |
<td align="right" valign="top">[% LxERP.t8("Country") %]</td> |
|
32 |
<td>[% L.input_tag('defaults.address_country', SELF.defaults.address_country, style=style) %]</td> |
|
33 |
</tr> |
|
34 |
|
|
35 |
<tr><td class="listheading" colspan="4">[% LxERP.t8("Company settings") %]</td></tr> |
|
36 |
|
|
17 | 37 |
<tr> |
18 | 38 |
<td align="right" valign="top">[% LxERP.t8("Signature") %]</td> |
19 | 39 |
<td valign="top">[% L.textarea_tag('defaults.signature', SELF.defaults.signature, style=style, rows=4) %]</td> |
Auch abrufbar als: Unified diff
Mandantenkonfiguration: Adress-Feld in einzelne Bestandteile aufgeteilt