diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 33d83a1a681..521a8f13ade 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -205,6 +205,8 @@ class Account extends CommonObject $emetteur=trim($emetteur); $banque=trim($banque); + $now=dol_now(); + if (is_numeric($oper)) // Clean oper to have a code instead of a rowid { $sql ="SELECT code FROM ".MAIN_DB_PREFIX."c_paiement"; @@ -255,7 +257,7 @@ class Account extends CommonObject $sql.= ", fk_type"; $sql.= ",emetteur,banque"; $sql.= ") VALUES ("; - $sql.= "'".$this->db->idate(mktime())."'"; + $sql.= "'".$this->db->idate($now)."'"; $sql.= ", '".$this->db->idate($date)."'"; $sql.= ", '".$this->db->idate($datev)."'"; $sql.= ", '".$this->db->escape($label)."'"; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 19d49d5fba4..1da7b6b2253 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -299,7 +299,8 @@ else } } - if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->societe->supprimer) + // Delete third party + if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes' && $user->rights->societe->supprimer) { $soc->fetch($socid); $result = $soc->delete($socid); @@ -321,9 +322,9 @@ else /* * Generate document */ - if ($_REQUEST['action'] == 'builddoc') // En get ou en post + if (GETPOST('action') == 'builddoc') // En get ou en post { - if (is_numeric($_REQUEST['model'])) + if (is_numeric(GETPOST('model'))) { $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model")); } @@ -397,54 +398,42 @@ if (! empty($objcanvas->template_dir)) } else { - // Fetch object - $result=$objcanvas->fetch($socid); - if ($result > 0) - { - // Assign values - $objcanvas->assign_values('view'); + $result=$objcanvas->fetch($socid); // Relaod object + $objcanvas->assign_values('view'); // Assign values + $objcanvas->display_canvas('view'); // Show template - // Display canvas - $objcanvas->display_canvas('view'); + // TODO Move this also into template + print '