Revision 032e3094
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
SL/Controller/PaymentTerm.pm | ||
---|---|---|
7 | 7 |
use SL::DB::PaymentTerm; |
8 | 8 |
use SL::DB::Language; |
9 | 9 |
use SL::Helper::Flash; |
10 |
use SL::Locale::String qw(t8); |
|
10 | 11 |
|
11 | 12 |
use Rose::Object::MakeMethods::Generic |
12 | 13 |
( |
... | ... | |
25 | 26 |
sub action_list { |
26 | 27 |
my ($self) = @_; |
27 | 28 |
|
29 |
$self->setup_list_action_bar; |
|
28 | 30 |
$self->render('payment_term/list', |
29 | 31 |
title => $::locale->text('Payment terms'), |
30 | 32 |
PAYMENT_TERMS => SL::DB::Manager::PaymentTerm->get_all_sorted); |
... | ... | |
34 | 36 |
my ($self) = @_; |
35 | 37 |
|
36 | 38 |
$self->{payment_term} = SL::DB::PaymentTerm->new(auto_calculation => 1); |
39 |
$self->setup_form_action_bar; |
|
37 | 40 |
$self->render('payment_term/form', title => $::locale->text('Create a new payment term')); |
38 | 41 |
} |
39 | 42 |
|
40 | 43 |
sub action_edit { |
41 | 44 |
my ($self) = @_; |
42 | 45 |
|
46 |
$self->setup_form_action_bar; |
|
43 | 47 |
$self->render('payment_term/form', title => $::locale->text('Edit payment term')); |
44 | 48 |
} |
45 | 49 |
|
... | ... | |
127 | 131 |
$self->{languages} = SL::DB::Manager::Language->get_all_sorted; |
128 | 132 |
} |
129 | 133 |
|
134 |
sub setup_list_action_bar { |
|
135 |
my ($self) = @_; |
|
136 |
|
|
137 |
for my $bar ($::request->layout->get('actionbar')) { |
|
138 |
$bar->add( |
|
139 |
link => [ |
|
140 |
t8('Add'), |
|
141 |
link => $self->url_for(action => 'new'), |
|
142 |
], |
|
143 |
); |
|
144 |
} |
|
145 |
} |
|
146 |
|
|
147 |
sub setup_form_action_bar { |
|
148 |
my ($self) = @_; |
|
149 |
|
|
150 |
my $is_new = !$self->payment_term->id; |
|
151 |
|
|
152 |
for my $bar ($::request->layout->get('actionbar')) { |
|
153 |
$bar->add( |
|
154 |
action => [ |
|
155 |
t8('Save'), |
|
156 |
submit => [ '#form', { action => 'PaymentTerm/' . ($is_new ? 'create' : 'update') } ], |
|
157 |
checks => [ 'kivi.validate_form' ], |
|
158 |
accesskey => 'enter', |
|
159 |
], |
|
160 |
|
|
161 |
action => [ |
|
162 |
t8('Delete'), |
|
163 |
submit => [ '#form', { action => 'PaymentTerm/destroy' } ], |
|
164 |
confirm => t8('Do you really want to delete this object?'), |
|
165 |
disabled => $is_new ? t8('This object has not been saved yet.') : undef, |
|
166 |
], |
|
167 |
|
|
168 |
'separator', |
|
169 |
|
|
170 |
link => [ |
|
171 |
t8('Abort'), |
|
172 |
link => $self->url_for(action => 'list'), |
|
173 |
], |
|
174 |
); |
|
175 |
} |
|
176 |
} |
|
177 |
|
|
130 | 178 |
1; |
locale/de/all | ||
---|---|---|
302 | 302 |
'Are you sure you want to delete Invoice Number' => 'Soll die Rechnung mit folgender Nummer wirklich gelöscht werden:', |
303 | 303 |
'Are you sure you want to delete this delivery term?' => 'Wollen Sie diese Lieferbedingungen wirklich löschen?', |
304 | 304 |
'Are you sure you want to delete this letter?' => 'Sind Sie sicher, dass Sie diesen Brief löschen wollen?', |
305 |
'Are you sure you want to delete this payment term?' => 'Wollen Sie diese Zahlungsbedingungen wirklich löschen?', |
|
306 | 305 |
'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?', |
307 | 306 |
'Are you sure you want to update the prices' => 'Sind Sie sicher, dass Sie die Preise aktualisieren wollen?', |
308 | 307 |
'Are you sure you want to update the selected record template with the current values? This cannot be undone.' => 'Sind Sie sicher, dass Sie die ausgewählte Belegvorlage mit den aktuellen Daten aktualisieren wollen? Das kann nicht rückgängig gemacht werden.', |
... | ... | |
714 | 713 |
'Create new' => 'Neu erfassen', |
715 | 714 |
'Create new client #1' => 'Neuen Mandanten #1 anlegen', |
716 | 715 |
'Create new delivery term' => 'Neue Lieferbedingungen anlegen', |
717 |
'Create new payment term' => 'Neue Zahlungsbedingung anlegen', |
|
718 | 716 |
'Create new quotation or order' => 'Neues Angebot oder neuen Auftrag anlegen', |
719 | 717 |
'Create new quotation/order' => 'Neues Angebot/neuen Auftrag anlegen', |
720 | 718 |
'Create new qutoation/order' => 'Neues Angebot/neuen Auftrag anlegen', |
... | ... | |
1725 | 1723 |
'Long Description' => 'Langtext', |
1726 | 1724 |
'Long Description (invoices)' => 'Langtext (Rechnungen)', |
1727 | 1725 |
'Long Description (quotations & orders)' => 'Langtext (Angebote & Aufträge)', |
1726 |
'Long Description for invoices' => 'Langtext für Rechnungen', |
|
1727 |
'Long Description for quotations & orders' => 'Langtext für Angebote & Aufträge', |
|
1728 | 1728 |
'Luxembourg' => 'Luxemburg', |
1729 | 1729 |
'MAILED' => 'Gesendet', |
1730 | 1730 |
'MD' => 'PT', |
templates/webpages/payment_term/form.html | ||
---|---|---|
1 |
[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %] |
|
1 |
[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %][%- USE P -%]
|
|
2 | 2 |
<h1>[% FORM.title %]</h1> |
3 | 3 |
|
4 |
<form method="post" action="controller.pl"> |
|
4 |
<form method="post" action="controller.pl" id="form">
|
|
5 | 5 |
|
6 | 6 |
[%- INCLUDE 'common/flash.html' %] |
7 | 7 |
|
... | ... | |
14 | 14 |
<tr> |
15 | 15 |
<td>[%- 'Description' | $T8 %]</td> |
16 | 16 |
<td> |
17 |
<input name="payment_term.description" value="[%- HTML.escape(SELF.payment_term.description) %]">
|
|
17 |
[% P.input_tag("payment_term.description", SELF.payment_term.description, "data-validate"="required", "data-title"=LxERP.t8("Description")) %]
|
|
18 | 18 |
</td> |
19 | 19 |
</tr> |
20 | 20 |
|
... | ... | |
61 | 61 |
<tr> |
62 | 62 |
<td>[%- 'Long Description' | $T8 %]</td> |
63 | 63 |
<td> |
64 |
<input name="payment_term.description_long" value="[%- HTML.escape(SELF.payment_term.description_long) %]" size="60">
|
|
64 |
[% P.input_tag("payment_term.description_long", SELF.payment_term.description_long, size="60", "data-validate"="required", "data-title"=LxERP.t8("Long Description for quotations & orders")) %]
|
|
65 | 65 |
</td> |
66 | 66 |
|
67 | 67 |
<td> |
68 |
<input name="payment_term.description_long_invoice" value="[%- HTML.escape(SELF.payment_term.description_long_invoice) %]" size="60">
|
|
68 |
[% P.input_tag("payment_term.description_long_invoice", SELF.payment_term.description_long_invoice, size="60", "data-validate"="required", "data-title"=LxERP.t8("Long Description for invoices")) %]
|
|
69 | 69 |
</td> |
70 | 70 |
</tr> |
71 | 71 |
|
... | ... | |
83 | 83 |
[%- END %] |
84 | 84 |
</table> |
85 | 85 |
|
86 |
<p> |
|
87 |
<input type="hidden" name="id" value="[% SELF.payment_term.id %]"> |
|
88 |
<input type="hidden" name="action" value="PaymentTerm/dispatch"> |
|
89 |
<input type="submit" class="submit" name="action_[% IF SELF.payment_term.id %]update[% ELSE %]create[% END %]" value="[% 'Save' | $T8 %]"> |
|
90 |
[%- IF SELF.payment_term.id %] |
|
91 |
<input type="submit" class="submit" name="action_destroy" value="[% 'Delete' | $T8 %]" |
|
92 |
onclick="if (confirm('[% 'Are you sure you want to delete this payment term?' | $T8 %]')) return true; else return false;"> |
|
93 |
[%- END %] |
|
94 |
<a href="[% SELF.url_for(action => 'list') %]">[%- 'Abort' | $T8 %]</a> |
|
95 |
</p> |
|
86 |
[% P.hidden_tag("id", SELF.payment_term.id) %] |
|
96 | 87 |
|
97 | 88 |
<hr size="3" noshade> |
98 | 89 |
|
templates/webpages/payment_term/list.html | ||
---|---|---|
46 | 46 |
</tbody> |
47 | 47 |
</table> |
48 | 48 |
[%- END %] |
49 |
|
|
50 |
<p> |
|
51 |
<a href="[% SELF.url_for(action => 'new') %]">[%- 'Create new payment term' | $T8 %]</a> |
|
52 |
</p> |
|
53 | 49 |
</form> |
54 | 50 |
|
55 | 51 |
[% L.sortable_element('#payment_term_list tbody', url => 'controller.pl?action=PaymentTerm/reorder', with => 'payment_term_id') %] |
Auch abrufbar als: Unified diff
ActionBar: Verwendung bei »System« → »Zahlungsbedingungen«