Skip to content

Commit

Permalink
Merge pull request #11071 from OPEN-DSI/fix-fourn--orderstoinvoice-re…
Browse files Browse the repository at this point in the history
…glement

Fix default payment terms and method
  • Loading branch information
eldy committed Apr 25, 2019
2 parents ad50aa2 + e804364 commit c76c0e6
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions htdocs/fourn/commande/orderstoinvoice.php
Expand Up @@ -298,11 +298,23 @@
if ($socid)
$res = $soc->fetch($socid);
if ($res) {
$cond_reglement_id = $soc->cond_reglement_id;
$mode_reglement_id = $soc->mode_reglement_id;
$cond_reglement_id = $soc->cond_reglement_supplier_id;
$mode_reglement_id = $soc->mode_reglement_supplier_id;
}
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ? - 1 : '';

$objectsrc = new CommandeFournisseur($db);
$listoforders = array();
foreach ($selected as $sel) {
$result = $objectsrc->fetch($sel);
if ($result > 0) {
$listoforders[] = $objectsrc->ref;
}

if (empty($cond_reglement_id)) $cond_reglement_id = $objectsrc->cond_reglement_id;
if (empty($mode_reglement_id)) $mode_reglement_id = $objectsrc->mode_reglement_id;
}

print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="add">';
Expand Down Expand Up @@ -350,15 +362,6 @@
print '</td></tr>';
}

$objectsrc = new CommandeFournisseur($db);
$listoforders = array ();
foreach ($selected as $sel) {
$result = $objectsrc->fetch($sel);
if ($result > 0) {
$listoforders[] = $objectsrc->ref;
}
}

// Other attributes
$parameters = array (
'objectsrc' => $objectsrc,
Expand Down

0 comments on commit c76c0e6

Please sign in to comment.