Fight against key tva_taux. Removed completely.

This commit is contained in:
Laurent Destailleur 2015-05-14 15:59:09 +02:00
parent 33b9d492e2
commit 74607218ea
6 changed files with 18 additions and 30 deletions

View File

@ -56,9 +56,6 @@ class Form
var $cache_types_fees=array(); var $cache_types_fees=array();
var $cache_vatrates=array(); var $cache_vatrates=array();
var $tva_taux_value;
var $tva_taux_libelle;
/** /**
* Constructor * Constructor
@ -3969,10 +3966,6 @@ class Form
$return.= '>'.vatrate($rate['libtva']); $return.= '>'.vatrate($rate['libtva']);
$return.= $rate['nprtva'] ? ' *': ''; $return.= $rate['nprtva'] ? ' *': '';
$return.= '</option>'; $return.= '</option>';
$this->tva_taux_value[] = $rate['txtva'];
$this->tva_taux_libelle[] = $rate['libtva'];
$this->tva_taux_npr[] = $rate['nprtva'];
} }
if (! $options_only) $return.= '</select>'; if (! $options_only) $return.= '</select>';

View File

@ -342,7 +342,7 @@ class pdf_standard extends ModeleExpenseReport
// VAT Rate // VAT Rate
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY($this->posxtva, $curY); $pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-1, 3,vatrate($object->lines[$i]->tva_taux,true), 0, 'R'); $pdf->MultiCell($this->posxup-$this->posxtva-1, 3,vatrate($object->lines[$i]->vatrate,true), 0, 'R');
// UP // UP
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);

View File

@ -879,7 +879,7 @@ if ($action == "addline")
$tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type); $tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type);
$object_ligne->total_ttc = $tmp[2]; $object_ligne->total_ttc = $tmp[2];
$object_ligne->tva_taux = GETPOST('vatrate'); $object_ligne->vatrate = GETPOST('vatrate');
$object_ligne->total_ht = $tmp[0]; $object_ligne->total_ht = $tmp[0];
$object_ligne->total_tva = $tmp[1]; $object_ligne->total_tva = $tmp[1];
@ -1649,17 +1649,17 @@ else
print '<textarea class="flat_ndf" name="comments" class="centpercent">'.$objp->comments.'</textarea>'; print '<textarea class="flat_ndf" name="comments" class="centpercent">'.$objp->comments.'</textarea>';
print '</td>'; print '</td>';
// Sélection TVA // VAT
print '<td style="text-align:right;">'; print '<td style="text-align:right;">';
print $form->load_tva('fk_c_tva', (isset($_POST["fk_c_tva"])?$_POST["fk_c_tva"]:$objp->tva_taux), $mysoc, ''); print $form->load_tva('fk_c_tva', (isset($_POST["fk_c_tva"])?$_POST["fk_c_tva"]:$objp->vatrate), $mysoc, '');
print '</td>'; print '</td>';
// Prix unitaire // Unit price
print '<td style="text-align:right;">'; print '<td style="text-align:right;">';
print '<input type="text" size="6" name="value_unit" value="'.$objp->value_unit.'" />'; print '<input type="text" size="6" name="value_unit" value="'.$objp->value_unit.'" />';
print '</td>'; print '</td>';
// Quantité // Qty
print '<td style="text-align:right;">'; print '<td style="text-align:right;">';
print '<input type="text" size="4" name="qty" value="'.$objp->qty.'" />'; print '<input type="text" size="4" name="qty" value="'.$objp->qty.'" />';
print '</td>'; print '</td>';

View File

@ -540,7 +540,7 @@ class ExpenseReport extends CommonObject
$line->total_ttc=120; $line->total_ttc=120;
$line->qty=1; $line->qty=1;
$line->fk_c_tva=20; $line->fk_c_tva=20;
$line->tva_taux=20; $line->vatrate=20;
$line->value_unit=120; $line->value_unit=120;
$line->fk_expensereport=0; $line->fk_expensereport=0;
$line->type_fees_code='TRA'; $line->type_fees_code='TRA';
@ -724,7 +724,7 @@ class ExpenseReport extends CommonObject
$this->lines=array(); $this->lines=array();
$sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date,'; $sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date,';
$sql.= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_projet, de.fk_c_tva,'; $sql.= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_projet, de.fk_c_tva, de.tva_tx as vatrate,';
$sql.= ' de.total_ht, de.total_tva, de.total_ttc,'; $sql.= ' de.total_ht, de.total_tva, de.total_ttc,';
$sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,'; $sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,';
$sql.= ' p.ref as ref_projet, p.title as title_projet'; $sql.= ' p.ref as ref_projet, p.title as title_projet';
@ -761,7 +761,7 @@ class ExpenseReport extends CommonObject
$deplig->type_fees_code = $objp->code_type_fees; $deplig->type_fees_code = $objp->code_type_fees;
$deplig->type_fees_libelle = $objp->libelle_type_fees; $deplig->type_fees_libelle = $objp->libelle_type_fees;
$deplig->tva_taux = $objp->taux_tva; $deplig->vatrate = $objp->vatrate;
$deplig->projet_ref = $objp->ref_projet; $deplig->projet_ref = $objp->ref_projet;
$deplig->projet_title = $objp->title_projet; $deplig->projet_title = $objp->title_projet;
@ -1239,7 +1239,7 @@ class ExpenseReport extends CommonObject
$ligne->total_ht = $total_ht; $ligne->total_ht = $total_ht;
$ligne->total_tva = $total_tva; $ligne->total_tva = $total_tva;
$ligne->total_ttc = $total_ttc; $ligne->total_ttc = $total_ttc;
$ligne->tva_taux = $objp_tva->taux_tva; $ligne->vatrate = $objp_tva->vatrate;
$ligne->rowid = $rowid; $ligne->rowid = $rowid;
// Select des infos sur le type fees // Select des infos sur le type fees
@ -1487,8 +1487,7 @@ class ExpenseReportLine
var $projet_ref; var $projet_ref;
var $projet_title; var $projet_title;
var $tva_taux; var $vatrate;
var $total_ht; var $total_ht;
var $total_tva; var $total_tva;
var $total_ttc; var $total_ttc;
@ -1512,7 +1511,7 @@ class ExpenseReportLine
function fetch($rowid) function fetch($rowid)
{ {
$sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_projet, fde.date,'; $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_projet, fde.date,';
$sql.= ' fde.fk_c_tva as tva_taux, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; $sql.= ' fde.fk_c_tva as fk_c_tva, fde.tva_tx as vatrate, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,';
$sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,';
$sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref';
$sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde';
@ -1539,7 +1538,7 @@ class ExpenseReportLine
$this->type_fees_libelle = $objp->type_fees_libelle; $this->type_fees_libelle = $objp->type_fees_libelle;
$this->projet_ref = $objp->projet_ref; $this->projet_ref = $objp->projet_ref;
$this->projet_title = $objp->projet_title; $this->projet_title = $objp->projet_title;
$this->tva_taux = $objp->tva_taux; $this->vatrate = $objp->vatrate;
$this->total_ht = $objp->total_ht; $this->total_ht = $objp->total_ht;
$this->total_tva = $objp->total_tva; $this->total_tva = $objp->total_tva;
$this->total_ttc = $objp->total_ttc; $this->total_ttc = $objp->total_ttc;

View File

@ -28,7 +28,7 @@ CREATE TABLE llx_expensereport_det
qty real NOT NULL, qty real NOT NULL,
value_unit real NOT NULL, value_unit real NOT NULL,
remise_percent real, remise_percent real,
tva_tx double(6,3), -- Vat rat tva_tx double(6,3), -- Vat rate
localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate
localtax1_type varchar(10) NULL, -- localtax1 type localtax1_type varchar(10) NULL, -- localtax1 type
localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate

View File

@ -22,9 +22,8 @@
/** /**
* \class FormProduct * Class with static methods for building HTML components related to products
* \brief Class with static methods for building HTML components related to products * Only components common to products and services must be here.
* \remarks Only common components must be here.
*/ */
class FormProduct class FormProduct
{ {
@ -34,9 +33,6 @@ class FormProduct
// Cache arrays // Cache arrays
var $cache_warehouses=array(); var $cache_warehouses=array();
var $tva_taux_value;
var $tva_taux_libelle;
/** /**
* Constructor * Constructor