Revision db101cc6
Von Cem Aydin vor etwa 2 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
53 | 53 |
use SL::IO; |
54 | 54 |
use SL::TransNumber; |
55 | 55 |
use SL::DB::Chart; |
56 |
use SL::DB::Customer; |
|
56 | 57 |
use SL::DB::Default; |
57 | 58 |
use SL::DB::Draft; |
58 | 59 |
use SL::DB::Tax; |
... | ... | |
60 | 61 |
use SL::TransNumber; |
61 | 62 |
use SL::DB; |
62 | 63 |
use SL::Presenter::Part qw(type_abbreviation classification_abbreviation); |
64 |
use SL::Helper::QrBillFunctions qw(get_qrbill_account assemble_ref_number); |
|
63 | 65 |
use Data::Dumper; |
64 | 66 |
|
65 | 67 |
use strict; |
... | ... | |
1467 | 1469 |
|
1468 | 1470 |
$amount = $form->round_amount( $netamount + $tax, 2, 1); |
1469 | 1471 |
|
1472 |
# qr reference |
|
1473 |
my $qr_reference; |
|
1474 |
if ($form->{has_qr_reference}) { |
|
1475 |
# (re-)generate reference number |
|
1476 |
|
|
1477 |
# get qr-account data |
|
1478 |
my ($qr_account, $error) = get_qrbill_account(); |
|
1479 |
die $error if !$qr_account; |
|
1480 |
|
|
1481 |
# get customer object |
|
1482 |
my $customer_obj = SL::DB::Customer->load_cached(conv_i($form->{customer_id})); |
|
1483 |
|
|
1484 |
# assemble reference number with check digit |
|
1485 |
($qr_reference, $error) = assemble_ref_number($qr_account->{bank_account_id}, |
|
1486 |
$customer_obj->{customernumber}, |
|
1487 |
$form->{ordnumber}, |
|
1488 |
$form->{invnumber}); |
|
1489 |
die $error if !$qr_reference; |
|
1490 |
} else { |
|
1491 |
# if the reference number has been previously defined keep it |
|
1492 |
if (defined $form->{qr_reference}) { |
|
1493 |
$qr_reference = $form->{qr_reference}; |
|
1494 |
} else { |
|
1495 |
$qr_reference = undef; |
|
1496 |
} |
|
1497 |
} |
|
1498 |
|
|
1470 | 1499 |
# save AR record |
1471 | 1500 |
#erweiterung fuer lieferscheinnummer (donumber) 12.02.09 jb |
1472 | 1501 |
|
... | ... | |
1484 | 1513 |
globalproject_id = ?, delivery_customer_id = ?, |
1485 | 1514 |
transaction_description = ?, delivery_vendor_id = ?, |
1486 | 1515 |
donumber = ?, invnumber_for_credit_note = ?, direct_debit = ?, qrbill_without_amount = ?, |
1487 |
delivery_term_id = ? |
|
1516 |
qr_reference = ?, delivery_term_id = ?
|
|
1488 | 1517 |
WHERE id = ?|; |
1489 | 1518 |
@values = ( $form->{"invnumber"}, $form->{"ordnumber"}, $form->{"quonumber"}, $form->{"cusordnumber"}, |
1490 | 1519 |
conv_date($form->{"invdate"}), conv_date($form->{"orddate"}), conv_date($form->{"quodate"}), conv_date($form->{tax_point}), conv_i($form->{"customer_id"}), |
... | ... | |
1498 | 1527 |
conv_i($form->{"globalproject_id"}), conv_i($form->{"delivery_customer_id"}), |
1499 | 1528 |
$form->{transaction_description}, conv_i($form->{"delivery_vendor_id"}), |
1500 | 1529 |
$form->{"donumber"}, $form->{"invnumber_for_credit_note"}, $form->{direct_debit} ? 't' : 'f', $form->{qrbill_without_amount} ? 't' : 'f', |
1501 |
conv_i($form->{delivery_term_id}), |
|
1530 |
$qr_reference, conv_i($form->{delivery_term_id}),
|
|
1502 | 1531 |
conv_i($form->{"id"})); |
1503 | 1532 |
do_query($form, $dbh, $query, @values); |
1504 | 1533 |
|
... | ... | |
2251 | 2280 |
a.mtime, a.itime, |
2252 | 2281 |
a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type, |
2253 | 2282 |
a.transaction_description, a.donumber, a.invnumber_for_credit_note, |
2254 |
a.marge_total, a.marge_percent, a.direct_debit, a.qrbill_without_amount, a.delivery_term_id, |
|
2283 |
a.marge_total, a.marge_percent, a.direct_debit, a.qrbill_without_amount, a.qr_reference, a.delivery_term_id,
|
|
2255 | 2284 |
dc.dunning_description, |
2256 | 2285 |
e.name AS employee |
2257 | 2286 |
FROM ar a |
Auch abrufbar als: Unified diff
Swiss QR-Bill: QR-Referenz soll in der jeweiligen Rechnung gespeichert werden