diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0cb132d23c6..26d54111098 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -221,14 +221,16 @@ abstract class CommonObject * @param int $rowid Id of line contact-element * @param int $statut New status of link * @param int $type_contact_id Id of contact type (not modified if 0) + * @param int $fk_socpeople Id of soc_people to update (not modified if 0) * @return int <0 if KO, >= 0 if OK */ - function update_contact($rowid, $statut, $type_contact_id=0) + function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0) { // Insertion dans la base $sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set"; $sql.= " statut = ".$statut; if ($type_contact_id) $sql.= ", fk_c_type_contact = '".$type_contact_id ."'"; + if ($fk_socpeople) $sql.= ", fk_socpeople = '".$fk_socpeople ."'"; $sql.= " where rowid = ".$rowid; $resql=$this->db->query($sql); if ($resql) @@ -3035,4 +3037,4 @@ abstract class CommonObject } } -?> +?> \ No newline at end of file diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 136d034a0ec..cf3c7b8ba96 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -115,7 +115,8 @@ class HookManager * @param Object &$object Object to use hooks on * @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) * @return mixed For doActions,formObjectOptions: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO. - * For printSearchForm,printLeftBlock,printTopRightMenu,...: Return HTML string. + * For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Must always return an int and things to print into ->resprints. + * Can also return some values into an array ->results. * $this->error or this->errors are also defined by class called by this function if error. */ function executeHooks($method, $parameters=false, &$object='', &$action='') @@ -127,45 +128,58 @@ class HookManager // Loop on each hook to qualify modules that declared context $modulealreadyexecuted=array(); - $resaction=0; $resprint=''; + $resaction=0; $error=0; + $this->resPrint=''; $this->resArray=array(); foreach($this->hooks as $modules) // this->hooks is an array with context as key and value is an array of modules that handle this context { if (! empty($modules)) { foreach($modules as $module => $actionclassinstance) { - // test to avoid to run twice a hook, when a module implements several active contexts + // jump to next class if method does not exists + if (! method_exists($actionclassinstance,$method)) continue; + // test to avoid to run twice a hook, when a module implements several active contexts if (in_array($module,$modulealreadyexecuted)) continue; $modulealreadyexecuted[$module]=$module; // Hooks that return int - if (($method == 'doActions' || $method == 'formObjectOptions') && method_exists($actionclassinstance,$method)) + if (($method == 'doActions' || $method == 'formObjectOptions')) { - $resaction+=$actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) - if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) - { - $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); - if ($method == 'doActions') - { - if ($action=='add') $action='create'; // TODO this change must be inside the doActions - if ($action=='update') $action='edit'; // TODO this change must be inside the doActions - } - } + $resaction+=$actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) + if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) + { + $error++; + $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); + // TODO remove this. Change must be inside the method if required + if ($method == 'doActions') + { + if ($action=='add') $action='create'; + if ($action=='update') $action='edit'; + } + } } - // Generic hooks that return a string (printSearchForm, printLeftBlock, formBuilddocOptions, ...) - else if (method_exists($actionclassinstance,$method)) + // Generic hooks that return a string (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) + else { - if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; + // TODO. this should be done into the method by returning nothing + if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; + $result = $actionclassinstance->$method($parameters, $object, $action, $this); - if (is_array($result)) $this->resArray = array_merge($this->resArray, $result); - else $resprint.=$result; + + if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); + if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; + + // TODO. remove this. array result must be set into $actionclassinstance->results + if (is_array($result)) $this->resArray = array_merge($this->resArray, $result); + // TODO. remove this. result must not be a string. we must use $actionclassinstance->resprint to return a string + if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result; } } } } - if ($method == 'doActions' || $method == 'formObjectOptions') return $resaction; - return $resprint; + if ($method != 'doActions' && $method != 'formObjectOptions') return $this->resPrint; // TODO remove this. When there is something to print, ->resPrint is filled. + return ($error?-1:$resaction); } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2cce0fcbdfa..945a65fb820 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -165,6 +165,10 @@ class Form { $ret.=$this->form_date($_SERVER['PHP_SELF'].'?id='.$object->id,$value,$htmlname); } + else if ($typeofdata == 'datehourpicker') + { + $ret.=$this->form_date($_SERVER['PHP_SELF'].'?id='.$object->id,$value,$htmlname,1,1); + } else if (preg_match('/^select;/',$typeofdata)) { $arraydata=explode(',',preg_replace('/^select;/','',$typeofdata)); @@ -183,7 +187,7 @@ class Form $ret.=$doleditor->Create(1); } $ret.=''; - if ($typeofdata != 'day' && $typeofdata != 'datepicker') $ret.=''; + if ($typeofdata != 'day' && $typeofdata != 'datepicker' && $typeofdata != 'datehourpicker') $ret.=''; $ret.=''."\n"; $ret.=''."\n"; } @@ -192,6 +196,7 @@ class Form if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1); elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value); elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day'); + elseif ($typeofdata == 'datehourpicker') $ret.=dol_print_date($value,'dayhour'); else if (preg_match('/^select;/',$typeofdata)) { $arraydata=explode(',',preg_replace('/^select;/','',$typeofdata)); @@ -272,7 +277,7 @@ class Form if (! empty($tmp[1])) $inputOption=$tmp[1]; if (! empty($tmp[2])) $savemethod=$tmp[2]; } - else if (preg_match('/^datepicker/',$inputType)) + else if ((preg_match('/^datepicker/',$inputType)) || (preg_match('/^datehourpicker/',$inputType))) { $tmp=explode(':',$inputType); $inputType=$tmp[0]; @@ -1447,7 +1452,8 @@ class Form $num = $this->db->num_rows($result); - $outselect.=''; // remove select to have id same with combo and ajax + $outselect.=''; print ''; print ''; print ''; print '
'; - print $this->select_date($selected,$htmlname,0,0,1,'form'.$htmlname); + print $this->select_date($selected,$htmlname,$displayhour,$displaymin,1,'form'.$htmlname); print '
'; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index d454cc3d005..ae43f9f34e7 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -143,6 +143,9 @@ class Translate * If data for file already loaded, do nothing. * All data in translation array are stored in UTF-8 format. * tab_loaded is completed with $domain key. + * Warning: MAIN_USE_CUSTOM_TRANSLATION is an old deprecated feature. Do not use it. It will revert + * rule "we keep first entry found with we keep last entry found" so it is probably not what you want to do. + * * Value for hash are: 1:Loaded from disk, 2:Not found, 3:Loaded from cache * * @param string $domain File name to load (.lang file). Must be "file" or "file@module" for module language files: @@ -198,13 +201,14 @@ class Translate // Directory of translation files $file_lang = $searchdir.($modulename?'/'.$modulename:'')."/langs/".$langofdir."/".$newdomain.".lang"; $file_lang_osencoded=dol_osencode($file_lang); + $filelangexists=is_file($file_lang_osencoded); //dol_syslog('Translate::Load Try to read for alt='.$alt.' langofdir='.$langofdir.' file_lang='.$file_lang." => filelangexists=".$filelangexists); if ($filelangexists) { - // TODO Move cache read out of loop on dirs + // TODO Move cache read out of loop on dirs or at least filelangexists $found=false; // Enable caching of lang file in memory (not by default) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 824d326883d..4b5b4f986ce 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -49,8 +49,13 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt // Remove product id before select another product // use keyup instead change to avoid loosing the product id - $("input#search_'.$htmlname.'").keyup(function() { - $("#'.$htmlname.'").val("").trigger("change"); + $("input#search_'.$htmlname.'").keydown(function() { + //console.log(\'purge_id_after_keydown\'); + $("#'.$htmlname.'").val(""); + }); + $("input#search_'.$htmlname.'").change(function() { + //console.log(\'keyup\'); + $("#'.$htmlname.'").trigger("change"); }); // Check when keyup $("input#search_'.$htmlname.'").onDelayedKeyup({ handler: function() { @@ -116,6 +121,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt dataType: "json", minLength: '.$minLength.', select: function( event, ui ) { + //console.log(\'set value of id with \'+ui.item.id); $("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Disable an element if (options.option_disabled) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d9d8703680c..605797c6422 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2703,9 +2703,8 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") // Some test to guess with no need to make database access if ($mysoc->country_code == 'ES') // For spain, localtaxes are qualified if both supplier and seller use local taxe { - if ($local == 1 && (! $thirdparty_seller->localtax1_assuj || ! $thirdparty_buyer->localtax1_assuj)) return 0; - if ($local == 2 && (! $thirdparty_seller->localtax2_assuj || ! $thirdparty_buyer->localtax2_assuj)) return 0; - + if ($local == 1 && ! $thirdparty_buyer->localtax1_assuj) return 0; + if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0; } else { @@ -2995,18 +2994,27 @@ function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod) */ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $idprod=0) { + global $mysoc; + if (!is_object($thirdparty_seller)) return -1; if (!is_object($thirdparty_buyer)) return -1; - if ($local==1) //RE + if ($local==1) // Localtax 1 { - // Si vendeur non assujeti a RE, localtax1 par default=0 - if (is_numeric($thirdparty_seller->localtax1_assuj) && ! $thirdparty_seller->localtax1_assuj) return 0; - if (! is_numeric($thirdparty_seller->localtax1_assuj) && $thirdparty_seller->localtax1_assuj=='localtax1off') return 0; + if ($mysoc->country_code == 'ES') + { + if (is_numeric($thirdparty_buyer->localtax1_assuj) && ! $thirdparty_buyer->localtax1_assuj) return 0; + } + else + { + // Si vendeur non assujeti a Localtax1, localtax1 par default=0 + if (is_numeric($thirdparty_seller->localtax1_assuj) && ! $thirdparty_seller->localtax1_assuj) return 0; + if (! is_numeric($thirdparty_seller->localtax1_assuj) && $thirdparty_seller->localtax1_assuj=='localtax1off') return 0; + } } - elseif ($local==2) //IRPF + elseif ($local==2) //I Localtax 2 { - // Si vendeur non assujeti a IRPF, localtax2 par default=0 + // Si vendeur non assujeti a Localtax2, localtax2 par default=0 if (is_numeric($thirdparty_seller->localtax2_assuj) && ! $thirdparty_seller->localtax2_assuj) return 0; if (! is_numeric($thirdparty_seller->localtax2_assuj) && $thirdparty_seller->localtax2_assuj=='localtax2off') return 0; } diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index 601f463682d..6897a523b56 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2010-2012 Laurent Destailleur * Copyright (C) 2012 Christophe Battarel * * This program is free software; you can redistribute it and/or modify @@ -42,15 +42,14 @@ trans('ReductionShort'); ?> margin->enabled)) { +if (! empty($conf->margin->enabled)) +{ + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; ?> trans('BuyingPrice'); ?> -global->DISPLAY_MARGIN_RATES)) - $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) - $colspan++; -} +   @@ -63,7 +62,7 @@ if (! empty($conf->margin->enabled)) { @@ -97,17 +96,16 @@ jQuery(document).ready(function() { % margin->enabled)) { +if (! empty($conf->margin->enabled)) +{ + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; ?> "> global->DISPLAY_MARGIN_RATES)) - $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) - $colspan++; } ?> @@ -115,18 +113,17 @@ if (! empty($conf->margin->enabled)) { -service->enabled) && $dateSelector) { -if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) - $colspan = 10; -else - $colspan = 9; -if (! empty($conf->margin->enabled)) { - $colspan++; // For the buying price - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) - $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) - $colspan++; -} +service->enabled) && $dateSelector) +{ + if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; + else $colspan = 9; + if (! empty($conf->margin->enabled)) + { + $colspan++; // For the buying price + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; + } ?> > @@ -138,11 +135,15 @@ if (! empty($conf->margin->enabled)) { ?> - + + margin->enabled)) { +if (! empty($conf->margin->enabled)) +{ ?> - + diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index d8eaef777ad..d2e93906bf4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -953,35 +953,68 @@ class CommandeFournisseur extends CommonOrder if ($this->db->query($sql)) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."commande_fournisseur"); + + if ($this->id) { + $num=count($this->lines); - $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; - $sql.= " SET ref='(PROV".$this->id.")'"; - $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::create sql=".$sql); - if ($this->db->query($sql)) - { - // On logue creation pour historique - $this->log($user, 0, time()); + /* + * Insertion du detail des produits dans la base + */ + for ($i=0;$i<$num;$i++) + { + $result = $this->addline( + $this->lines[$i]->desc, + $this->lines[$i]->subprice, + $this->lines[$i]->qty, + $this->lines[$i]->tva_tx, + $this->lines[$i]->localtax1_tx, + $this->lines[$i]->localtax2_tx, + $this->lines[$i]->fk_product, + 0, + $this->lines[$i]->ref_fourn, + $this->lines[$i]->remise_percent, + 'HT', + 0, + $this->lines[$i]->info_bits + ); + if ($result < 0) + { + $this->error=$this->db->lasterror(); + dol_print_error($this->db); + $this->db->rollback(); + return -1; + } + } - if (! $notrigger) - { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers - } - - $this->db->commit(); - return $this->id; - } - else - { - $this->error=$this->db->error(); - dol_syslog(get_class($this)."::create: Failed -2 - ".$this->error, LOG_ERR); - $this->db->rollback(); - return -2; + $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; + $sql.= " SET ref='(PROV".$this->id.")'"; + $sql.= " WHERE rowid=".$this->id; + dol_syslog(get_class($this)."::create sql=".$sql); + if ($this->db->query($sql)) + { + // On logue creation pour historique + $this->log($user, 0, time()); + + if (! $notrigger) + { + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('ORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + } + + $this->db->commit(); + return $this->id; + } + else + { + $this->error=$this->db->error(); + dol_syslog(get_class($this)."::create: Failed -2 - ".$this->error, LOG_ERR); + $this->db->rollback(); + return -2; + } } } else @@ -993,6 +1026,69 @@ class CommandeFournisseur extends CommonOrder } } + /** + * Load an object from its id and create a new one in database + * + * @param HookManager $hookmanager Hook manager instance + * @return int New id of clone + */ + function createFromClone($hookmanager=false) + { + global $conf,$user,$langs; + + $error=0; + + $this->db->begin(); + + // Load source object + $objFrom = dol_clone($this); + + $this->id=0; + $this->statut=0; + + // Clear fields + $this->user_author_id = $user->id; + $this->user_valid = ''; + $this->date_creation = ''; + $this->date_validation = ''; + $this->ref_supplier = ''; + + // Create clone + $result=$this->create($user); + if ($result < 0) $error++; + + if (! $error) + { + // Hook of thirdparty module + if (is_object($hookmanager)) + { + $parameters=array('objFrom'=>$objFrom); + $action=''; + $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; + } + + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('ORDER_SUPPLIER_CLONE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + } + + // End + if (! $error) + { + $this->db->commit(); + return $this->id; + } + else + { + $this->db->rollback(); + return -1; + } + } + /** * Add order line * @@ -1044,7 +1140,6 @@ class CommandeFournisseur extends CommonOrder } $desc=trim($desc); - // Check parameters if ($qty < 1 && ! $fk_product) { @@ -1053,7 +1148,6 @@ class CommandeFournisseur extends CommonOrder } if ($type < 0) return -1; - if ($this->statut == 0) { $this->db->begin(); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index c57d9e12bfc..81503d29dd3 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -78,13 +78,18 @@ $errors=array(); $object = new CommandeFournisseur($db); +// Load object +if ($id > 0 || ! empty($ref)) +{ + $object->fetch($id, $ref); + $object->fetch_thirdparty(); +} /* * Actions */ if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) { - $object->fetch($id); $result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha')); if ($result < 0) dol_print_error($db, $object->error); } @@ -92,14 +97,12 @@ if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) // conditions de reglement if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer) { - $object->fetch($id); $result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int')); } // mode de reglement else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) { - $object->fetch($id); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); } @@ -119,13 +122,11 @@ if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->cree // Set project else if ($action == 'classin' && $user->rights->fournisseur->commande->creer) { - $object->fetch($id); $object->setProject($projectid); } else if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer) { - $object->fetch($id); $result = $object->set_remise($user, $_POST['remise_percent']); } @@ -381,7 +382,6 @@ else if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer) { - $object->fetch($id); $result = $object->deleteline(GETPOST('lineid')); if ($result >= 0) @@ -413,7 +413,6 @@ else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->r else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->commande->valider) { - $object->fetch($id); $object->fetch_thirdparty(); $object->date_commande=dol_now(); @@ -448,7 +447,6 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou { $idwarehouse=GETPOST('idwarehouse', 'int'); - $object->fetch($id); $object->fetch_thirdparty(); // Check parameters @@ -479,7 +477,6 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver) { - $object->fetch($id); $result = $object->refuse($user); if ($result > 0) { @@ -494,7 +491,6 @@ else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->four else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) { - $object->fetch($id); $result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']); if ($result > 0) { @@ -510,7 +506,6 @@ else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fo else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer) { - $object->fetch($id); $object->fetch_thirdparty(); $result=$object->delete($user); if ($result > 0) @@ -524,10 +519,35 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->four } } +// Action clone object +else if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer) +{ + if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) + { + $mesg='
'.$langs->trans("NoCloneOptionsSpecified").'
'; + } + else + { + if ($object->id > 0) + { + $result=$object->createFromClone($hookmanager); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); + exit; + } + else + { + $mesg='
'.$object->error.'
'; + $action=''; + } + } + } +} + // Receive else if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner) { - $object->fetch($id); if ($_POST["type"]) { @@ -557,7 +577,6 @@ else if ($action == 'livraison' && $user->rights->fournisseur->commande->recepti else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) { - $object->fetch($id); $result = $object->cancel($user); if ($result > 0) { @@ -573,7 +592,6 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->four // Line ordering else if ($action == 'up' && $user->rights->fournisseur->commande->creer) { - $object->fetch($id); $object->line_up($_GET['rowid']); $outputlangs = $langs; @@ -588,7 +606,6 @@ else if ($action == 'up' && $user->rights->fournisseur->commande->creer) } else if ($action == 'down' && $user->rights->fournisseur->commande->creer) { - $object->fetch($id); $object->line_down($_GET['rowid']); $outputlangs = $langs; @@ -607,7 +624,6 @@ else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) / // Build document // Sauvegarde le dernier module choisi pour generer un document - $object->fetch($id); $object->fetch_thirdparty(); if ($_REQUEST['model']) @@ -984,6 +1000,18 @@ if ($id > 0 || ! empty($ref)) $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2); if ($ret == 'html') print '
'; } + + // Clone confirmation + if ($action == 'clone') + { + // Create an array for form + $formquestion=array( + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1) + ); + // Paiement incomplet. On demande si motif = escompte ou autre + $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1); + if ($ret == 'html') print '
'; + } /* * Confirmation de la validation @@ -1037,6 +1065,7 @@ if ($id > 0 || ! empty($ref)) $ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1); if ($ret == 'html') print '
'; } + /* * Confirmation de l'annulation */ @@ -1461,12 +1490,22 @@ if ($id > 0 || ! empty($ref)) print ' '; print ''; + // TODO Use the predefinedproductline_create.tpl.php file + // Add free products/services form print '
'; print ''; print ''; print ''; + print ''; + $var=true; print ''; print ''; @@ -1645,6 +1684,12 @@ if ($id > 0 || ! empty($ref)) print ''.$langs->trans("CancelOrder").''; } } + + // Clone + if ($user->rights->fournisseur->commande->creer) + { + print ''.$langs->trans("ToClone").''; + } // Delete if ($user->rights->fournisseur->commande->supprimer) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 4e3d60848f6..7ecc09268e6 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -82,7 +82,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') $result=$object->createFromClone($id); if ($result > 0) { - header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); + header("Location: ".$_SERVER['PHP_SELF'].'?action=editfacnumber&id='.$result); exit; } else @@ -466,10 +466,19 @@ elseif ($action == 'addline') } $ret=$object->fetch_thirdparty(); - if ($_POST['idprodfournprice']) // > 0 or -1 + if (GETPOST('search_idprodfournprice') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1, with autocomplete, idprodfournprice is > 0 or '' { - $product=new Product($db); - $idprod=$product->get_buyprice($_POST['idprodfournprice'], $_POST['qty']); // Just to see if a price exists for the quantity. Not used to found vat + $idprod=0; + $product=new Product($db); + + if (GETPOST('idprodfournprice') == '') + { + $idprod=-1; + } + if (GETPOST('idprodfournprice') > 0) + { + $idprod=$product->get_buyprice(GETPOST('idprodfournprice'), $_POST['qty']); // Just to see if a price exists for the quantity. Not used to found vat + } if ($idprod > 0) { @@ -1805,10 +1814,20 @@ else print ' '; print ''; + // TODO Use the predefinedproductline_create.tpl.php file print ''; print ''; print ''; print ''; + + print ''; + $var=! $var; print ''; print ''; diff --git a/htdocs/langs/ar_SA/suppliers.lang b/htdocs/langs/ar_SA/suppliers.lang index 5929a7d55d3..c4ac7827029 100644 --- a/htdocs/langs/ar_SA/suppliers.lang +++ b/htdocs/langs/ar_SA/suppliers.lang @@ -14,7 +14,6 @@ Supplier=المورد AddSupplier=إضافة مورد SupplierRemoved=إزالة المورد SuppliersInvoice=فاتورة الموردين -SuppliersInvoices=فواتير الموردين NewSupplier=مورد جديد History=التاريخ ListOfSuppliers=قائمة الموردين diff --git a/htdocs/langs/bg_BG/suppliers.lang b/htdocs/langs/bg_BG/suppliers.lang index 283ada1c1c5..e279ad69213 100644 --- a/htdocs/langs/bg_BG/suppliers.lang +++ b/htdocs/langs/bg_BG/suppliers.lang @@ -13,7 +13,6 @@ Supplier=Снабдител AddSupplier=Добави доставчик SupplierRemoved=Изтрити доставчик SuppliersInvoice=Фактура -SuppliersInvoices=Фактури NewSupplier=Нов доставчик History=Исторически ListOfSuppliers=Списък на доставчиците diff --git a/htdocs/langs/ca_ES/bills.lang b/htdocs/langs/ca_ES/bills.lang index f6ce99e3c04..d8d87882d13 100644 --- a/htdocs/langs/ca_ES/bills.lang +++ b/htdocs/langs/ca_ES/bills.lang @@ -47,7 +47,7 @@ InvoiceCustomer=Factura a client CustomerInvoice=Factura a client CustomersInvoices=Factures a clientes SupplierInvoice=Factura de proveïdor -SuppliersInvoices=Factures de proveïdors +SuppliersInvoices=Factures proveïdors SupplierBill=Factura de proveïdor SupplierBills=Factures de proveïdors Payment=Pagament diff --git a/htdocs/langs/ca_ES/languages.lang b/htdocs/langs/ca_ES/languages.lang index d9716305d73..97b44e22cbe 100644 --- a/htdocs/langs/ca_ES/languages.lang +++ b/htdocs/langs/ca_ES/languages.lang @@ -12,6 +12,7 @@ Language_en_AU=Anglès (Australia) Language_en_GB=Anglès (Regne Unit) Language_en_IN=Anglès (Índia) Language_en_NZ=Anglais (Nova Zelanda) +Language_en_SA=Inglés (Aràbia Saudita) Language_en_US=Anglès (Estats Units) Language_es_ES=Espanyol Language_es_AR=Espanyol (Argentina) diff --git a/htdocs/langs/ca_ES/suppliers.lang b/htdocs/langs/ca_ES/suppliers.lang index be740e4eab1..065d0404862 100644 --- a/htdocs/langs/ca_ES/suppliers.lang +++ b/htdocs/langs/ca_ES/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Proveïdor AddSupplier=Afegir proveïdor SupplierRemoved=Proveïdor eliminat SuppliersInvoice=Factura proveïdor -SuppliersInvoices=Factures proveïdors NewSupplier=Nou proveïdor History=Històric ListOfSuppliers=Llistat de proveïdors diff --git a/htdocs/langs/da_DK/suppliers.lang b/htdocs/langs/da_DK/suppliers.lang index cc435074e79..5b06a4bfdba 100644 --- a/htdocs/langs/da_DK/suppliers.lang +++ b/htdocs/langs/da_DK/suppliers.lang @@ -16,7 +16,6 @@ Supplier=Leverandør AddSupplier=Tilføj en leverandør SupplierRemoved=Leverandør fjernet SuppliersInvoice=Leverandører faktura -SuppliersInvoices=Leverandører fakturaer NewSupplier=Ny leverandør History=Historie ListOfSuppliers=Liste over leverandører diff --git a/htdocs/langs/de_AT/suppliers.lang b/htdocs/langs/de_AT/suppliers.lang index 6a960705d76..5d17837ec06 100644 --- a/htdocs/langs/de_AT/suppliers.lang +++ b/htdocs/langs/de_AT/suppliers.lang @@ -12,7 +12,6 @@ Supplier=Lieferant AddSupplier=Lieferanten hinzufügen SupplierRemoved=Lieferant entfernt SuppliersInvoice=Lieferantenrechnung -SuppliersInvoices=Lieferantenrechnungen NewSupplier=Neuer Lieferant History=Verlauf ListOfSuppliers=Lieferantenliste diff --git a/htdocs/langs/de_DE/suppliers.lang b/htdocs/langs/de_DE/suppliers.lang index 945bea65fcd..e44f7ed7ccb 100644 --- a/htdocs/langs/de_DE/suppliers.lang +++ b/htdocs/langs/de_DE/suppliers.lang @@ -12,7 +12,6 @@ Supplier=Lieferant AddSupplier=Lieferanten hinzufügen SupplierRemoved=Lieferant entfernt SuppliersInvoice=Lieferantenrechnung -SuppliersInvoices=Lieferantenrechnungen NewSupplier=Neuer Lieferant History=Verlauf ListOfSuppliers=Lieferantenliste diff --git a/htdocs/langs/el_GR/suppliers.lang b/htdocs/langs/el_GR/suppliers.lang index 5a42434f340..9db72404188 100644 --- a/htdocs/langs/el_GR/suppliers.lang +++ b/htdocs/langs/el_GR/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Προμηθευτής AddSupplier=Προσθήκη προμηθευτή SupplierRemoved=Ο προμηθευτής αφαιρέθηκε SuppliersInvoice=Τιμολόγιο προμηθευτή -SuppliersInvoices=Τιμολόγια προμηθευτών NewSupplier=Νέος προμηθευτής History=Ιστορικό ListOfSuppliers=Λίστα προμηθευτών diff --git a/htdocs/langs/en_SA/main.lang b/htdocs/langs/en_SA/main.lang new file mode 100644 index 00000000000..146ae3fd85e --- /dev/null +++ b/htdocs/langs/en_SA/main.lang @@ -0,0 +1,17 @@ +# Dolibarr language file - en_SA - main +CHARSET=UTF-8 +DIRECTION=ltr +FONTFORPDF=DejaVuSans +FONTSIZEFORPDF=9 +SeparatorDecimal=. +SeparatorThousand=, +FormatDateShort=%d/%m/%Y +FormatDateShortJava=dd/MM/yyyy +FormatDateShortJQuery=dd/mm/yy +FormatHourShort=%I:%M %p +FormatHourShortDuration=%H:%M +FormatDateTextShort=%d %b %Y +FormatDateText=%d %B %Y +FormatDateHourShort=%d/%m/%Y %I:%M %p +FormatDateHourTextShort=%d %b %Y, %I:%M %p +FormatDateHourText=%d %B %Y, %I:%M %p \ No newline at end of file diff --git a/htdocs/langs/en_SA/propal.lang b/htdocs/langs/en_SA/propal.lang new file mode 100644 index 00000000000..a985b025a19 --- /dev/null +++ b/htdocs/langs/en_SA/propal.lang @@ -0,0 +1,8 @@ +# Dolibarr language file - en_SA - propal +CHARSET=UTF-8 +Proposals=Commercial Proposals +Proposal=Commercial Proposal +Prop=Commercial Proposals +CommercialProposal=Commercial Proposal +CommercialProposals=Commercial Proposals +DateEndPropal=Validity Ending Date \ No newline at end of file diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 6195a5147b9..01cbb6950d4 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -49,9 +49,9 @@ Invoices=Invoices InvoiceLine=Invoice line InvoiceCustomer=Customer invoice CustomerInvoice=Customer invoice -CustomersInvoices=Customer's invoices +CustomersInvoices=Customers invoices SupplierInvoice=Supplier invoice -SuppliersInvoices=Supplier's invoices +SuppliersInvoices=Suppliers invoices SupplierBill=Supplier invoice SupplierBills=suppliers invoices Payment=Payment diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index e2f8cd0a510..8f79cd99fe0 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -14,6 +14,7 @@ Language_en_AU=English (Australia) Language_en_GB=English (United Kingdom) Language_en_IN=English (India) Language_en_NZ=English (New Zealand) +Language_en_SA=English (Saudi Arabia) Language_en_US=English (United States) Language_es_ES=Spanish Language_es_AR=Spanish (Argentina) diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 78119f38ebb..3f76ca5ecda 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -61,7 +61,7 @@ FileUploaded=The file was successfully uploaded AssociatedDocuments=Documents associated with the proposal: ErrorCantOpenDir=Can't open directory DatePropal=Date of proposal -DateEndPropal=Date end validity +DateEndPropal=Validity ending date DateEndPropalShort=Date end ValidityDuration=Validity duration CloseAs=Close with status diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index fd5a35d3f53..8f05c209b95 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Supplier AddSupplier=Add a supplier SupplierRemoved=Supplier removed SuppliersInvoice=Suppliers invoice -SuppliersInvoices=Suppliers invoices NewSupplier=New supplier History=History ListOfSuppliers=List of suppliers diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 63a33d062b0..42e5f4c60ba 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -47,7 +47,7 @@ InvoiceCustomer=Factura a cliente CustomerInvoice=Factura a cliente CustomersInvoices=Facturas a clientes SupplierInvoice=Factura de proveedor -SuppliersInvoices=Facturas de proveedores +SuppliersInvoices=Facturas proveedores SupplierBill=Factura de proveedor SupplierBills=Facturas de proveedores Payment=Pago diff --git a/htdocs/langs/es_ES/languages.lang b/htdocs/langs/es_ES/languages.lang index bd9b00231ce..0e537271c37 100644 --- a/htdocs/langs/es_ES/languages.lang +++ b/htdocs/langs/es_ES/languages.lang @@ -14,6 +14,7 @@ Language_en_AU=Inglés (Australia) Language_en_GB=Inglés (Reino Unido) Language_en_IN=Inglés (India) Language_en_NZ=Inglés (Nueva Zelanda) +Language_en_SA=Inglés (Arabia Saudita) Language_en_US=Inglés (Estados Unidos) Language_es_ES=Español Language_es_AR=Español (Argentina) diff --git a/htdocs/langs/es_ES/suppliers.lang b/htdocs/langs/es_ES/suppliers.lang index a03eccb719f..e500aea17bb 100644 --- a/htdocs/langs/es_ES/suppliers.lang +++ b/htdocs/langs/es_ES/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Proveedor AddSupplier=Añadir proveedor SupplierRemoved=Proveedor eliminado SuppliersInvoice=Factura proveedor -SuppliersInvoices=Facturas proveedores NewSupplier=Nuevo proveedor History=Histórico ListOfSuppliers=Listado de proveedores diff --git a/htdocs/langs/et_EE/suppliers.lang b/htdocs/langs/et_EE/suppliers.lang index 57f6ab11194..c9487dad634 100644 --- a/htdocs/langs/et_EE/suppliers.lang +++ b/htdocs/langs/et_EE/suppliers.lang @@ -13,7 +13,6 @@ Supplier=Tarnija AddSupplier=Lisa tarnija SupplierRemoved=Tarnija välja SuppliersInvoice=Tarnijate arve -SuppliersInvoices=Tarnijate arvete NewSupplier=New tarnija History=Ajalugu ListOfSuppliers=Tarnijate diff --git a/htdocs/langs/fa_IR/suppliers.lang b/htdocs/langs/fa_IR/suppliers.lang index 327d6ecc56e..d24ea173e77 100644 --- a/htdocs/langs/fa_IR/suppliers.lang +++ b/htdocs/langs/fa_IR/suppliers.lang @@ -14,7 +14,6 @@ Supplier=المورد AddSupplier=إضافة مورد SupplierRemoved=إزالة المورد SuppliersInvoice=فاتورة الموردين -SuppliersInvoices=فواتير الموردين NewSupplier=مورد جديد History=التاريخ ListOfSuppliers=قائمة الموردين diff --git a/htdocs/langs/fi_FI/suppliers.lang b/htdocs/langs/fi_FI/suppliers.lang index 8d8d8e5fb0d..43e75c7d246 100644 --- a/htdocs/langs/fi_FI/suppliers.lang +++ b/htdocs/langs/fi_FI/suppliers.lang @@ -14,7 +14,6 @@ Supplier=Toimittaja AddSupplier=Lisää toimittaja SupplierRemoved=Toimittaja poistettu SuppliersInvoice=Tavarantoimittajat lasku -SuppliersInvoices=Tavarantoimittajat laskut NewSupplier=Uuden toimittajan History=Historia ListOfSuppliers=Luettelo toimittajat diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 866773ee131..30786b6e542 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -47,7 +47,6 @@ InvoiceCustomer=Facture client CustomerInvoice=Facture client CustomersInvoices=Factures clients SupplierInvoice=Facture fournisseur -SuppliersInvoices=Factures fournisseurs SupplierBill=Facture fournisseur SupplierBills=Factures fournisseurs Payment=Règlement diff --git a/htdocs/langs/fr_FR/languages.lang b/htdocs/langs/fr_FR/languages.lang index 09231867347..40efc72e533 100644 --- a/htdocs/langs/fr_FR/languages.lang +++ b/htdocs/langs/fr_FR/languages.lang @@ -14,6 +14,7 @@ Language_en_AU=Anglais (Australie) Language_en_GB=Anglais (Royaume-Uni) Language_en_IN=Anglais (Inde) Language_en_NZ=Anglais (Nouvelle Zeland) +Language_en_SA=Anglais (Arabie Saoudite) Language_en_US=Anglais (Etats-Unis) Language_es_ES=Espagnol Language_es_AR=Espagnol (Argentine) diff --git a/htdocs/langs/fr_FR/suppliers.lang b/htdocs/langs/fr_FR/suppliers.lang index c042b74ea89..932615ff181 100644 --- a/htdocs/langs/fr_FR/suppliers.lang +++ b/htdocs/langs/fr_FR/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Fournisseur AddSupplier=Ajouter un fournisseur SupplierRemoved=Fournisseur supprimé SuppliersInvoice=Facture fournisseur -SuppliersInvoices=Factures fournisseurs NewSupplier=Nouveau fournisseur History=Historique ListOfSuppliers=Liste des fournisseurs diff --git a/htdocs/langs/he_IL/suppliers.lang b/htdocs/langs/he_IL/suppliers.lang index 0949262da42..3706da71c41 100644 --- a/htdocs/langs/he_IL/suppliers.lang +++ b/htdocs/langs/he_IL/suppliers.lang @@ -13,7 +13,6 @@ Supplier=ספק AddSupplier=הוסף הספק SupplierRemoved=הספק הוסר SuppliersInvoice=ספקים חשבונית -SuppliersInvoices=חשבוניות ספקים NewSupplier=חדש הספק History=היסטוריה ListOfSuppliers=רשימת הספקים diff --git a/htdocs/langs/hu_HU/suppliers.lang b/htdocs/langs/hu_HU/suppliers.lang index 9a0c2643fc7..89bdd570292 100644 --- a/htdocs/langs/hu_HU/suppliers.lang +++ b/htdocs/langs/hu_HU/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Beszállító AddSupplier=Beszállító hozzáadása SupplierRemoved=Beszállító eltávolítva SuppliersInvoice=Beszállító számla -SuppliersInvoices=Beszállítók számlái NewSupplier=Új beszállító History=Történet ListOfSuppliers=Beszállító listája diff --git a/htdocs/langs/is_IS/suppliers.lang b/htdocs/langs/is_IS/suppliers.lang index 625ded3432e..a33597212b3 100644 --- a/htdocs/langs/is_IS/suppliers.lang +++ b/htdocs/langs/is_IS/suppliers.lang @@ -13,7 +13,6 @@ Supplier=Birgir AddSupplier=Bæta við birgja SupplierRemoved=Birgir fjarri SuppliersInvoice=Birgjar Reikningar -SuppliersInvoices=Birgjar reikningum NewSupplier=New birgir History=Saga ListOfSuppliers=Listi yfir birgja diff --git a/htdocs/langs/it_IT/suppliers.lang b/htdocs/langs/it_IT/suppliers.lang index 7f21a0f73c3..8771326292b 100644 --- a/htdocs/langs/it_IT/suppliers.lang +++ b/htdocs/langs/it_IT/suppliers.lang @@ -39,4 +39,3 @@ SupplierRemoved =Fornitore rimosso SuppliersArea =Area fornitori Suppliers =Fornitori SuppliersInvoice =Fattura Fornitore -SuppliersInvoices =Fatture fornitori diff --git a/htdocs/langs/ja_JP/suppliers.lang b/htdocs/langs/ja_JP/suppliers.lang index 3cb36fb8a85..70416c864a9 100644 --- a/htdocs/langs/ja_JP/suppliers.lang +++ b/htdocs/langs/ja_JP/suppliers.lang @@ -13,7 +13,6 @@ Supplier=サプライヤー AddSupplier=サプライヤーを追加します。 SupplierRemoved=サプライヤーは、削除 SuppliersInvoice=仕入先の請求書 -SuppliersInvoices=仕入先の請求書 NewSupplier=新しいサプライヤー History=歴史 ListOfSuppliers=サプライヤーのリスト diff --git a/htdocs/langs/nb_NO/suppliers.lang b/htdocs/langs/nb_NO/suppliers.lang index 120b83656a5..9ee3898c986 100644 --- a/htdocs/langs/nb_NO/suppliers.lang +++ b/htdocs/langs/nb_NO/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Leverandør AddSupplier=Legg til en leverandør SupplierRemoved=Leverandør slettet SuppliersInvoice=Leverandørfaktura -SuppliersInvoices=Leverandørfakturaer NewSupplier=Ny leverandør History=Historikk ListOfSuppliers=Leverandøroversikt diff --git a/htdocs/langs/nl_BE/suppliers.lang b/htdocs/langs/nl_BE/suppliers.lang index 2c3a226584f..5326e9b7fe5 100644 --- a/htdocs/langs/nl_BE/suppliers.lang +++ b/htdocs/langs/nl_BE/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Leverancier AddSupplier=Voeg een leverancier toe SupplierRemoved=Leverancier verwijderd SuppliersInvoice=Leveranciers factuur -SuppliersInvoices=Leveranciers facturen NewSupplier=Nieuwe leverancier History=Geschiedenis ListOfSuppliers=Lijst van de leveranciers diff --git a/htdocs/langs/nl_NL/suppliers.lang b/htdocs/langs/nl_NL/suppliers.lang index 6d43ab7831b..1d8f1a032d8 100644 --- a/htdocs/langs/nl_NL/suppliers.lang +++ b/htdocs/langs/nl_NL/suppliers.lang @@ -5,7 +5,6 @@ Supplier = Leverancier AddSupplier = Voeg een leverancier toe SupplierRemoved = Leverancier verwijderd SuppliersInvoice = Leveranciersfactuur -SuppliersInvoices = Leveranciersfacturen NewSupplier = Nieuwe leverancier History = Geschiedenis ListOfSuppliers = Leverancierslijst diff --git a/htdocs/langs/pl_PL/suppliers.lang b/htdocs/langs/pl_PL/suppliers.lang index 88c424f5ab0..ce47c187730 100644 --- a/htdocs/langs/pl_PL/suppliers.lang +++ b/htdocs/langs/pl_PL/suppliers.lang @@ -16,7 +16,6 @@ Supplier=Dostawca AddSupplier=Dodaj dostawcy SupplierRemoved=Dostawca usunięte SuppliersInvoice=Dostawcy faktury -SuppliersInvoices=Dostawcy faktur NewSupplier=Nowy dostawca History=Historia ListOfSuppliers=Lista dostawców diff --git a/htdocs/langs/pt_BR/suppliers.lang b/htdocs/langs/pt_BR/suppliers.lang index acc5ad3d5e6..537a39c03f8 100644 --- a/htdocs/langs/pt_BR/suppliers.lang +++ b/htdocs/langs/pt_BR/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Fornecedor AddSupplier=Adicionar Fornecedor SupplierRemoved=Fornecedor Eliminado SuppliersInvoice=Faturas do Fornecedor -SuppliersInvoices=Faturas de Fornecedores NewSupplier=Novo Fornecedor History=Histórico ListOfSuppliers=Lista de Fornecedores diff --git a/htdocs/langs/pt_PT/suppliers.lang b/htdocs/langs/pt_PT/suppliers.lang index faab981a749..85dfde74227 100644 --- a/htdocs/langs/pt_PT/suppliers.lang +++ b/htdocs/langs/pt_PT/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Fornecedor AddSupplier=Adicionar Fornecedor SupplierRemoved=Fornecedor Eliminado SuppliersInvoice=Facturas do Fornecedor -SuppliersInvoices=Facturas de Fornecedores NewSupplier=Novo Fornecedor History=Histórico ListOfSuppliers=Lista de Fornecedores diff --git a/htdocs/langs/ro_RO/suppliers.lang b/htdocs/langs/ro_RO/suppliers.lang index 9603ceaeb1d..e1a10dc72be 100644 --- a/htdocs/langs/ro_RO/suppliers.lang +++ b/htdocs/langs/ro_RO/suppliers.lang @@ -14,7 +14,6 @@ Supplier=Furnizor AddSupplier=Adauga un furnizor SupplierRemoved=Furnizor eliminat SuppliersInvoice=Furnizori de factură -SuppliersInvoices=Furnizori facturi NewSupplier=New furnizor History=Istorie ListOfSuppliers=Lista de furnizori diff --git a/htdocs/langs/ru_RU/suppliers.lang b/htdocs/langs/ru_RU/suppliers.lang index 252c838ad1e..c118f0af1a9 100644 --- a/htdocs/langs/ru_RU/suppliers.lang +++ b/htdocs/langs/ru_RU/suppliers.lang @@ -14,7 +14,6 @@ Supplier=Поставщик AddSupplier=Добавить поставщиком SupplierRemoved=Поставщик удален SuppliersInvoice=Поставщики счета -SuppliersInvoices=Поставщики счета NewSupplier=Новый поставщик History=История ListOfSuppliers=Список поставщиков diff --git a/htdocs/langs/sl_SI/suppliers.lang b/htdocs/langs/sl_SI/suppliers.lang index 42e73cd433e..4df1bc83641 100644 --- a/htdocs/langs/sl_SI/suppliers.lang +++ b/htdocs/langs/sl_SI/suppliers.lang @@ -5,7 +5,6 @@ Supplier = Dobavitelj AddSupplier = Dodaj dobavitelja SupplierRemoved = Dobavitelj odstranjen SuppliersInvoice = Računi dobavitelja -SuppliersInvoices = Računi dobaviteljev NewSupplier = Nov dobavitelj History = Zgodovina ListOfSuppliers = Seznam dobaviteljev diff --git a/htdocs/langs/sv_SE/suppliers.lang b/htdocs/langs/sv_SE/suppliers.lang index 159fff54da5..3d99a40f5fe 100644 --- a/htdocs/langs/sv_SE/suppliers.lang +++ b/htdocs/langs/sv_SE/suppliers.lang @@ -13,7 +13,6 @@ Supplier=Leverantör AddSupplier=Lägg till en leverantör SupplierRemoved=Leverantör bort SuppliersInvoice=Leverantörer faktura -SuppliersInvoices=Leverantörer fakturor NewSupplier=Ny leverantör History=Historia ListOfSuppliers=Lista över leverantörer diff --git a/htdocs/langs/tr_TR/suppliers.lang b/htdocs/langs/tr_TR/suppliers.lang index f9543986615..fb3f2aa2945 100644 --- a/htdocs/langs/tr_TR/suppliers.lang +++ b/htdocs/langs/tr_TR/suppliers.lang @@ -12,7 +12,6 @@ Supplier=Tedarikçi AddSupplier=Bir tedarikçi ekle SupplierRemoved=Tedarikçi kaldırıldı SuppliersInvoice=Tedarikçi faturası -SuppliersInvoices=Tedarikçi faturaları NewSupplier=Yeni tedarikçi History=Geçmiş ListOfSuppliers=Tedarikçiler listesi diff --git a/htdocs/langs/zh_CN/suppliers.lang b/htdocs/langs/zh_CN/suppliers.lang index be4673ed4e4..49769de806b 100644 --- a/htdocs/langs/zh_CN/suppliers.lang +++ b/htdocs/langs/zh_CN/suppliers.lang @@ -13,7 +13,6 @@ Supplier=供应商 AddSupplier=新增供应商 SupplierRemoved=供应商删除 SuppliersInvoice=供应商发票 -SuppliersInvoices=供应商发票 NewSupplier=新供应商 History=历史 ListOfSuppliers=供应商名单 diff --git a/htdocs/langs/zh_TW/suppliers.lang b/htdocs/langs/zh_TW/suppliers.lang index 8a3e4b5ee2f..24bb921b63c 100644 --- a/htdocs/langs/zh_TW/suppliers.lang +++ b/htdocs/langs/zh_TW/suppliers.lang @@ -13,7 +13,6 @@ Supplier=供應商 AddSupplier=新增供應商 SupplierRemoved=供應商刪除 SuppliersInvoice=供應商的發票 -SuppliersInvoices=供應商的發票 NewSupplier=新供應商 History=歷史 ListOfSuppliers=供應商名單 diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 4f631358c9f..eda89ef1c5d 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -349,11 +349,8 @@ if ($id || $ref) //print $form->load_tva('tva_tx',$product->tva_tx,$supplier,$mysoc); // Do not use list here as it may be any vat rates for any country if (! empty($socid)) // When update { - $supplierselected=new Societe($db); - $supplierselected->fetch($socid); $default_vat=get_default_tva($supplier, $mysoc, $product->id); } - if ($action == 'add_price' && $socid) $default_vat=$product->tva_tx; // If editing product-fourn print ''; print ''; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index b34bfb472ec..c7990224d69 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -165,8 +165,7 @@ if ($id > 0 || ! empty($ref)) print ""; print dol_print_date($db->jdate($objp->datef)).""; print "".price($objp->total_ht)."\n"; - $fac=new Facture($db); - print ''.$fac->LibStatut($objp->paye,$objp->statut,5).''; + print ''.$supplierinvoicestatic->LibStatut($objp->paye,$objp->statut,5).''; print "\n"; $i++; } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index a916a7377c3..d922ea8f51d 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1121,7 +1121,7 @@ else print ''; // Name - print ''; + print ''; // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field @@ -1130,12 +1130,12 @@ else // It does not change the prefix mode using the auto numbering prefix if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $object->prefix_comm) { - print ''; + print ''; print $object->prefix_comm; } else { - print ''; + print ''; } print ''; }
'.$langs->trans('ThirdPartyName').'
'.$langs->trans('ThirdPartyName').'