From c94689e9a972e431de79965d223af5c0c416f5f2 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 12 Sep 2018 09:21:23 +0200 Subject: [PATCH 1/6] FIX remain to pay for credit note was wrong on invoice list --- htdocs/compta/facture/list.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 859889966eb..1fbdfcf380a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1014,6 +1014,9 @@ if ($resql) $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; $facturestatic->statut=$obj->fk_statut; + $facturestatic->total_ttc=$obj->total_ttc; + $facturestatic->paye=$obj->paye; + $facturestatic->fk_soc=$obj->fk_soc; $facturestatic->date_lim_reglement=$db->jdate($obj->datelimite); $facturestatic->note_public=$obj->note_public; $facturestatic->note_private=$obj->note_private; @@ -1022,7 +1025,13 @@ if ($resql) $totalcreditnotes = $facturestatic->getSumCreditNotesUsed(); $totaldeposits = $facturestatic->getSumDepositsUsed(); $totalpay = $paiement + $totalcreditnotes + $totaldeposits; - $remaintopay = $obj->total_ttc - $totalpay; + $remaintopay = $facturestatic->total_ttc - $totalpay; + if($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { + $discount = new DiscountAbsolute($db); + $remaincreditnote = $discount->getAvailableDiscounts($obj->fk_soc, '', 'rc.fk_facture_source='.$facturestatic->id); + $remaintopay = -$remaincreditnote; + $totalpay = $facturestatic->total_ttc - $remaintopay; + } print ''; if (! empty($arrayfields['f.facnumber']['checked'])) From b68523b9c1333504fbc851c22accb167efca2451 Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 13 Sep 2018 14:12:31 +0200 Subject: [PATCH 2/6] FIX : According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product --- htdocs/core/lib/functions.lib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f27c1fbf0a0..26a34af374b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4744,6 +4744,11 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, } } + // Si (vendeur en France et acheteur hors Communaute europeenne et acheteur particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle + if($seller_country_code === 'FR' && empty($buyer_in_cee) && !$thirdparty_buyer->isACompany()) { + return get_product_vat_for_country($idprod,$thirdparty_seller,$idprodfournprice); + } + // Sinon la TVA proposee par defaut=0. Fin de regle. // Rem: Cela signifie qu'au moins un des 2 est hors Communaute europeenne et que le pays differe //print 'VATRULE 5'; From d62118dca83ca6f57758deabf3cbb82c759cddbc Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 19 Sep 2018 14:53:56 +0200 Subject: [PATCH 3/6] FIX : langs fr --- htdocs/langs/fr_FR/agenda.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index dbbf3513041..5efd3959e6e 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -108,7 +108,7 @@ MyAvailability=Ma disponibilité ActionType=Type événement DateActionBegin=Date début événément CloneAction=Cloner l'événement -ConfirmCloneEvent=Êtes-vous sûr de vouloir cloner cette facture %s ? +ConfirmCloneEvent=Êtes-vous sûr de vouloir cloner l'événement %s ? RepeatEvent=Répétez événement EveryWeek=Chaque semaine EveryMonth=Chaque mois From 7b46bedce63aff7c8ae47f24248048f2b656ddaf Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 21 Sep 2018 14:35:36 +0200 Subject: [PATCH 4/6] NEW : hidden configuration --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 26a34af374b..f9399b7ab55 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4745,7 +4745,7 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, } // Si (vendeur en France et acheteur hors Communaute europeenne et acheteur particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle - if($seller_country_code === 'FR' && empty($buyer_in_cee) && !$thirdparty_buyer->isACompany()) { + if(!empty($conf->global->MAIN_USE_PRODUCT_TVA_WHEN_FRENCH_SELLER_AND_INDIVIDUAL_CUSTOMER) && $seller_country_code === 'FR' && empty($buyer_in_cee) && !$thirdparty_buyer->isACompany()) { return get_product_vat_for_country($idprod,$thirdparty_seller,$idprodfournprice); } From 1569770855e7fa3e03700d20fd061591dd3012b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Sep 2018 15:41:22 +0200 Subject: [PATCH 5/6] Rename hidden conf into MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f9399b7ab55..1797617a26d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4745,7 +4745,8 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, } // Si (vendeur en France et acheteur hors Communaute europeenne et acheteur particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle - if(!empty($conf->global->MAIN_USE_PRODUCT_TVA_WHEN_FRENCH_SELLER_AND_INDIVIDUAL_CUSTOMER) && $seller_country_code === 'FR' && empty($buyer_in_cee) && !$thirdparty_buyer->isACompany()) { + if (! empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC) && empty($buyer_in_cee) && !$thirdparty_buyer->isACompany()) + { return get_product_vat_for_country($idprod,$thirdparty_seller,$idprodfournprice); } From 12690666e2cbe0ccb4b961bd00e6120b348badf7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Sep 2018 10:03:08 +0200 Subject: [PATCH 6/6] Missing trans --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f932ec05959..6f2a8a951b5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1705,6 +1705,7 @@ BaseCurrency=Reference currency of the company (go into setup of company to chan WarningNoteModuleInvoiceForFrenchLaw=This module %s is compliant with french laws (Loi Finance 2016). WarningNoteModulePOSForFrenchLaw=This module %s is compliant with french laws (Loi Finance 2016) because module Non Reversible Logs is automatically activated. WarningInstallationMayBecomeNotCompliantWithLaw=You try to install the module %s that is an external module. Activating an external module means you trust the publisher of the module and you are sure that this module does not alterate negatively the behavior of your application and is compliant with laws of your country (%s). If the module bring a non legal feature, you become responsible for the use of a non legal software. +NothingToSetup=There is no specific setup to do for this module. ##### Resource #### ResourceSetup=Configuration du module Resource UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).