llx_societe_rib.sql 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. -- =============================================================================
  2. -- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
  4. -- Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
  5. -- Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
  6. --
  7. -- This program is free software; you can redistribute it and/or modify
  8. -- it under the terms of the GNU General Public License as published by
  9. -- the Free Software Foundation; either version 3 of the License, or
  10. -- (at your option) any later version.
  11. --
  12. -- This program is distributed in the hope that it will be useful,
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. -- GNU General Public License for more details.
  16. --
  17. -- You should have received a copy of the GNU General Public License
  18. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. --
  20. -- Table with the payment modes of a thirdparty (BAN, Paypal, Card, ...)
  21. -- =============================================================================
  22. create table llx_societe_rib
  23. (
  24. rowid integer AUTO_INCREMENT PRIMARY KEY,
  25. type varchar(32) DEFAULT 'ban' NOT NULL, -- 'ban' or 'paypal' or 'card' or 'stripe'
  26. label varchar(200),
  27. fk_soc integer NOT NULL,
  28. datec datetime,
  29. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  30. -- For BAN
  31. bank varchar(255), -- bank name
  32. code_banque varchar(128), -- bank code
  33. code_guichet varchar(6), -- desk code
  34. number varchar(255), -- account number
  35. cle_rib varchar(5), -- key of bank account
  36. bic varchar(20), -- 11 according to ISO 9362 (we keep 20 for backward compatibility)
  37. iban_prefix varchar(34), -- full iban. 34 according to ISO 13616
  38. domiciliation varchar(255),
  39. proprio varchar(60),
  40. owner_address varchar(255),
  41. default_rib smallint NOT NULL DEFAULT 0,
  42. state_id integer,
  43. fk_country integer,
  44. currency_code varchar(3),
  45. -- For BAN direct debit feature
  46. rum varchar(32), -- RUM value to use for SEPA generation
  47. date_rum date, -- Date of mandate
  48. frstrecur varchar(16) default 'FRST', -- 'FRST' or 'RECUR'
  49. --For credit card
  50. last_four varchar(4), -- last 4
  51. card_type varchar(255), -- card type 'VISA', 'MC' , ...
  52. cvn varchar(255),
  53. exp_date_month INTEGER,
  54. exp_date_year INTEGER,
  55. country_code varchar(10),
  56. --For Paypal
  57. approved INTEGER DEFAULT 0,
  58. email varchar(255),
  59. ending_date date,
  60. max_total_amount_of_all_payments double(24,8),
  61. preapproval_key varchar(255),
  62. starting_date date,
  63. total_amount_of_all_payments double(24,8),
  64. --For Stripe
  65. stripe_card_ref varchar(128), -- 'card_...'
  66. stripe_account varchar(128), -- 'pk_live_...'
  67. comment varchar(255),
  68. ipaddress varchar(68),
  69. status integer NOT NULL DEFAULT 1, -- 1=ACTIVE, 0=IN_TRASH
  70. import_key varchar(14) -- import key
  71. )ENGINE=innodb;