Fix edit of incoterm from the shipments tab

This commit is contained in:
Laurent Destailleur 2017-11-02 12:48:40 +01:00
parent cfacfab6cf
commit 38e620d656
2 changed files with 12 additions and 3 deletions

View File

@ -1533,9 +1533,9 @@ if ($action == 'create')
print '<br>';
print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Create").'">';
print ' &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
print '&nbsp; ';
print '<input type="'.($backtopage?"submit":"button").'" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage?'':' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
print '</div>';
print '</form>';

View File

@ -151,6 +151,15 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors');
}
// Set incoterm
elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled))
{
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// shipping method
if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
$object = new Commande($db);