Browse Source

TG-1 Change TVA from 19,6 to 20%

SiM 5 years ago
parent
commit
f220e0a5ba

+ 12 - 12
apps/admin/modules/kataoPeriod/actions/actions.class.php

@@ -234,13 +234,13 @@ class kataoPeriodActions extends wpActions {
 
             $discount = $katao_supplier_invoice->getTaux0DiscountHt() + $katao_supplier_invoice->getTaux1DiscountHt() + $katao_supplier_invoice->getTaux2DiscountHt();
 
-            $tva_rates = array('0.196' => 1, '0.055' => 2, '0' => 0);
+            $tva_rates = array('0.2' => 1, '0.055' => 2, '0' => 0);
             $tva_5_5 = $katao_supplier_invoice->getTaux2Amount();
-            $tva_19_6 = $katao_supplier_invoice->getTaux1Amount();
+            $tva_20 = $katao_supplier_invoice->getTaux1Amount();
             if ($katao_supplier_invoice->getFeesBillingTva() && !empty($tva_rates[(string)$katao_supplier_invoice->getFeesBillingRate()])) {
                 switch ($tva_rates[(string)$katao_supplier_invoice->getFeesBillingRate()]) {
                     case 1:
-                        $tva_19_6 += $katao_supplier_invoice->getFeesBillingTva();
+                        $tva_20 += $katao_supplier_invoice->getFeesBillingTva();
                         break;
                     case 2:
                         $tva_5_5 += $katao_supplier_invoice->getFeesBillingTva();
@@ -250,7 +250,7 @@ class kataoPeriodActions extends wpActions {
             if ($katao_supplier_invoice->getFeesShippingTva() && !empty($tva_rates[(string)$katao_supplier_invoice->getFeesShippingRate()])) {
                 switch ($tva_rates[(string)$katao_supplier_invoice->getFeesShippingRate()]) {
                     case 1:
-                        $tva_19_6 += $katao_supplier_invoice->getFeesShippingTva();
+                        $tva_20 += $katao_supplier_invoice->getFeesShippingTva();
                         break;
                     case 2:
                         $tva_5_5 += $katao_supplier_invoice->getFeesShippingTva();
@@ -258,9 +258,9 @@ class kataoPeriodActions extends wpActions {
                 }
             }
 
-            if ($tva_19_6) {
-                $total_debit += $tva_19_6;
-                $this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, '445664', $libelle_ecriture, $tva_19_6, 'D', $num_pointage, $code_analytique_budgetaire, 'TVA 19.6%');
+            if ($tva_20) {
+                $total_debit += $tva_20;
+                $this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, '445664', $libelle_ecriture, $tva_20, 'D', $num_pointage, $code_analytique_budgetaire, 'TVA 20%');
             }
             if ($tva_5_5) {
                 $total_debit += $tva_5_5;
@@ -342,7 +342,7 @@ class kataoPeriodActions extends wpActions {
             $code_analytique_budgetaire = '';
             $libelle_compte = '';
 
-            $total_by_tva_rate = array('0.196' => 0, '0.055' => 0, '0' => 0);
+            $total_by_tva_rate = array('0.2' => 0, '0.055' => 0, '0' => 0);
 
             $total_debit = $katao_invoice->sumProducts();
             $total_debit_sol = $katao_invoice->getSolAmount() / CONST_EURO_TO_SOL;
@@ -406,9 +406,9 @@ class kataoPeriodActions extends wpActions {
                 $this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, $accounting_code, $libelle_ecriture, $data['amount'], 'C', $num_pointage, $code_analytique_budgetaire, $data['category']);
             }
 
-            if (!empty($total_by_tva_rate['0.196'])) {
-                $this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, '445714', $libelle_ecriture, $total_by_tva_rate['0.196'], 'C', $num_pointage, $code_analytique_budgetaire, 'TVA 19.6%');
-                $total_credit += round($total_by_tva_rate['0.196'], 2);
+            if (!empty($total_by_tva_rate['0.2'])) {
+                $this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, '445714', $libelle_ecriture, $total_by_tva_rate['0.2'], 'C', $num_pointage, $code_analytique_budgetaire, 'TVA 20%');
+                $total_credit += round($total_by_tva_rate['0.2'], 2);
             }
             if (!empty($total_by_tva_rate['0.055'])) {
                 $this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, '445712', $libelle_ecriture, $total_by_tva_rate['0.055'], 'C', $num_pointage, $code_analytique_budgetaire, 'TVA 5.5%');
@@ -461,4 +461,4 @@ class kataoPeriodActions extends wpActions {
         wpFlashMessages::addError('Impossible de copier la période "' . $katao_period->getName() . '".');
         $this->redirect('kataoPeriod/index');
     }
-}
+}

+ 6 - 6
apps/admin/modules/kataoSupplierInvoice/actions/actions.class.php

@@ -117,7 +117,7 @@ class kataoSupplierInvoiceActions extends wpActions {
                 $this->katao_supplier_invoice->setKataoCapital(wpConfig::getCapital());
             }
 
-            $tva_rates = array('0.196' => 1, '0.055' => 2, '0' => 0);
+            $tva_rates = array('0.2' => 1, '0.055' => 2, '0' => 0);
             $without_taxes_by_tva_rate = $request->getParameter('without_taxes_by_tva_rate[]');
             $discount_by_tva_rate = $request->getParameter('discount_by_tva_rate[]');
             $total_by_tva_rate = $request->getParameter('total_by_tva_rate[]');
@@ -327,8 +327,8 @@ class kataoSupplierInvoiceActions extends wpActions {
     public function executeUpdateProductsList($request) {
         $return = '<br /><i>Merci de sélectionner des commandes</i>';
 
-        $tva_rates = array('0.196' => 1, '0.055' => 2, '0' => 0);
-        $total_by_tva_rate = array('0.196' => 0, '0.055' => 0, '0' => 0);
+        $tva_rates = array('0.2' => 1, '0.055' => 2, '0' => 0);
+        $total_by_tva_rate = array('0.2' => 0, '0.055' => 0, '0' => 0);
         $discount_by_tva_rate = $total_by_tva_rate;
 
         $products = array();
@@ -483,7 +483,7 @@ class kataoSupplierInvoiceActions extends wpActions {
 	<td>Port</td>
 	<td nowrap="nowrap" style="text-align:right!important"><input type="text" name="fees_shipping_ht" id="fees_shipping_ht" value="' . $fees_shipping_ht . '" onchange="updateFeesTVA();" style="width: 45px; text-align: right" />&nbsp;€</td>
 	<td nowrap="nowrap" style="text-align:right!important"><select name="fees_shipping_rate" id="fees_shipping_rate" onchange="updateFeesTVA();">';
-            foreach (array('0' => '0%', '0.055' => '5.5%', '0.196' => '19.6%') as $value => $label) {
+            foreach (array('0' => '0%', '0.055' => '5.5%', '0.2' => '20%') as $value => $label) {
                 $return .= '<option value="' . $value . '"' . sprintf('%s', ($value == $fees_shipping_rate)?' selected="selected"':'') . '>' . $label . '</option>';
             }
             $return .= '</select></td>
@@ -493,7 +493,7 @@ class kataoSupplierInvoiceActions extends wpActions {
 	<td>Facturation</td>
 	<td nowrap="nowrap" style="text-align:right!important"><input type="text" name="fees_billing_ht" id="fees_billing_ht" value="' . $fees_billing_ht . '" onchange="updateFeesTVA();" style="width: 45px; text-align: right" />&nbsp;€</td>
 	<td nowrap="nowrap" style="text-align:right!important"><select name="fees_billing_rate" id="fees_billing_rate" onchange="updateFeesTVA();">';
-            foreach (array('0' => '0%', '0.055' => '5.5%', '0.196' => '19.6%') as $value => $label) {
+            foreach (array('0' => '0%', '0.055' => '5.5%', '0.2' => '20%') as $value => $label) {
                 $return .= '<option value="' . $value . '"' . sprintf('%s', ($value == $fees_billing_rate)?' selected="selected"':'') . '>' . $label . '</option>';
             }
             $return .= '</select></td>
@@ -525,4 +525,4 @@ class kataoSupplierInvoiceActions extends wpActions {
 
         return $this->renderText($return);
     }
-}
+}

+ 9 - 9
apps/admin/modules/kataoSupplierInvoice/templates/editSuccess.php

@@ -92,8 +92,8 @@ function updateProductTotalPrice(id){
 }
 
 function updateTotalPricesHT(){
-<?php $tva_rates = array('0.196' => 1, '0.055' => 2, '0' => 0) ?>
-<?php $total_by_tva_rate = array('0.196' => 0, '0.055' => 0, '0' => 0) ?>
+<?php $tva_rates = array('0.2' => 1, '0.055' => 2, '0' => 0) ?>
+<?php $total_by_tva_rate = array('0.2' => 0, '0.055' => 0, '0' => 0) ?>
 <?php $discount_by_tva_rate = $total_by_tva_rate ?>
 <?php foreach ($total_by_tva_rate as $tva_rate => $tva_rate_total): ?>
 	<?php $tva_rate_discount = $discount_by_tva_rate[$tva_rate] ?>
@@ -108,8 +108,8 @@ function updateTotalPricesHT(){
 }
 
 function updateTotalPricesTTC(){
-<?php $tva_rates = array('0.196' => 1, '0.055' => 2, '0' => 0) ?>
-<?php $total_by_tva_rate = array('0.196' => 0, '0.055' => 0, '0' => 0) ?>
+<?php $tva_rates = array('0.2' => 1, '0.055' => 2, '0' => 0) ?>
+<?php $total_by_tva_rate = array('0.2' => 0, '0.055' => 0, '0' => 0) ?>
 <?php $discount_by_tva_rate = $total_by_tva_rate ?>
 	var without_taxes_total = 0;
 	var tva_total = 0;
@@ -137,8 +137,8 @@ function updateFeesTVA(){
 }
 
 function updateTotalHT(){
-<?php $tva_rates = array('0.196' => 1, '0.055' => 2, '0' => 0) ?>
-<?php $total_by_tva_rate = array('0.196' => 0, '0.055' => 0, '0' => 0) ?>
+<?php $tva_rates = array('0.2' => 1, '0.055' => 2, '0' => 0) ?>
+<?php $total_by_tva_rate = array('0.2' => 0, '0.055' => 0, '0' => 0) ?>
 <?php $discount_by_tva_rate = $total_by_tva_rate ?>
 	var without_taxes_total = 0;
 <?php foreach ($total_by_tva_rate as $tva_rate => $tva_rate_total): ?>
@@ -152,8 +152,8 @@ function updateTotalHT(){
 }
 
 function updateTotalTVA(){
-<?php $tva_rates = array('0.196' => 1, '0.055' => 2, '0' => 0) ?>
-<?php $total_by_tva_rate = array('0.196' => 0, '0.055' => 0, '0' => 0) ?>
+<?php $tva_rates = array('0.2' => 1, '0.055' => 2, '0' => 0) ?>
+<?php $total_by_tva_rate = array('0.2' => 0, '0.055' => 0, '0' => 0) ?>
 <?php $discount_by_tva_rate = $total_by_tva_rate ?>
 	var tva_total = 0;
 <?php foreach ($total_by_tva_rate as $tva_rate => $tva_rate_total): ?>
@@ -208,4 +208,4 @@ function submitForm(){
 updateOrdersList();
 
 /* ]]> */
-</script>
+</script>

+ 3 - 3
apps/admin/modules/kataoSupplierInvoice/templates/indexSuccess.php

@@ -78,8 +78,8 @@
 		<?php endforeach ?>
 		</table>
 
-		<?php $tva_rates = array('0.196' => 1, '0.055' => 2, '0' => 0) ?>
-		<?php $total_by_tva_rate = array('0.196' => 0, '0.055' => 0, '0' => 0) ?>
+		<?php $tva_rates = array('0.2' => 1, '0.055' => 2, '0' => 0) ?>
+		<?php $total_by_tva_rate = array('0.2' => 0, '0.055' => 0, '0' => 0) ?>
 
 		<table class="admin-sub-list">
 		<tr valign="top">
@@ -146,4 +146,4 @@ function toggleDetails( id ){
 }
 
 /* ]]> */
-</script>
+</script>

+ 1 - 1
config/schema.yml

@@ -347,7 +347,7 @@ propel:
     taux0_bases_ht:      { type: float, default: 0 } # Taux de TVA : 0
     taux0_discount_ht:   { type: float, default: 0 }
     taux0_amount:        { type: float, default: 0 }
-    taux1_bases_ht:      { type: float, default: 0 } # Taux de TVA : 19.6%
+    taux1_bases_ht:      { type: float, default: 0 } # Taux de TVA : 20%
     taux1_discount_ht:   { type: float, default: 0 }
     taux1_amount:        { type: float, default: 0 }
     taux2_bases_ht:      { type: float, default: 0 } # Taux de TVA : 5.5%

+ 2 - 2
lib/form/KataoProductForm.class.php

@@ -45,7 +45,7 @@ class KataoProductForm extends BaseKataoProductForm {
 		if ($this->getObject()->isNew()) {
 			$this->setDefault('margin', 0.15);
 		}
-		$this->widgetSchema['tva_rate'] = new sfWidgetFormSelect(array('choices' => array('0' => '0%', '0.055' => '5.5%', '0.196' => '19.6%')));
+		$this->widgetSchema['tva_rate'] = new sfWidgetFormSelect(array('choices' => array('0' => '0%', '0.055' => '5.5%', '0.2' => '20%')));
 
 		$this->widgetSchema['is_archived'] = new wpWidgetFormInputCheckbox();
 		$this->widgetSchema['is_archived']->setOption('value_attribute_value', 1);
@@ -122,4 +122,4 @@ class KataoProductForm extends BaseKataoProductForm {
 
 		return $object;
 	}
-}
+}

+ 5 - 5
lib/fpdf/invoice.php

@@ -537,14 +537,14 @@ function addCadreEurosFrancs()
 //                      "remise_percent" => percent,   // {pourcentage de remise sur ce montant de TVA}
 //                  "FraisPort"     => [0|1],
 //                      "portTTC"        => value,     // montant des frais de ports TTC
-//                                                     // par defaut la TVA = 19.6 %
+//                                                     // par defaut la TVA = 20 %
 //                      "portHT"         => value,     // montant des frais de ports HT
 //                      "portTVA"        => tva_value, // valeur de la TVA a appliquer sur le montant HT
 //                  "AccompteExige" => [0|1],
 //                      "accompte"         => value    // montant de l'acompte (TTC)
 //                      "accompte_percent" => percent  // pourcentage d'acompte (TTC)
 //                  "Remarque" => "texte"              // texte
-// tab_tva = array( "1"       => 19.6,
+// tab_tva = array( "1"       => 2020202020202020202020202020202020202020,
 //                  "2"       => 5.5, ... );
 // invoice = array( "px_unit" => value,
 //                  "qte"     => qte,
@@ -632,8 +632,8 @@ function addTVAs( $params, $tab_tva, $invoice, $katao_supplier_invoice = null )
 		if ( $params["portTTC"] > 0 )
 		{
 			$pTTC = sprintf("%0.2F", $params["portTTC"]);
-			$pHT  = sprintf("%0.2F", $pTTC / 1.196);
-			$pTVA = sprintf("%0.2F", $pHT * 0.196);
+			$pHT  = sprintf("%0.2F", $pTTC / 1.2);
+			$pTVA = sprintf("%0.2F", $pHT * 0.2);
 			$this->SetFont('Arial','',6);
 			$this->SetXY(85, 261 );
 			$this->Cell( 6 ,4, "HT : ", '', '', '');
@@ -944,4 +944,4 @@ function temporaire( $texte )
 	}
 
 }
-?>
+?>

+ 6 - 6
lib/model/KataoCart.php

@@ -154,8 +154,8 @@ class KataoCart extends BaseKataoCart {
             throw new Exception('Adhérent inconnu pour l\'utilisateur #' . $this->getId());
         }
 
-        $tva_rates = array('0.055' => '2', '0.196' => '1');
-        $tva_rates_map = array(2 => 0.055, 1 => 0.196);
+        $tva_rates = array('0.055' => '2', '0.2' => '1');
+        $tva_rates_map = array(2 => 0.055, 1 => 0.2);
 
         $pdf = new PDF_Invoice('P', 'mm', 'A4');
 
@@ -228,7 +228,7 @@ class KataoCart extends BaseKataoCart {
             $tot_prods[] = array ("px_unit" => round($amount / (1 + $tva_rates_map[$tva_rate]), 2), "qte" => 1, "tva" => $tva_rate);
         }
 
-        $tab_tva = array("1" => 19.6,
+        $tab_tva = array("1" => 20,
             "2" => 5.5);
         $params = array("RemiseGlobale" => 1,
             "remise_tva" => 0, // {la remise s'applique sur ce code TVA}
@@ -236,9 +236,9 @@ class KataoCart extends BaseKataoCart {
             "remise_percent" => 0, // {pourcentage de remise sur ce montant de TVA}
             "FraisPort" => 0,
             "portTTC" => 0, // montant des frais de ports TTC
-            // par defaut la TVA = 19.6 %
+            // par defaut la TVA = 20 %
             "portHT" => 0, // montant des frais de ports HT
-            "portTVA" => 19.6, // valeur de la TVA a appliquer sur le montant HT
+            "portTVA" => 20, // valeur de la TVA a appliquer sur le montant HT
             "AccompteExige" => 0,
             "accompte" => 0, // montant de l'acompte (TTC)
             "accompte_percent" => 0, // pourcentage d'acompte (TTC)
@@ -254,4 +254,4 @@ class KataoCart extends BaseKataoCart {
         $criteria->addAscendingOrderByColumn(KataoCartProductPeer::PRODUCT_NAME);
         return $this->getKataoCartProducts($criteria);
     }
-}
+}

+ 6 - 6
lib/model/KataoInvoice.php

@@ -89,8 +89,8 @@ class KataoInvoice extends BaseKataoInvoice {
     public function generatePDF() {
         $katao_member = $this->getKataoMember();
 
-        $tva_rates = array('0.055' => '2', '0.196' => '1');
-    	$tva_rates_map = array(2 => 0.055, 1 => 0.196);
+        $tva_rates = array('0.055' => '2', '0.2' => '1');
+    	$tva_rates_map = array(2 => 0.055, 1 => 0.2);
 
         $pdf = new PDF_Invoice('P', 'mm', 'A4');
 
@@ -133,7 +133,7 @@ class KataoInvoice extends BaseKataoInvoice {
         foreach ($total_by_tva_rate as $tva_rate => $amount) {
             $tot_prods[] = array ("px_unit" => round($amount / (1 + $tva_rates_map[$tva_rate]), 2), "qte" => 1, "tva" => $tva_rate);
         }
-        $tab_tva = array("1" => 19.6,
+        $tab_tva = array("1" => 20,
             "2" => 5.5);
         $params = array("RemiseGlobale" => 1,
             "remise_tva" => 0, // {la remise s'applique sur ce code TVA}
@@ -141,9 +141,9 @@ class KataoInvoice extends BaseKataoInvoice {
             "remise_percent" => 0, // {pourcentage de remise sur ce montant de TVA}
             "FraisPort" => 0,
             "portTTC" => 0, // montant des frais de ports TTC
-            // par defaut la TVA = 19.6 %
+            // par defaut la TVA = 20 %
             "portHT" => 0, // montant des frais de ports HT
-            "portTVA" => 19.6, // valeur de la TVA a appliquer sur le montant HT
+            "portTVA" => 20, // valeur de la TVA a appliquer sur le montant HT
             "AccompteExige" => 1,
             "accompte" => 0, // montant de l'acompte (TTC)
             "accompte_percent" => 100, // pourcentage d'acompte (TTC)
@@ -193,4 +193,4 @@ class KataoInvoice extends BaseKataoInvoice {
         $criteria->addAscendingOrderByColumn(KataoInvoiceProductPeer::PRODUCT_NAME);
         return $this->getKataoInvoiceProducts($criteria);
     }
-}
+}

+ 6 - 6
lib/model/KataoOrder.php

@@ -125,8 +125,8 @@ class KataoOrder extends BaseKataoOrder {
     public function generatePDF() {
         $katao_supplier = $this->getKataoSupplier();
 
-        $tva_rates = array('0.055' => '2', '0.196' => '1');
-    	$tva_rates_map = array(2 => 0.055, 1 => 0.196);
+        $tva_rates = array('0.055' => '2', '0.2' => '1');
+    	$tva_rates_map = array(2 => 0.055, 1 => 0.2);
 
         $pdf = new PDF_Invoice('P', 'mm', 'A4');
 
@@ -187,7 +187,7 @@ class KataoOrder extends BaseKataoOrder {
         foreach ($total_by_tva_rate as $tva_rate => $amount) {
             $tot_prods[] = array ("px_unit" => round($amount / (1 + $tva_rates_map[$tva_rate]), 2), "qte" => 1, "tva" => $tva_rate);
         }
-        $tab_tva = array("1" => 19.6,
+        $tab_tva = array("1" => 20,
             "2" => 5.5);
         $params = array("RemiseGlobale" => 1,
             "remise_tva" => 0, // {la remise s'applique sur ce code TVA}
@@ -195,9 +195,9 @@ class KataoOrder extends BaseKataoOrder {
             "remise_percent" => 0, // {pourcentage de remise sur ce montant de TVA}
             "FraisPort" => 0,
             "portTTC" => 0, // montant des frais de ports TTC
-            // par defaut la TVA = 19.6 %
+            // par defaut la TVA = 20 %
             "portHT" => 0, // montant des frais de ports HT
-            "portTVA" => 19.6, // valeur de la TVA a appliquer sur le montant HT
+            "portTVA" => 20, // valeur de la TVA a appliquer sur le montant HT
             "AccompteExige" => 0,
             "accompte" => 0, // montant de l'acompte (TTC)
             "accompte_percent" => 0, // pourcentage d'acompte (TTC)
@@ -433,4 +433,4 @@ Système katao.fr', $katao_member_seo->getFirstName(), CatalyzDate::formatShort(
 
         return $return;
     }
-}
+}

+ 5 - 5
lib/model/KataoSupplierInvoice.php

@@ -71,7 +71,7 @@ class KataoSupplierInvoice extends BaseKataoSupplierInvoice {
     public function generatePDF() {
         $katao_supplier = $this->getKataoSupplier();
 
-        $tva_rates = array('0.055' => '2', '0.196' => '1');
+        $tva_rates = array('0.055' => '2', '0.2' => '1');
 
         $pdf = new PDF_Invoice('P', 'mm', 'A4');
 
@@ -121,7 +121,7 @@ class KataoSupplierInvoice extends BaseKataoSupplierInvoice {
         foreach ($total_by_tva_rate as $tva_rate => $amount) {
             $tot_prods[] = array ("px_unit" => $amount, "qte" => 1, "tva" => $tva_rate);
         }
-        $tab_tva = array("1" => 19.6,
+        $tab_tva = array("1" => 20,
             "2" => 5.5);
         $params = array("RemiseGlobale" => 1,
             "remise_tva" => 0, // {la remise s'applique sur ce code TVA}
@@ -129,9 +129,9 @@ class KataoSupplierInvoice extends BaseKataoSupplierInvoice {
             "remise_percent" => 0, // {pourcentage de remise sur ce montant de TVA}
             "FraisPort" => 0,
             "portTTC" => 0, // montant des frais de ports TTC
-            // par defaut la TVA = 19.6 %
+            // par defaut la TVA = 20 %
             "portHT" => 0, // montant des frais de ports HT
-            "portTVA" => 19.6, // valeur de la TVA a appliquer sur le montant HT
+            "portTVA" => 20, // valeur de la TVA a appliquer sur le montant HT
             "AccompteExige" => 0,
             "accompte" => 0, // montant de l'acompte (TTC)
             "accompte_percent" => 0, // pourcentage d'acompte (TTC)
@@ -173,4 +173,4 @@ class KataoSupplierInvoice extends BaseKataoSupplierInvoice {
         $this->setPaymentAmountEuro($payment_amount_euro - $payment_amount_sol / CONST_EURO_TO_SOL);
         $this->setPaymentAmountSol($payment_amount_sol);
     }
-}
+}