Revision 254ef1b2
Von Jan Büren vor etwa 7 Jahren hinzugefügt
SL/DATEV.pm | ||
---|---|---|
1417 | 1417 |
return defined $has_non_pk_accounts ? 0 : 1; |
1418 | 1418 |
} |
1419 | 1419 |
|
1420 |
|
|
1421 |
sub check_valid_length_of_accounts { |
|
1422 |
my ($self) = @_; |
|
1423 |
|
|
1424 |
my $query = <<"SQL"; |
|
1425 |
SELECT DISTINCT char_length (accno) FROM chart WHERE charttype='A' AND id in (select chart_id from acc_trans); |
|
1426 |
SQL |
|
1427 |
|
|
1428 |
my $accno_length = selectall_hashref_query($::form, SL::DB->client->dbh, $query); |
|
1429 |
if (1 < keys $accno_length) { |
|
1430 |
$::form->error(t8("Invalid combination of ledger account number length." . |
|
1431 |
" Mismatch length of #1 with length of #2. Please check your account settings. ", |
|
1432 |
$accno_length->[0]->{char_length}, $accno_length->[1]->{char_length})); |
|
1433 |
} |
|
1434 |
return 1; |
|
1435 |
} |
|
1436 |
|
|
1420 | 1437 |
sub DESTROY { |
1421 | 1438 |
clean_temporary_directories(); |
1422 | 1439 |
} |
... | ... | |
1656 | 1673 |
There is also no check for the typical customer range 10000-69999 and the |
1657 | 1674 |
typical vendor range 70000-99999. |
1658 | 1675 |
|
1676 |
=item check_valid_length_of_accounts |
|
1677 |
|
|
1678 |
Returns 1 if all currently booked accounts have only one common number length domain (e.g. 4 or 6). |
|
1679 |
Will throw an error if more than one distinct size is detected. |
|
1680 |
The error message gives a short hint with the value of the (at least) |
|
1681 |
two mismatching number length domains. |
|
1659 | 1682 |
=back |
1660 | 1683 |
|
1661 | 1684 |
=head1 ATTRIBUTES |
bin/mozilla/datev.pl | ||
---|---|---|
79 | 79 |
$::form->header; |
80 | 80 |
$::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted; |
81 | 81 |
$::form->{show_pk_option} = SL::DATEV->new->check_vcnumbers_are_valid_pk_numbers; |
82 |
|
|
83 |
# check if we have mismatching number length domains |
|
84 |
SL::DATEV->new->check_valid_length_of_accounts; |
|
85 |
|
|
82 | 86 |
print $::form->parse_html_template('datev/export_bewegungsdaten'); |
83 | 87 |
|
84 | 88 |
$::lxdebug->leave_sub; |
Auch abrufbar als: Unified diff
DATEV: Nummernkreislänge muss konstant sein.
Entsprechende Prüfung am Anfang des Exports