Revision 558c234e
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
bin/mozilla/ar.pl | ||
---|---|---|
37 | 37 |
use List::UtilsBy qw(sort_by); |
38 | 38 |
|
39 | 39 |
use SL::AR; |
40 |
use SL::Controller::Base; |
|
40 | 41 |
use SL::FU; |
41 | 42 |
use SL::GL; |
42 | 43 |
use SL::IS; |
... | ... | |
152 | 153 |
update(); |
153 | 154 |
} |
154 | 155 |
|
156 |
sub save_record_template { |
|
157 |
$::auth->assert('ar_transactions'); |
|
158 |
|
|
159 |
my $template = $::form->{record_template_id} ? SL::DB::RecordTemplate->new(id => $::form->{record_template_id})->load : SL::DB::RecordTemplate->new; |
|
160 |
my $js = SL::ClientJS->new(controller => SL::Controller::Base->new); |
|
161 |
my $new_name = $template->template_name_to_use($::form->{record_template_new_template_name}); |
|
162 |
|
|
163 |
$js->dialog->close('#record_template_dialog'); |
|
164 |
|
|
165 |
my @items = grep { |
|
166 |
$_->{chart_id} && (($_->{tax_id} // '') ne '') && ($_->{amount1} != 0) |
|
167 |
} map { |
|
168 |
+{ chart_id => $::form->{"AR_amount_chart_id_${_}"}, |
|
169 |
amount1 => $::form->parse_amount(\%::myconfig, $::form->{"amount_${_}"}), |
|
170 |
tax_id => (split m{--}, $::form->{"taxchart_${_}"})[0], |
|
171 |
project_id => $::form->{"project_id_${_}"} || undef, |
|
172 |
} |
|
173 |
} (1..($::form->{rowcount} || 1)); |
|
174 |
|
|
175 |
$template->assign_attributes( |
|
176 |
template_type => 'ar_transaction', |
|
177 |
template_name => $new_name, |
|
178 |
|
|
179 |
currency_id => SL::DB::Manager::Currency->find_by(name => $::form->{currency})->id, |
|
180 |
ar_ap_chart_id => $::form->{AR_chart_id} || undef, |
|
181 |
customer_id => $::form->{customer_id} || undef, |
|
182 |
department_id => $::form->{department_id} || undef, |
|
183 |
project_id => $::form->{globalproject_id} || undef, |
|
184 |
employee_id => $::form->{employee_id} || undef, |
|
185 |
taxincluded => $::form->{taxincluded} ? 1 : 0, |
|
186 |
direct_debit => $::form->{direct_debit} ? 1 : 0, |
|
187 |
ordnumber => $::form->{ordnumber}, |
|
188 |
notes => $::form->{notes}, |
|
189 |
|
|
190 |
items => \@items, |
|
191 |
); |
|
192 |
|
|
193 |
eval { |
|
194 |
$template->save; |
|
195 |
1; |
|
196 |
} or do { |
|
197 |
return $js |
|
198 |
->flash('error', $::locale->text("Saving the record template '#1' failed.", $new_name)) |
|
199 |
->render; |
|
200 |
}; |
|
201 |
|
|
202 |
return $js |
|
203 |
->flash('info', $::locale->text("The record template '#1' has been saved.", $new_name)) |
|
204 |
->render; |
|
205 |
} |
|
206 |
|
|
155 | 207 |
sub add { |
156 | 208 |
$main::lxdebug->enter_sub(); |
157 | 209 |
|
... | ... | |
334 | 386 |
my $follow_up_vc = $form->{customer_id} ? SL::DB::Customer->load_cached($form->{customer_id})->name : ''; |
335 | 387 |
my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)"; |
336 | 388 |
|
337 |
$::request->layout->add_javascripts("autocomplete_chart.js", "autocomplete_customer.js", "show_vc_details.js", "show_history.js", "follow_up.js", "kivi.Draft.js", "kivi.GL.js"); |
|
389 |
$::request->layout->add_javascripts("autocomplete_chart.js", "autocomplete_customer.js", "show_vc_details.js", "show_history.js", "follow_up.js", "kivi.Draft.js", "kivi.GL.js", "kivi.RecordTemplate.js");
|
|
338 | 390 |
|
339 | 391 |
my $transdate = $::form->{transdate} ? DateTime->from_kivitendo($::form->{transdate}) : DateTime->today_local; |
340 | 392 |
my $first_taxchart; |
locale/de/all | ||
---|---|---|
2497 | 2497 |
'Save settings as' => 'Einstellungen speichern unter', |
2498 | 2498 |
'Saving failed. Error message from the database: #1' => 'Speichern schlug fehl. Fehlermeldung der Datenbank: #1', |
2499 | 2499 |
'Saving the file \'%s\' failed. OS error message: %s' => 'Das Speichern der Datei \'%s\' schlug fehl. Fehlermeldung des Betriebssystems: %s', |
2500 |
'Saving the record template \'#1\' failed.' => 'Das Speichern der Belegvorlage »#1« schlug fehl.', |
|
2500 | 2501 |
'Score' => 'Punkte', |
2501 | 2502 |
'Screen' => 'Bildschirm', |
2502 | 2503 |
'Search' => 'Suchen', |
... | ... | |
3058 | 3059 |
'The project type is in use and cannot be deleted.' => 'Der Projekttyp wird verwendet und kann nicht gelöscht werden.', |
3059 | 3060 |
'The receivables chart isn\'t a valid chart.' => 'Das Forderungskonto ist kein gültiges Konto', |
3060 | 3061 |
'The recipient, subject or body is missing.' => 'Der Empfäger, der Betreff oder der Text ist leer.', |
3062 |
'The record template \'#1\' has been loaded.' => 'Die Belegvorlage »#1« wurde geladen.', |
|
3063 |
'The record template \'#1\' has been saved.' => 'Die Belegvorlage »#1« wurde gespeichert.', |
|
3061 | 3064 |
'The required information consists of the IBAN and the BIC.' => 'Die benötigten Informationen bestehen aus der IBAN und der BIC. Zusätzlich wird die SEPA-Kreditoren-Identifikation aus der Mandantenkonfiguration benötigt.', |
3062 | 3065 |
'The required information consists of the IBAN, the BIC, the mandator ID and the mandate\'s date of signature.' => 'Die benötigten Informationen bestehen aus IBAN, BIC, Mandanten-ID und dem Unterschriftsdatum des Mandates. Zusätzlich wird die SEPA-Kreditoren-Identifikation aus der Mandantenkonfiguration benötigt.', |
3063 | 3066 |
'The requirement spec has been deleted.' => 'Das Pflichtenheft wurde gelöscht.', |
templates/webpages/ar/form_footer.html | ||
---|---|---|
43 | 43 |
[% L.submit_tag("action", LxERP.t8('mark as paid'), confirm=LxERP.t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?')) %] |
44 | 44 |
[% END %] |
45 | 45 |
|
46 |
[% L.button_tag("kivi.RecordTemplate.popup('ar_transaction')", LxERP.t8("Record templates")) %] |
|
47 |
|
|
46 | 48 |
</form> |
47 | 49 |
|
48 | 50 |
<script type="text/javascript"> |
Auch abrufbar als: Unified diff
Belegvorlagen: Speichern bei Debitorenbuchungen