diff --git a/admin/setup_mvp.php b/admin/setup_mvp.php index 0588e1e..3b495e0 100644 --- a/admin/setup_mvp.php +++ b/admin/setup_mvp.php @@ -164,8 +164,6 @@ foreach ($lines_by_section as $section_code => $lines) { print ''; foreach ($lines as $line => $definition) { - $selected_accounts = isset($mappings_by_line[$line]) ? $mappings_by_line[$line] : array(); - print ''; print '' . $line . ''; print '' . $definition['label'] . ''; @@ -181,16 +179,21 @@ foreach ($lines_by_section as $section_code => $lines) { // Special handling for lines 08, 09, 9B (need both base and VAT accounts) if (in_array($line, array('08', '09', '9B'))) { + // Load separate mappings for base and VAT + $base_selected_accounts = isset($mappings_by_line[$line . '_BASE']) ? $mappings_by_line[$line . '_BASE'] : array(); + $vat_selected_accounts = isset($mappings_by_line[$line . '_VAT']) ? $mappings_by_line[$line . '_VAT'] : array(); + print '
'; print 'Comptes de base (ventes):
'; - print $form->multiselectarray('base_account_codes_' . $line, $account_options, $selected_accounts, 0, 0, '', 0, '200px'); + print $form->multiselectarray('base_account_codes_' . $line, $account_options, $base_selected_accounts, 0, 0, '', 0, '200px'); print '
'; print '
'; print 'Comptes de TVA:
'; - print $form->multiselectarray('vat_account_codes_' . $line, $account_options, $selected_accounts, 0, 0, '', 0, '200px'); + print $form->multiselectarray('vat_account_codes_' . $line, $account_options, $vat_selected_accounts, 0, 0, '', 0, '200px'); print '
'; } else { // Normal single selection for other lines + $selected_accounts = isset($mappings_by_line[$line]) ? $mappings_by_line[$line] : array(); print $form->multiselectarray('account_codes_' . $line, $account_options, $selected_accounts, 0, 0, '', 0, '200px'); } print '';