mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 17:02:34 +01:00
NEW: deposit payment terms: prefill deposit parameters if coming from an origin with the corresponding payment conditions
This commit is contained in:
@@ -3256,10 +3256,21 @@ if ($action == 'create') {
|
||||
'variable' => $langs->transnoentitiesnoconv('VarAmountOneLine', $langs->transnoentitiesnoconv('Deposit')),
|
||||
'variablealllines' => $langs->transnoentitiesnoconv('VarAmountAllLines')
|
||||
);
|
||||
print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit', 'aZ09'), 0, 0, 0, '', 1);
|
||||
$typedeposit = GETPOST('typedeposit', 'aZ09');
|
||||
$valuedeposit = GETPOST('valuedeposit', 'int');
|
||||
if (empty($typedeposit) && ! empty($objectsrc->deposit_percent)) {
|
||||
$origin_payment_conditions_deposit_percent = getDictvalue(MAIN_DB_PREFIX . 'c_payment_term', 'deposit_percent', $objectsrc->cond_reglement_id);
|
||||
if (! empty($origin_payment_conditions_deposit_percent)) {
|
||||
$typedeposit = 'variable';
|
||||
}
|
||||
}
|
||||
if (empty($valuedeposit) && $typedeposit == 'variable' && ! empty($objectsrc->deposit_percent)) {
|
||||
$valuedeposit = $objectsrc->deposit_percent;
|
||||
}
|
||||
print $form->selectarray('typedeposit', $arraylist, $typedeposit, 0, 0, 0, '', 1);
|
||||
print '</td>';
|
||||
print '<td class="nowrap" style="padding-left: 5px">';
|
||||
print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="'.GETPOST('valuedeposit', 'int').'"/>';
|
||||
print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="'.$valuedeposit.'"/>';
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
|
||||
Reference in New Issue
Block a user