Debug v16

This commit is contained in:
Laurent Destailleur 2022-07-26 11:53:00 +02:00
parent d65ea8c333
commit 3eedf18344
10 changed files with 60 additions and 58 deletions

View File

@ -2390,7 +2390,7 @@ class AccountLine extends CommonObject
$result = '';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Transaction").'</u>:<br>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("BankTransactionLine").'</u>:<br>';
$label .= '<b>'.$langs->trans("Ref").':</b> '.$this->ref;
$linkstart = '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.((int) $this->id).'&save_lastsearch_values=1" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';

View File

@ -606,45 +606,20 @@ class PaymentVarious extends CommonObject
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
if ($mode == 0) {
return $langs->trans($this->statuts[$status]);
} elseif ($mode == 1) {
return $langs->trans($this->statuts_short[$status]);
} elseif ($mode == 2) {
if ($status == 0) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]);
} elseif ($status == 1) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
} elseif ($status == 2) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
}
} elseif ($mode == 3) {
if ($status == 0 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
} elseif ($mode == 4) {
if ($status == 0 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
}
} elseif ($mode == 5) {
if ($status == 0 && !empty($this->statuts_short[$status])) {
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
global $langs;
//$langs->load("mymodule@mymodule");
/*$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
$this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
$this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');*/
}
$statusType = 'status'.$status;
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
}

View File

@ -584,6 +584,8 @@ if ($id) {
$morehtmlref .= '</div>';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlright = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
print '<div class="fichecenter">';
@ -613,7 +615,7 @@ if ($id) {
}
print '<tr><td>'.$langs->trans("Sens").'</td><td>'.$sens.'</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span></td></tr>';
// Accountancy code
print '<tr><td class="nowrap">';

View File

@ -537,6 +537,8 @@ if ($resql) {
$totalarray = array();
$totalarray['nbfield'] = 0;
$totalarray['val']['total_cred'] = 0;
$totalarray['val']['total_deb'] = 0;
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);

View File

@ -667,3 +667,5 @@ ALTER TABLE llx_cronjob DROP INDEX uk_cronjob;
ALTER TABLE llx_cronjob ADD UNIQUE INDEX uk_cronjob (label, entity);
ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0;
ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, datep);

View File

@ -0,0 +1,20 @@
-- ===================================================================
-- Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- ===================================================================
ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, datep);

View File

@ -23,7 +23,7 @@ create table llx_loan_schedule
fk_loan integer,
datec datetime, -- creation date
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
datep datetime, -- payment date expected
amount_capital double(24,8) DEFAULT 0,
amount_insurance double(24,8) DEFAULT 0,
amount_interest double(24,8) DEFAULT 0,

View File

