FIX create sociales : keep values error form

This commit is contained in:
atm-lena 2021-03-10 14:15:03 +01:00
parent 7cb10eae2e
commit b798535af9
2 changed files with 9 additions and 8 deletions

View File

@ -248,7 +248,7 @@ if ($action == 'create')
print '<tr>'; print '<tr>';
print '<td class="tdtop">'.$langs->trans("Comments").'</td>'; print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
print '<td class="tdtop"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>'; print '<td class="tdtop"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'">'.GETPOST('note', 'alphanohtml').'</textarea></td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
@ -296,6 +296,7 @@ if ($action == 'create')
print '<td class="right">'.price($objp->amount - $sumpaid)."</td>"; print '<td class="right">'.price($objp->amount - $sumpaid)."</td>";
print '<td class="center">'; print '<td class="center">';
if ($sumpaid < $objp->amount) if ($sumpaid < $objp->amount)
{ {
$namef = "amount_".$objp->id; $namef = "amount_".$objp->id;
@ -304,7 +305,7 @@ if ($action == 'create')
print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'"); print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'");
$remaintopay = $objp->amount - $sumpaid; $remaintopay = $objp->amount - $sumpaid;
print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">'; print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'">'; print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'" value="'.GETPOST('amount_'.$objp->id, 'intcomma').'">';
} }
else else
{ {

View File

@ -45,7 +45,7 @@ $langs->loadLangs(array('compta', 'bills', 'banks'));
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm'); $confirm = GETPOST('confirm');
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); $fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0);
$dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear'));
$dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear'));
@ -91,7 +91,7 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) {
if ($action == 'classin' && $user->rights->tax->charges->creer) if ($action == 'classin' && $user->rights->tax->charges->creer)
{ {
$object->fetch($id); $object->fetch($id);
$object->setProject(GETPOST('projectid')); $object->setProject(GETPOST('fk_project'));
} }
if ($action == 'setlib' && $user->rights->tax->charges->creer) if ($action == 'setlib' && $user->rights->tax->charges->creer)
@ -375,21 +375,21 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans("Project").'</td><td>'; print '<tr><td>'.$langs->trans("Project").'</td><td>';
$numproject = $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); $numproject = $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, 1);
print '</td></tr>'; print '</td></tr>';
} }
// Payment Mode // Payment Mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">'; print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id'); $form->select_types_paiements(GETPOST('mode_reglement_id', 'int'), 'mode_reglement_id');
print '</td></tr>'; print '</td></tr>';
// Bank Account // Bank Account
if (!empty($conf->banque->enabled)) if (!empty($conf->banque->enabled))
{ {
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">'; print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
$form->select_comptes($fk_account, 'fk_account', 0, '', 1); $form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 1);
print '</td></tr>'; print '</td></tr>';
} }
@ -482,7 +482,7 @@ if ($id > 0)
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">'; $morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">'; $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'fk_project', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref .= '</form>'; $morehtmlref .= '</form>';
} else { } else {