diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index 20ae7061a33..e51a1b6833f 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -19,7 +19,7 @@ /** * \file htdocs/comm/remise.php * \ingroup societe - * \brief Onglet remise de la societe + * \brief Page to edit relative discount of a customer */ require("../main.inc.php"); @@ -30,7 +30,7 @@ $langs->load("companies"); $langs->load("orders"); $langs->load("bills"); -$_socid = $_GET["id"]; +$_socid = GETPOST("id"); // Security check if ($user->societe_id > 0) { @@ -38,7 +38,17 @@ if ($user->societe_id > 0) } -if ($_POST["action"] == 'setremise') +/* + * Actions + */ + +if (GETPOST('cancel') && GETPOST('backtopage')) +{ + Header("Location: ".GETPOST("backtopage")); + exit; +} + +if (GETPOST("action") == 'setremise') { $soc = New Societe($db); $soc->fetch($_GET["id"]); @@ -110,6 +120,7 @@ if ($_socid > 0) print '
'; print ''; print ''; + print ''; print ''; @@ -123,7 +134,14 @@ if ($_socid > 0) print "
"; - print '
'; + print '
'; + print ''; + if (GETPOST("backtopage")) + { + print '    '; + print ''; + } + print '
'; print "
"; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 5893dcd16d3..811bf19b42a 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -33,7 +33,7 @@ $langs->load("bills"); $langs->load("companies"); // Security check -$_socid = $_GET["id"]; +$_socid = GETPOST("id"); if ($user->societe_id > 0) { $_socid = $user->societe_id; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 54ac2810be2..e5d92528c58 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -109,6 +109,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') } } +// Change status of invoice if ($action == 'reopen' && $user->rights->facture->creer) { $result = $object->fetch($id); @@ -128,7 +129,7 @@ if ($action == 'reopen' && $user->rights->facture->creer) } } -// Suppression de la facture +// Delete invoice if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->supprimer) { if ($user->rights->facture->supprimer) @@ -147,9 +148,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture-> } } -/* - * Supprime une ligne produit AVEC ou SANS confirmation - */ +// Delete line if ($action == 'confirm_deleteline' && $confirm == 'yes') { if ($user->rights->facture->creer) @@ -185,7 +184,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes') } } -// Supprime affectation d'un avoir a la facture +// Delete link of credit note to invoice if ($action == 'unlinkdiscount') { if ($user->rights->facture->creer) @@ -226,8 +225,8 @@ if ($action == 'set_thirdparty') { $object->updateObjectField('facture',$id,'fk_soc',$socid); - Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); - exit; + Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); + exit; } if ($action == 'classin') @@ -1291,7 +1290,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $object->actionmsg = $actionmsg; // Long text $object->actionmsg2 = $actionmsg2; // Short text $object->fk_element = $object->id; - $object->elementtype = $object->element; + $object->elementtype = $object->element; // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); @@ -1658,10 +1657,10 @@ if ($action == 'create') // Discounts for third party print ''.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",''.$soc->remise_client.''); else print $langs->trans("CompanyHasNoRelativeDiscount"); print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie)); + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",''.price($absolute_discount).'',$langs->trans("Currency".$conf->monnaie)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print '.'; print ''; @@ -2069,24 +2068,24 @@ else print ''; // Third party - print ''; + print ''; print ''; print ''; - print ''; print '
'.$langs->trans('Company').''; - if ($conf->global->FACTURE_CHANGE_THIRDPARTY && $action != 'editthirdparty' && $object->brouillon && $user->rights->facture->creer) + print ''; + if ($conf->global->FACTURE_CHANGE_THIRDPARTY && $action != 'editthirdparty' && $object->brouillon && $user->rights->facture->creer) print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'
'; print ''; - if ($action == 'editthirdparty') + if ($action == 'editthirdparty') { $html->form_thirdparty($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->socid,'socid'); } - else - { - print '  '.$soc->getNomUrl(1,'compta'); - print '   ('.$langs->trans('OtherBills').')'; - } - print ''; + else + { + print '  '.$soc->getNomUrl(1,'compta'); + print '   ('.$langs->trans('OtherBills').')'; + } + print ''; // Type print ''.$langs->trans('Type').'';