2
0
forked from Wavyzz/dolibarr

Revert "Revert "Reverse const STOCK_ALLOW_NEGATIVE_TRANSFER to STOCK_DISALLOW…" (#33454)

This reverts commit e943c9c97f.
This commit is contained in:
Laurent Destailleur
2025-03-13 23:22:40 +01:00
committed by GitHub
parent e943c9c97f
commit 051a902f1f
7 changed files with 26 additions and 21 deletions

View File

@@ -199,3 +199,8 @@ ALTER TABLE llx_session ADD COLUMN date_creation datetime NOT NULL AFTER session
ALTER TABLE llx_accounting_account ADD COLUMN centralized tinyint DEFAULT 0 NOT NULL AFTER active;
UPDATE llx_accounting_account as acc SET acc.centralized = 1 WHERE acc.account_number in (SELECT value FROM llx_const WHERE name IN (__ENCRYPT('ACCOUNTING_ACCOUNT_CUSTOMER')__,__ENCRYPT('ACCOUNTING_ACCOUNT_SUPPLIER')__,__ENCRYPT('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT')__));
-- invert constant STOCK_ALLOW_NEGATIVE_TRANSFER because it was automatically set to 1, deleting the user config.
INSERT INTO llx_const (name, entity, value, type, visible, note) SELECT DISTINCT 'STOCK_DISALLOW_NEGATIVE_TRANSFER', entity, 1, 'chaine', 0, '' FROM llx_const c1 WHERE NOT EXISTS (SELECT rowid FROM llx_const c2 WHERE c2.name = 'STOCK_ALLOW_NEGATIVE_TRANSFER' AND c2.value = 1 AND c2.entity = c1.entity);
UPDATE llx_const SET name = 'STOCK_DISALLOW_NEGATIVE_TRANSFER', value = 1 WHERE name = 'STOCK_ALLOW_NEGATIVE_TRANSFER' AND value = 0;
DELETE FROM llx_const WHERE name = 'STOCK_ALLOW_NEGATIVE_TRANSFER' AND value = 1;