llx_asset_depreciation_options_fiscal-asset.sql 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. -- ========================================================================
  2. -- Copyright (C) 2022 OpenDSI <support@open-dsi.fr>
  3. --
  4. -- This program is free software: you can redistribute it and/or modify
  5. -- it under the terms of the GNU General Public License as published by
  6. -- the Free Software Foundation, either version 3 of the License, or
  7. -- (at your option) any later version.
  8. --
  9. -- This program is distributed in the hope that it will be useful,
  10. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. -- GNU General Public License for more details.
  13. --
  14. -- You should have received a copy of the GNU General Public License
  15. -- along with this program. If not, see https://www.gnu.org/licenses/.
  16. -- ========================================================================
  17. --
  18. -- Table to store fiscal depreciation of a fixed asset
  19. --
  20. -- Data example:
  21. -- INSERT INTO llx_asset_depreciation_options_fiscal (fk_asset, fk_asset_model, depreciation_type, accelerated_depreciation_option, degressive_coefficient, duration, duration_type, amount_base_depreciation_ht, amount_base_deductible_ht, total_amount_last_depreciation_ht, tms, fk_user_modif) VALUES
  22. -- (1, NULL, 1, NULL, 1.75000000, 60, 1, 500.00000000, 0.00000000, 7.00000000, '2022-03-09 14:15:48', 1);
  23. CREATE TABLE llx_asset_depreciation_options_fiscal(
  24. rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
  25. fk_asset integer,
  26. fk_asset_model integer,
  27. depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional
  28. degressive_coefficient double(24,8),
  29. duration smallint NOT NULL,
  30. duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily
  31. amount_base_depreciation_ht double(24,8),
  32. amount_base_deductible_ht double(24,8),
  33. total_amount_last_depreciation_ht double(24,8),
  34. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  35. fk_user_modif integer
  36. ) ENGINE=innodb;