diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 61d177086e3..900832600bf 100755 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -1,5 +1,6 @@ + * Copyright (C) 2015 Alexandre Spangaro * * 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 @@ -23,9 +24,9 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/modules/expensereport/modules_expensereport.php'; -require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); -require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -252,7 +253,7 @@ class pdf_standard extends ModeleExpenseReport $tab_height = 110; $tab_height_newpage = 110; - // Affiche notes + // Show notes $notetoshow=empty($object->note_public)?'':$object->note_public; if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) { @@ -340,9 +341,10 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell($this->posxtva-$this->posxprojet-1, 3,$object->lines[$i]->projet_ref, 0, 'C'); // VAT Rate + $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $pdf->SetFont('','', $default_font_size - 1); $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,$vat_rate, 0, 'R'); // Unit price $pdf->SetFont('','', $default_font_size - 1); @@ -438,6 +440,13 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetXY(160, $posy); $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_ht), 1, 'R'); $pdf->SetFillColor(248,248,248); + + $posy+=5; + $pdf->SetXY(100, $posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(60, 5, $outputlangs->transnoentities("TotalVAT"), 1,'L'); + $pdf->SetXY(160, $posy); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_tva),1, 'R'); $posy+=5; $pdf->SetXY(100, $posy); @@ -766,7 +775,7 @@ class pdf_standard extends ModeleExpenseReport // Unit price $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); $pdf->SetXY($this->posxup-1, $tab_top+1); - $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("UP"),'','C'); + $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceU"),'','C'); // Quantity $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 476a8862041..98099d305a7 100755 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -879,7 +879,7 @@ if ($action == "addline") $tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type); $object_ligne->total_ttc = $tmp[2]; - $object_ligne->tva_taux = GETPOST('vatrate'); + $object_ligne->tva_tx = GETPOST('vatrate'); $object_ligne->total_ht = $tmp[0]; $object_ligne->total_tva = $tmp[1]; @@ -1008,9 +1008,9 @@ if ($action == "updateligne" ) /* - * Generer ou regenerer le document PDF + * Generate or regenerate the PDF document */ -if ($action == 'builddoc') // En get ou en post +if ($action == 'builddoc') // GET or POST { $depl = new ExpenseReport($db, 0, $_GET['id']); $depl->fetch($id); @@ -1639,7 +1639,7 @@ else $formproject->select_projects(-1, $objp->fk_projet,'fk_projet', 0, 0, 0, 1); print ''; - // Sélect type + // Select type print ''; select_type_fees_id($objp->type_fees_code,'fk_c_type_fees'); print ''; @@ -1649,17 +1649,17 @@ else print ''; print ''; - // Sélection TVA + // Select VAT print ''; - 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->tva_tx), $mysoc, ''); print ''; - // Prix unitaire + // Unit price print ''; print ''; print ''; - // Quantité + // Quantity print ''; print ''; print ''; @@ -1744,7 +1744,7 @@ else print ''; print ''; - // Prix unitaire + // Unit price print ''; print ''; print ''; @@ -1805,7 +1805,7 @@ if ($action != 'create' && $action != 'edit') { if ($object->fk_user_author == $user->id) { - // Modifier + // Modify print ''.$langs->trans('Modify').''; // Validate @@ -1816,7 +1816,7 @@ if ($action != 'create' && $action != 'edit') if ($user->rights->expensereport->supprimer) { - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } } @@ -1831,7 +1831,7 @@ if ($action != 'create' && $action != 'edit') { if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) { - // Modifier + // Modify print ''.$langs->trans('Modify').''; // Brouillonner (le statut refusée est identique à brouillon) @@ -1841,7 +1841,7 @@ if ($action != 'create' && $action != 'edit') if ($user->rights->expensereport->supprimer) { - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } } @@ -1874,9 +1874,9 @@ if ($action != 'create' && $action != 'edit') { //if($object->fk_user_validator==$user->id) //{ - // Valider + // Validate print ''.$langs->trans('Approve').''; - // Refuser + // Deny print ''.$langs->trans('Deny').''; //} @@ -1888,7 +1888,7 @@ if ($action != 'create' && $action != 'edit') if($user->rights->expensereport->supprimer) { - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } } @@ -1899,7 +1899,7 @@ if ($action != 'create' && $action != 'edit') */ if ($user->rights->expensereport->to_paid && $object->fk_statut == 5) { - // Payer + // Pay print ''.$langs->trans('TO_PAID').''; // Cancel @@ -1910,7 +1910,7 @@ if ($action != 'create' && $action != 'edit') if($user->rights->expensereport->supprimer) { - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } } @@ -1922,11 +1922,11 @@ if ($action != 'create' && $action != 'edit') */ if ($user->rights->expensereport->approve && $user->rights->expensereport->to_paid && $object->fk_statut==6) { - // Annuler + // Cancel print ''.$langs->trans('Cancel').''; if($user->rights->expensereport->supprimer) { - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } } @@ -1944,7 +1944,7 @@ if ($action != 'create' && $action != 'edit') print ''.$langs->trans('ReOpen').''; } - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } @@ -1959,7 +1959,7 @@ print ''; print '
'; /* - * Documents generes + * Generate documents */ if($user->rights->expensereport->export && $object->fk_statut>0 && $action != 'edit') { diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 63924d9c952..f65f0c814d5 100755 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -540,7 +540,7 @@ class ExpenseReport extends CommonObject $line->total_ttc=120; $line->qty=1; $line->fk_c_tva=20; - $line->tva_taux=20; + $line->tva_tx=20; $line->value_unit=120; $line->fk_expensereport=0; $line->type_fees_code='TRA'; @@ -761,7 +761,7 @@ class ExpenseReport extends CommonObject $deplig->type_fees_code = $objp->code_type_fees; $deplig->type_fees_libelle = $objp->libelle_type_fees; - $deplig->tva_taux = $objp->taux_tva; + $deplig->tva_tx = $objp->vatrate; $deplig->projet_ref = $objp->ref_projet; $deplig->projet_title = $objp->title_projet; @@ -1207,7 +1207,7 @@ class ExpenseReport extends CommonObject $this->db->begin(); // Select du taux de tva par rapport au code - $sql = "SELECT t.taux as taux_tva"; + $sql = "SELECT t.taux as vatrate"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t"; $sql.= " WHERE t.rowid = ".$c_tva; $result = $this->db->query($sql); @@ -1217,7 +1217,7 @@ class ExpenseReport extends CommonObject $total_ttc = $qty*$value_unit; $total_ttc = number_format($total_ttc,2,'.',''); - $tx_tva = $objp_tva->taux_tva/100; + $tx_tva = $objp_tva->vatrate/100; $tx_tva = $tx_tva + 1; $total_ht = $total_ttc/$tx_tva; $total_ht = number_format($total_ht,2,'.',''); @@ -1239,7 +1239,7 @@ class ExpenseReport extends CommonObject $ligne->total_ht = $total_ht; $ligne->total_tva = $total_tva; $ligne->total_ttc = $total_ttc; - $ligne->tva_taux = $objp_tva->taux_tva; + $ligne->tva_tx = $objp_tva->vatrate; $ligne->rowid = $rowid; // Select des infos sur le type fees @@ -1487,7 +1487,7 @@ class ExpenseReportLine var $projet_ref; var $projet_title; - var $tva_taux; + var $tva_tx; var $total_ht; var $total_tva; @@ -1512,7 +1512,7 @@ class ExpenseReportLine function fetch($rowid) { $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 tva_tx, 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.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; @@ -1539,7 +1539,7 @@ class ExpenseReportLine $this->type_fees_libelle = $objp->type_fees_libelle; $this->projet_ref = $objp->projet_ref; $this->projet_title = $objp->projet_title; - $this->tva_taux = $objp->tva_taux; + $this->tva_tx = $objp->tva_tx; $this->total_ht = $objp->total_ht; $this->total_tva = $objp->total_tva; $this->total_ttc = $objp->total_ttc;