Bug 23049: (follow-up) Handle unexpected types

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2019-10-15 12:00:24 +01:00
parent cf1904bb08
commit f046b5073e
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 23 additions and 0 deletions

View File

@ -105,6 +105,29 @@ if ( CheckVersion($DBversion) ) {
}
);
# Add any unexpected accounttype codes to debit_types as appropriate
$dbh->do(
qq{
INSERT IGNORE INTO account_debit_types (
code,
description,
can_be_added_manually,
default_amount,
is_system
)
SELECT
SUBSTR(accounttype, 1, 80),
"Unexpected type found during upgrade",
1,
NULL,
0
FROM
accountlines
WHERE
amount > 0
}
);
# Adding debit_type_code to accountlines
unless ( column_exists('accountlines', 'debit_type_code') ) {
$dbh->do(