Revision 77807bf5
Von Kivitendo Admin vor fast 8 Jahren hinzugefügt
SL/Controller/CustomerVendor.pm | ||
---|---|---|
901 | 901 |
$self->{all_salesmen} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $self->{cv}->salesman_id, deleted => 0 ] ]); |
902 | 902 |
} |
903 | 903 |
|
904 |
$self->{all_payment_terms} = SL::DB::Manager::PaymentTerm->get_all(); |
|
904 |
$self->{all_payment_terms} = SL::DB::Manager::PaymentTerm->get_all_sorted(where => [ or => [ id => $self->{cv}->payment_id, |
|
905 |
obsolete => 0 ] ]); |
|
905 | 906 |
|
906 | 907 |
$self->{all_delivery_terms} = SL::DB::Manager::DeliveryTerm->get_all(); |
907 | 908 |
|
SL/Controller/Order.pm | ||
---|---|---|
1047 | 1047 |
$self->{all_projects} = SL::DB::Manager::Project->get_all(where => [ or => [ id => $self->order->globalproject_id, |
1048 | 1048 |
active => 1 ] ], |
1049 | 1049 |
sort_by => 'projectnumber'); |
1050 |
$self->{all_payment_terms} = SL::DB::Manager::PaymentTerm->get_all_sorted(); |
|
1050 |
$self->{all_payment_terms} = SL::DB::Manager::PaymentTerm->get_all_sorted(where => [ or => [ id => $self->order->payment_id, |
|
1051 |
obsolete => 0 ] ]); |
|
1052 |
|
|
1051 | 1053 |
$self->{all_delivery_terms} = SL::DB::Manager::DeliveryTerm->get_all_sorted(); |
1052 | 1054 |
|
1053 | 1055 |
$self->{current_employee_id} = SL::DB::Manager::Employee->current->id; |
SL/Controller/Part.pm | ||
---|---|---|
895 | 895 |
} |
896 | 896 |
|
897 | 897 |
sub init_all_payment_terms { |
898 |
SL::DB::Manager::PaymentTerm->get_all_sorted; |
|
898 |
my ($self) = @_; |
|
899 |
SL::DB::Manager::PaymentTerm->get_all_sorted(query => [ or => [ id => $self->part->payment_id, obsolete => 0 ] ]); |
|
899 | 900 |
} |
900 | 901 |
|
901 | 902 |
sub init_all_price_factors { |
SL/DB/MetaSetup/PaymentTerm.pm | ||
---|---|---|
16 | 16 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
17 | 17 |
itime => { type => 'timestamp', default => 'now()' }, |
18 | 18 |
mtime => { type => 'timestamp' }, |
19 |
percent_skonto => { type => 'float', precision => 4, scale => 4 }, |
|
19 |
obsolete => { type => 'boolean', default => 'false' }, |
|
20 |
percent_skonto => { type => 'float', scale => 4 }, |
|
20 | 21 |
ranking => { type => 'integer' }, |
21 | 22 |
sortkey => { type => 'integer', not_null => 1 }, |
22 | 23 |
terms_netto => { type => 'integer' }, |
SL/Form.pm | ||
---|---|---|
2531 | 2531 |
# get payment terms |
2532 | 2532 |
$query = qq|SELECT id, description |
2533 | 2533 |
FROM payment_terms |
2534 |
ORDER BY sortkey|;
|
|
2535 |
|
|
2536 |
$self->{payment_terms} = selectall_hashref_query($self, $dbh, $query); |
|
2534 |
WHERE ( obsolete IS FALSE OR id = ? )
|
|
2535 |
ORDER BY sortkey |; |
|
2536 |
$self->{payment_terms} = selectall_hashref_query($self, $dbh, $query, $self->{payment_id} || undef);
|
|
2537 | 2537 |
|
2538 | 2538 |
$main::lxdebug->leave_sub(); |
2539 | 2539 |
} |
... | ... | |
2575 | 2575 |
} |
2576 | 2576 |
} |
2577 | 2577 |
|
2578 |
# language_payment duplicates some of the functionality of all_vc (language, |
|
2579 |
# printer, payment_terms), and at least in the case of sales invoices both |
|
2580 |
# all_vc and language_payment are called when adding new invoices |
|
2578 | 2581 |
sub language_payment { |
2579 | 2582 |
$main::lxdebug->enter_sub(); |
2580 | 2583 |
|
... | ... | |
2598 | 2601 |
# get payment terms |
2599 | 2602 |
$query = qq|SELECT id, description |
2600 | 2603 |
FROM payment_terms |
2601 |
ORDER BY sortkey|;
|
|
2602 |
|
|
2603 |
$self->{payment_terms} = selectall_hashref_query($self, $dbh, $query); |
|
2604 |
WHERE ( obsolete IS FALSE OR id = ? )
|
|
2605 |
ORDER BY sortkey |; |
|
2606 |
$self->{payment_terms} = selectall_hashref_query($self, $dbh, $query, $self->{payment_id} || undef);
|
|
2604 | 2607 |
|
2605 | 2608 |
# get buchungsgruppen |
2606 | 2609 |
$query = qq|SELECT id, description |
bin/mozilla/oe.pl | ||
---|---|---|
50 | 50 |
|
51 | 51 |
use SL::DB::Customer; |
52 | 52 |
use SL::DB::TaxZone; |
53 |
use SL::DB::PaymentTerm; |
|
53 | 54 |
|
54 | 55 |
require "bin/mozilla/io.pl"; |
55 | 56 |
require "bin/mozilla/arap.pl"; |
... | ... | |
352 | 353 |
my $vc = $form->{vc} eq "customer" ? "customers" : "vendors"; |
353 | 354 |
|
354 | 355 |
$form->get_lists("taxzones" => ($form->{id} ? "ALL_TAXZONES" : "ALL_ACTIVE_TAXZONES"), |
355 |
"payments" => "ALL_PAYMENTS", |
|
356 | 356 |
"currencies" => "ALL_CURRENCIES", |
357 | 357 |
$vc => { key => "ALL_" . uc($vc), |
358 | 358 |
limit => $myconfig{vclimit} + 1 }, |
359 | 359 |
"price_factors" => "ALL_PRICE_FACTORS"); |
360 |
$form->{ALL_PAYMENTS} = SL::DB::Manager::PaymentTerm->get_all( where => [ or => [ obsolete => 0, id => $form->{payment_id} || undef ] ]); |
|
360 | 361 |
|
361 | 362 |
$form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all; |
362 | 363 |
|
sql/Pg-upgrade2/payment_terms_obsolete.sql | ||
---|---|---|
1 |
-- @tag: payment_terms_obsolete |
|
2 |
-- @description: Zahlungsbedingungen ungültig setzen |
|
3 |
-- @charset: UTF-8 |
|
4 |
-- @depends: release_3_4_1 |
|
5 |
-- @ignore: 0 |
|
6 |
|
|
7 |
ALTER TABLE payment_terms ADD COLUMN obsolete BOOLEAN DEFAULT FALSE; |
templates/webpages/is/form_footer.html | ||
---|---|---|
24 | 24 |
<table> |
25 | 25 |
<tr> |
26 | 26 |
<th align="right">[% 'Payment Terms' | $T8 %]</th> |
27 |
<td> |
|
28 |
[%- INCLUDE 'generic/multibox.html' |
|
29 |
name = 'payment_id', |
|
30 |
style = 'width: 250px', |
|
31 |
DATA = payment_terms, |
|
32 |
id_key = 'id', |
|
33 |
label_key = 'description', |
|
34 |
show_empty = 1 |
|
35 |
allow_textbox = 0 -%] |
|
27 |
<td>[% L.select_tag('payment_id', payment_terms, default = payment_id, title_key = 'description', with_empty = 1, style="width: 250px") %] |
|
36 | 28 |
<script type='text/javascript'>$('#payment_id').change(function(){ kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate"); })</script> |
37 | 29 |
</td> |
38 | 30 |
</tr> |
templates/webpages/oe/form_footer.html | ||
---|---|---|
27 | 27 |
</tr> |
28 | 28 |
<tr> |
29 | 29 |
<th align="right">[% 'Payment Terms' | $T8 %]</th> |
30 |
<td> |
|
31 |
[%- INCLUDE 'generic/multibox.html' |
|
32 |
name = 'payment_id', |
|
33 |
style = 'width: 250px', |
|
34 |
DATA = ALL_PAYMENTS, |
|
35 |
id_key = 'id', |
|
36 |
label_key = 'description', |
|
37 |
show_empty = 1 -%] |
|
38 |
</td> |
|
30 |
<td>[% L.select_tag('payment_id', ALL_PAYMENTS, default = payment_id, title_key = 'description', with_empty = 1, style="width: 250px") %]</td> |
|
39 | 31 |
</tr> |
40 | 32 |
<tr> |
41 | 33 |
<th align="right">[% 'Delivery Terms' | $T8 %]</th> |
templates/webpages/payment_term/form.html | ||
---|---|---|
44 | 44 |
</td> |
45 | 45 |
</tr> |
46 | 46 |
|
47 |
[% IF SELF.payment_term.id %] |
|
48 |
<tr> |
|
49 |
<td>[% 'Obsolete' | $T8 %]</td> |
|
50 |
<td>[% L.checkbox_tag('payment_term.obsolete', checked = SELF.payment_term.obsolete, for_submit=1) %]</td> |
|
51 |
</tr> |
|
52 |
</tr> |
|
53 |
[% END %] |
|
54 |
|
|
47 | 55 |
<tr class="listheading"> |
48 | 56 |
<th></th> |
49 | 57 |
<th>[% LxERP.t8("Texts for quotations & orders") %]</th> |
templates/webpages/payment_term/list.html | ||
---|---|---|
21 | 21 |
<th align="right">[%- 'Netto Terms' | $T8 %]</th> |
22 | 22 |
<th align="right">[%- 'Skonto Terms' | $T8 %]</th> |
23 | 23 |
<th align="right">[%- 'Skonto' | $T8 %]</th> |
24 |
<th align="right">[%- 'Obsolete' | $T8 %]</th> |
|
24 | 25 |
</tr> |
25 | 26 |
</thead> |
26 | 27 |
|
... | ... | |
39 | 40 |
<td align="right">[%- HTML.escape(payment_term.terms_netto_as_number) %]</td> |
40 | 41 |
<td align="right">[%- HTML.escape(payment_term.terms_skonto_as_number) %]</td> |
41 | 42 |
<td align="right">[%- HTML.escape(payment_term.percent_skonto_as_percent) %] %</td> |
43 |
<td align="right">[%- HTML.escape(payment_term.obsolete) %]</td> |
|
42 | 44 |
</tr> |
43 | 45 |
[%- END %] |
44 | 46 |
</tbody> |
Auch abrufbar als: Unified diff
Zahlungsbedingungen obsolet setzen
Damit können alte und ungenutzte Zahlungsbedingungen für neue
Belege/CV/Artikel ausgeblendet werden.
Außerdem Umstellung von generic/multibox auf L.select_tag in den Masken