llx_asset-asset.sql 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. -- ========================================================================
  2. -- Copyright (C) 2018-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 for fixed asset
  19. --
  20. -- Data example:
  21. -- INSERT INTO llx_asset (ref, entity, label, fk_asset_model, reversal_amount_ht, acquisition_value_ht, recovered_vat, reversal_date, date_acquisition, date_start, qty, acquisition_type, asset_type, not_depreciated, disposal_date, disposal_amount_ht, fk_disposal_type, disposal_depreciated, disposal_subject_to_vat, note_public, note_private, date_creation, tms, fk_user_creat, fk_user_modif, last_main_doc, import_key, model_pdf, status) VALUES
  22. -- ('LAPTOP', 1, 'LAPTOP xxx for accountancy department', 1, NULL, 1000.00000000, NULL, NULL, '2022-01-18', '2022-01-20', 0, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2022-01-18 14:31:21', '2022-03-09 14:09:46', 1, 1, NULL, NULL, NULL, 0);
  23. CREATE TABLE llx_asset(
  24. rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
  25. ref varchar(128) NOT NULL,
  26. entity integer DEFAULT 1 NOT NULL,
  27. label varchar(255),
  28. fk_asset_model integer,
  29. reversal_amount_ht double(24,8),
  30. acquisition_value_ht double(24,8) DEFAULT NULL,
  31. recovered_vat double(24,8),
  32. reversal_date date,
  33. date_acquisition date NOT NULL,
  34. date_start date NOT NULL,
  35. qty real DEFAULT 1 NOT NULL,
  36. acquisition_type smallint DEFAULT 0 NOT NULL,
  37. asset_type smallint DEFAULT 0 NOT NULL,
  38. not_depreciated integer DEFAULT 0,
  39. disposal_date date,
  40. disposal_amount_ht double(24,8),
  41. fk_disposal_type integer,
  42. disposal_depreciated integer DEFAULT 0,
  43. disposal_subject_to_vat integer DEFAULT 0,
  44. note_public text,
  45. note_private text,
  46. date_creation datetime NOT NULL,
  47. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  48. fk_user_creat integer NOT NULL,
  49. fk_user_modif integer,
  50. last_main_doc varchar(255),
  51. import_key varchar(14),
  52. model_pdf varchar(255),
  53. status integer NOT NULL
  54. ) ENGINE=innodb;