From 6b7d3ad0c15202fa726ca7d1ac938d94546d5a27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2009 16:13:33 +0000 Subject: [PATCH] Qual: Code to calucalte VAT is now more clear. --- htdocs/admin/compta.php | 2 +- htdocs/admin/taxes.php | 85 +++++-- htdocs/compta/sociales/index.php | 16 +- htdocs/compta/tva/clients.php | 22 +- htdocs/compta/tva/index.php | 216 +++++------------- htdocs/compta/tva/quadri_detail.php | 22 +- htdocs/fourn/facture/fiche.php | 3 - .../modules/commande/pdf_einstein.modules.php | 7 +- .../modules/facture/pdf_crabe.modules.php | 3 +- .../modules/facture/pdf_oursin.modules.php | 3 +- .../livraison/pdf/pdf_typhon.modules.php | 4 +- .../includes/modules/modAccounting.class.php | 2 +- .../propale/pdf_propale_azur.modules.php | 3 +- .../pdf/pdf_muscadet.modules.php | 8 +- htdocs/langs/en_US/admin.lang | 17 +- htdocs/langs/fr_FR/admin.lang | 13 +- htdocs/lib/tax.lib.php | 76 +++--- htdocs/master.inc.php | 4 +- htdocs/theme/eldy/eldy.css.php | 1 + 19 files changed, 242 insertions(+), 265 deletions(-) diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 4a1f56cf298..49ed1a84a45 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -45,7 +45,7 @@ if ($_POST['action'] == 'setcomptamode') $compta_mode = $_POST['compta_mode']; if (! dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode,'chaine',0,'',$conf->entity)) { print $db->error(); } // Note: This setup differs from TAX_MODE. - // TAX_MODE is used with 0=normal, 1=option vat for services is on debit + // TAX_MODE is used for VAT exigibility only. } diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 14b4d799cc9..addb47e6b2c 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -45,6 +45,17 @@ llxHeader(); // 0=normal, 1=option vat for services is on debit $tax_mode = defined('TAX_MODE')?TAX_MODE:0; +// TAX_MODE=0 (most cases): +// Buy Sell +// Product On delivery On delivery +// Service On payment On payment + +// TAX_MODE=1 (option): +// Buy Sell +// Product On delivery On delivery +// Service On payment On invoice + + if ($_POST['action'] == 'settaxmode') { $tax_mode = $_POST['tax_mode']; @@ -79,25 +90,67 @@ print_fiche_titre($langs->trans('TaxSetup'),$linkback,'setup'); print '
'; +if (empty($mysoc->tva_assuj)) +{ + print $langs->trans("YourCompanyDoesNotUseVAT").'
'; +} +else +{ + print ''; -print '
'; + // Cas des parametres TAX_MODE_SELL/BUY_SERVICE/PRODUCT + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + print ''; + print '\n"; + print ''; + print '\n"; + print ''; -// Cas du parametre TAX_MODE -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; -print ''; -print '\n"; -print ''; -print '\n"; -print ''; + print "
'.$langs->trans('OptionVatMode').''.$langs->trans('Description').'
'.$langs->trans('OptionVATDefault').''.nl2br($langs->trans('OptionVatDefaultDesc')); + print "
'.$langs->trans('OptionVATDebitOption').''.nl2br($langs->trans('OptionVatDebitOptionDesc'))."
'.$langs->trans('OptionVatMode').''.$langs->trans('Description').'
'.$langs->trans('OptionVATDefault').''.nl2br($langs->trans('OptionVatDefaultDesc')); -print "
'.$langs->trans('OptionVATDebitOption').''.nl2br($langs->trans('OptionVatDebitOptionDesc'))."
\n"; -print "\n"; + print '

'; + print_fiche_titre($langs->trans("SummaryOfVatExigibilityUsedByDefault"),'',''); + //print ' ('.$langs->trans("CanBeChangedWhenMakingInvoice").')'; + + print ''; + print ''; + // Products + print ''; + print ''; + print ''; + // Services + print ''; + print ''; + print ''; + print '
 '.$langs->trans("Buy").''.$langs->trans("Sell").'
