diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index c8278f38c88..dc87fd800ba 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -333,7 +333,6 @@ class Account extends CommonObject public function __toString() { $string = ''; - foreach ($this->getFieldsToShow() as $val) { if ($val == 'BankCode') { $string .= $this->code_banque.' '; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 7cbe336e126..ba6cc96e3dd 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; if (!$user->rights->facture->lire) accessforbidden(); @@ -44,6 +45,8 @@ $ref = GETPOST('ref', 'alpha'); $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'alpha'); +$type = GETPOST('type', 'aZ09'); + $fieldid = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid); @@ -379,7 +382,13 @@ if ($object->id > 0) print ''; print ''.$langs->trans("RIB").''; - print $object->thirdparty->display_rib(); + + $bac = new CompanyBankAccount($db); + $bac->fetch(0, $object->thirdparty->id); + + print $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic; + if ($bac->verif() <= 0) print img_warning('Error on default bank number for IBAN : '.$bac->error_message); + print ''; print ''; @@ -475,7 +484,11 @@ if ($object->id > 0) $sql .= " , pfd.date_traite as date_traite"; $sql .= " , pfd.amount"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - $sql .= " WHERE fk_facture = ".$object->id; + if ($type == 'bank-transfer') { + $sql .= " WHERE fk_facture_fourn = ".$object->id; + } else { + $sql .= " WHERE fk_facture = ".$object->id; + } $sql .= " AND pfd.traite = 0"; $sql .= " ORDER BY pfd.date_demande DESC"; @@ -488,11 +501,15 @@ if ($object->id > 0) dol_print_error($db); } - // For wich amount ? + // For which amount ? $sql = "SELECT SUM(pfd.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - $sql .= " WHERE fk_facture = ".$object->id; + if ($type == 'bank-transfer') { + $sql .= " WHERE fk_facture_fourn = ".$object->id; + } else { + $sql .= " WHERE fk_facture = ".$object->id; + } $sql .= " AND pfd.traite = 0"; $result_sql = $db->query($sql); @@ -521,10 +538,11 @@ if ($object->id > 0) $remaintopaylesspendingdebit = $resteapayer - $pending; print '
'; + print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print '
'; } else { @@ -564,13 +582,17 @@ if ($object->id > 0) print ' '; print ''; - $sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande"; - $sql .= " , pfd.date_traite as date_traite, pfd.amount,"; + $sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,"; + $sql .= " pfd.date_traite as date_traite, pfd.amount,"; $sql .= " u.rowid as user_id, u.lastname, u.firstname, u.login"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on pfd.fk_user_demande = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons"; - $sql .= " WHERE fk_facture = ".$object->id; + if ($type == 'bank-transfer') { + $sql .= " WHERE fk_facture_fourn = ".$object->id; + } else { + $sql .= " WHERE fk_facture = ".$object->id; + } $sql .= " AND pfd.traite = 0"; $sql .= " ORDER BY pfd.date_demande DESC"; @@ -618,7 +640,11 @@ if ($object->id > 0) $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on pfd.fk_user_demande = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons"; - $sql .= " WHERE fk_facture = ".$object->id; + if ($type == 'bank-transfer') { + $sql .= " WHERE fk_facture_fourn = ".$object->id; + } else { + $sql .= " WHERE fk_facture = ".$object->id; + } $sql .= " AND pfd.traite = 1"; $sql .= " ORDER BY pfd.date_demande DESC"; diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index a8c14cbc124..608c9fe594d 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -174,35 +174,40 @@ if ($result) $directdebitorder = new BonPrelevement($db); - while ($i < min($num, $limit)) - { - $obj = $db->fetch_object($result); + if ($num) { + while ($i < min($num, $limit)) + { + $obj = $db->fetch_object($result); - $directdebitorder->id = $obj->rowid; - $directdebitorder->ref = $obj->ref; - $directdebitorder->datec = $obj->datec; - $directdebitorder->amount = $obj->amount; - $directdebitorder->statut = $obj->statut; + $directdebitorder->id = $obj->rowid; + $directdebitorder->ref = $obj->ref; + $directdebitorder->datec = $obj->datec; + $directdebitorder->amount = $obj->amount; + $directdebitorder->statut = $obj->statut; - print ''; + print ''; - print ''; - print $directdebitorder->getNomUrl(1); - print "\n"; + print ''; + print $directdebitorder->getNomUrl(1); + print "\n"; - print ''.dol_print_date($db->jdate($obj->datec), 'day')."\n"; + print ''.dol_print_date($db->jdate($obj->datec), 'day')."\n"; - print ''.price($obj->amount)."\n"; + print ''.price($obj->amount)."\n"; - print ''; - print $bon->LibStatut($obj->statut, 3); - print ''; + print ''; + print $bon->LibStatut($obj->statut, 3); + print ''; - print ''."\n"; + print ''."\n"; - print "\n"; - $i++; + print "\n"; + $i++; + } + } else { + print ''.$langs->trans("None").''; } + print ""; print ''; diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 3a6fed68113..7b6a9089368 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -292,7 +292,7 @@ if ($id > 0 || $ref) print $form->selectDate('', '', '', '', '', "infocredit", 1, 1); print ''; print ''; - print '
'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice"); + print '
'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice").'
'; print '
'; print ''; print '
'; @@ -405,13 +405,30 @@ if ($id > 0 || $ref) print ''.price($obj->amount)."\n"; - print ''; + print ''; if ($obj->statut == 3) { print ''.$langs->trans("StatusRefused").''; } else { - print " "; + if ($object->statut == BonPrelevement::STATUS_CREDITED) + { + if ($obj->statut == 2) { + if ($user->rights->prelevement->bons->credit) + { + //print ''.$langs->trans("StandingOrderReject").''; + print ''.$langs->trans("StandingOrderReject").''; + } + else + { + //print ''.$langs->trans("StandingOrderReject").''; + } + } + } + else + { + //print ''.$langs->trans("StandingOrderReject").''; + } } print ''; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 98e7a06e0da..06f3448cd39 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -276,7 +276,7 @@ class BonPrelevement extends CommonObject $sql .= ", p.method_trans, p.fk_user_trans"; $sql .= ", p.date_credit as date_credit"; $sql .= ", p.fk_user_credit"; - $sql .= ", p.statut"; + $sql .= ", p.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " WHERE p.entity IN (".getEntity('invoice').")"; if ($rowid > 0) $sql .= " AND p.rowid = ".$rowid; @@ -303,7 +303,8 @@ class BonPrelevement extends CommonObject $this->date_credit = $this->db->jdate($obj->date_credit); $this->user_credit = $obj->fk_user_credit; - $this->statut = $obj->statut; + $this->status = $obj->status; + $this->statut = $obj->status; // For backward compatibility $this->fetched = 1; diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 1e731b24524..78e364c1abc 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -66,14 +66,14 @@ class LignePrelevement /** * Recupere l'objet prelevement * - * @param int $rowid id de la facture a recuperer - * @return integer + * @param int $rowid Id de la facture a recuperer + * @return integer <0 if KO, >=0 if OK */ public function fetch($rowid) { global $conf; - $result = 0; + $error = 0; $sql = "SELECT pl.rowid, pl.amount, p.ref, p.rowid as bon_rowid"; $sql .= ", pl.statut, pl.fk_soc"; @@ -97,18 +97,18 @@ class LignePrelevement $this->bon_ref = $obj->ref; $this->bon_rowid = $obj->bon_rowid; } else { - $result++; + $error++; dol_syslog("LignePrelevement::Fetch rowid=$rowid numrows=0"); } $this->db->free($resql); } else { - $result++; + $error++; dol_syslog("LignePrelevement::Fetch rowid=$rowid"); dol_syslog($this->db->error()); } - return $result; + return $error; } /** diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 6c4a54f0768..b52a657ae3f 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -96,6 +96,9 @@ if (empty($reshook)) } } else { setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); + + header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id); + exit; } } } @@ -138,8 +141,8 @@ print load_fiche_titre($title); dol_fiche_head(); -$nb = $bprev->NbFactureAPrelever(); -$pricetowithdraw = $bprev->SommeAPrelever(); +$nb = $bprev->nbOfInvoiceToPay($type); +$pricetowithdraw = $bprev->SommeAPrelever($type); if ($nb < 0) { dol_print_error($bprev->error); @@ -175,17 +178,32 @@ if ($nb) { if ($pricetowithdraw) { print $langs->trans('ExecutionDate').' '; print $form->selectDate(); + if ($mysoc->isInEEC()) { + $title = $langs->trans("CreateForSepa"); + print ''; - print ''; + print ''; } else { - print ''.$langs->trans("CreateAll")."\n"; + $title = $langs->trans("CreateAll"); + if ($type == 'bank-transfer') { + $title = $langs->trans("CreateFileForPaymentByBankTransfer"); + } + print ''.$title."\n"; } } else { if ($mysoc->isInEEC()) { - print ''.$langs->trans("CreateForSepaFRST")."\n"; - print ''.$langs->trans("CreateForSepaRCUR")."\n"; + $title = $langs->trans("CreateForSepaFRST"); + if ($type == 'bank-transfer') { + $title = $langs->trans("CreateSepaFileForPaymentByBankTransfer"); + } + print ''.$title."\n"; + + if ($type != 'bank-transfer') { + $title = $langs->trans("CreateForSepaRCUR"); + print ''.$title."\n"; + } } else { $title = $langs->trans("CreateAll"); if ($type == 'bank-transfer') { @@ -195,7 +213,13 @@ if ($nb) { } } } else { - print 'transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."\n"; + $titlefortab = $langs->transnoentitiesnoconv("StandingOrders"); + $title = $langs->trans("CreateAll"); + if ($type == 'bank-transfer') { + $titlefortab = $langs->transnoentitiesnoconv("PaymentByBankTransfers"); + $title = $langs->trans("CreateFileForPaymentByBankTransfer"); + } + print ''.$title."\n"; } print "\n"; @@ -227,9 +251,9 @@ if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) $sql .= " AND f.total_ttc > 0"; $sql .= " AND pfd.traite = 0"; if ($type == 'bank-transfer') { - $sql .= " AND pfd.fk_facture = f.rowid"; -} else { $sql .= " AND pfd.fk_facture_fourn = f.rowid"; +} else { + $sql .= " AND pfd.fk_facture = f.rowid"; } if ($socid > 0) $sql .= " AND f.fk_soc = ".$socid; @@ -290,23 +314,29 @@ if ($resql) { $obj = $db->fetch_object($resql); + $bac->fetch(0, $obj->socid); + print ''; + + // Ref invoice print ''; $invoicestatic->id = $obj->rowid; $invoicestatic->ref = $obj->ref; print $invoicestatic->getNomUrl(1, 'withdraw'); print ''; + // Thirdparty print ''; $thirdpartystatic->fetch($obj->socid); print $thirdpartystatic->getNomUrl(1, 'ban'); print ''; + // RIB print ''; - print $thirdpartystatic->display_rib(); - $bac->fetch(0, $obj->socid); + print $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic; if ($bac->verif() <= 0) print img_warning('Error on default bank number for IBAN : '.$bac->error_message); print ''; + // RUM print ''; print $thirdpartystatic->display_rib('rum'); diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 309a739a697..3bbc5c8b2bc 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -197,14 +197,14 @@ print ''; print ''; print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]); print_liste_field_titre("Company", $_SERVER["PHP_SELF"]); -print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'class="right"'); -print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'class="center"'); +print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'right '); +print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center '); print_liste_field_titre(''); print ''; print ''; -print ''; -print ''; +print ''; +print ''; print ''; print ''; // Action column diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index b9cd1232690..452e1bf8be7 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -38,7 +38,7 @@ $langs->loadLangs(array('banks', 'categories', 'companies', 'withdrawals', 'bill if ($user->socid > 0) accessforbidden(); // Get supervariables -$prev_id = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $socid = GETPOST('socid', 'int'); $ref = GETPOST('ref', 'alpha'); @@ -68,9 +68,9 @@ $thirdpartytmp = new Societe($db); llxHeader('', $langs->trans("WithdrawalsReceipts")); -if ($prev_id > 0 || $ref) +if ($id > 0 || $ref) { - if ($object->fetch($prev_id, $ref) >= 0) + if ($object->fetch($id, $ref) >= 0) { $head = prelevement_prepare_head($object); dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); @@ -181,7 +181,7 @@ if ($result) $num = $db->num_rows($result); $i = 0; - $param = "&id=".$prev_id; + $param = "&id=".$id; // Lines of title fields print ''; @@ -193,7 +193,7 @@ if ($result) print ''; print ''; print ''; - print ''; + print ''; $massactionbutton = ''; diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 52e62f51006..ae146522f39 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -118,11 +118,18 @@ if ($action == 'confirm_rejet') $invoicestatic = new Facture($db); -llxHeader('', $langs->trans("StandingOrder")); +$title = $langs->trans("WithdrawalsLine"); +if ($type == 'bank-transfer') { + $title = $langs->trans("CreditTransferLine"); +} + +llxHeader('', $title); + +$head = array(); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id; -$head[$h][1] = $langs->trans("StandingOrder"); +$head[$h][1] = $title; $hselected = $h; $h++; @@ -130,20 +137,24 @@ if ($id) { $lipre = new LignePrelevement($db); - if ($lipre->fetch($id) == 0) + if ($lipre->fetch($id) >= 0) { $bon = new BonPrelevement($db); $bon->fetch($lipre->bon_rowid); - dol_fiche_head($head, $hselected, $langs->trans("StandingOrder")); + dol_fiche_head($head, $hselected, $title); - print '
'; + print '
'; - print ''; + + print ''; - print ''; - print ''; - print ''; + + print ''; + print ''; + print ''; if ($lipre->statut == 3) { @@ -151,8 +162,8 @@ if ($id) $resf = $rej->fetch($lipre->id); if ($resf == 0) { - print ''; - print ''; + print ''; - print ''; + print ''; } else { - print ''; + print ''; } } @@ -185,7 +196,7 @@ if ($id) print ''; print ''; print ''; - print '
'.$langs->trans("WithdrawalsReceipts").''; + print '
'.$langs->trans("Ref").''; + print $id.'
'.$langs->trans("WithdrawalsReceipts").''; print $bon->getNomUrl(1).'
'.$langs->trans("Date").''.dol_print_date($bon->datec, 'day').'
'.$langs->trans("Amount").''.price($lipre->amount).'
'.$langs->trans("Status").''.$lipre->LibStatut($lipre->statut, 1).'
'.$langs->trans("Date").''.dol_print_date($bon->datec, 'day').'
'.$langs->trans("Amount").''.price($lipre->amount).'
'.$langs->trans("Status").''.$lipre->LibStatut($lipre->statut, 1).'
'.$langs->trans("RefusedReason").''.$rej->motif.'
'.$langs->trans("RefusedData").''; + print '
'.$langs->trans("RefusedReason").''.$rej->motif.'
'.$langs->trans("RefusedData").''; if ($rej->date_rejet == 0) { /* Historique pour certaines install */ @@ -161,9 +172,9 @@ if ($id) print dol_print_date($rej->date_rejet, 'day'); } print '
'.$langs->trans("RefusedInvoicing").''.$rej->invoicing.'
'.$langs->trans("RefusedInvoicing").''.$rej->invoicing.'
'.$resf.'
'.$resf.'
'; + print '
'; print ''; print ''; @@ -205,13 +216,13 @@ if ($id) //Reason print ''; print ''; //Facturer print ''; print ''; print '
'.$langs->trans("WithdrawalRefused").'
'.$langs->trans("RefusedReason").''; - print $form->selectarray("motif", $rej->motifs); + print $form->selectarray("motif", $rej->motifs, GETPOSTISSET('motif') ? GETPOST('motif', 'int') : ''); print '
'.$langs->trans("RefusedInvoicing").''; - print $form->selectarray("facturer", $rej->facturer); + print $form->selectarray("facturer", $rej->facturer, GETPOSTISSET('facturer') ? GETPOST('facturer', 'int') : ''); print '

