This commit is contained in:
Alexandre SPANGARO 2020-10-06 14:39:10 +02:00
parent 050a4770d3
commit 503f190fd4
3 changed files with 12 additions and 5 deletions

View File

@ -263,7 +263,6 @@ class PaymentVarious extends CommonObject
$this->subledger_account = $obj->subledger_account; $this->subledger_account = $obj->subledger_account;
$this->accountancy_code = $obj->accountancy_code; $this->accountancy_code = $obj->accountancy_code;
$this->fk_project = $obj->fk_project; $this->fk_project = $obj->fk_project;
$this->accountid = 1; // to clone
$this->fk_bank = $obj->fk_bank; $this->fk_bank = $obj->fk_bank;
$this->fk_user_author = $obj->fk_user_author; $this->fk_user_author = $obj->fk_user_author;
$this->fk_user_modif = $obj->fk_user_modif; $this->fk_user_modif = $obj->fk_user_modif;

View File

@ -248,7 +248,13 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->banque->m
} }
$newdatepayment = dol_mktime(0, 0, 0, GETPOST('clone_date_paymentmonth', 'int'), GETPOST('clone_date_paymentday', 'int'), GETPOST('clone_date_paymentyear', 'int')); $newdatepayment = dol_mktime(0, 0, 0, GETPOST('clone_date_paymentmonth', 'int'), GETPOST('clone_date_paymentday', 'int'), GETPOST('clone_date_paymentyear', 'int'));
$newdatevalue = dol_mktime(0, 0, 0, GETPOST('clone_date_valuemonth', 'int'), GETPOST('clone_date_valueday', 'int'), GETPOST('clone_date_valueyear', 'int'));
if ($newdatepayment) $object->datep = $newdatepayment; if ($newdatepayment) $object->datep = $newdatepayment;
if (!empty($newdatevalue)) {
$object->datev = $newdatevalue;
} else {
$object->datev = $newdatepayment;
}
if ($object->check()) if ($object->check())
{ {
@ -473,9 +479,11 @@ if ($id)
$formquestion = array( $formquestion = array(
array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label), array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label),
); );
$formquestion[] = array('type' => 'date', 'name' => 'clone_date_payment', 'label' => $langs->trans("DatePayment"), 'value' => -1); $formquestion[] = array('type' => 'date', 'tdclass'=>'fieldrequired', 'name' => 'clone_date_payment', 'label' => $langs->trans("DatePayment"), 'value' => -1);
$formquestion[] = array('type' => 'date', 'name' => 'clone_date_value', 'label' => $langs->trans("DateValue"), 'value' => -1);
$formquestion[] = array('type' => 'other', 'tdclass'=>'fieldrequired', 'name' => 'accountid', 'label' => $langs->trans("BankAccount"), 'value' => $form->select_comptes($accountid, "accountid", 0, '', 1));
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 220); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 300);
} }
dol_fiche_head($head, 'card', $langs->trans("VariousPayment"), -1, $object->picto); dol_fiche_head($head, 'card', $langs->trans("VariousPayment"), -1, $object->picto);

View File

@ -490,10 +490,10 @@ if ($result)
print $accountstatic->getNomUrl(1); print $accountstatic->getNomUrl(1);
} else { } else {
print ' '; print ' ';
}
print '</td>'; print '</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }
}
// Bank entry // Bank entry
if ($arrayfields['entry']['checked']) { if ($arrayfields['entry']['checked']) {