'.$langs->trans("Product").''; + print $langs->trans("OnDelivery"); + print ' ('.$langs->trans("SupposedToBePaymentDate").')'; + print ''; + print $langs->trans("OnDelivery"); + print ' ('.$langs->trans("SupposedToBePaymentDate").')'; + print '
'.$langs->trans("Services").''; + print $langs->trans("OnPayment"); + print ' ('.$langs->trans("SupposedToBePaymentDate").')'; + print ''; + if ($tax_mode == 0) + { + print $langs->trans("OnPayment"); + print ' ('.$langs->trans("SupposedToBePaymentDate").')'; + } + if ($tax_mode == 1) + { + print $langs->trans("OnInvoice"); + print ' ('.$langs->trans("InvoiceValidateDateUsed").')'; + } + print '
'; +} $db->close(); diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 01d61f6c426..451a0e57e8e 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -155,18 +155,18 @@ if ($resql) print_liste_field_titre($langs->trans("Status"),"index.php","s.paye","",$param,'align="right"',$sortfield,$sortorder); print "\n"; - print ""; - print ' '; - print ' '; + print ''; + print ' '; + print ' '; // Type - print ''; + print ''; $html->select_type_socialcontrib($typeid,'typeid',1,16,0); print ''; // Period end date - print ' '; - print ' '; - print ' '; - print ''; + print ' '; + print ' '; + print ' '; + print ''; print ''; print ''; print "\n"; diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 26cbd1ac31a..773b142975c 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Éric Seigne + * Copyright (C) 2004 �ric Seigne * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2006 Yannick Warnier * @@ -56,7 +56,7 @@ if($min == 0 or $min!=floatval(strval($min))){ // Define modetax (0 or 1) // 0=normal, 1=option vat for services is on debit $modetax = $conf->global->TAX_MODE; -if ($_GET["modetax"]) $modetax=$_GET["modetax"]; +if (isset($_GET["modetax"])) $modetax=$_GET["modetax"]; // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; @@ -82,7 +82,7 @@ $fsearch.=' '; $fsearch.=' '; $fsearch.=''; -// Affiche en-tête du rapport +// Affiche en-tete du rapport if ($modetax==1) // Calculate on invoice for goods and services { $nom=$langs->trans("VATReportByCustomersInDueDebtMode"); @@ -90,7 +90,7 @@ if ($modetax==1) // Calculate on invoice for goods and services $period=$year_start; $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesVATDue"); - if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); + //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); $description.=$fsearch; $builddate=time(); $exportlink=$langs->trans("NotYetAvailable"); @@ -99,12 +99,12 @@ if ($modetax==1) // Calculate on invoice for goods and services $productcust=$langs->trans("Description"); $amountcust=$langs->trans("AmountHT"); $vatcust=$langs->trans("VATReceived"); - if ($conf->global->FACTURE_TVAOPTION != 'franchise') $vatcust.=' ('.$langs->trans("ToPay").')'; + if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')'; $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("Description"); $amountsup=$langs->trans("AmountHT"); $vatsup=$langs->trans("VATPayed"); - if ($conf->global->FACTURE_TVAOPTION != 'franchise') $vatsup.=' ('.$langs->trans("ToGetBack").')'; + if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } if ($modetax==0) // Invoice for goods, payment for services { @@ -113,7 +113,7 @@ if ($modetax==0) // Invoice for goods, payment for services $period=$year_start; $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesVATIn"); - if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); + if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); $description.=$fsearch; $builddate=time(); $exportlink=$langs->trans("NotYetAvailable"); @@ -122,12 +122,12 @@ if ($modetax==0) // Invoice for goods, payment for services $productcust=$langs->trans("Description"); $amountcust=$langs->trans("AmountHT"); $vatcust=$langs->trans("VATReceived"); - if ($conf->global->FACTURE_TVAOPTION != 'franchise') $vatcust.=' ('.$langs->trans("ToPay").')'; + if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')'; $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("Description"); $amountsup=$langs->trans("AmountHT"); $vatsup=$langs->trans("VATPayed"); - if ($conf->global->FACTURE_TVAOPTION != 'franchise') $vatsup.=' ('.$langs->trans("ToGetBack").')'; + if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); @@ -185,7 +185,7 @@ if (is_array($coll_list)) } } - print ''.$langs->trans("TotalVATReceived").':'.price($total).''; + print ''.$langs->trans("Total").':'.price($total).''; print ''; } else @@ -257,7 +257,7 @@ if (is_array($coll_list)) } } - print ''.$langs->trans("TotalVATReceived").':'.price($total).''; + print ''.$langs->trans("Total").':'.price($total).''; print ''; } else diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 8bed2c28c00..5b31f85478a 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Éric Seigne + * Copyright (C) 2004 �ric Seigne * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * @@ -26,6 +26,7 @@ \version $Id$ */ require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/tax.lib.php"); require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); $langs->load("other"); @@ -45,128 +46,12 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +// Define modetax (0 or 1) +// 0=normal, 1=option vat for services is on debit +$modetax = $conf->global->TAX_MODE; +if (isset($_GET["modetax"])) $modetax=$_GET["modetax"]; -/** - * \brief On cherche la tva a collecter - * \param db Handle acces base - * \param y Year - * \param m Month - */ -function tva_coll($db,$y,$m) -{ - global $conf; - - if ($conf->compta->mode == "CREANCES-DETTES") - { - // Si on paye la tva sur les factures dues (non brouillon) - $sql = "SELECT sum(f.tva) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; - $sql.= " AND f.fk_statut IN (1,2)"; - $sql.= " AND date_format(f.datef,'%Y') = ".$y; - $sql.= " AND date_format(f.datef,'%m') = ".$m; - } - else - { - // Si on paye la tva sur les payments - - // \todo a ce jour on se sait pas la compter car le montant tva d'un payment - // n'est pas stocké dans la table des payments. - // Seul le module compta expert peut résoudre ce problème. - // (Il faut quand un payment a lieu, stocker en plus du montant du paiement le - // detail part tva et part ht). - -/* - // Tva sur factures payés - $sql = "SELECT sum(f.tva) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE "; - $sql.= " f.paye = 1"; - $sql.= " AND date_format(f.datef,'%Y') = ".$y; - $sql.= " AND date_format(f.datef,'%m') = ".$m; -*/ - } - - $resql = $db->query($sql); - - if ($resql) - { - $obj = $db->fetch_object($resql); - return $obj->amount; - } - else - { - dol_print_error($db); - } -} - - -/** - * \brief On recupere la tva à payer - * \param db Handle accès base - * \param y Année - * \param m Mois - */ -function tva_paye($db, $y,$m) -{ - global $conf; - - if ($conf->compta->mode == "CREANCES-DETTES") - { - // Si on paye la tva sur les factures dues (non brouillon) - $sql = "SELECT sum(f.total_tva) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND s.entity = ".$conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; - $sql.= " AND date_format(f.datef,'%Y') = $y"; - $sql.= " AND date_format(f.datef,'%m') = $m"; - } - else - { - // Si on paye la tva sur les payments - - // \todo a ce jour on se sait pas la compter car le montant tva d'un payment - // n'est pas stocke dans la table des payments. - // Seul le module compta expert peut resoudre ce probleme. - // (Il faut quand un payment a lieu, stocker en plus du montant du paiement le - // detail part tva et part ht). - -/* - - // \todo a ce jour on se sait pas la compter car le montant tva d'un payment - // n'est pas stocke dans la table des payments. - // Il faut quand un payment a lieu, stocker en plus du montant du paiement le - // detail part tva et part ht. - - // Tva sur factures payes - $sql = "SELECT sum(f.total_tva) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - // $sql.= " WHERE "; - $sql .= " WHERE f.fk_statut in (1,2)"; -// $sql.= " f.paye = 1"; - $sql.= " AND date_format(f.datef,'%Y') = $y"; - $sql.= " AND date_format(f.datef,'%m') = $m"; - //print "xx $sql"; -*/ - } - - $resql = $db->query($sql); - if ($resql) - { - $obj = $db->fetch_object($resql); - return $obj->amount; - } - else - { - dol_print_error($db); - } -} - function pt ($db, $sql, $date) { @@ -227,6 +112,9 @@ print_fiche_titre($langs->trans("VAT"),"$textprevyear ".$langs->trans("Year")." echo ''; echo ''; @@ -242,51 +130,67 @@ print ""; print "\n"; print "\n"; -if ($conf->compta->mode == "CREANCES-DETTES") + +$y = $year_current ; + + +$var=True; +$total = 0; $subtotal = 0; +$i=0; +for ($m = 1 ; $m < 13 ; $m++ ) { - $y = $year_current ; + $coll_listsell = vat_by_quarter($db, $y, 0, $modetax, 'sell', $m); + $coll_listbuy = vat_by_quarter($db, $y, 0, $modetax, 'buy', $m); - - $var=True; - $total = 0; $subtotal = 0; - $i=0; - for ($m = 1 ; $m < 13 ; $m++ ) + if ($coll_listbuy == -2) { - $var=!$var; - print ""; - print ''; - - $x_coll = tva_coll($db, $y, $m); - print ""; - - $x_paye = tva_paye($db, $y, $m); - print ""; - - $diff = $x_coll - $x_paye; - $total = $total + $diff; - $subtotal = $subtotal + $diff; - - print "\n"; - print "\n"; - print "\n"; - - $i++; - if ($i > 2) { - print ''; - $i = 0; - $subtotal = 0; - } + print ''; + break; } - print ''; - print "\n"; - print ''; + $var=!$var; + print ""; + print ''; + + $x_coll = 0; + foreach($coll_listsell as $vatrate=>$val) + { + $x_coll+=$val['vat']; + } + print ""; + + $x_paye = 0; + foreach($coll_listbuy as $vatrate=>$val) + { + $x_paye+=$val['vat']; + } + print ""; + + $diff = $x_coll - $x_paye; + $total = $total + $diff; + $subtotal = $subtotal + $diff; + + print "\n"; + print "\n"; + print "\n"; + + $i++; + if ($i > 2) { + print ''; + $i = 0; + $subtotal = 0; + } } +print ''; +print "\n"; +print ''; + +/*} else { print ''; print ''; -} +}*/ print '
'; print_titre($langs->trans("VATSummary")); +// The report mode is the one defined by defaut in tax module setup +//print $modetax; +//print '('.$langs->trans("SeeVATReportInInputOutputMode",'','').')'; echo ' '; print_titre($langs->trans("VATPayed")); echo '
".$langs->trans("TotalToPay")." 
'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'".price($x_coll)."".price($x_paye)."".price($diff)." 
'.$langs->trans("SubTotal").':'.price($subtotal).' 
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("TotalToPay").':'.price($total).' 
'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'".price($x_coll)."".price($x_paye)."".price($diff)." 
'.$langs->trans("SubTotal").':'.price($subtotal).' 
'.$langs->trans("TotalToPay").':'.price($total).' 
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("FeatureIsSupportedInInOutModeOnly").'
'; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 56d21decc73..8ca2dab1ce2 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Éric Seigne + * Copyright (C) 2004 �ric Seigne * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2006-2007 Yannick Warnier * @@ -56,7 +56,7 @@ $q=(! empty($_GET["q"]))?$_GET["q"]:1; // Define modetax (0 or 1) // 0=normal, 1=option vat for services is on debit $modetax = $conf->global->TAX_MODE; -if ($_GET["modetax"]) $modetax=$_GET["modetax"]; +if (isset($_GET["modetax"])) $modetax=$_GET["modetax"]; // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; @@ -80,8 +80,8 @@ $paymentfourn_static=new PaiementFourn($db); //print_fiche_titre($langs->trans("VAT"),""); -// Affiche en-tête du rapport -if ($modetax==1) // Caluclate on invoice for goods and services +// Affiche en-tete du rapport +if ($modetax==1) // Calculate on invoice for goods and services { $nom=$langs->trans("VATReportByQuartersInDueDebtMode"); $nom.='
('.$langs->trans("SeeVATReportInInputOutputMode",'','').')'; @@ -94,7 +94,7 @@ if ($modetax==1) // Caluclate on invoice for goods and services else { $nextquarter=1; $nextyear++; } $periodlink=($prevyear?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesVATDue"); - if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); + //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); $description.=$fsearch; $builddate=time(); $exportlink=$langs->trans("NotYetAvailable"); @@ -103,12 +103,12 @@ if ($modetax==1) // Caluclate on invoice for goods and services $productcust=$langs->trans("ProductOrService"); $amountcust=$langs->trans("AmountHT"); $vatcust=$langs->trans("VATReceived"); - if ($conf->global->FACTURE_TVAOPTION != 'franchise') $vatcust.=' ('.$langs->trans("ToPay").')'; + if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')'; $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("ProductOrService"); $amountsup=$langs->trans("AmountHT"); $vatsup=$langs->trans("VATPayed"); - if ($conf->global->FACTURE_TVAOPTION != 'franchise') $vatsup.=' ('.$langs->trans("ToGetBack").')'; + if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } if ($modetax==0) // Invoice for goods, payment for services { @@ -123,7 +123,7 @@ if ($modetax==0) // Invoice for goods, payment for services else { $nextquarter=1; $nextyear++; } $periodlink=($prevyear?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesVATIn"); - if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); + if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); $description.=$fsearch; $builddate=time(); $exportlink=$langs->trans("NotYetAvailable"); @@ -132,12 +132,12 @@ if ($modetax==0) // Invoice for goods, payment for services $productcust=$langs->trans("ProductOrService"); $amountcust=$langs->trans("AmountHT"); $vatcust=$langs->trans("VATReceived"); - if ($conf->global->FACTURE_TVAOPTION != 'franchise') $vatcust.=' ('.$langs->trans("ToPay").')'; + if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')'; $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("ProductOrService"); $amountsup=$langs->trans("AmountHT"); $vatsup=$langs->trans("VATPayed"); - if ($conf->global->FACTURE_TVAOPTION != 'franchise') $vatsup.=' ('.$langs->trans("ToGetBack").')'; + if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); @@ -386,7 +386,7 @@ else print ' '; //print table headers for this quadri - expenses now - //imprime les en-tete de tables pour ce quadri - maintenant les dépenses + //imprime les en-tete de tables pour ce quadri - maintenant les d�penses print ''; print ''.$elementsup.''; print ''.$productsup.''; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 88974a1d023..216f590c466 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1040,9 +1040,6 @@ else } print ''; print ''; - //if($mysoc->tva_assuj == "0") - //print '0'; - //else print $html->select_tva('tauxtva',$conf->defaulttx,$societe,$mysoc); print ''; print ''; diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index 96274622394..b57449d680a 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -69,8 +69,8 @@ class pdf_einstein extends ModelePDFCommandes $this->option_logo = 1; // Affiche logo $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode r�glement - $this->option_condreg = 1; // Affiche conditions r�glement + $this->option_modereg = 1; // Affiche mode reglement + $this->option_condreg = 1; // Affiche conditions reglement $this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 1; // Affiche si il y a eu escompte @@ -78,8 +78,7 @@ class pdf_einstein extends ModelePDFCommandes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; //Support add of a watermark on drafts - if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') - $this->franchise=1; + $this->franchise=!$mysoc->tva_assuj; // Recupere emmetteur $this->emetteur=$mysoc; diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index a0b9b10e607..55ba225f016 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -79,8 +79,7 @@ class pdf_crabe extends ModelePDFFactures $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts - if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') - $this->franchise=1; + $this->franchise=!$mysoc->tva_assuj; // Recupere emmetteur $this->emetteur=$mysoc; diff --git a/htdocs/includes/modules/facture/pdf_oursin.modules.php b/htdocs/includes/modules/facture/pdf_oursin.modules.php index 5bcfedbd224..622ee69b209 100644 --- a/htdocs/includes/modules/facture/pdf_oursin.modules.php +++ b/htdocs/includes/modules/facture/pdf_oursin.modules.php @@ -79,8 +79,7 @@ class pdf_oursin extends ModelePDFFactures $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts - if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') - $this->franchise=1; + $this->franchise=!$mysoc->tva_assuj; // Recupere emmetteur $this->emetteur=$mysoc; diff --git a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php index 30b02e738b1..d0ed09efba7 100644 --- a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php @@ -72,8 +72,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') - $this->franchise=1; + + $this->franchise=!$mysoc->tva_assuj; // Recupere emmetteur $this->emetteur=$mysoc; diff --git a/htdocs/includes/modules/modAccounting.class.php b/htdocs/includes/modules/modAccounting.class.php index e24107534e0..171b3457759 100644 --- a/htdocs/includes/modules/modAccounting.class.php +++ b/htdocs/includes/modules/modAccounting.class.php @@ -67,7 +67,7 @@ class modAccounting extends DolibarrModules $this->config_page_url = array("accounting.php"); // Dependancies - $this->depends = array("modFacture","modBanque"); + $this->depends = array("modFacture","modBanque","modTax"); $this->requiredby = array(); $this->conflictwith = array("modComptabilite"); $this->langfiles = array("compta"); diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 133d3797c3b..8e05c3cd909 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -79,8 +79,7 @@ class pdf_propale_azur extends ModelePDFPropales $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; //Support add of a watermark on drafts - if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') - $this->franchise=1; + $this->franchise=!$mysoc->tva_assuj; // Recupere emmetteur $this->emetteur=$mysoc; diff --git a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php index 4c87aa652bf..ff013c97814 100644 --- a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -71,8 +71,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_multilang = 1; // Dispo en plusieurs langues - if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') - $this->franchise=1; + $this->franchise=!$mysoc->tva_assuj; // Recupere emmetteur $this->emetteur=$mysoc; @@ -397,9 +396,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $tab2_height = $tab2_hl * 4; $pdf->SetFont('Arial','', 9); - // Affiche la mention TVA non applicable selon option $pdf->SetXY ($this->marge_gauche, $tab2_top + 0); - if ($this->franchise==1) + + // If France, show VAT mention if not applicable + if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1) { $pdf->MultiCell(100, $tab2_hl, "* TVA non applicable art-293B du CGI", 0, 'L', 0); } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index fb34e722be6..4373904e3aa 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1041,11 +1041,20 @@ DeleteLine=Delete line ConfirmDeleteLine=Are you sure you want to delete this line ? ##### Tax ##### TaxSetup=Taxes, social contributions and dividends module setup -OptionVatMode=Option d'exigibilité de TVA +OptionVatMode=VAT due OptionVATDefault=Standard -OptionVATDebitOption=Option services sur debit -OptionVatDefaultDesc=L'exigibilité de la TVA est:
- sur livraison pour les biens
- sur paiement pour les services -OptionVatDebitOptionDesc=L'exigibilité de la TVA est:
- sur livraison pour les biens
- sur facturation (d�bit) pour les services +OptionVATDebitOption=Option services on Debit +OptionVatDefaultDesc=VAT is due:
- on delivery/payments for goods
- on payments for services +OptionVatDebitOptionDesc=VAT is due:
- on delivery/payments for goods
- on invoice (debit) for services +SummaryOfVatExigibilityUsedByDefault=Time of VAT exigibility by default according to choosed option: +OnDelivery=On delivery +OnPayment=On payement +OnInvoice=On invoice +SupposedToBePaymentDate=Payment date used if delivery date not known +Buy=Buy +Sell=Sell +InvoiceValidateDateUsed=Invoice dtate used +YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Setup - Company/Foundation), so there is no VAT options to setup. ##### Agenda ##### AgendaSetup=Actions and agenda module setup PasswordTogetVCalExport=Key to authorize export link diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index c4a29c156d8..48bdb488546 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1041,11 +1041,20 @@ DeleteLine = Suppression de ligne ConfirmDeleteLine = Êtes-vous sûr de vouloir effacer cette ligne ? ##### Tax ##### = undefined TaxSetup = Configuration du module Taxes, charges sociales et dividendes -OptionVatMode = Option d'exigibilité de TVA +OptionVatMode = Option d'exigibilité de TVA par défaut OptionVATDefault = Standard -OptionVATDebitOption = Option services sur debit +OptionVATDebitOption = Option services sur Débit OptionVatDefaultDesc = L'exigibilité de la TVA est:
- sur livraison pour les biens
- sur paiement pour les services OptionVatDebitOptionDesc = L'exigibilité de la TVA est:
- sur livraison pour les biens
- sur facturation (débit) pour les services +SummaryOfVatExigibilityUsedByDefault=Moment d'exigibilité par défaut de la TVA pour l'option choisie: +OnDelivery=Sur livraison +OnPayment=Sur paiement +OnInvoice=Sur facture +SupposedToBePaymentDate=Date de paiement utilisé +Buy=Achat +Sell=Vente +InvoiceValidateDateUsed=Date de validation utilisée +YourCompanyDoesNotUseVAT=Votre institution est configurée comme non assujetie à la TVA (Accueil - Configuration - Société/Institution), aussi il n'y a aucun option sur la gestion TVA à paramétrer. ##### Agenda ##### = undefined AgendaSetup = Configuration du module actions et agenda PasswordTogetVCalExport = Clé pour autoriser lien export diff --git a/htdocs/lib/tax.lib.php b/htdocs/lib/tax.lib.php index 00e8ab9af11..d5307c044ec 100644 --- a/htdocs/lib/tax.lib.php +++ b/htdocs/lib/tax.lib.php @@ -64,7 +64,7 @@ function vat_by_thirdparty($db, $y, $modetax, $direction) if ($conf->global->MAIN_MODULE_ACCOUNTING) { // \todo a ce jour on se sait pas la compter car le montant tva d'un payment - // n'est pas stock� dans la table des payments. + // n'est pas stocke dans la table des payments. // Seul le module compta expert peut r�soudre ce probl�me. // (Il faut quand un payment a lieu, stocker en plus du montant du paiement le // detail part tva et part ht). @@ -116,7 +116,7 @@ function vat_by_thirdparty($db, $y, $modetax, $direction) if ($sql && $sql=='TODO') return -2; if ($sql && $sql!='TODO') { - dol_syslog("Client::vat_by_customer sql=".$sql); + dol_syslog("Tax.lib:thirdparty sql=".$sql); $resql = $db->query($sql); if ($resql) { @@ -137,7 +137,7 @@ function vat_by_thirdparty($db, $y, $modetax, $direction) /** - * \brief Gets VAT to collect for the given month of the given year + * \brief Gets VAT to collect for the given year (and given quarter or month) * The function gets the VAT in split results, as the VAT declaration asks * to report the amounts for different VAT rates as different lines. * This function also accounts recurrent invoices @@ -145,10 +145,11 @@ function vat_by_thirdparty($db, $y, $modetax, $direction) * \param y Year * \param q Period. If 1-4, it's year quarter. * \param modetax 0 or 1 (option vat on debit) - * \param direction 'sell' or 'buy' + * \param direction 'sell' (customer invoice) or 'buy' (supplier invoices) + * \param m Month * \return array List of quarters with vat */ -function vat_by_quarter($db, $y, $q, $modetax, $direction) +function vat_by_quarter($db, $y, $q=0, $modetax, $direction, $m=0) { global $conf; @@ -181,20 +182,20 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction) // Define sql request $sql=''; - if ($modetax == 1) // Option vat on debit + if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services { - // If vat payed on due invoices (non draft) if ($conf->global->MAIN_MODULE_ACCOUNTING) { // \todo a ce jour on se sait pas la compter car le montant tva d'un payment - // n'est pas stock� dans la table des payments. - // Seul le module compta expert peut r�soudre ce probl�me. + // n'est pas stocke dans la table des payments. + // Seul le module compta expert peut resoudre ce probleme. // (Il faut quand un payment a lieu, stocker en plus du montant du paiement le // detail part tva et part ht). $sql='TODO'; } if ($conf->global->MAIN_MODULE_COMPTABILITE) { + // Count on delivery date (use invoice date as delivery is unknown) $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,"; @@ -207,27 +208,27 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction) $sql.= " f.fk_statut in (1,2)"; // Validated or payed (partially or completely) $sql.= " AND f.rowid = d.".$fk_facture; $sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'"; - $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; + if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; + if ($m) $sql.= " AND (date_format(f.datef,'%m') > ".($m-1)." AND date_format(f.datef,'%m') <= ".($m).")"; $sql.= " AND (d.product_type = 0"; // Limit to products $sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of service $sql.= " ORDER BY d.rowid, d.".$fk_facture; } } - else // Option vat on payments + else // Option vat on delivery for goods (payments) and payments for services { - // If vat payed on payments if ($conf->global->MAIN_MODULE_ACCOUNTING) { // \todo a ce jour on se sait pas la compter car le montant tva d'un payment - // n'est pas stock� dans la table des payments. - // Seul le module compta expert peut r�soudre ce probl�me. + // n'est pas stocke dans la table des payments. + // Seul le module compta expert peut resoudre ce probleme. // (Il faut quand un payment a lieu, stocker en plus du montant du paiement le // detail part tva et part ht). $sql='TODO'; } if ($conf->global->MAIN_MODULE_COMPTABILITE) { - // Tva sur factures pay�s (should be on shipment, done on payment instead !) + // Count on delivery date (use invoice date as delivery is unknown) $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,"; @@ -247,13 +248,15 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction) // $sql.= " AND pa.datep >= '".$y."0101000000' AND pa.datep <= '".$y."1231235959'"; // $sql.= " AND (date_format(pa.datep,'%m') > ".(($q-1)*3)." AND date_format(pa.datep,'%m') <= ".($q*3).")"; $sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'"; - $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; + if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; + if ($m) $sql.= " AND (date_format(f.datef,'%m') > ".($m-1)." AND date_format(f.datef,'%m') <= ".($m).")"; $sql.= " AND (d.product_type = 0"; // Limit to products $sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of service $sql.= " ORDER BY d.rowid, d.".$fk_facture; } } + //print $sql.'
'; if (! $sql) return -1; if ($sql && $sql=='TODO') return -2; if ($sql && $sql!='TODO') @@ -267,8 +270,8 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction) $oldrowid=''; while($assoc = $db->fetch_array($resql)) { - if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['total_ht']=0; - if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['total_vat']=0; + if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['totalht']=0; + if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['vat']=0; if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid { @@ -312,21 +315,22 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction) // Define sql request $sql=''; - if ($modetax == 1) // Option vat on debit + if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services { - // If vat payed on due invoices (non draft) if ($conf->global->MAIN_MODULE_ACCOUNTING) { - // \todo a ce jour on se sait pas la compter car le montant tva d'un payment - // n'est pas stock� dans la table des payments. - // Seul le module compta expert peut r�soudre ce probl�me. + // Count on invoice date + // \todo a ce jour on se sait pas la compter car le montant tva d'un payment + // n'est pas stocke dans la table des payments. + // Seul le module compta expert peut resoudre ce probleme. // (Il faut quand un payment a lieu, stocker en plus du montant du paiement le // detail part tva et part ht). $sql='TODO'; } if ($conf->global->MAIN_MODULE_COMPTABILITE) { - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + // Count on invoice date + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,"; $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; @@ -338,28 +342,29 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction) $sql.= " f.fk_statut in (1,2)"; // Validated or payed (partially or completely) $sql.= " AND f.rowid = d.".$fk_facture; $sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'"; - $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; + if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; + if ($m) $sql.= " AND (date_format(f.datef,'%m') > ".($m-1)." AND date_format(f.datef,'%m') <= ".($m).")"; $sql.= " AND (d.product_type = 1"; // Limit to services $sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service $sql.= " ORDER BY d.rowid, d.".$fk_facture; } } - else // Option vat on payments + else // Option vat on delivery for goods (payments) and payments for services { - // If vat payed on payments if ($conf->global->MAIN_MODULE_ACCOUNTING) { - // \todo a ce jour on se sait pas la compter car le montant tva d'un payment - // n'est pas stock� dans la table des payments. - // Seul le module compta expert peut r�soudre ce probl�me. + // Count on payments date + // \todo a ce jour on se sait pas la compter car le montant tva d'un payment + // n'est pas stocke dans la table des payments. + // Seul le module compta expert peut resoudre ce probleme. // (Il faut quand un paiement a lieu, stocker en plus du montant du paiement le // detail part tva et part ht). $sql='TODO'; } if ($conf->global->MAIN_MODULE_COMPTABILITE) { - // Tva sur factures pay�s (should be on payment) - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + // Count on payments date + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,"; $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; @@ -375,7 +380,8 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction) $sql.= " AND pf.".$fk_facture2." = f.rowid"; $sql.= " AND pa.rowid = pf.".$fk_payment; $sql.= " AND pa.datep >= '".$y."0101000000' AND pa.datep <= '".$y."1231235959'"; - $sql.= " AND (date_format(pa.datep,'%m') > ".(($q-1)*3)." AND date_format(pa.datep,'%m') <= ".($q*3).")"; + if ($q) $sql.= " AND (date_format(pa.datep,'%m') > ".(($q-1)*3)." AND date_format(pa.datep,'%m') <= ".($q*3).")"; + if ($m) $sql.= " AND (date_format(pa.datep,'%m') > ".($m-1)." AND date_format(pa.datep,'%m') <= ".($m).")"; $sql.= " AND (d.product_type = 1"; // Limit to services $sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service $sql.= " ORDER BY d.rowid, d.".$fk_facture.", pf.rowid"; @@ -394,8 +400,8 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction) $oldrowid=''; while($assoc = $db->fetch_array($resql)) { - if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['total_ht']=0; - if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['total_vat']=0; + if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['totalht']=0; + if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['vat']=0; if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid { diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 47428203efd..01fc29c1b58 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -296,7 +296,6 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC')) $mysoc->profid2=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET; $mysoc->profid3=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE; $mysoc->profid4=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS; - $mysoc->tva_assuj=$conf->global->FACTURE_TVAOPTION; $mysoc->tva_intra=$conf->global->MAIN_INFO_TVAINTRA; $mysoc->capital=$conf->global->MAIN_INFO_CAPITAL; $mysoc->forme_juridique_code=$conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE; @@ -305,6 +304,9 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC')) $mysoc->logo=$conf->global->MAIN_INFO_SOCIETE_LOGO; $mysoc->logo_small=$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL; $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; + + // Define if company use vat or not (Do not use conf->global->FACTURE_TVAOPTION anymore) + $mysoc->tva_assuj=($conf->global->FACTURE_TVAOPTION=='franchise'?0:1); } diff --git a/htdocs/theme/eldy/eldy.css.php b/htdocs/theme/eldy/eldy.css.php index dc8edfc724b..8ed7dc56b65 100644 --- a/htdocs/theme/eldy/eldy.css.php +++ b/htdocs/theme/eldy/eldy.css.php @@ -498,6 +498,7 @@ div.tabBar { border-bottom: 1px solid #555555; border-left: 1px solid #D0D0D0; border-top: 1px solid #D8D8D8; +/* background: #F0F0F0 url() repeat-x; */ } div.tabsAction {