'; @@ -230,16 +241,18 @@ if ($id) if ($action == '') { - if ($bon->statut == 2 && $lipre->statut == 2) + if ($bon->statut == BonPrelevement::STATUS_CREDITED) { - if ($user->rights->prelevement->bons->credit) - { - print "id\">".$langs->trans("StandingOrderReject").""; - } else { - print "trans("NotAllowed")."\">".$langs->trans("StandingOrderReject").""; + if ($lipre->statut == 2) { + if ($user->rights->prelevement->bons->credit) + { + print ''.$langs->trans("StandingOrderReject").''; + } else { + print ''.$langs->trans("StandingOrderReject").''; + } } } else { - print "trans("NotPossibleForThisStatusOfWithdrawReceiptORLine")."\">".$langs->trans("StandingOrderReject").""; + print ''.$langs->trans("StandingOrderReject").''; } } diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index dab050e3eaa..2666e8587e6 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -21,7 +21,7 @@ /** * \file htdocs/compta/prelevement/list.php * \ingroup prelevement - * \brief Page liste des prelevements + * \brief Page list of direct debit orders or credit transfers orders */ require '../../main.inc.php'; @@ -96,23 +96,35 @@ $form = new Form($db); llxHeader('', $langs->trans("WithdrawalsLines")); $sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec"; -$sql .= " ,f.rowid as facid, f.ref as invoiceref, f.total_ttc"; +$sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc"; $sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.email"; $sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; -$sql .= " , ".MAIN_DB_PREFIX."facture as f"; +if ($type == 'bank-transfer') { + $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; +} else { + $sql .= " , ".MAIN_DB_PREFIX."facture as f"; +} $sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE pl.fk_prelevement_bons = p.rowid"; $sql .= " AND pf.fk_prelevement_lignes = pl.rowid"; -$sql .= " AND pf.fk_facture = f.rowid"; +if ($type == 'bank-transfer') { + $sql .= " AND pf.fk_facture_fourn = f.rowid"; +} else { + $sql .= " AND pf.fk_facture = f.rowid"; +} $sql .= " AND f.fk_soc = s.rowid"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; if ($socid) $sql .= " AND s.rowid = ".$socid; if ($search_line) $sql .= " AND pl.rowid = '".$db->escape($search_line)."'"; if ($search_bon) $sql .= natural_search("p.ref", $search_bon); -if ($search_code) $sql .= natural_search("s.code_client", $search_code); +if ($type == 'bank-transfer') { + if ($search_code) $sql .= natural_search("s.code_fourn", $search_code); +} else { + if ($search_code) $sql .= natural_search("s.code_client", $search_code); +} if ($search_company) $sql .= natural_search("s.nom", $search_company); $sql .= $db->order($sortfield, $sortorder); @@ -152,7 +164,11 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 0, 0, 1); + $title = $langs->trans("WithdrawalsLines"); + if ($type == 'bank-transfer') { + $title = $langs->trans("CreditTransferLines"); + } + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 0, 0, 1); $moreforfilter = ''; @@ -173,9 +189,14 @@ if ($result) print ''; print ''; + $columntitle= "WithdrawalsReceipts"; + if ($type == 'bank-transfer') { + $columntitle= "BankTransferReceipts"; + } + print ''; + print_liste_field_titre($columntitle, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); - print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder); print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", '', $param, '', $sortfield, $sortorder, 'center '); @@ -184,53 +205,58 @@ if ($result) print_liste_field_titre(''); print "\n"; - while ($i < min($num, $limit)) - { - $obj = $db->fetch_object($result); + if ($num) { + while ($i < min($num, $limit)) + { + $obj = $db->fetch_object($result); - $bon->ref = $obj->ref; - $bon->statut = $obj->status; + $bon->id = $obj->rowid; + $bon->ref = $obj->ref; + $bon->statut = $obj->status; - $company->id = $obj->socid; - $company->name = $obj->name; - $company->email = $obj->email; - $company->code_client = $obj->code_client; + $company->id = $obj->socid; + $company->name = $obj->name; + $company->email = $obj->email; + $company->code_client = $obj->code_client; - print ''; + print ''; - print ''; - print $line->LibStatut($obj->statut_ligne, 2); - print " "; - print ''; - print substr('000000'.$obj->rowid_ligne, -6); - print ''; + print ''; + print $bon->getNomUrl(1); + print "\n"; - print ''; - print $bon->getNomUrl(1); - print "\n"; + print ''; + print $line->LibStatut($obj->statut_ligne, 2); + print " "; + print ''; + print substr('000000'.$obj->rowid_ligne, -6); + print ''; - print ''; - print ''; - print img_object($langs->trans("ShowBill"), "bill"); - print ' '.$obj->invoiceref."\n"; - print ''; - print ''; + print ''; + print ''; + print img_object($langs->trans("ShowBill"), "bill"); + print ' '.$obj->invoiceref."\n"; + print ''; + print ''; - print ''; - print $company->getNomUrl(1); - print "\n"; + print ''; + print $company->getNomUrl(1); + print "\n"; - print ''.$obj->code_client."\n"; + print ''.$obj->code_client."\n"; - print ''.dol_print_date($db->jdate($obj->datec), 'day')."\n"; + print ''.dol_print_date($db->jdate($obj->datec), 'day')."\n"; - print ''.price($obj->amount)."\n"; + print ''.price($obj->amount)."\n"; - print ' '; + print ' '; - print "\n"; - $i++; - } + print "\n"; + $i++; + } + } else { + print ''.$langs->trans("None").''; + } print ""; print ''; diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 5701bb6cd1c..a8481d25f7a 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -55,7 +55,12 @@ $pagenext = $page + 1; * View */ -llxHeader('', $langs->trans("WithdrawsRefused")); +$title = $langs->trans("WithdrawsRefused"); +if ($type == 'bank-transfer') { + $title = $langs->trans("CreditTransfersRefused"); +} + +llxHeader('', $title); if ($sortorder == "") $sortorder = "DESC"; if ($sortfield == "") $sortfield = "p.datec"; @@ -80,9 +85,14 @@ $sql .= " WHERE pr.fk_prelevement_lignes = pl.rowid"; $sql .= " AND pl.fk_prelevement_bons = p.rowid"; $sql .= " AND pl.fk_soc = s.rowid"; $sql .= " AND p.entity = ".$conf->entity; +if ($type == 'bank-transfer') { + $sql .= " AND p.type = 'bank-transfer'"; +} else { + $sql .= " AND p.type = 'debit-order'"; +} if ($socid) $sql .= " AND s.rowid = ".$socid; -$sql .= " ".$db->order($sortfield, $sortorder); -$sql .= " ".$db->plimit($conf->liste_limit + 1, $offset); +$sql .= $db->order($sortfield, $sortorder); +$sql .= $db->plimit($limit + 1, $offset); $result = $db->query($sql); if ($result) @@ -90,33 +100,39 @@ if ($result) $num = $db->num_rows($result); $i = 0; - print_barre_liste($langs->trans("WithdrawsRefused"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num); + $param = ''; + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); print"\n\n"; print ''; print ''; - print_liste_field_titre("Line", $_SERVER["PHP_SELF"], "p.ref", '', $urladd); - print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $urladd); - print_liste_field_titre("Reason", $_SERVER["PHP_SELF"], "pr.motif", "", $urladd); + print_liste_field_titre("Line", $_SERVER["PHP_SELF"], "p.ref", '', $param); + print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $param); + print_liste_field_titre("Reason", $_SERVER["PHP_SELF"], "pr.motif", "", $param); print "\n"; - $total = 0; + if ($num) { + while ($i < min($num, $limit)) + { + $obj = $db->fetch_object($result); - while ($i < min($num, $conf->liste_limit)) - { - $obj = $db->fetch_object($result); + print ''; - print '"; - print substr('000000'.$obj->rowid, -6).""; + print '\n"; - print '\n"; + print ''; - print ''; - print "\n"; + print "\n"; - $i++; + $i++; + } + } else { + print ''; } print "
'; - print $line->LibStatut($obj->statut, 2).' '; - print ''; + print ''; + print $line->LibStatut($obj->statut, 2).' '; + print ''; + print substr('000000'.$obj->rowid, -6)."'.$obj->nom."'.stripslashes($obj->nom)."'.$rej->motifs[$obj->motif].''.$rej->motifs[$obj->motif].'
'.$langs->trans("None").'
"; diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index a113766bbd0..1d6e1c2a183 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -43,15 +43,25 @@ $type = GETPOST('type', 'aZ09'); * View */ -llxHeader('', $langs->trans("WithdrawStatistics")); +$title = $langs->trans("WithdrawStatistics"); +if ($type == 'bank-transfer') { + $title = $langs->trans("CreditTransferStatistics"); +} -print load_fiche_titre($langs->trans("Statistics")); +llxHeader('', $title); + +print load_fiche_titre($title); // Define total and nbtotal $sql = "SELECT sum(pl.amount), count(pl.amount)"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; $sql .= " WHERE pl.fk_prelevement_bons = pb.rowid"; +if ($type == 'bank-transfer') { + $sql .= " AND pb.type = 'bank-transfer'"; +} else { + $sql .= " AND pb.type = 'debit-order'"; +} $sql .= " AND pb.entity = ".$conf->entity; $resql = $db->query($sql); if ($resql) @@ -73,7 +83,7 @@ if ($resql) */ print '
'; -print load_fiche_titre($langs->trans("WithdrawStatistics"), '', ''); +print load_fiche_titre($langs->trans("ByStatus"), '', ''); $ligne = new LignePrelevement($db); @@ -82,6 +92,11 @@ $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; $sql .= " WHERE pl.fk_prelevement_bons = pb.rowid"; $sql .= " AND pb.entity = ".$conf->entity; +if ($type == 'bank-transfer') { + $sql .= " AND pb.type = 'bank-transfer'"; +} else { + $sql .= " AND pb.type = 'debit-order'"; +} $sql .= " GROUP BY pl.statut"; $resql = $db->query($sql); @@ -137,7 +152,7 @@ if ($resql) */ print '
'; -print load_fiche_titre($langs->trans("WithdrawRejectStatistics"), '', ''); +print load_fiche_titre($langs->trans("Rejects"), '', ''); // Define total and nbtotal @@ -147,6 +162,11 @@ $sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; $sql .= " WHERE pl.fk_prelevement_bons = pb.rowid"; $sql .= " AND pb.entity = ".$conf->entity; $sql .= " AND pl.statut = 3"; +if ($type == 'bank-transfer') { + $sql .= " AND pb.type = 'bank-transfer'"; +} else { + $sql .= " AND pb.type = 'debit-order'"; +} $resql = $db->query($sql); if ($resql) { @@ -164,6 +184,7 @@ if ($resql) /* * Stats sur les rejets */ + $sql = "SELECT sum(pl.amount), count(pl.amount) as cc, pr.motif"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; @@ -172,6 +193,11 @@ $sql .= " WHERE pl.fk_prelevement_bons = pb.rowid"; $sql .= " AND pb.entity = ".$conf->entity; $sql .= " AND pl.statut = 3"; $sql .= " AND pr.fk_prelevement_lignes = pl.rowid"; +if ($type == 'bank-transfer') { + $sql .= " AND pb.type = 'bank-transfer'"; +} else { + $sql .= " AND pb.type = 'debit-order'"; +} $sql .= " GROUP BY pr.motif"; $sql .= " ORDER BY cc DESC"; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 83e3c5d1f4f..5ce798c0867 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3043,7 +3043,12 @@ abstract class CommonObject //print 'Line '.$i.' rowid='.$obj->rowid.' vat_rate='.$obj->vatrate.' total_ht='.$obj->total_ht.' total_tva='.$obj->total_tva.' total_ttc='.$obj->total_ttc.' total_ht_by_vats='.$total_ht_by_vats[$obj->vatrate].' total_tva_by_vats='.$total_tva_by_vats[$obj->vatrate].' (new calculation = '.$tmpvat.') total_ttc_by_vats='.$total_ttc_by_vats[$obj->vatrate].($diff?" => DIFF":"")."
\n"; if ($diff) { - if (abs($diff) > 0.1) { dol_syslog('A rounding difference was detected into TOTAL but is too high to be corrected', LOG_WARNING); exit; } + if (abs($diff) > 0.1) { + $errmsg = 'A rounding difference was detected into TOTAL but is too high to be corrected. Some data in your line may be corrupted. Try to edit each line manually.'; + dol_syslog($errmsg, LOG_WARNING); + dol_print_error('', $errmsg); + exit; + } $sqlfix = "UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".($obj->total_tva - $diff).", total_ttc = ".($obj->total_ttc - $diff)." WHERE rowid = ".$obj->rowid; dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix); $resqlfix = $this->db->query($sqlfix); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index b5cf64229bd..94a357f353a 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1037,3 +1037,5 @@ DeleteFileText=Do you really want delete this file? ShowOtherLanguages=Show other languages SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language NotUsedForThisCustomer=Not used for this customer +AmountMustBePositive=Amount must be positive +ByStatus=By status \ No newline at end of file diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index e145647baa4..1a35eda4b9c 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -265,3 +265,4 @@ NewInvoice=New invoice OneLinePerTask=One line per task OneLinePerPeriod=One line per period RefTaskParent=Ref. Parent Task +ProfitIsCalculatedWith=Profit is calculated using \ No newline at end of file diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 9ec13c20c4a..73e1433acc0 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -130,6 +130,7 @@ WarehouseForStockDecrease=The warehouse %s will be used for stock decreas WarehouseForStockIncrease=The warehouse %s will be used for stock increase ForThisWarehouse=For this warehouse ReplenishmentStatusDesc=This is a list of all products with a stock lower than desired stock (or lower than alert value if checkbox "alert only" is checked). Using the checkbox, you can create purchase orders to fill the difference. +ReplenishmentStatusDescPerWarehouse=If you want a replenishment based on desired quantity defined per warehouse, you must add a filter on the warehouse. ReplenishmentOrdersDesc=This is a list of all open purchase orders including predefined products. Only open orders with predefined products, so orders that may affect stocks, are visible here. Replenishments=Replenishments NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 6109f3ca879..04338f38e6e 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -16,6 +16,7 @@ WEBSITE_ROBOT=Robot file (robots.txt) WEBSITE_HTACCESS=Website .htaccess file WEBSITE_MANIFEST_JSON=Website manifest.json file WEBSITE_README=README.md file +WEBSITE_KEYWORDSDesc=Use a comma to separate values EnterHereLicenseInformation=Enter here meta data or license information to fille a README.md file. if you distribute your website as a template, the file will be included into the temptate package. HtmlHeaderPage=HTML header (specific to this page only) PageNameAliasHelp=Name or alias of the page.
This alias is also used to forge a SEO URL when website is ran from a Virtual host of a Web server (like Apacke, Nginx, ...). Use the button "%s" to edit this alias. diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index a7a55c69c53..5217d54d39a 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -1,6 +1,6 @@ # Dolibarr language file - Source file is en_US - withdrawals -CustomersStandingOrdersArea=Direct debit payment orders area -SuppliersStandingOrdersArea=Direct credit payment orders area +CustomersStandingOrdersArea=Payments by Direct debit orders +SuppliersStandingOrdersArea=Payments by Credit transfer StandingOrdersPayment=Direct debit payment orders StandingOrderPayment=Direct debit payment order NewStandingOrder=New direct debit order @@ -10,26 +10,34 @@ PaymentByBankTransferReceipts=Credit transfer orders PaymentByBankTransferLines=Credit transfer order lines WithdrawalsReceipts=Direct debit orders WithdrawalReceipt=Direct debit order +BankTransferReceipts=Credit transfer receipts +BankTransferReceipt=Credit transfer receipt LatestBankTransferReceipts=Latest %s credit transfer orders LastWithdrawalReceipts=Latest %s direct debit files +WithdrawalsLine=Direct debit order line +CreditTransferLine=Credit transfer line WithdrawalsLines=Direct debit order lines -RequestStandingOrderToTreat=Request for direct debit payment order to process -RequestStandingOrderTreated=Request for direct debit payment order processed +CreditTransferLines=Credit transfer lines +RequestStandingOrderToTreat=Requests for direct debit payment order to process +RequestStandingOrderTreated=Requests for direct debit payment order processed +RequestPaymentsByBankTransferToTreat=Requests for credit transfer to process +RequestPaymentsByBankTransferTreated=Requests for credit transfer processed NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines. NbOfInvoiceToWithdraw=No. of qualified customer invoices with waiting direct debit order NbOfInvoiceToWithdrawWithInfo=No. of customer invoice with direct debit payment orders having defined bank account information NbOfInvoiceToPayByBankTransfer=No. of qualified supplier invoices waiting for a payment by credit transfer SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by credit transfer InvoiceWaitingWithdraw=Invoice waiting for direct debit +InvoiceWaitingPaymentByBankTransfer=Invoice waiting for credit transfer AmountToWithdraw=Amount to withdraw -WithdrawsRefused=Direct debit refused -NoInvoiceToWithdraw=No customer invoice with open 'Direct debit requests' is waiting. Go on tab '%s' on invoice card to make a request. +NoInvoiceToWithdraw=No invoice open for '%s' is waiting. Go on tab '%s' on invoice card to make a request. NoSupplierInvoiceToWithdraw=No supplier invoice with open 'Direct credit requests' is waiting. Go on tab '%s' on invoice card to make a request. ResponsibleUser=User Responsible WithdrawalsSetup=Direct debit payment setup CreditTransferSetup=Crebit transfer setup WithdrawStatistics=Direct debit payment statistics -WithdrawRejectStatistics=Direct debit payment reject statistics +CreditTransferStatistics=Credit transfer statistics +Rejects=Rejects LastWithdrawalReceipt=Latest %s direct debit receipts MakeWithdrawRequest=Make a direct debit payment request WithdrawRequestsDone=%s direct debit payment requests recorded @@ -42,7 +50,9 @@ TransMetod=Transmission method Send=Send Lines=Lines StandingOrderReject=Issue a rejection +WithdrawsRefused=Direct debit refused WithdrawalRefused=Withdrawal refused +CreditTransfersRefused=Credit transfers refused WithdrawalRefusedConfirm=Are you sure you want to enter a withdrawal rejection for society RefusedData=Date of rejection RefusedReason=Reason for rejection @@ -66,6 +76,8 @@ StatusMotif8=Other reason CreateForSepaFRST=Create direct debit file (SEPA FRST) CreateForSepaRCUR=Create direct debit file (SEPA RCUR) CreateAll=Create direct debit file (all) +CreateFileForPaymentByBankTransfer=Create credit transfer (all) +CreateSepaFileForPaymentByBankTransfer=Create credit transfer file (SEPA) CreateGuichet=Only office CreateBanque=Only bank OrderWaiting=Waiting for treatment @@ -83,7 +95,7 @@ IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Direct Debit orders to manage the direct debit payment order. When payment order is closed, payment on invoice will be automatically recorded, and invoice closed if remainder to pay is null. WithdrawalFile=Withdrawal file SetToStatusSent=Set to status "File Sent" -ThisWillAlsoAddPaymentOnInvoice=This will also record payments to invoices and will classify them as "Paid" if remain to pay is null +ThisWillAlsoAddPaymentOnInvoice=This will also record payments on invoices and will classify them as "Paid" if remain to pay is null StatisticsByLineStatus=Statistics by status of lines RUM=UMR DateRUM=Mandate signature date diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index b52162e08f3..b7ab9edbf06 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -876,6 +876,7 @@ if (!$variants) { print "\n".''; print ''; print ''; + print ''; print ''; print ''; print '
'; @@ -943,6 +944,7 @@ if (!$variants) { if (!empty($user->rights->produit->creer)) { print ''; + print ''; print ''; print ''; } diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index bd8045d0b5d..c12add256c3 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -99,6 +99,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + /* * Actions */ @@ -107,7 +108,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' { $sref = ''; $snom = ''; - $sal = ''; + $sall = ''; $salert = ''; $draftorder = ''; } @@ -299,7 +300,6 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre $sqlalertstock = 'p.seuil_stock_alerte'; } - $sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price,'; $sql .= ' p.price_ttc, p.price_base_type,p.fk_product_type,'; $sql .= ' p.tms as datem, p.duration, p.tobuy,'; @@ -489,6 +489,9 @@ print load_fiche_titre($langs->trans('Replenishment'), '', 'stock'); dol_fiche_head($head, 'replenish', '', -1, ''); print ''.$langs->trans("ReplenishmentStatusDesc").'
'."\n"; +if (empty($fk_warhouse) && !empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) { + print ''.$langs->trans("ReplenishmentStatusDescPerWarehouse").''."
\n"; +} if ($usevirtualstock == 1) { print $langs->trans("CurentSelectionMode").': '; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 84612ef76ce..a785316e204 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -526,7 +526,7 @@ $listofreferent = array( */ ); -// Change rules for benefit calculation +// Change rules for profit/benefit calculation if (! empty($conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN)) { foreach ($listofreferent as $key => $element) { if ($listofreferent[$key]['margin'] == 'add') { @@ -623,7 +623,28 @@ print load_fiche_titre($langs->trans("Profit"), '', 'title_accountancy'); print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -639,7 +660,7 @@ foreach ($listofreferent as $key => $value) $qualified = $value['test']; $margin = $value['margin']; $project_field = $value['project_field']; - if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'plus') + if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'add') { $element = new $classname($db); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 4a50e29d0fb..1388319868a 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1601,6 +1601,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) // Show fields of bank account foreach ($companybankaccount->getFieldsToShow(1) as $val) { $require = false; + $tooltip = ''; if ($val == 'BankCode') { $name = 'code_banque'; $size = 8; @@ -1622,14 +1623,22 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) $size = 30; $content = $companybankaccount->iban; if ($companybankaccount->needIBAN()) $require = true; + $tooltip = $langs->trans("Example").':
LT12 1000 0111 0100 1000
FR14 2004 1010 0505 0001 3M02 606
LU28 0019 4006 4475 0000
DE89 3704 0044 0532 0130 00'; } elseif ($val == 'BIC') { $name = 'bic'; $size = 12; $content = $companybankaccount->bic; if ($companybankaccount->needIBAN()) $require = true; + $tooltip = $langs->trans("Example").': LIABLT2XXXX'; } - print ''.$langs->trans($val).''; + print ''; + if ($tooltip) { + print $form->textwithpicto($langs->trans($val), $tooltip, 4, 'help', '', 0, 3, $name); + } else { + print $langs->trans($val); + } + print ''; print ''; print ''; } diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index 227134bc785..3665f43d9c4 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -209,11 +209,9 @@ a.top-menu-dropdown-link { } .dropdown-menu > .user-header{ - background: rgb(); + background: var(--colorbackhmenu1); } - - .dropdown-menu .dropdown-header{ padding: 8px 8px 8px 8px; } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index bb4cd84ada1..6e3a582f7c6 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3362,8 +3362,10 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''; print ''; + // Keywords print '';
'.$langs->trans("Element").''; +$tooltiponprofit = $langs->trans("ProfitIsCalculatedWith")."
\n"; +$tooltiponprofitplus = $tooltiponprofitminus = ''; +foreach($listofreferent as $key => $value) +{ + $name = $langs->trans($value['name']); + $qualified = $value['test']; + $margin = $value['margin']; + if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'add') + { + if ($margin == 'add') { + $tooltiponprofitplus.=' + '.$name."
\n"; + } + if ($margin == 'minus') { + $tooltiponprofitminus.=' - '.$name."
\n"; + } + } +} +$tooltiponprofit .= $tooltiponprofitplus; +$tooltiponprofit .= $tooltiponprofitminus; +print $form->textwithpicto($langs->trans("Element"), $tooltiponprofit); +print '
'.$langs->trans("Number").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").'
'; - print $langs->trans('WEBSITE_KEYWORDS'); + $htmlhelp = $langs->trans("WEBSITE_KEYWORDSDesc"); + print $form->textwithpicto($langs->trans('WEBSITE_KEYWORDS'), $htmlhelp, 1, 'help', '', 0, 2, 'keywordtooltip'); print ''; print ''; print '