From 2a1ab9a8d4ee2ce0408bb47c1a8c8892e3af59d4 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Sat, 30 Jan 2016 16:43:35 +0100 Subject: [PATCH 1/4] Update card.php delete empty row in select list of vats in expenses as this value is not accepted --- htdocs/expensereport/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index a14e006fd7c..5036fd617f0 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1829,7 +1829,6 @@ else $defaultvat=-1; if (! empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; print ''; print ''; From d75a20c589828cc4defe2d26ce6c2f4727b3862a Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 30 Jan 2016 17:30:06 +0100 Subject: [PATCH 2/4] bad id on restricted aera --- htdocs/fichinter/info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php index 5be4af71d27..9f951dfe2d3 100644 --- a/htdocs/fichinter/info.php +++ b/htdocs/fichinter/info.php @@ -35,7 +35,7 @@ $id = GETPOST('id','int'); // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter'); +$result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); $object = new Fichinter($db); From 6a12cdc876183b176481f4a471bcec3228d0ee7d Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 31 Jan 2016 08:18:47 +0100 Subject: [PATCH 3/4] New: Add User accountancy code in export --- htdocs/core/modules/modUser.class.php | 6 +++--- htdocs/langs/en_US/users.lang | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 02a085c4a8b..48de5a48a6c 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -210,9 +210,9 @@ class modUser extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='Liste des utilisateurs Dolibarr et attributs'; $this->export_permission[$r]=array(array("user","user","export")); - $this->export_fields_array[$r]=array('u.rowid'=>"Id",'u.login'=>"Login",'u.lastname'=>"Lastname",'u.firstname'=>"Firstname",'u.office_phone'=>'Phone','u.office_fax'=>'Fax','u.email'=>'EMail','u.datec'=>"DateCreation",'u.tms'=>"DateLastModification",'u.admin'=>"Administrator",'u.statut'=>'Status','u.note'=>"Note",'u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion','u.fk_socpeople'=>"IdContact",'u.fk_soc'=>"IdCompany",'u.fk_member'=>"MemberId"); - $this->export_TypeFields_array[$r]=array('u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.office_phone'=>'Text','u.office_fax'=>'Text','u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date','u.datepreviouslogin'=>'Date','u.fk_soc'=>"List:societe:nom:rowid",'u.fk_member'=>"List:adherent:firstname"); - $this->export_entities_array[$r]=array('u.rowid'=>"user",'u.login'=>"user",'u.lastname'=>"user",'u.firstname'=>"user",'u.office_phone'=>'user','u.office_fax'=>'user','u.email'=>'user','u.datec'=>"user",'u.tms'=>"user",'u.admin'=>"user",'u.statut'=>'user','u.note'=>"user",'u.datelastlogin'=>'user','u.datepreviouslogin'=>'user','u.fk_socpeople'=>"contact",'u.fk_soc'=>"company",'u.fk_member'=>"member"); + $this->export_fields_array[$r]=array('u.rowid'=>"Id",'u.login'=>"Login",'u.lastname'=>"Lastname",'u.firstname'=>"Firstname",'u.accountancy_code'=>"UserAccountancyCode",'u.office_phone'=>'Phone','u.office_fax'=>'Fax','u.email'=>'EMail','u.datec'=>"DateCreation",'u.tms'=>"DateLastModification",'u.admin'=>"Administrator",'u.statut'=>'Status','u.note'=>"Note",'u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion','u.fk_socpeople'=>"IdContact",'u.fk_soc'=>"IdCompany",'u.fk_member'=>"MemberId"); + $this->export_TypeFields_array[$r]=array('u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.accountancy_code'=>'Text','u.office_phone'=>'Text','u.office_fax'=>'Text','u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date','u.datepreviouslogin'=>'Date','u.fk_soc'=>"List:societe:nom:rowid",'u.fk_member'=>"List:adherent:firstname"); + $this->export_entities_array[$r]=array('u.rowid'=>"user",'u.login'=>"user",'u.lastname'=>"user",'u.firstname'=>"user",'u.accountancy_code'=>'user','u.office_phone'=>'user','u.office_fax'=>'user','u.email'=>'user','u.datec'=>"user",'u.tms'=>"user",'u.admin'=>"user",'u.statut'=>'user','u.note'=>"user",'u.datelastlogin'=>'user','u.datepreviouslogin'=>'user','u.fk_socpeople'=>"contact",'u.fk_soc'=>"company",'u.fk_member'=>"member"); if (empty($conf->adherent->enabled)) { unset($this->export_fields_array[$r]['u.fk_member']); diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 8a7dfcfe787..47cddfa433f 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -122,3 +122,4 @@ LoginUsingOpenID=Use OpenID to login WeeklyHours=Weekly hours ColorUser=Color of the user DisabledInMonoUserMode=Disabled in maintenance mode +UserAccountancyCode=User accountancy code \ No newline at end of file From 773ee5c0eadf540cee9cbb091214c3cb0aca6fbd Mon Sep 17 00:00:00 2001 From: abb Date: Sun, 31 Jan 2016 18:56:05 +0100 Subject: [PATCH 4/4] provide link section in expenses and add option for intervention --- htdocs/core/class/html.form.class.php | 63 ++++++++++++++++++++++++++- htdocs/expensereport/card.php | 21 +++++++++ htdocs/langs/en_US/compta.lang | 3 +- htdocs/langs/fr_FR/compta.lang | 1 + 4 files changed, 86 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2230aebdbb5..5f23c65df61 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5100,7 +5100,68 @@ class Form print ''; } - if (((! is_array($restrictlinksto)) || in_array('supplier_order',$restrictlinksto)) + if ((in_array('fichinter',$restrictlinksto)) && ! empty($conf->ficheinter->enabled)) + { + $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedFichinter') . ''; + + print ' + + '; + + print '
global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>'; + + $sql = "SELECT s.rowid as socid, s.nom as name, s.client, f.rowid, f.ref"; + $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s"; + $sql .= ", " . MAIN_DB_PREFIX . "fichinter as f"; + $sql .= ' WHERE f.fk_soc = s.rowid'; + + $resqlorderlist = $this->db->query($sql); + if ($resqlorderlist) + { + $num = $this->db->num_rows($resqlorderlist); + $i = 0; + + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + while ($i < $num) + { + $objp = $this->db->fetch_object($resqlorderlist); + + $var = ! $var; + print ''; + print ''; + print ''; + print ''; + print ''; + + $i ++; + } + print '
' . $langs->trans("Ref") . '' . $langs->trans("Company") . '
'; + print ''; + print '' . $objp->ref . '' . $objp->name . '
'; + print '
     
'; + print '
'; + $this->db->free($resqlorderlist); + } else { + dol_print_error($this->db); + } + + print '
'; + } + + if (((! is_array($restrictlinksto)) || in_array('supplier_order',$restrictlinksto)) && ! empty($conf->fournisseur->enabled)) { $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedOrder') . ''; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index a14e006fd7c..ea1f62b215b 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2087,7 +2087,28 @@ if($user->rights->expensereport->export && $object->fk_statut>0 && $action != 'e print ''; +if ($action != 'create' && $action != 'edit' && ($id || $ref)) +{ + $permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + // Link invoice to intervention + if (GETPOST('LinkedFichinter')) { + $object->fetch($id); + $object->fetch_thirdparty(); + $result = $object->add_object_linked('fichinter', GETPOST('LinkedFichinter')); + } + // Linked object block + $somethingshown = $form->showLinkedObjectBlock($object); + + // Show links to link elements + $linktoelements=array(); + if($conf->global->EXPENSES_LINK_TO_INTERVENTION) $linktoelements[]='fichinter'; + $linktoelem=''; + $linktoelem = $form->showLinkToObjectBlock($object,$linktoelements); + if ($linktoelem) print '
'.$linktoelem; + +} llxFooter(); $db->close(); diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 14cacf57022..964a7c30678 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -220,4 +220,5 @@ AddExtraReport=Extra reports OtherCountriesCustomersReport=Foreign customers report BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry=Based on the two first letters of the VAT number being different from your own company's country code SameCountryCustomersWithVAT=National customers report -BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry=Based on the two first letters of the VAT number being the same as your own company's country code \ No newline at end of file +BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry=Based on the two first letters of the VAT number being the same as your own company's country code +LinkedFichinter=Link to an intervention diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index accb0faa9bf..75d28992070 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -220,3 +220,4 @@ OtherCountriesCustomersReport=Rapport client étranger BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry=Basé sur les deux premières lettres du numéro de TVA étant différent du code de pays de votre propre entreprise SameCountryCustomersWithVAT=Rapport clients nationaux BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry=Basé sur les deux premières lettres du numéro de TVA étant les mêmes que le code pays de votre propre entreprise +LinkedFichinter=Lier à une intervention