';
print '';
@@ -3070,7 +3075,7 @@ else
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print ' ';
- // éditeur wysiwyg
+ // Editor wysiwyg
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS)
{
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php
index 5f5e6c1afce..5b0e36accf8 100644
--- a/htdocs/facture.class.php
+++ b/htdocs/facture.class.php
@@ -127,7 +127,7 @@ class Facture extends CommonObject
/**
* \brief Create invoice in database
- * \param user Object uset that create
+ * \param user Object user that create
* \param notrigger 1 ne declenche pas les triggers, 0 sinon
* \return int <0 si ko, >0 si ok
*/
@@ -243,23 +243,17 @@ class Facture extends CommonObject
}
/*
- * Insertion du detail des produits dans la base,
- * si tableau products défini.
+ * Insert lines of invoices in database
*/
- for ($i = 0 ; $i < sizeof($this->products) ; $i++)
+ for ($i = 0 ; $i < sizeof($this->lignes) ; $i++)
{
- $result = $this->addline(
- $this->id,
- $this->products[$i]->desc,
- $this->products[$i]->subprice,
- $this->products[$i]->qty,
- $this->products[$i]->tva_tx,
- $this->products[$i]->fk_product,
- $this->products[$i]->remise_percent,
- $this->products[$i]->date_start,
- $this->products[$i]->date_end
- );
-
+ $newinvoiceline=new FactureLigne($this->db);
+ $newinvoiceline=$this->lignes[$i];
+ $newinvoiceline->fk_facture=$this->id;
+ if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
+ {
+ $result=$newinvoiceline->insert();
+ }
if ($result < 0)
{
$error++;
@@ -362,6 +356,7 @@ class Facture extends CommonObject
$facture->amount = $this->amount;
$facture->remise_absolue = $this->remise_absolue;
$facture->remise_percent = $this->remise_percent;
+
$facture->lignes = $this->lignes; // Tableau des lignes de factures
$facture->products = $this->lignes; // Tant que products encore utilisé
@@ -608,12 +603,12 @@ class Facture extends CommonObject
/**
- \brief Recupére les lignes de factures dans this->lignes
- \return int 1 si ok, < 0 si erreur
- */
+ * \brief Recupére les lignes de factures dans this->lignes
+ * \return int 1 si ok, < 0 si erreur
+ */
function fetch_lines()
{
- $sql = 'SELECT l.rowid, l.fk_product, l.description, l.price, l.qty, l.tva_taux, ';
+ $sql = 'SELECT l.rowid, l.fk_product, l.description, l.product_type, l.price, l.qty, l.tva_taux, ';
$sql.= ' l.remise, l.remise_percent, l.fk_remise_except, l.subprice,';
$sql.= ' '.$this->db->pdate('l.date_start').' as date_start,'.$this->db->pdate('l.date_end').' as date_end,';
$sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_ttc, l.fk_code_ventilation, l.fk_export_compta,';
@@ -638,7 +633,7 @@ class Facture extends CommonObject
$faclig->desc = $objp->description; // Description ligne
$faclig->libelle = $objp->label; // Label produit
$faclig->product_desc = $objp->product_desc; // Description produit
- $faclig->product_type = $objp->fk_product_type;
+ $faclig->product_type = $objp->product_type; // Type of line
$faclig->qty = $objp->qty;
$faclig->subprice = $objp->subprice;
$faclig->tva_tx = $objp->tva_taux;
@@ -646,6 +641,7 @@ class Facture extends CommonObject
$faclig->fk_remise_except = $objp->fk_remise_except;
$faclig->produit_id = $objp->fk_product;
$faclig->fk_product = $objp->fk_product;
+ $faclig->fk_product_type = $objp->fk_product_type;
$faclig->date_start = $objp->date_start;
$faclig->date_end = $objp->date_end;
$faclig->date_start = $objp->date_start;
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 04894411086..2e3cf4f3e2a 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -501,6 +501,7 @@ Informations=Informations
Page=Page
Notes=Notes
AddNewLine=Add new line
+FreeZone=Free text
# Week day
Day1=Monday
Day2=Tuesday
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index c52226ad862..9441602572a 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -500,6 +500,7 @@ Informations=Informations
Page=Page
Notes=Notes
AddNewLine=Ajout nouvelle ligne
+FreeZone=Zone libre
# Week day
Day1=Lundi
Day2=Mardi
diff --git a/mysql/migration/2.5.0-2.6.0.sql b/mysql/migration/2.5.0-2.6.0.sql
index 17d83ed5347..709175e1c90 100644
--- a/mysql/migration/2.5.0-2.6.0.sql
+++ b/mysql/migration/2.5.0-2.6.0.sql
@@ -86,6 +86,15 @@ drop table llx_don_projet;
alter table llx_facture_fourn_det add column date_start datetime DEFAULT NULL;
alter table llx_facture_fourn_det add column date_end datetime DEFAULT NULL;
+alter table llx_commandedet add column product_type integer DEFAULT 0 after total_ttc;
+
+alter table llx_propaldet add column product_type integer DEFAULT 0 after total_ttc;
+alter table llx_propaldet add column date_start datetime DEFAULT NULL after product_type;
+alter table llx_propaldet add column date_end datetime DEFAULT NULL after date_start;
+
+alter table llx_commande_fournisseur add column product_type integer DEFAULT 0 after total_ttc;
+alter table llx_commande_fournisseur add column date_start datetime DEFAULT NULL after product_type;
+alter table llx_commande_fournisseur add column date_end datetime DEFAULT NULL after date_start;
-- V4.1 delete from llx_projet_task where fk_projet not in (select rowid from llx_projet);
-- V4.1 ALTER TABLE llx_projet_task ADD CONSTRAINT fk_projet_task_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
diff --git a/mysql/tables/llx_commande_fournisseurdet.sql b/mysql/tables/llx_commande_fournisseurdet.sql
index 40e7a27f9b9..ab12d187ff1 100644
--- a/mysql/tables/llx_commande_fournisseurdet.sql
+++ b/mysql/tables/llx_commande_fournisseurdet.sql
@@ -1,6 +1,6 @@
-- ===================================================================
--- Copyright (C) 2007 Rodolphe Quiedeville
--- Copyright (C) 2007 Laurent Destailleur
+-- Copyright (C) 2007 Rodolphe Quiedeville
+-- Copyright (C) 2007-2009 Laurent Destailleur
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -35,5 +35,8 @@ create table llx_commande_fournisseurdet
total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantité et incluant remise ligne et globale
total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale
total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale
+ product_type integer DEFAULT 0,
+ date_start datetime DEFAULT NULL, -- date debut si service
+ date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0 -- TVA NPR ou non
)type=innodb;
diff --git a/mysql/tables/llx_commandedet.sql b/mysql/tables/llx_commandedet.sql
index bcc575f7b65..27e4a0a1f26 100644
--- a/mysql/tables/llx_commandedet.sql
+++ b/mysql/tables/llx_commandedet.sql
@@ -35,6 +35,7 @@ create table llx_commandedet
total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantité et incluant remise ligne et globale
total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale
total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale
+ product_type integer DEFAULT 0,
date_start datetime DEFAULT NULL, -- date debut si service
date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non
diff --git a/mysql/tables/llx_facture_fourn_det.sql b/mysql/tables/llx_facture_fourn_det.sql
index b68ea821f85..6dc58145384 100644
--- a/mysql/tables/llx_facture_fourn_det.sql
+++ b/mysql/tables/llx_facture_fourn_det.sql
@@ -1,5 +1,6 @@
-- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville
+-- Copyright (C) 2009 Laurent Destailleur
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/mysql/tables/llx_propaldet.sql b/mysql/tables/llx_propaldet.sql
index 3870390546b..05d90bddded 100644
--- a/mysql/tables/llx_propaldet.sql
+++ b/mysql/tables/llx_propaldet.sql
@@ -26,7 +26,7 @@ create table llx_propaldet
description text,
fk_remise_except integer NULL, -- Lien vers table des remises fixes
tva_tx double(6,3) DEFAULT 0, -- taux tva
- qty real, -- quantité
+ qty real, -- quantity
remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise (obsolete)
price real, -- prix final (obsolete)
@@ -34,10 +34,15 @@ create table llx_propaldet
total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantité et incluant remise ligne et globale
total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale
total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale
+ product_type integer DEFAULT 0,
+ date_start datetime DEFAULT NULL, -- date debut si service
+ date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non
+
pa_ht double(24,8) DEFAULT 0, -- prix d'achat HT
marge_tx double(6,3) DEFAULT 0, -- taux de marge (marge sur prix d'achat)
marque_tx double(6,3) DEFAULT 0, -- taux de marque (marge sur prix de vente)
+
special_code tinyint(4) UNSIGNED DEFAULT 0, -- code pour les lignes speciales
rang integer DEFAULT 0 -- ordre affichage sur la propal
)type=innodb;
|