diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 66cd78c903b..ff860a0a958 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -49,7 +49,7 @@ $langs->load('bills'); $langs->load('suppliers'); $langs->load('companies'); -$facid = isset($_GET["facid"])?$_GET["facid"]:''; +$facid = isset($_GET["facid"])?$_GET["facid"]:(isset($_POST["facid"])?$_POST["facid"]:''); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -135,11 +135,12 @@ if ($_REQUEST['action'] == 'confirm_paid' && $_REQUEST['confirm'] == 'yes' && $u } // Set supplier ref -if ($_POST['action'] == 'set_ref_supplier' && $user->rights->fournisseur->facture->creer) +if (($_POST['action'] == 'setref_supplier' || $_POST['action'] == 'set_ref_supplier') && $user->rights->fournisseur->facture->creer) { $facturefourn = new FactureFournisseur($db); - $facturefourn->fetch($_GET['facid']); + $facturefourn->fetch($facid); $result=$facturefourn->set_ref_supplier($user, $_POST['ref_supplier']); + $_GET['facid']=$facid; } if($_GET['action'] == 'deletepaiement') @@ -156,8 +157,8 @@ if($_GET['action'] == 'deletepaiement') if ($_POST['action'] == 'update' && ! $_POST['cancel']) { - $datefacture = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - $date_echeance = dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); + $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + $date_echeance = dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']); $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn set '; $sql .= " facnumber='".addslashes(trim($_POST['facnumber']))."'"; @@ -166,7 +167,7 @@ if ($_POST['action'] == 'update' && ! $_POST['cancel']) $sql .= ", datef = '".$db->idate($datefacture)."'"; $sql .= ", date_lim_reglement = '".$db->idate($date_echeance)."'"; $sql .= ' WHERE rowid = '.$_GET['facid'].' ;'; - $result = $db->query( $sql); + $result = $db->query($sql); } /* * Action creation @@ -716,29 +717,10 @@ else print ''; print "\n"; - // Ref supplier - print '
| '; - print $langs->trans('RefSupplier').' | '; - print ' | '; - if ($_GET['action'] != 'refsupplier' && $fac->brouillon) print ''.img_edit($langs->trans('Modify')).' | '; - print '