forked from Wavyzz/dolibarr
Merge pull request #11071 from OPEN-DSI/fix-fourn--orderstoinvoice-reglement
Fix default payment terms and method
This commit is contained in:
@@ -298,11 +298,23 @@ if ($action == 'create' && !$error) {
|
||||
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">';
|
||||
@@ -350,15 +362,6 @@ if ($action == 'create' && !$error) {
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user