Revision 7349649b
Von Kivitendo Admin vor mehr als 8 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
251 | 251 |
} |
252 | 252 |
|
253 | 253 |
my $pg_select = $form->{l_pricegroup} ? qq|, pg.pricegroup as pricegroup | : ''; |
254 |
my $pg_join = $form->{l_pricegroup} ? qq|LEFT JOIN pricegroup pg ON (ct.klass = pg.id) | : '';
|
|
254 |
my $pg_join = $form->{l_pricegroup} ? qq|LEFT JOIN pricegroup pg ON (ct.pricegroup_id = pg.id) | : '';
|
|
255 | 255 |
my $query = |
256 | 256 |
qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | . |
257 | 257 |
qq| pt.description as payment | . |
SL/Common.pm | ||
---|---|---|
350 | 350 |
$form->{CONTACTS} = selectall_hashref_query($form, $dbh, $query, $vc_id); |
351 | 351 |
|
352 | 352 |
# Only show default pricegroup for customer, not vendor, which is why this is outside the main query |
353 |
($form->{pricegroup}) = selectrow_query($form, $dbh, qq|SELECT pricegroup FROM pricegroup WHERE id = ?|, $form->{klass});
|
|
353 |
($form->{pricegroup}) = selectrow_query($form, $dbh, qq|SELECT pricegroup FROM pricegroup WHERE id = ?|, $form->{pricegroup_id});
|
|
354 | 354 |
|
355 | 355 |
$dbh->disconnect(); |
356 | 356 |
|
SL/Controller/CsvImport/CustomerVendor.pm | ||
---|---|---|
300 | 300 |
{ name => 'greeting', description => $::locale->text('Greeting') }, |
301 | 301 |
{ name => 'homepage', description => $::locale->text('Homepage') }, |
302 | 302 |
{ name => 'iban', description => $::locale->text('IBAN') }, |
303 |
{ name => 'klass', description => $::locale->text('Preisklasse') },
|
|
303 |
{ name => 'pricegroup_id', description => $::locale->text('Price group (database ID)') },
|
|
304 | 304 |
{ name => 'language_id', description => $::locale->text('Language (database ID)') }, |
305 | 305 |
{ name => 'language', description => $::locale->text('Language (name)') }, |
306 | 306 |
{ name => 'name', description => $::locale->text('Name') }, |
SL/DB/MetaSetup/Customer.pm | ||
---|---|---|
38 | 38 |
iban => { type => 'text' }, |
39 | 39 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
40 | 40 |
itime => { type => 'timestamp', default => 'now()' }, |
41 |
klass => { type => 'integer', default => '0' }, |
|
42 | 41 |
language => { type => 'text' }, |
43 | 42 |
language_id => { type => 'integer' }, |
44 | 43 |
mandate_date_of_signature => { type => 'date' }, |
... | ... | |
49 | 48 |
obsolete => { type => 'boolean', default => 'false' }, |
50 | 49 |
payment_id => { type => 'integer' }, |
51 | 50 |
phone => { type => 'text' }, |
51 |
pricegroup_id => { type => 'integer' }, |
|
52 | 52 |
salesman_id => { type => 'integer' }, |
53 | 53 |
street => { type => 'text' }, |
54 | 54 |
taxincluded => { type => 'boolean' }, |
... | ... | |
91 | 91 |
key_columns => { payment_id => 'id' }, |
92 | 92 |
}, |
93 | 93 |
|
94 |
pricegroup => { |
|
95 |
class => 'SL::DB::Pricegroup', |
|
96 |
key_columns => { pricegroup_id => 'id' }, |
|
97 |
}, |
|
98 |
|
|
94 | 99 |
taxzone => { |
95 | 100 |
class => 'SL::DB::TaxZone', |
96 | 101 |
key_columns => { taxzone_id => 'id' }, |
SL/IC.pm | ||
---|---|---|
193 | 193 |
|
194 | 194 |
my $i = 1; |
195 | 195 |
foreach my $pg (@{ $pricegroups }) { |
196 |
$form->{"klass_$i"} = "$pg->{id}"; |
|
197 |
$form->{"price_$i"} = $form->format_amount($myconfig, $form->{"price_$i"}, -2); |
|
196 |
$form->{"price_$i"} = $form->format_amount($myconfig, $form->{"price_$i"}, -2); |
|
198 | 197 |
$form->{"pricegroup_id_$i"} = "$pg->{id}"; |
199 | 198 |
$form->{"pricegroup_$i"} = "$pg->{pricegroup}"; |
200 | 199 |
$i++; |
SL/IS.pm | ||
---|---|---|
2112 | 2112 |
c.id AS customer_id, c.name AS customer, c.discount as customer_discount, c.creditlimit, |
2113 | 2113 |
c.email, c.cc, c.bcc, c.language_id, c.payment_id, c.delivery_term_id, |
2114 | 2114 |
c.street, c.zipcode, c.city, c.country, |
2115 |
c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, cu.name AS curr,
|
|
2115 |
c.notes AS intnotes, c.pricegroup_id as customer_pricegroup_id, c.taxzone_id, c.salesman_id, cu.name AS curr,
|
|
2116 | 2116 |
c.taxincluded_checked, c.direct_debit, |
2117 | 2117 |
b.discount AS tradediscount, b.description AS business |
2118 | 2118 |
FROM customer c |
SL/PriceSource/Pricegroup.pm | ||
---|---|---|
54 | 54 |
my @prices = $self->available_prices; |
55 | 55 |
my $customer = $self->record->customer; |
56 | 56 |
|
57 |
return () if !$customer || !$customer->klass;
|
|
57 |
return () if !$customer || !$customer->pricegroup_id;
|
|
58 | 58 |
|
59 |
my $best_price = first { $_->spec == $customer->klass } @prices;
|
|
59 |
my $best_price = first { $_->spec == $customer->pricegroup_id } @prices;
|
|
60 | 60 |
|
61 | 61 |
return $best_price || (); |
62 | 62 |
} |
bin/mozilla/oe.pl | ||
---|---|---|
425 | 425 |
# business |
426 | 426 |
$TMPL_VAR{business_label} = ($form->{vc} eq "customer" ? $locale->text('Customer type') : $locale->text('Vendor type')); |
427 | 427 |
|
428 |
push @custom_hiddens, "customer_klass" if $form->{vc} eq 'customer';
|
|
428 |
push @custom_hiddens, "customer_pricegroup_id" if $form->{vc} eq 'customer';
|
|
429 | 429 |
|
430 | 430 |
my $credittext = $locale->text('Credit Limit exceeded!!!'); |
431 | 431 |
|
doc/UPGRADE | ||
---|---|---|
10 | 10 |
* In der Rechte-Tabelle auth.master_rights wurden alle Positionswerte mit 100 |
11 | 11 |
multipliziert, um Lücken für neue Rechte zu schaffen. |
12 | 12 |
|
13 |
* In der Tabelle "customer" wurde die Spalte "klass" nach "pricegroup_id" |
|
14 |
migriert. Bei Kunden ohne Preisgruppe ist der Datenbankwert jetzt NULL statt |
|
15 |
"0". Falls Kunden per CSV-Import importiert werden muß dieses Feld in der |
|
16 |
CSV-Datei ebenfalls umbenannt werden. |
|
17 |
|
|
13 | 18 |
* Es wird jetzt Postgres 9.1 vorausgesetzt um GIN Indizes zu verwenden. Wenn |
14 | 19 |
das auf dem Zielsystem absolut nicht möglich ist, muss das Upgradescript |
15 | 20 |
sql/Pg-Upgrade2/trigram_indices.sql deaktiviert oder entfernt werden. |
locale/de/all | ||
---|---|---|
2080 | 2080 |
'Preferences saved!' => 'Einstellungen gespeichert!', |
2081 | 2081 |
'Prefix for the new bins\' names' => 'Namenspräfix für die neuen Lagerplätze', |
2082 | 2082 |
'Preis' => 'Preis', |
2083 |
'Preisklasse' => 'Preisgruppe', |
|
2084 | 2083 |
'Prepare bank collection via SEPA XML' => 'Einzug via SEPA XML vorbereiten', |
2085 | 2084 |
'Prepare bank transfer via SEPA XML' => 'Überweisung via SEPA XML vorbereiten', |
2086 | 2085 |
'Prepayment' => 'Vorauszahlung', |
locale/en/all | ||
---|---|---|
2079 | 2079 |
'Preferences saved!' => '', |
2080 | 2080 |
'Prefix for the new bins\' names' => '', |
2081 | 2081 |
'Preis' => '', |
2082 |
'Preisklasse' => '', |
|
2083 | 2082 |
'Prepare bank collection via SEPA XML' => '', |
2084 | 2083 |
'Prepare bank transfer via SEPA XML' => '', |
2085 | 2084 |
'Prepayment' => '', |
sql/Pg-upgrade2/customer_klass_rename_to_pricegroup_id_and_foreign_key.sql | ||
---|---|---|
1 |
-- @tag: customer_klass_rename_to_pricegroup_id_and_foreign_key |
|
2 |
-- @description: klass nach pricegroup_id umbenannt |
|
3 |
-- @depends: release_3_4_1 |
|
4 |
-- @ignore: 0 |
|
5 |
|
|
6 |
ALTER TABLE customer ADD COLUMN pricegroup_id INTEGER REFERENCES pricegroup (id); |
|
7 |
UPDATE customer SET pricegroup_id = klass WHERE klass != 0; |
|
8 |
ALTER TABLE customer DROP COLUMN klass; |
templates/webpages/customer_vendor/tabs/billing.html | ||
---|---|---|
317 | 317 |
<th align="right">[% 'Price group' | $T8 %]</th> |
318 | 318 |
|
319 | 319 |
<td> |
320 |
[% L.select_tag('cv.klass', SELF.all_pricegroups, default = SELF.cv.klass, value_key = 'id', title_key = 'pricegroup', with_empty = 1) %]
|
|
320 |
[% L.select_tag('cv.pricegroup_id', SELF.all_pricegroups, default = SELF.cv.pricegroup_id, value_key = 'id', title_key = 'pricegroup', with_empty = 1) %]
|
|
321 | 321 |
</td> |
322 | 322 |
[% END %] |
323 | 323 |
|
templates/webpages/do/form_header.html | ||
---|---|---|
73 | 73 |
<input type="hidden" name="closed" value="[% HTML.escape(closed) %]"> |
74 | 74 |
<input type="hidden" name="convert_from_oe_ids" value="[% HTML.escape(convert_from_oe_ids) %]"> |
75 | 75 |
<input type="hidden" name="currency" value="[% HTML.escape(currency) %]"> |
76 |
<input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
|
|
76 |
<input type="hidden" name="customer_pricegroup_id" value="[% HTML.escape(customer_pricegroup_id) %]">
|
|
77 | 77 |
<input type="hidden" name="discount" value="[% HTML.escape(discount) %]"> |
78 | 78 |
<input type="hidden" name="dunning_amount" value="[% HTML.escape(dunning_amount) %]"> |
79 | 79 |
<input type="hidden" name="email" value="[% HTML.escape(email) %]"> |
templates/webpages/ir/form_header.html | ||
---|---|---|
63 | 63 |
onChange = "document.getElementById('update_button').click();" -%] |
64 | 64 |
<input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% vc | html %]')"> |
65 | 65 |
</td> |
66 |
<input type="hidden" name="vendor_klass" value="[% HTML.escape(vendor_klass) %]"> |
|
67 | 66 |
<input type="hidden" name="vendor_id" value="[% HTML.escape(vendor_id) %]"> |
68 | 67 |
<input type="hidden" name="oldvendor" value="[% HTML.escape(oldvendor) %]"> |
69 | 68 |
<input type="hidden" name="selectvendor" value="[% HTML.escape(selectvendor) %]"> |
templates/webpages/is/form_header.html | ||
---|---|---|
65 | 65 |
allow_textbox = 1, |
66 | 66 |
onChange = "document.getElementById('update_button').click();" -%] |
67 | 67 |
<input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% HTML.escape(vc) %]')"> |
68 |
<input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
|
|
68 |
<input type="hidden" name="customer_pricegroup_id" value="[% HTML.escape(customer_pricegroup_id) %]">
|
|
69 | 69 |
<input type="hidden" name="customer_id" value="[% HTML.escape(customer_id) %]"> |
70 | 70 |
<input type="hidden" name="oldcustomer" value="[% HTML.escape(oldcustomer) %]"> |
71 | 71 |
<input type="hidden" name="selectcustomer" value="[% HTML.escape(selectcustomer) %]"> |
Auch abrufbar als: Unified diff
Kunde: Datenbanktabelle "klass" nach "pricegroup_id" migriert
und einen Fremdschlüssel gesetzt.