llx_propal.sql 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. -- ===================================================================
  2. -- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
  4. -- Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
  5. -- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
  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. -- ===================================================================
  21. create table llx_propal
  22. (
  23. rowid integer AUTO_INCREMENT PRIMARY KEY,
  24. ref varchar(30) NOT NULL, -- proposal reference number
  25. entity integer DEFAULT 1 NOT NULL, -- multi company id
  26. ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
  27. ref_client varchar(255), -- customer proposal number
  28. fk_soc integer,
  29. fk_projet integer DEFAULT NULL, -- projet auquel est rattache la propale
  30. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  31. datec datetime, -- date de creation
  32. datep date, -- date de la propal
  33. fin_validite datetime, -- date de fin de validite
  34. date_valid datetime, -- date de validation
  35. date_signature datetime, -- date signature
  36. date_cloture datetime, -- date de cloture
  37. fk_user_author integer, -- user making creation
  38. fk_user_modif integer, -- user making last change
  39. fk_user_valid integer, -- user validating
  40. fk_user_signature integer, -- user signing (signed or not)
  41. fk_user_cloture integer, -- user closing
  42. fk_statut smallint DEFAULT 0 NOT NULL, -- 0=draft, 1=validated, 2=accepted, 3=refused, 4=billed/closed
  43. price real DEFAULT 0, -- (obsolete)
  44. remise_percent real DEFAULT 0, -- remise globale relative en pourcent (obsolete)
  45. remise_absolue real DEFAULT 0, -- remise globale absolue (obsolete)
  46. remise real DEFAULT 0, -- remise calculee (obsolete)
  47. total_ht double(24,8) DEFAULT 0, -- montant total ht apres remise globale
  48. total_tva double(24,8) DEFAULT 0, -- montant total tva apres remise globale
  49. localtax1 double(24,8) DEFAULT 0, -- amount total localtax1
  50. localtax2 double(24,8) DEFAULT 0, -- amount total localtax2
  51. total_ttc double(24,8) DEFAULT 0, -- montant total ttc apres remise globale
  52. fk_account integer, -- bank account
  53. fk_currency varchar(3), -- currency code
  54. fk_cond_reglement integer, -- condition de reglement (30 jours, fin de mois ...)
  55. deposit_percent varchar(63) DEFAULT NULL, -- default deposit % if payment term needs it
  56. fk_mode_reglement integer, -- mode de reglement (Virement, Prelevement)
  57. online_sign_ip varchar(48),
  58. online_sign_name varchar(64),
  59. note_private text,
  60. note_public text,
  61. model_pdf varchar(255), -- last template used to generate main document
  62. last_main_doc varchar(255), -- relative filepath+filename of last main generated document
  63. date_livraison date DEFAULT NULL, -- delivery date
  64. fk_shipping_method integer, -- shipping method id
  65. fk_warehouse integer DEFAULT NULL, -- warehouse id
  66. fk_availability integer NULL,
  67. fk_input_reason integer,
  68. fk_incoterms integer, -- for incoterms
  69. location_incoterms varchar(255), -- for incoterms
  70. import_key varchar(14),
  71. extraparams varchar(255), -- for stock other parameters with json format
  72. fk_delivery_address integer, -- delivery address (deprecated)
  73. fk_multicurrency integer,
  74. multicurrency_code varchar(3),
  75. multicurrency_tx double(24,8) DEFAULT 1,
  76. multicurrency_total_ht double(24,8) DEFAULT 0,
  77. multicurrency_total_tva double(24,8) DEFAULT 0,
  78. multicurrency_total_ttc double(24,8) DEFAULT 0
  79. )ENGINE=innodb;