Revision 57342517
Von Jan Büren vor mehr als 2 Jahren hinzugefügt
bin/mozilla/ap.pl | ||
---|---|---|
493 | 493 |
$form->{"selected_taxchart_$i"} = $selected_taxchart; |
494 | 494 |
$form->{"AP_amount_chart_id_$i"} = $amount_chart_id; |
495 | 495 |
$form->{"taxcharts_$i"} = \@taxcharts; |
496 |
|
|
497 |
# reverse charge hack for template, display two taxes |
|
498 |
if ($taxchart_to_use->taxkey == 94) { |
|
499 |
my $tmpnetamount; |
|
500 |
($tmpnetamount, $form->{"tax_reverse_$i"}) = $form->calculate_tax($form->parse_amount(\%myconfig, $form->{"amount_$i"}), 0.19, $form->{taxincluded},2); |
|
501 |
$form->{"tax_charge_$i"} = $form->{"tax_reverse_$i"} * -1; |
|
502 |
$form->{"tax_reverse_$i"} = $form->format_amount(\%myconfig, $form->{"tax_reverse_$i"}, 2); |
|
503 |
$form->{"tax_charge_$i"} = $form->format_amount(\%myconfig, $form->{"tax_charge_$i"}, 2); |
|
504 |
} |
|
496 | 505 |
} |
497 | 506 |
|
498 | 507 |
$form->{taxchart_value_title_sub} = sub { |
... | ... | |
797 | 806 |
$form->error($locale->text('Cannot post transaction for a closed period!')) if ($form->date_closed($form->{"transdate"}, \%myconfig)); |
798 | 807 |
|
799 | 808 |
my $zero_amount_posting = 1; |
809 |
# no taxincluded for 94 |
|
810 |
my $tax = SL::DB::Manager::Tax->get_first( where => [taxkey => 94 ]); |
|
811 |
my $tax_id = ref $tax eq 'SL::DB::Tax' ? $tax->id : undef; |
|
800 | 812 |
for my $i (1 .. $form->{rowcount}) { |
813 |
# no taxincluded for 94 |
|
814 |
if ($tax_id && $form->{"taxchart_$i"} =~ m/^$tax_id--/ && $form->{taxincluded}) { |
|
815 |
$form->error($locale->text('Cannot Post AP transaction with tax included!')); |
|
816 |
} |
|
801 | 817 |
if ($form->parse_amount(\%myconfig, $form->{"amount_$i"})) { |
802 | 818 |
$zero_amount_posting = 0; |
803 |
last; |
|
804 | 819 |
} |
805 | 820 |
} |
806 | 821 |
|
... | ... | |
1348 | 1363 |
|
1349 | 1364 |
$is_linked_bank_transaction = 1; |
1350 | 1365 |
} |
1366 |
my $is_linked_gl_transaction; |
|
1367 |
if ($::form->{id} && SL::DB::Manager::ApGl->find_by(ap_id => $::form->{id})) { |
|
1368 |
$is_linked_gl_transaction = 1; |
|
1369 |
} |
|
1351 | 1370 |
|
1352 | 1371 |
my $create_post_action = sub { |
1353 | 1372 |
# $_[0]: description |
... | ... | |
1419 | 1438 |
: $is_storno ? t8('Reversal invoices cannot be canceled.') |
1420 | 1439 |
: $::form->{totalpaid} ? t8('Invoices with payments cannot be canceled.') |
1421 | 1440 |
: $has_sepa_exports ? t8('This invoice has been linked with a sepa export, undo this first.') |
1441 |
: $is_linked_gl_transaction ? t8('This transaction is linked with a gl transaction. Please delete the ap transaction booking if needed.') |
|
1422 | 1442 |
: undef, |
1423 | 1443 |
], |
1424 | 1444 |
action => [ t8('Delete'), |
... | ... | |
1426 | 1446 |
confirm => t8('Do you really want to delete this object?'), |
1427 | 1447 |
disabled => !$may_edit_create ? t8('You must not change this AP transaction.') |
1428 | 1448 |
: !$::form->{id} ? t8('This invoice has not been posted yet.') |
1429 |
: $change_never ? t8('Changing invoices has been disabled in the configuration.') |
|
1430 |
: $change_on_same_day_only ? t8('Invoices can only be changed on the day they are posted.') |
|
1431 |
: $has_storno ? t8('This invoice has been canceled already.') |
|
1432 | 1449 |
: $is_closed ? t8('The billing period has already been locked.') |
1433 | 1450 |
: $has_sepa_exports ? t8('This invoice has been linked with a sepa export, undo this first.') |
1434 | 1451 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
1452 |
: $is_linked_gl_transaction ? undef # linked transactions can be deleted, if period is not closed |
|
1453 |
: $change_never ? t8('Changing invoices has been disabled in the configuration.') |
|
1454 |
: $change_on_same_day_only ? t8('Invoices can only be changed on the day they are posted.') |
|
1455 |
: $has_storno ? t8('This invoice has been canceled already.') |
|
1435 | 1456 |
: undef, |
1436 | 1457 |
], |
1437 | 1458 |
], # end of combobox "Storno" |
Auch abrufbar als: Unified diff
Kreditorenbuchung um Steuerschlüssel 94 (reverse charge) erweitert
Bucht die gegensätzliche Steuer auf eine verknüpfte Dialogbuchung
und setzt den Steuerschlüssel beim DATEV-Export auf 0. Ferner sind
Steuer inklusive Buchungen unterbunden und die Dialogbuchung ist
nicht veränderbar, wird aber entsprechend modifiziert wenn die
Quell-Buchung geändert (gelöscht) wird.