@ -293,6 +293,7 @@ if ($action == 'create') {
print '</tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td colspan="2">';
print img_picto('', 'money-bill-alt', 'class="pictofixedwidth"');
$form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype", 'alphanohtml') : $loan->fk_typepayment, "paymenttype");
print "</td>\n";
print '</tr>';
@ -300,10 +301,11 @@ if ($action == 'create') {
print '<tr>';
print '<td class="fieldrequired">'.$langs->trans('AccountToDebit').'</td>';
print '<td colspan="2">';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid", 'int') : $loan->accountid, "accountid", 0, 'courant = '.Account::TYPE_CURRENT, 1); // Show opend bank account list
print '</td></tr>';
// Number
// Number
print '<tr><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print '</td>';

View File

@ -234,17 +234,16 @@ if (count($echeances->lines) > 0) {
print '<input type="hidden" name="action" value="createecheancier">';
}
//print_fiche_titre($langs->trans("FinancialCommitment"));
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="border centpercent">';
print '<tr class="liste_titre">';
$colspan = 6;
if (count($echeances->lines) > 0) {
$colspan++;
}
print '<th class="center" colspan="'.$colspan.'">';
print $langs->trans("FinancialCommitment");
print '</th>';
print '</tr>';
print '<tr class="liste_titre">';
print '<th class="center">'.$langs->trans("Term").'</th>';
@ -276,10 +275,10 @@ if ($object->nbterm > 0 && count($echeances->lines) == 0) {
print '<tr>';
print '<td class="center" id="n'.$i.'">'.$i.'</td>';
print '<td class="center" id ="date'.$i.'"><input type="hidden" name="hi_date'.$i.'" id ="hi_date'.$i.'" value="'.dol_time_plus_duree($object->datestart, $i - 1, 'm').'">'.dol_print_date(dol_time_plus_duree($object->datestart, $i - 1, 'm'), 'day').'</td>';
print '<td class="center" id="insurance'.$i.'">'.price($insurance + (($i == 1) ? $regulInsurance : 0), 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="hi_insurance'.$i.'" id ="hi_insurance'.$i.'" value="'.($insurance + (($i == 1) ? $regulInsurance : 0)).'">';
print '<td class="center" id="interets'.$i.'">'.price($int, 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="hi_interets'.$i.'" id ="hi_interets'.$i.'" value="'.$int.'">';
print '<td class="center"><input name="mens'.$i.'" id="mens'.$i.'" size="5" value="'.$mens.'" ech="'.$i.'"></td>';
print '<td class="center" id="capital'.$i.'">'.price($cap_rest).'</td><input type="hidden" name="hi_capital'.$i.'" id ="hi_capital'.$i.'" value="'.$cap_rest.'">';
print '<td class="center amount" id="insurance'.$i.'">'.price($insurance + (($i == 1) ? $regulInsurance : 0), 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="hi_insurance'.$i.'" id ="hi_insurance'.$i.'" value="'.($insurance + (($i == 1) ? $regulInsurance : 0)).'">';
print '<td class="center amount" id="interets'.$i.'">'.price($int, 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="hi_interets'.$i.'" id ="hi_interets'.$i.'" value="'.$int.'">';
print '<td class="center"><input class="width75 right" name="mens'.$i.'" id="mens'.$i.'" value="'.$mens.'" ech="'.$i.'"></td>';
print '<td class="center amount" id="capital'.$i.'">'.price($cap_rest).'</td><input type="hidden" name="hi_capital'.$i.'" id ="hi_capital'.$i.'" value="'.$cap_rest.'">';
print '</tr>'."\n";
$i++;
$capital = $cap_rest;
@ -300,15 +299,15 @@ if ($object->nbterm > 0 && count($echeances->lines) == 0) {
print '<tr>';
print '<td class="center" id="n'.$i.'"><input type="hidden" name="hi_rowid'.$i.'" id ="hi_rowid'.$i.'" value="'.$line->id.'">'.$i.'</td>';
print '<td class="center" id ="date'.$i.'"><input type="hidden" name="hi_date'.$i.'" id ="hi_date'.$i.'" value="'.$line->datep.'">'.dol_print_date($line->datep, 'day').'</td>';
print '<td class="center" id="insurance'.$i.'">'.price($insu, 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="hi_insurance'.$i.'" id ="hi_insurance'.$i.'" value="'.$insu.'">';
print '<td class="center" id="interets'.$i.'">'.price($int, 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="hi_interets'.$i.'" id ="hi_interets'.$i.'" value="'.$int.'">';
print '<td class="center amount" id="insurance'.$i.'">'.price($insu, 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="hi_insurance'.$i.'" id ="hi_insurance'.$i.'" value="'.$insu.'">';
print '<td class="center amount" id="interets'.$i.'">'.price($int, 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="hi_interets'.$i.'" id ="hi_interets'.$i.'" value="'.$int.'">';
if (empty($line->fk_bank)) {
print '<td class="center"><input name="mens'.$i.'" id="mens'.$i.'" size="5" value="'.$mens.'" ech="'.$i.'"></td>';
print '<td class="center"><input class="right width75" name="mens'.$i.'" id="mens'.$i.'" value="'.$mens.'" ech="'.$i.'"></td>';
} else {
print '<td class="center">'.price($mens, 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="mens'.$i.'" id ="mens'.$i.'" value="'.$mens.'">';
print '<td class="center amount">'.price($mens, 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="mens'.$i.'" id ="mens'.$i.'" value="'.$mens.'">';
}
print '<td class="center" id="capital'.$i.'">'.price($cap_rest, 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="hi_capital'.$i.'" id ="hi_capital'.$i.'" value="'.$cap_rest.'">';
print '<td class="center amount" id="capital'.$i.'">'.price($cap_rest, 0, '', 1, -1, -1, $conf->currency).'</td><input type="hidden" name="hi_capital'.$i.'" id ="hi_capital'.$i.'" value="'.$cap_rest.'">';
print '<td class="center">';
if (!empty($line->fk_bank)) {
print $langs->trans('Paid');
@ -316,7 +315,7 @@ if ($object->nbterm > 0 && count($echeances->lines) == 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$line->fk_payment_loan.'">('.img_object($langs->trans("Payment"), "payment").' '.$line->fk_payment_loan.')</a>';
}
} elseif (!$printed) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/loan/payment/payment.php?id='.$object->id.'&amp;action=create">'.$langs->trans('DoPayment').'</a>';
print '<a class="butAction smallpaddingimp" href="'.DOL_URL_ROOT.'/loan/payment/payment.php?id='.$object->id.'&action=create">'.$langs->trans('DoPayment').'</a>';
$printed = true;
}
print '</td>';

View File

@ -1294,7 +1294,7 @@ class Project extends CommonObject
$result .= $linkstart;
if ($withpicto) {
$result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip pictofixedwidth"'), 0, 0, $notooltip ? 0 : 1);
$result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip pictofixedwidth em088"'), 0, 0, $notooltip ? 0 : 1);
}
if ($withpicto != 2) {
$result .= $this->ref;