From 942e2f40bf6afe5e16d6dfd9543ad50aa963a626 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 2 May 2018 17:07:27 +0200 Subject: [PATCH 1/2] addline manage rank on its own if not provided --- htdocs/fourn/class/fournisseur.facture.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index c1337452d8a..34609a8fa33 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1383,6 +1383,11 @@ class FactureFournisseur extends CommonInvoice if (empty($txlocaltax1)) $txlocaltax1=0; if (empty($txlocaltax2)) $txlocaltax2=0; + if ($rang < 0) { + $rangmax = $this->line_max(); + $rang = $rangmax + 1; + } + $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $mysoc, $this->thirdparty); // Clean vat code From bc7b05537f6f41f1707a0c00f027ec768d4aaf9b Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Thu, 3 May 2018 09:26:48 +0200 Subject: [PATCH 2/2] NEW: hidden conf to assign category to thirparty neither customer nor prospect nor supplier --- htdocs/societe/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 204eff383d5..afec096a500 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1321,7 +1321,7 @@ else $langs->load('categories'); // Customer - if ($object->prospect || $object->client) { + if ($object->prospect || $object->client || (! $object->fournisseur && ! empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER))) { print '' . fieldLabel('CustomersCategoriesShort', 'custcats') . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, @@ -1879,7 +1879,7 @@ else if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { // Customer - if ($object->prospect || $object->client) { + if ($object->prospect || $object->client || (! $object->fournisseur && ! empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER))) { print '' . fieldLabel('CustomersCategoriesShort', 'custcats') . ''; print ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, null, null, null, 1); @@ -2269,7 +2269,7 @@ else if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { // Customer - if ($object->prospect || $object->client) { + if ($object->prospect || $object->client || (! $object->fournisseur && ! empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER))) { print '' . $langs->trans("CustomersCategoriesShort") . ''; print ''; print $form->showCategories($object->id, 'customer', 1);