Fix regression in accounting transfer

This commit is contained in:
ldestailleur 2025-10-11 15:31:32 +02:00
parent 92b158d1fc
commit bbec15ee91
4 changed files with 22 additions and 34 deletions

View file

@ -29,7 +29,14 @@
* \brief Ventilation page from customers invoices
*/
require '../../main.inc.php';
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Societe $mysoc
* @var Translate $langs
* @var User $user
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@ -40,14 +47,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Societe $mysoc
* @var Translate $langs
* @var User $user
*/
// Load translation files required by the page
$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch", "products"));
@ -55,15 +54,12 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other",
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array:int');
$toselect = GETPOST('toselect', 'array:aZ09'); // Value can be 'X_Y'
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancycustomerlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'alpha');
$default_account = GETPOSTINT('default_account');
// Select Box
$mesCasesCochees = GETPOST('toselect', 'array:int');
// Search Getpost
$search_societe = GETPOST('search_societe', 'alpha');
$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100'
@ -206,21 +202,20 @@ if (empty($reshook)) {
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
$msg = '';
//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
if (!empty($mesCasesCochees)) {
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($mesCasesCochees).'</div>';
if (!empty($toselect)) {
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($toselect).'</div>';
$msg .= '<div class="detail">';
$cpt = 0;
$ok = 0;
$ko = 0;
foreach ($mesCasesCochees as $maLigneCochee) {
foreach ($toselect as $maLigneCochee) {
$maLigneCourante = explode("_", $maLigneCochee);
$monId = $maLigneCourante[0];
$monCompte = GETPOSTINT('codeventil'.$monId);
if ($monCompte <= 0) {
$msg .= '<div><span style="color:red">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'</span></div>';
$msg .= '<div><span class="error">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'</span></div>';
$ko++;
} else {
$sql = " UPDATE ".MAIN_DB_PREFIX."facturedet";

View file

@ -51,14 +51,10 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other",
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array:int');
$toselect = GETPOST('toselect', 'array:aZ09'); // Value can be 'X_Y'
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancyexpensereportlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
// Select Box
$mesCasesCochees = GETPOST('toselect', 'array:int');
// Search Getpost
$search_login = GETPOST('search_login', 'alpha');
$search_lineid = GETPOST('search_lineid', 'alpha');
@ -199,14 +195,14 @@ if (empty($reshook)) {
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
$msg = '';
if (!empty($mesCasesCochees)) {
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($mesCasesCochees).'</div>';
if (!empty($toselect)) {
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($toselect).'</div>';
$msg .= '<div class="detail">';
$cpt = 0;
$ok = 0;
$ko = 0;
foreach ($mesCasesCochees as $maLigneCochee) {
foreach ($toselect as $maLigneCochee) {
$maLigneCourante = explode("_", $maLigneCochee);
$monId = $maLigneCourante[0];
$monCompte = GETPOSTINT('codeventil'.$monId);

View file

@ -56,15 +56,12 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other",
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array:int');
$toselect = GETPOST('toselect', 'array:aZ09'); // Value can be 'X_Y'
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancysupplierlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'alpha');
$default_account = GETPOSTINT('default_account');
// Select Box
$mesCasesCochees = GETPOST('toselect', 'array:int');
// Search Getpost
$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100'
$search_societe = GETPOST('search_societe', 'alpha');
@ -212,14 +209,14 @@ if (empty($reshook)) {
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
$msg = '';
if (!empty($mesCasesCochees)) {
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($mesCasesCochees).'</div>';
if (!empty($toselect)) {
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($toselect).'</div>';
$msg .= '<div class="detail">';
$cpt = 0;
$ok = 0;
$ko = 0;
foreach ($mesCasesCochees as $maLigneCochee) {
foreach ($toselect as $maLigneCochee) {
$maLigneCourante = explode("_", $maLigneCochee);
$monId = $maLigneCourante[0];
$monCompte = GETPOSTINT('codeventil'.$monId);

View file

@ -447,7 +447,7 @@ AccountRemovedFromGroup=Account removed from group
SaleLocal=Local sale
SaleExport=Export sale
SaleEEC=Sale in EEC
SaleEECWithVAT=Sale is in EEC with a VAT not null, so we suppose this is NOT an intra-community sale and the suggested account is the standard product account.
SaleEECWithVAT=Sale is in EEC with a non-zero VAT, so we suppose this is NOT an intra-community sale. If an account is suggested, it is the standard product account for a national sale.
SaleEECWithoutVATNumber=Sale is in EEC with no VAT but the VAT ID of third party is not defined. We fall back on the account for standard sales. You can fix the VAT ID of the third party, or change the product account suggested for binding if needed.
AnySale=Any sale
ForbiddenTransactionAlreadyExported=Forbidden: The transaction has been validated and/or exported.