Revision b3259be1
Von Jan Büren vor fast 6 Jahren hinzugefügt
bin/mozilla/ap.pl | ||
---|---|---|
43 | 43 |
use SL::IR; |
44 | 44 |
use SL::IS; |
45 | 45 |
use SL::ReportGenerator; |
46 |
use SL::DB::BankTransactionAccTrans; |
|
46 | 47 |
use SL::DB::Currency; |
47 | 48 |
use SL::DB::Default; |
48 | 49 |
use SL::DB::PurchaseInvoice; |
... | ... | |
1231 | 1232 |
my $may_edit_create = $::auth->assert('vendor_invoice_edit', 1); |
1232 | 1233 |
|
1233 | 1234 |
my $has_sepa_exports; |
1234 |
|
|
1235 | 1235 |
if ($::form->{id}) { |
1236 | 1236 |
my $invoice = SL::DB::Manager::PurchaseInvoice->find_by(id => $::form->{id}); |
1237 | 1237 |
$has_sepa_exports = 1 if ($invoice->find_sepa_export_items()->[0]); |
1238 | 1238 |
} |
1239 | 1239 |
|
1240 |
my $is_linked_bank_transaction; |
|
1241 |
if ($::form->{id} |
|
1242 |
&& SL::DB::Default->get->payments_changeable != 0 |
|
1243 |
&& SL::DB::Manager::BankTransactionAccTrans->find_by(ap_id => $::form->{id})) { |
|
1244 |
|
|
1245 |
$is_linked_bank_transaction = 1; |
|
1246 |
} |
|
1247 |
|
|
1240 | 1248 |
for my $bar ($::request->layout->get('actionbar')) { |
1241 | 1249 |
$bar->add( |
1242 | 1250 |
action => [ |
... | ... | |
1258 | 1266 |
: $is_storno ? t8('A canceled invoice cannot be posted.') |
1259 | 1267 |
: ($::form->{id} && $change_never) ? t8('Changing invoices has been disabled in the configuration.') |
1260 | 1268 |
: ($::form->{id} && $change_on_same_day_only) ? t8('Invoices can only be changed on the day they are posted.') |
1269 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
|
1261 | 1270 |
: undef, |
1262 | 1271 |
], |
1263 | 1272 |
action => [ |
1264 | 1273 |
t8('Post Payment'), |
1265 | 1274 |
submit => [ '#form', { action => "post_payment" } ], |
1266 | 1275 |
checks => [ 'kivi.validate_form' ], |
1267 |
disabled => !$may_edit_create ? t8('You must not change this AP transaction.') |
|
1268 |
: !$::form->{id} ? t8('This invoice has not been posted yet.') |
|
1269 |
: undef, |
|
1276 |
disabled => !$may_edit_create ? t8('You must not change this AP transaction.') |
|
1277 |
: !$::form->{id} ? t8('This invoice has not been posted yet.') |
|
1278 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
|
1279 |
: undef, |
|
1270 | 1280 |
], |
1271 | 1281 |
action => [ t8('Mark as paid'), |
1272 | 1282 |
submit => [ '#form', { action => "mark_as_paid" } ], |
... | ... | |
1294 | 1304 |
action => [ t8('Delete'), |
1295 | 1305 |
submit => [ '#form', { action => "delete" } ], |
1296 | 1306 |
confirm => t8('Do you really want to delete this object?'), |
1297 |
disabled => !$may_edit_create ? t8('You must not change this AP transaction.') |
|
1298 |
: !$::form->{id} ? t8('This invoice has not been posted yet.') |
|
1299 |
: $change_never ? t8('Changing invoices has been disabled in the configuration.') |
|
1300 |
: $change_on_same_day_only ? t8('Invoices can only be changed on the day they are posted.') |
|
1301 |
: $has_storno ? t8('This invoice has been canceled already.') |
|
1302 |
: $is_closed ? t8('The billing period has already been locked.') |
|
1303 |
: $has_sepa_exports ? t8('This invoice has been linked with a sepa export, undo this first.') |
|
1304 |
: undef, |
|
1307 |
disabled => !$may_edit_create ? t8('You must not change this AP transaction.') |
|
1308 |
: !$::form->{id} ? t8('This invoice has not been posted yet.') |
|
1309 |
: $change_never ? t8('Changing invoices has been disabled in the configuration.') |
|
1310 |
: $change_on_same_day_only ? t8('Invoices can only be changed on the day they are posted.') |
|
1311 |
: $has_storno ? t8('This invoice has been canceled already.') |
|
1312 |
: $is_closed ? t8('The billing period has already been locked.') |
|
1313 |
: $has_sepa_exports ? t8('This invoice has been linked with a sepa export, undo this first.') |
|
1314 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
|
1315 |
: undef, |
|
1305 | 1316 |
], |
1306 | 1317 |
], # end of combobox "Storno" |
1307 | 1318 |
|
Auch abrufbar als: Unified diff
Manuelle Zahlungen verbieten, falls mit Kontoauszug verknüpft.
Falls die Änderbarkeit von Zahlungen nicht auf niemals steht,
entsprechend Überbuchen / manuelles Ändern verbieten.
Der Fehlertext weißt zusätzlich auf die Funktion im Bankbewegungs-Bericht hin