Merge pull request #1253 from atm-maxime/develop

Qual : duplicate code
This commit is contained in:
Laurent Destailleur 2013-10-14 02:39:07 -07:00
commit 4dcec72362
2 changed files with 8 additions and 7 deletions

View File

@ -57,6 +57,14 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
$object=new Facture($db);
// Load object
if ($facid > 0)
{
$ret=$object->fetch($facid);
}
// Initialize technical object to manage hooks of paiements. Note that conf->hooks_modules contains array array
$hookmanager = new HookManager($db);
$hookmanager->initHooks(array('paiementcard'));

View File

@ -70,11 +70,6 @@ $hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty(
$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
$object = new Expedition($db);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
}
// Load object
if ($id > 0 || ! empty($ref))
@ -95,8 +90,6 @@ if ($action == 'add')
{
$error=0;
$object = new Expedition($db);
$db->begin();
$object->note = GETPOST('note','alpha');