';
else print '
';
print '| ';
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 20b7d4369ac..f4e1fe159fe 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2653,10 +2653,11 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
}
/**
- * Show a title (deprecated. use print_fiche_titre instead)
+ * Show a title.
*
* @param string $title Title to show
* @return string Title to show
+ * @deprecated Use print_fiche_titre instead
*/
function print_titre($title)
{
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index 219d0074813..7517fac7d20 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -573,7 +573,7 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
/**
* Return last or next value for a mask (according to area we should not reset)
*
- * @param DoliDB $db Database handler
+ * @param DoliDB $db Database handler
* @param string $mask Mask to use
* @param string $table Table containing field with counter
* @param string $field Field containing already used values of counter
@@ -581,8 +581,8 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
* @param Societe $objsoc The company that own the object we need a counter for
* @param string $date Date to use for the {y},{m},{d} tags.
* @param string $mode 'next' for next value or 'last' for last value
- * @param bool $bentityon activate the entity filterdefault is true (for modules not compatible with multicompany)
- * @return string New value (numeric) or error message
+ * @param bool $bentityon Activate the entity filter. Default is true (for modules not compatible with multicompany)
+ * @return string New value (numeric) or error message
*/
function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true)
{
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index 06a187fd7de..7acce783e39 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -232,7 +232,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&action=create', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3610__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects&mode=mine', 'MyProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3610__+MAX_llx_menu__, 'project', 'myprojects', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects&mode=mine', 'MyProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3611__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&action=create&mode=mine', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3612__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index a2c28280984..9b7b49c9d3d 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1132,12 +1132,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$langs->load("projects");
// Project affected to user
- $newmenu->add("/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire, '', $mainmenu, 'projects');
+ $newmenu->add("/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire, '', $mainmenu, 'myprojects');
$newmenu->add("/projet/card.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
$newmenu->add("/projet/list.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
// All project i have permission on
- $newmenu->add("/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire && $user->rights->projet->lire);
+ $newmenu->add("/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire && $user->rights->projet->lire, '', $mainmenu, 'projects');
$newmenu->add("/projet/card.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer && $user->rights->projet->creer);
$newmenu->add("/projet/list.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire);
diff --git a/htdocs/core/tpl/document_actions_pre_headers.tpl.php b/htdocs/core/tpl/document_actions_pre_headers.tpl.php
index a4d97e7defb..36b6ce75fe1 100644
--- a/htdocs/core/tpl/document_actions_pre_headers.tpl.php
+++ b/htdocs/core/tpl/document_actions_pre_headers.tpl.php
@@ -72,11 +72,16 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
$link->id = $linkid;
$link->fetch();
$res = $link->delete($user);
+
$langs->load('link');
- if ($res) {
+ if ($res > 0) {
setEventMessage($langs->trans("LinkRemoved", $link->label));
} else {
- setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
+ if (count($link->errors)) {
+ setEventMessages('', $link->errors, 'errors');
+ } else {
+ setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
+ }
}
}
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.(!empty($withproject)?'&withproject=1':''));
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index 7d0fc5c64bf..7626774b24c 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -409,7 +409,7 @@ if (! empty($conf->global->ECM_AUTO_TREE_ENABLED))
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
if (! empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); }
if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); }
- if (! empty($conf->ficheinter->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsByInterventions")); }
+ if (! empty($conf->ficheinter->enabled)) { $langs->load("interventions"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsByInterventions")); }
$rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsByUsers"));
}
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 886340b4df0..7ccd24f871b 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -279,10 +279,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->exped
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
- if (empty($model)) {
- $tmp=getListOfModels($db, 'shipping'); $keys=array_keys($tmp); $model=$keys[0];
- }
$ret = $object->fetch($id); // Reload to get new records
+
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result);
}
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index d144d5eee54..fbd5261a55f 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -37,6 +37,11 @@ class Fichinter extends CommonObject
public $fk_element='fk_fichinter';
public $table_element_line='fichinterdet';
+ /**
+ * {@inheritdoc}
+ */
+ protected $table_ref_field = 'ref';
+
var $id;
var $socid; // Id client
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 3e234af68cd..8511a3e1a48 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -62,13 +62,17 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if ($action == 'setsupplieraccountancycode')
{
- $result=$object->fetch($id);
- $object->code_compta_fournisseur=$_POST["supplieraccountancycode"];
- $result=$object->update($object->id,$user,1,0,1);
- if ($result < 0)
- {
- $mesg=join(',',$object->errors);
- }
+ $cancelbutton = GETPOST('cancel');
+ if (! $cancelbutton)
+ {
+ $result=$object->fetch($id);
+ $object->code_compta_fournisseur=$_POST["supplieraccountancycode"];
+ $result=$object->update($object->id,$user,1,0,1);
+ if ($result < 0)
+ {
+ $mesg=join(',',$object->errors);
+ }
+ }
$action="";
}
// conditions de reglement
@@ -174,24 +178,15 @@ if ($object->fetch($id))
print ' | ';
// Local Taxes
- if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
+ if ($mysoc->useLocalTax(1))
{
- print '| '.$langs->trans('LocalTax1IsUsedES').' | ';
- print yn($object->localtax1_assuj);
- print ' | ';
- print '| '.$langs->trans('LocalTax2IsUsedES').' | ';
- print yn($object->localtax2_assuj);
- print ' | ';
- }
- elseif($mysoc->localtax1_assuj=="1")
- {
- print '| '.$langs->trans("LocalTax1IsUsedES").' | ';
+ print ' | | '.$langs->trans("LocalTax1IsUsed").' | ';
print yn($object->localtax1_assuj);
print ' | ';
}
- elseif($mysoc->localtax2_assuj=="1")
+ if ($mysoc->useLocalTax(2))
{
- print '| '.$langs->trans("LocalTax2IsUsedES").' | ';
+ print ' | | '.$langs->trans("LocalTax2IsUsed").' | ';
print yn($object->localtax2_assuj);
print ' | ';
}
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 7593dcf9903..4fe4675f5d8 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -45,6 +45,11 @@ class CommandeFournisseur extends CommonOrder
public $fk_element = 'fk_commande';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ /**
+ * {@inheritdoc}
+ */
+ protected $table_ref_field = 'ref';
+
var $id;
var $ref; // TODO deprecated
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 95da7550db7..d9a4469481f 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -43,6 +43,11 @@ class FactureFournisseur extends CommonInvoice
public $fk_element='fk_facture_fourn';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ /**
+ * {@inheritdoc}
+ */
+ protected $table_ref_field = 'ref';
+
var $rowid;
var $ref;
var $product_ref;
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index f85a7a042f2..b90bd275e4c 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -357,10 +357,8 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
- if (empty($model)) {
- $tmp=getListOfModels($db, 'order_supplier'); $keys=array_keys($tmp); $model=$keys[0];
- }
$ret = $object->fetch($id); // Reload to get new records
+
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result);
}
@@ -462,10 +460,8 @@ else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
- if (empty($model)) {
- $tmp=getListOfModels($db, 'order_supplier'); $keys=array_keys($tmp); $model=$keys[0];
- }
$ret = $object->fetch($id); // Reload to get new records
+
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result);
}
@@ -526,10 +522,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourn
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
- if (empty($model)) {
- $tmp=getListOfModels($db, 'order_supplier'); $keys=array_keys($tmp); $model=$keys[0];
- }
$ret = $object->fetch($id); // Reload to get new records
+
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result);
}
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 248fa0af59a..05e8590628f 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -711,10 +711,8 @@ elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer)
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
- if (empty($model)) {
- $tmp=getListOfModels($db, 'invoice_supplier'); $keys=array_keys($tmp); $model=$keys[0];
- }
$ret = $object->fetch($id); // Reload to get new records
+
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result);
}
@@ -793,10 +791,8 @@ elseif ($action == 'edit' && $user->rights->fournisseur->facture->creer)
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
- if (empty($model)) {
- $tmp=getListOfModels($db, 'invoice_supplier'); $keys=array_keys($tmp); $model=$keys[0];
- }
$ret = $object->fetch($id); // Reload to get new records
+
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result);
}
diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
index 2281793929f..0b71a2fe6fe 100755
--- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
+++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
@@ -220,8 +220,8 @@ create table llx_accounting_fiscalyear
fk_user_modif integer NULL
)ENGINE=innodb;
-ALTER TABLE llx_contrat ADD COLUMN ref_ext varchar(30) after ref;
-ALTER TABLE llx_contrat ADD COLUMN ref_supplier varchar(30) after ref_ext;
+ALTER TABLE llx_contrat ADD COLUMN ref_supplier varchar(30) after ref;
+ALTER TABLE llx_contrat ADD COLUMN ref_ext varchar(30) after ref_supplier;
ALTER TABLE llx_propal ADD COLUMN fk_shipping_method integer AFTER date_livraison;
ALTER TABLE llx_commande ADD COLUMN fk_shipping_method integer AFTER date_livraison;
diff --git a/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql b/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql
index 333eb41ad08..0a89810dce5 100644
--- a/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql
@@ -21,6 +21,6 @@ CREATE TABLE IF NOT EXISTS llx_usergroup_extrafields (
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
-) ENGINE=InnoDB ;
+)ENGINE=innodb;
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 8c737eecd52..0b328e705a7 100755
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1157,6 +1157,7 @@ ValidOrderAfterPropalClosed=To validate the order after proposal closer, makes i
FreeLegalTextOnOrders=Free text on orders
WatermarkOnDraftOrders=Watermark on draft orders (none if empty)
ShippableOrderIconInList=Add an icon in Orders list which indicate if order is shippable
+BANK_ASK_PAYMENT_BANK_DURING_ORDER=Ask for bank account destination of order
##### Clicktodial #####
ClickToDialSetup=Click To Dial module setup
ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags __PHONETO__ that will be replaced with the phone number of person to call __PHONEFROM__ that will be replaced with phone number of calling person (yours) __LOGIN__ that will be replaced with your clicktodial login (defined on your user card) __PASS__ that will be replaced with your clicktodial password (defined on your user card).
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index 9847ce53524..a5dfb52d40c 100755
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -28,10 +28,10 @@ ProductsAndServicesStatistics=Products and Services statistics
ProductsStatistics=Products statistics
ProductsOnSell=Available products
ProductsNotOnSell=Obsolete products
-ProductsOnSellAndOnBuy=Products not for sale nor purchase
+ProductsOnSellAndOnBuy=Products for sale and for purchase
ServicesOnSell=Available services
ServicesNotOnSell=Obsolete services
-ServicesOnSellAndOnBuy=Services not for sale nor purchase
+ServicesOnSellAndOnBuy=Services for sale and for purchase
InternalRef=Internal reference
LastRecorded=Last products/services on sell recorded
LastRecordedProductsAndServices=Last %s recorded products/services
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 8d5d7c26a53..84624b219f9 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -3,6 +3,7 @@ RefProject=Ref. project
ProjectId=Project Id
Project=Project
Projects=Projects
+ProjectStatus=Project status
SharedProject=Everybody
PrivateProject=Contacts of project
MyProjectsDesc=This view is limited to projects you are a contact for (whatever is the type).
@@ -11,7 +12,6 @@ ProjectsDesc=This view presents all projects (your user permissions grant you pe
MyTasksDesc=This view is limited to projects or tasks you are a contact for (whatever is the type).
TasksPublicDesc=This view presents all projects and tasks you are allowed to read.
TasksDesc=This view presents all projects and tasks (your user permissions grant you permission to view everything).
-Myprojects=My projects
ProjectsArea=Projects area
NewProject=New project
AddProject=Create project
@@ -131,4 +131,4 @@ ProjectReferers=Refering objects
SearchAProject=Search a project
ProjectMustBeValidatedFirst=Project must be validated first
ProjectDraft=Draft projects
-FirstAddRessourceToAllocateTime=Associate a ressource to allocate time
\ No newline at end of file
+FirstAddRessourceToAllocateTime=Associate a ressource to allocate time
diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang
index 5ac8e82d6f9..3a6ed7f8784 100644
--- a/htdocs/langs/es_ES/projects.lang
+++ b/htdocs/langs/es_ES/projects.lang
@@ -3,6 +3,7 @@ RefProject=Ref. proyecto
ProjectId=Id proyecto
Project=Proyecto
Projects=Proyectos
+ProjectStatus=Estado del proyecto
SharedProject=Proyecto compartido
PrivateProject=Contactos del proyecto
MyProjectsDesc=Esta vista muestra aquellos proyectos en los que usted es un contacto afectado (cualquier tipo).
diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang
index 6b29fa82fec..e20b6efae12 100644
--- a/htdocs/langs/fr_FR/compta.lang
+++ b/htdocs/langs/fr_FR/compta.lang
@@ -204,3 +204,11 @@ ACCOUNTING_ACCOUNT_SUPPLIER=Code comptable par défaut des tiers fournisseurs
CloneTax=Cloner une charge sociale
ConfirmCloneTax=Confirmer le clonage de la charge sociale
CloneTaxForNextMonth=Cloner pour le mois suivant
+COMPTA_PRODUCT_BUY_ACCOUNT=Code comptable par défaut pour l'achat de produits
+COMPTA_PRODUCT_SOLD_ACCOUNT=Code comptable par défaut pour la vente de produits
+COMPTA_SERVICE_BUY_ACCOUNT=Code comptable par défaut pour l'achat de services
+COMPTA_SERVICE_SOLD_ACCOUNT=Code comptable par défaut pour la vente de services
+COMPTA_VAT_ACCOUNT=Code comptable par défaut pour l'encaissement de TVA
+COMPTA_VAT_BUY_ACCOUNT=Code comptable par défaut pour le versement de la TVA
+COMPTA_ACCOUNT_CUSTOMER=Code comptable par défaut des tiers clients
+COMPTA_ACCOUNT_SUPPLIER=Code comptable par défaut des tiers fournisseurs
diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php
index 2b6a74a519e..1a89a377fef 100644
--- a/htdocs/livraison/card.php
+++ b/htdocs/livraison/card.php
@@ -135,10 +135,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->exped
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
- if (empty($model)) {
- $tmp=getListOfModels($db, 'delivery'); $keys=array_keys($tmp); $model=$keys[0];
- }
$ret = $object->fetch($id); // Reload to get new records
+
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result);
}
diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php
index 2304268070c..8a0aefba711 100644
--- a/htdocs/margin/agentMargins.php
+++ b/htdocs/margin/agentMargins.php
@@ -57,9 +57,9 @@ $pagenext = $page + 1;
$startdate=$enddate='';
if (!empty($_POST['startdatemonth']))
- $startdate = dol_mktime(12, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
+ $startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
if (!empty($_POST['enddatemonth']))
- $enddate = dol_mktime(12, 0, 0, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
+ $enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
/*
* View
diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php
index 7385342c905..eec35e38430 100644
--- a/htdocs/paypal/admin/paypal.php
+++ b/htdocs/paypal/admin/paypal.php
@@ -93,7 +93,7 @@ llxHeader('',$langs->trans("PaypalSetup"));
$linkback=''.$langs->trans("BackToModuleList").'';
-print_fiche_titre(' - '.$langs->trans("ModuleSetup"),$linkback,'paypal_logo@paypal');
+print_fiche_titre($langs->trans("ModuleSetup").' PayPal',$linkback);
print ' ';
$head=paypaladmin_prepare_head();
diff --git a/htdocs/paypal/img/object_paypal.png b/htdocs/paypal/img/object_paypal.png
index 4ff3c80565d..74ac4392ded 100644
Binary files a/htdocs/paypal/img/object_paypal.png and b/htdocs/paypal/img/object_paypal.png differ
diff --git a/htdocs/paypal/img/paypal.png b/htdocs/paypal/img/paypal.png
deleted file mode 100644
index 2caabff50b7..00000000000
Binary files a/htdocs/paypal/img/paypal.png and /dev/null differ
diff --git a/htdocs/paypal/img/paypal_logo.png b/htdocs/paypal/img/paypal_logo.png
deleted file mode 100644
index 2a4fd7c9ad5..00000000000
Binary files a/htdocs/paypal/img/paypal_logo.png and /dev/null differ
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index cc52bf38d87..d739f72afc4 100755
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -46,6 +46,11 @@ class Product extends CommonObject
protected $isnolinkedbythird = 1; // No field fk_soc
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ /**
+ * {@inheritdoc}
+ */
+ protected $table_ref_field = 'ref';
+
var $regeximgext='\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff';
//! Identifiant unique
diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php
index 8607cfeeb8e..92ad4cfbe1f 100644
--- a/htdocs/product/popuprop.php
+++ b/htdocs/product/popuprop.php
@@ -3,6 +3,7 @@
* Copyright (C) 2004-2005 Laurent Destailleur
* Copyright (C) 2004 Eric Seigne
* Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2014 Marcos García
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -71,7 +72,9 @@ llxHeader('','',$helpurl);
$sql = "SELECT count(*) as c";
$sql.= " FROM ".MAIN_DB_PREFIX."product";
$sql.= ' WHERE entity IN ('.getEntity('product', 1).')';
-if (isset($type)) $sql.= " AND fk_product_type = ".$type;
+if ($type !== '') {
+ $sql.= " AND fk_product_type = ".$type;
+}
$result=$db->query($sql);
if ($result)
@@ -82,11 +85,14 @@ if ($result)
$param = '';
$title = $langs->trans("ListProductServiceByPopularity");
-if (isset($type))
-{
+if ($type !== '') {
$param = '&type='.$type;
- $title = $langs->trans("ListProductByPopularity");
- if ($type == 1) $title = $langs->trans("ListServiceByPopularity");
+
+ if ($type == 1) {
+ $title = $langs->trans("ListServiceByPopularity");
+ } else {
+ $title = $langs->trans("ListProductByPopularity");
+ }
}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$param,"","","",$num);
@@ -106,7 +112,9 @@ $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd";
$sql.= ", ".MAIN_DB_PREFIX."product as p";
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
$sql.= " AND p.rowid = pd.fk_product";
-if (isset($type)) $sql.= " AND fk_product_type = ".$type;
+if ($type !== '') {
+ $sql.= " AND fk_product_type = ".$type;
+}
$sql.= " GROUP BY (p.rowid)";
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit, $offset);
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 41ae40a259d..c9d4ed9f546 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -38,6 +38,11 @@ class Project extends CommonObject
public $fk_element = 'fk_projet';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ /**
+ * {@inheritdoc}
+ */
+ protected $table_ref_field = 'ref';
+
var $id;
var $ref;
var $description;
@@ -568,16 +573,9 @@ class Project extends CommonObject
{
// Call trigger
$result=$this->call_trigger('PROJECT_DELETE',$user);
- if ($result < 0)
- {
+
+ if ($result < 0) {
$error++;
- if (! empty($interface->errors))
- {
- foreach ($interface->errors as $errmsg ) {
- dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
- $this->errors[] =$errmsg;
- }
- }
}
// End call triggers
}
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index a54e7c45aac..bc7478a0dbb 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -460,8 +460,8 @@ $langs->load("suppliers");
$langs->load("bills");
$langs->load("orders");
$langs->load("proposals");
-$langs->load("margin");
-print_titre($langs->trans("Profit"));
+$langs->load("margins");
+print_fiche_titre($langs->trans("Profit"),'','');
print '';
print '';
print '| '.$langs->trans("Element").' | ';
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index 15604ba0e89..99d127fb9a9 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -57,7 +57,7 @@ $projectstatic = new Project($db);
// Add new contact
if ($action == 'addcontact' && $user->rights->projet->creer)
{
- $result = $object->fetch($id);
+ $result = $object->fetch($id, $ref);
if ($result > 0 && $id > 0)
{
@@ -87,7 +87,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
// bascule du statut d'un contact
if ($action == 'swapstatut' && $user->rights->projet->creer)
{
- if ($object->fetch($id))
+ if ($object->fetch($id, $ref))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
@@ -100,7 +100,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer)
// Efface un contact
if ($action == 'deleteline' && $user->rights->projet->creer)
{
- $object->fetch($id);
+ $object->fetch($id, $ref);
$result = $object->delete_contact($_GET["lineid"]);
if ($result >= 0)
@@ -152,7 +152,7 @@ $userstatic = new User($db);
if ($id > 0 || ! empty($ref))
{
- if ($object->fetch($id) > 0)
+ if ($object->fetch($id, $ref) > 0)
{
$result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php
index c6ded20ecb4..a9b059fce81 100644
--- a/htdocs/projet/tasks/index.php
+++ b/htdocs/projet/tasks/index.php
@@ -103,7 +103,7 @@ print '';
print '';
print '| '.$langs->trans("Project").' | ';
-print ''.$langs->trans("Status").' | ';
+print ''.$langs->trans("ProjectStatus").' | ';
print ''.$langs->trans("RefTask").' | ';
print ''.$langs->trans("LabelTask").' | ';
print ''.$langs->trans("DateStart").' | ';
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index d489581e078..9951902ec5b 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -73,7 +73,7 @@ if ($action == 'addtimespent' && $user->rights->projet->creer)
if (! $error)
{
- $object->fetch($id);
+ $object->fetch($id, $ref);
$object->fetch_projet();
if (empty($object->projet->statut))
@@ -119,7 +119,7 @@ if ($action == 'updateline' && ! $_POST["cancel"] && $user->rights->projet->cree
if (! $error)
{
- $object->fetch($id);
+ $object->fetch($id, $ref);
$object->timespent_id = $_POST["lineid"];
$object->timespent_note = $_POST["timespent_note_line"];
@@ -194,7 +194,7 @@ if ($id > 0 || ! empty($ref))
/*
* Fiche projet en mode visu
*/
- if ($object->fetch($id) >= 0)
+ if ($object->fetch($id, $ref) >= 0)
{
$result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
diff --git a/scripts/odt2pdf/odt2pdf.sh b/scripts/odt2pdf/odt2pdf.sh
index 0599e4291c5..9d9bf18a8c7 100755
--- a/scripts/odt2pdf/odt2pdf.sh
+++ b/scripts/odt2pdf/odt2pdf.sh
@@ -22,7 +22,7 @@ if [ -f "$1.odt" ]
nbprocess=$(pgrep -c soffice)
if [ $nbprocess -ne 1 ]
then
- soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless&
+ soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless &
retcode=$?
if [ $retcode -ne 0 ]
then
|