llx_loan-loan.sql 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. -- ========================================================================
  2. -- Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
  3. -- Copyright (C) 2015 Frederic France <frederic.france@free.fr>
  4. --
  5. -- This program is free software; you can redistribute it and/or modify
  6. -- it under the terms of the GNU General Public License as published by
  7. -- the Free Software Foundation; either version 3 of the License, or
  8. -- (at your option) any later version.
  9. --
  10. -- This program is distributed in the hope that it will be useful,
  11. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. -- GNU General Public License for more details.
  14. --
  15. -- You should have received a copy of the GNU General Public License
  16. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. --
  18. -- ========================================================================
  19. create table llx_loan
  20. (
  21. rowid integer AUTO_INCREMENT PRIMARY KEY,
  22. entity integer DEFAULT 1 NOT NULL,
  23. datec datetime,
  24. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  25. label varchar(80) NOT NULL,
  26. fk_bank integer,
  27. capital double(24,8) DEFAULT 0 NOT NULL,
  28. insurance_amount double(24,8) DEFAULT 0,
  29. datestart date,
  30. dateend date,
  31. nbterm real,
  32. rate double NOT NULL,
  33. note_private text,
  34. note_public text,
  35. capital_position double(24,8) DEFAULT 0, -- If not a new loan, just have the position of capital
  36. date_position date,
  37. paid smallint default 0 NOT NULL,
  38. accountancy_account_capital varchar(32),
  39. accountancy_account_insurance varchar(32),
  40. accountancy_account_interest varchar(32),
  41. fk_projet integer DEFAULT NULL,
  42. fk_user_author integer DEFAULT NULL,
  43. fk_user_modif integer DEFAULT NULL,
  44. active tinyint DEFAULT 1 NOT NULL
  45. )ENGINE=innodb;