Debug v19

This commit is contained in:
Laurent Destailleur 2024-01-23 11:07:53 +01:00
parent 2b5155ef02
commit 9a9ca50b49
3 changed files with 15 additions and 10 deletions

View file

@ -33,7 +33,7 @@ if (isModEnabled("banque")) {
}
// Load translation files required by the page
$langs->loadLangs(array("companies", "members", "bills", "users"));
$langs->loadLangs(array("companies", "members", "bills", "users", "banks"));
$adh = new Adherent($db);
$adht = new AdherentType($db);
@ -86,7 +86,10 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'update' &&
$errmsg = '';
if ($object->fk_bank) {
$newdatestart = dol_mktime(GETPOST('datesubhour', 'int'), GETPOST('datesubmin', 'int'), 0, GETPOST('datesubmonth', 'int'), GETPOST('datesubday', 'int'), GETPOST('datesubyear', 'int'));
$newdateend = dol_mktime(GETPOST('datesubendhour', 'int'), GETPOST('datesubendmin', 'int'), 0, GETPOST('datesubendmonth', 'int'), GETPOST('datesubendday', 'int'), GETPOST('datesubendyear', 'int'));
if ($object->fk_bank > 0) {
$accountline = new AccountLine($db);
$result = $accountline->fetch($object->fk_bank);
@ -94,9 +97,10 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'update' &&
if ($accountline->rappro) {
$errmsg = $langs->trans("SubscriptionLinkedToConciliatedTransaction");
} else {
$accountline->datev = dol_mktime(GETPOST('datesubhour', 'int'), GETPOST('datesubmin', 'int'), 0, GETPOST('datesubmonth', 'int'), GETPOST('datesubday', 'int'), GETPOST('datesubyear', 'int'));
$accountline->dateo = dol_mktime(GETPOST('datesubhour', 'int'), GETPOST('datesubmin', 'int'), 0, GETPOST('datesubmonth', 'int'), GETPOST('datesubday', 'int'), GETPOST('datesubyear', 'int'));
$accountline->datev = $newdatestart;
$accountline->dateo = $newdatestart;
$accountline->amount = $amount;
$result = $accountline->update($user);
if ($result < 0) {
$errmsg = $accountline->error;
@ -106,8 +110,8 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'update' &&
if (!$errmsg) {
// Modify values
$object->dateh = dol_mktime(GETPOST('datesubhour', 'int'), GETPOST('datesubmin', 'int'), 0, GETPOST('datesubmonth', 'int'), GETPOST('datesubday', 'int'), GETPOST('datesubyear', 'int'));
$object->datef = dol_mktime(GETPOST('datesubendhour', 'int'), GETPOST('datesubendmin', 'int'), 0, GETPOST('datesubendmonth', 'int'), GETPOST('datesubendday', 'int'), GETPOST('datesubendyear', 'int'));
$object->dateh = $newdatestart;
$object->datef = $newdateend;
$object->fk_type = $typeid;
$object->note_public = $note;
$object->note_private = $note;
@ -335,7 +339,7 @@ if ($rowid && $action != 'edit') {
// Bank line
if (isModEnabled("banque") && (getDolGlobalString('ADHERENT_BANK_USE') || $object->fk_bank)) {
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
if ($object->fk_bank) {
if ($object->fk_bank > 0) {
$bankline = new AccountLine($db);
$result = $bankline->fetch($object->fk_bank);
print $bankline->getNomUrl(1, 0, 'showall');
@ -358,8 +362,8 @@ if ($rowid && $action != 'edit') {
print '<div class="tabsAction">';
if ($user->hasRight('adherent', 'cotisation', 'creer')) {
if (!empty($bankline->rappro) || empty($bankline)) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify")."</a></div>";
if (empty($bankline->rappro) || empty($bankline)) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".((int) $object->id).'&action=edit&token='.newToken().'">'.$langs->trans("Modify")."</a></div>";
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.$langs->trans("BankLineConciliated").'" href="#">'.$langs->trans("Modify")."</a></div>";
}

View file

@ -2092,7 +2092,7 @@ class AccountLine extends CommonObjectLine
$this->fk_user_rappro = $obj->fk_user_rappro;
$this->fk_type = $obj->fk_type; // Type of transaction
$this->rappro = $obj->rappro;
$this->rappro = (int) $obj->rappro;
$this->num_releve = $obj->num_releve;
$this->num_chq = $obj->num_chq;

View file

@ -244,3 +244,4 @@ MemberCodeDesc=Member Code, unique for all members
NoRecordedMembers=No recorded members
MemberSubscriptionStartFirstDayOf=The start date of a membership corresponds to the first day of a
MemberSubscriptionStartAfter=Minimum period before the entry into force of the start date of a subscription except renewals (example +3m = +3 months, -5d = -5 days, +1Y = +1 year)
SubscriptionLinkedToConciliatedTransaction=Membership is linked to a conciliated transaction so this modification is not allowed.