llx_propal.sql 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. -- ===================================================================
  2. -- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.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 <http://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_int varchar(255), -- reference into an internal system (used by dolibarr to store extern id like paypal info)
  28. ref_client varchar(255), -- customer proposal number
  29. fk_soc integer,
  30. fk_projet integer DEFAULT NULL, -- projet auquel est rattache la propale
  31. tms timestamp,
  32. datec datetime, -- date de creation
  33. datep date, -- date de la propal
  34. fin_validite datetime, -- date de fin de validite
  35. date_valid datetime, -- date de validation
  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_cloture integer, -- user closing (signed or not)
  41. fk_statut smallint DEFAULT 0 NOT NULL, -- 0=draft, 1=validated, 2=accepted, 3=refused, 4=billed/closed
  42. price real DEFAULT 0, -- (obsolete)
  43. remise_percent real DEFAULT 0, -- remise globale relative en pourcent (obsolete)
  44. remise_absolue real DEFAULT 0, -- remise globale absolue (obsolete)
  45. remise real DEFAULT 0, -- remise calculee (obsolete)
  46. total_ht double(24,8) DEFAULT 0, -- montant total ht apres remise globale
  47. tva double(24,8) DEFAULT 0, -- montant total tva apres remise globale
  48. localtax1 double(24,8) DEFAULT 0, -- amount total localtax1
  49. localtax2 double(24,8) DEFAULT 0, -- amount total localtax2
  50. total double(24,8) DEFAULT 0, -- montant total ttc apres remise globale
  51. fk_account integer, -- bank account
  52. fk_currency varchar(3), -- currency code
  53. fk_cond_reglement integer, -- condition de reglement (30 jours, fin de mois ...)
  54. fk_mode_reglement integer, -- mode de reglement (Virement, Prelevement)
  55. note_private text,
  56. note_public text,
  57. model_pdf varchar(255),
  58. date_livraison date DEFAULT NULL, -- delivery date
  59. fk_shipping_method integer, -- shipping method id
  60. fk_availability integer NULL,
  61. fk_input_reason integer,
  62. fk_incoterms integer, -- for incoterms
  63. location_incoterms varchar(255), -- for incoterms
  64. import_key varchar(14),
  65. extraparams varchar(255), -- for stock other parameters with json format
  66. fk_delivery_address integer, -- delivery address (deprecated)
  67. fk_multicurrency integer,
  68. multicurrency_code varchar(255),
  69. multicurrency_tx double(24,8) DEFAULT 1,
  70. multicurrency_total_ht double(24,8) DEFAULT 0,
  71. multicurrency_total_tva double(24,8) DEFAULT 0,
  72. multicurrency_total_ttc double(24,8) DEFAULT 0
  73. )ENGINE=innodb;