From c50e288a075106ea2156a3e559e8ba89f5b5217f Mon Sep 17 00:00:00 2001 From: Givriz Date: Wed, 14 Oct 2020 18:26:05 +0200 Subject: [PATCH 1/9] Correction de commentaires MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correction de commentaires (passage de français à anglais ou correction d'un mauvais anglais). --- htdocs/comm/mailing/card.php | 60 +++++++++++++------------- htdocs/compta/paiement.php | 8 ++-- htdocs/compta/paiement/card.php | 6 +-- htdocs/compta/paiement/cheque/card.php | 14 +++--- htdocs/compta/paiement_charge.php | 8 ++-- htdocs/compta/payment_sc/card.php | 4 +- 6 files changed, 50 insertions(+), 50 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 02d779e5525..4fe46859dc7 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -135,7 +135,7 @@ if (empty($reshook)) $from = $object->email_from; $replyto = $object->email_replyto; $errorsto = $object->email_errorsto; - // Le message est-il en html + // Is the message in html $msgishtml = -1; // Unknown by default if (preg_match('/[\s\t]*/i', $message)) $msgishtml = 1; @@ -144,8 +144,8 @@ if (empty($reshook)) $nbok = 0; $nbko = 0; - // On choisit les mails non deja envoyes pour ce mailing (statut=0) - // ou envoyes en erreur (statut=-1) + // We choose mails not already sent for this mailing (statut=0) + // or sent in error (statut=-1) $sql = "SELECT mc.rowid, mc.fk_mailing, mc.lastname, mc.firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id; @@ -155,7 +155,7 @@ if (empty($reshook)) $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); // nb of possible recipients + $num = $db->num_rows($resql); // Number of possible recipients if ($num) { @@ -163,7 +163,7 @@ if (empty($reshook)) $now = dol_now(); - // Positionne date debut envoi + // Positioning date of start sending $sql = "UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi='".$db->idate($now)."' WHERE rowid=".$object->id; $resql2 = $db->query($sql); if (!$resql2) @@ -273,7 +273,7 @@ if (empty($reshook)) } } - // Fabrication du mail + // Mail making $trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid; $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, '', 'emailing'); @@ -408,15 +408,15 @@ if (empty($reshook)) if (!$error) { - // Le message est-il en html - $msgishtml = -1; // Inconnu par defaut + // Is the message in html + $msgishtml = -1; // Unknow by default if (preg_match('/[\s\t]*/i', $object->body)) $msgishtml = 1; // other are set at begin of page $object->substitutionarrayfortest['__EMAIL__'] = $object->sendto; $object->substitutionarrayfortest['__MAILTOEMAIL__'] = ''.$object->sendto.''; - // Pratique les substitutions sur le sujet et message + // Subject and message substitutions complete_substitutions_array($object->substitutionarrayfortest, $langs); $tmpsujet = make_substitutions($object->sujet, $object->substitutionarrayfortest); $tmpbody = make_substitutions($object->body, $object->substitutionarrayfortest); @@ -426,7 +426,7 @@ if (empty($reshook)) $arr_name = array(); $arr_css = array(); - // Ajout CSS + // Add CSS if (!empty($object->bgcolor)) $arr_css['bgcolor'] = (preg_match('/^#/', $object->bgcolor) ? '' : '#').$object->bgcolor; if (!empty($object->bgimage)) $arr_css['bgimage'] = $object->bgimage; @@ -540,7 +540,7 @@ if (empty($reshook)) $action = "edit"; } - // Action remove file + // Action of file remove if (!empty($_POST["removedfile"])) { $upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing'); @@ -552,7 +552,7 @@ if (empty($reshook)) $action = "edit"; } - // Action update emailing + // Action of emailing update if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"])) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -592,7 +592,7 @@ if (empty($reshook)) } } - // Action confirmation validation + // Action of validation confirmation if ($action == 'confirm_valid' && $confirm == 'yes') { if ($object->id > 0) @@ -606,7 +606,7 @@ if (empty($reshook)) } } - // Action confirmation validation + // Action of validation confirmation if ($action == 'confirm_settodraft' && $confirm == 'yes') { if ($object->id > 0) @@ -652,7 +652,7 @@ if (empty($reshook)) } } - // Action confirmation suppression + // Action of delete confirmation if ($action == 'confirm_delete' && $confirm == 'yes') { if ($object->delete($object->id)) @@ -736,7 +736,7 @@ if ($action == 'create') print ''; print '
'; - // Editeur wysiwyg + // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtml'), '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%'); $doleditor->Create(); @@ -759,7 +759,7 @@ if ($action == 'create') { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("SetToDraft"), $langs->trans("ConfirmUnvalidateEmailing"), "confirm_settodraft", '', '', 1); } - // Confirmation validation of mailing + // Confirmation of mailing validation if ($action == 'valid') { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("ValidMailing"), $langs->trans("ConfirmValidMailing"), "confirm_valid", '', '', 1); @@ -779,7 +779,7 @@ if ($action == 'create') dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); /* - * Mailing en mode visu + * View mode mailing */ if ($action == 'sendall') { @@ -883,7 +883,7 @@ if ($action == 'create') } print ''; - // Nb of distinct emails + // Number of distinct emails print ''; print $langs->trans("TotalNbOfDistinctRecipients"); print ''; @@ -929,12 +929,12 @@ if ($action == 'create') array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContent"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_receivers', 'label' => $langs->trans("CloneReceivers"), 'value' => 0) ); - // Paiement incomplet. On demande si motif = escompte ou autre + // Incomplete payment. On demande si motif = escompte ou autre print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneEMailing', $object->ref), 'confirm_clone', $formquestion, 'yes', 2, 240); } /* - * Boutons d'action + * Actions Buttons */ if (GETPOST('cancel', 'alpha') || $confirm == 'no' || $action == '' || in_array($action, array('settodraft', 'valid', 'delete', 'sendall', 'clone', 'test'))) @@ -1021,7 +1021,7 @@ if ($action == 'create') print '
'; } - // Affichage formulaire de TEST + // Display of the TEST form if ($action == 'test') { print '
'; @@ -1029,7 +1029,7 @@ if ($action == 'create') dol_fiche_head(null, '', '', -1); - // Create l'objet formulaire mail + // Create mail form object include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $formmail->fromname = $object->email_from; @@ -1046,9 +1046,9 @@ if ($action == 'create') $formmail->withbodyreadonly = 1; $formmail->withcancel = 1; $formmail->withdeliveryreceipt = 0; - // Tableau des substitutions + // Table of substitutions $formmail->substit = $object->substitutionarrayfortest; - // Tableau des parametres complementaires du post + // Table of post's complementary params $formmail->param["action"] = "send"; $formmail->param["models"] = 'none'; $formmail->param["mailid"] = $object->id; @@ -1109,7 +1109,7 @@ if ($action == 'create') if (empty($object->bgcolor) || strtolower($object->bgcolor) == 'ffffff') // CKEditor does not apply the color of the div into its content area { $readonly = 1; - // Editeur wysiwyg + // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', false, true, empty($conf->global->FCKEDITOR_ENABLE_MAILING) ? 0 : 1, 20, '90%', $readonly); $doleditor->Create(); @@ -1119,7 +1119,7 @@ if ($action == 'create') dol_fiche_end(); } else { /* - * Mailing en mode edition (CKeditor or HTML source) + * Edition mode mailing (CKeditor or HTML source) */ dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); @@ -1150,7 +1150,7 @@ if ($action == 'create') // To print ''.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1).''; - // Nb of distinct emails + // Number of distinct emails print ''; print $langs->trans("TotalNbOfDistinctRecipients"); print ''; @@ -1267,14 +1267,14 @@ if ($action == 'create') if ($action == 'edit') { - // Editeur wysiwyg + // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%'); $doleditor->Create(); } if ($action == 'edithtml') { - // Editor HTML source + // HTML source editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, true, 'ace', 20, '90%'); $doleditor->Create(0, '', false, 'HTML Source', 'php'); diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 9d86cff65dd..efe102c48b2 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -207,7 +207,7 @@ if (empty($reshook)) { $action = 'create'; } - // Le reste propre a cette action s'affiche en bas de page. + // The next of this action is displayed at the page's bottom. } /* @@ -249,7 +249,7 @@ if (empty($reshook)) if (!empty($conf->banque->enabled)) { - // Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement + // If the bank module is active, an account is required to input a payment if (GETPOST('accountid', 'int') <= 0) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); @@ -503,7 +503,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print "\n"; - // Cheque number + // Bank check number print ''.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; print ''; @@ -793,7 +793,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } - // Bouton Enregistrer + // Save button if ($action != 'add_paiement') { $checkboxlabel = $langs->trans("ClosePaidInvoicesAutomatically"); diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index dd7651a6147..c6789aacfad 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -179,13 +179,13 @@ $head = payment_prepare_head($object); dol_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), -1, 'payment'); -// Confirmation de la suppression du paiement +// Confirmation of payment delete if ($action == 'delete') { print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete', '', 0, 2); } -// Confirmation de la validation du paiement +// Confirmation of payment validation if ($action == 'valide') { $facid = $_GET['facid']; @@ -408,7 +408,7 @@ if ($resql) /* - * Boutons Actions + * Actions Buttons */ print '
'; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 71cd900f915..b4927ae4503 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -312,7 +312,7 @@ if ($action == 'new') dol_fiche_head($head, $hselected, $langs->trans("Cheques"), -1, 'payment'); /* - * Confirmation de la suppression du bordereau + * Confirmation of slip's delete */ if ($action == 'delete') { @@ -320,7 +320,7 @@ if ($action == 'new') } /* - * Confirmation de la validation du bordereau + * Confirmation of slip's validation */ if ($action == 'valide') { @@ -595,7 +595,7 @@ if ($action == 'new') print $accountstatic->getNomUrl(1); print ''; - // Nb of cheques + // Number of bank checks print ''.$langs->trans('NbOfCheques').''; print $object->nbcheque; print ''; @@ -613,7 +613,7 @@ if ($action == 'new') print '
'; - // List of cheques + // List of bank checks $sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,"; $sql .= " b.dateo as date, b.datec as datec, b.banque,"; $sql .= " p.rowid as pid, ba.rowid as bid, p.statut"; @@ -654,7 +654,7 @@ if ($action == 'new') { print ''; print ''.$i.''; - print ''.dol_print_date($db->jdate($objp->date), 'day').''; // Date operation + print ''.dol_print_date($db->jdate($objp->date), 'day').''; // Operation date print ''.($objp->num_chq ? $objp->num_chq : ' ').''; print ''.dol_trunc($objp->emetteur, 24).''; print ''.dol_trunc($objp->banque, 24).''; @@ -707,7 +707,7 @@ if ($action == 'new') print ""; - // Cheque denormalized data nbcheque is similar to real number of cheque + // Cheque denormalized data nbcheque is similar to real number of bank check if ($num > 0 && $i < ($object->nbcheque + 1)) { // Show warning that some records were removed. $langs->load("errors"); @@ -727,7 +727,7 @@ if ($action == 'new') /* - * Boutons Actions + * Actions Buttons */ print '
'; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 5f442ab0b18..706151c5b81 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -109,7 +109,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y $paiement = new PaymentSocialContribution($db); $paiement->chid = $chid; $paiement->datepaye = $datepaye; - $paiement->amounts = $amounts; // Tableau de montant + $paiement->amounts = $amounts; // Amount list $paiement->paiementtype = GETPOST("paiementtype", 'alphanohtml'); $paiement->num_payment = GETPOST("num_payment", 'alphanohtml'); $paiement->note = GETPOST("note", 'restricthtml'); @@ -160,7 +160,7 @@ llxHeader(); $form = new Form($db); -// Formulaire de creation d'un paiement de charge +// Form of charge payment creation if ($action == 'create') { $charge->fetch($chid); @@ -255,7 +255,7 @@ if ($action == 'create') dol_fiche_end(); /* - * Autres charges impayees + * Other unpaid charges */ $num = 1; $i = 0; @@ -327,7 +327,7 @@ if ($action == 'create') print ""; - // Bouton Save payment + // Save payment button print '
'.$langs->trans("ClosePaidContributionsAutomatically"); print '
'; print '     '; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 0e71c83f6cb..adab68a157f 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -184,7 +184,7 @@ print ''.$langs->trans('Mode').''.$langs->trans("Pa // Numero print ''.$langs->trans('Numero').''.$object->num_payment.''; -// Montant +// Amount print ''.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).''; // Note @@ -288,7 +288,7 @@ if ($resql) /* - * Boutons Actions + * Actions Buttons */ print '
'; From 20aee01fd8e4c50d46a5c97d232f018af889db24 Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Thu, 15 Oct 2020 11:14:20 +0200 Subject: [PATCH 2/9] FIX : Use table_element instead of element --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 55a2fc58d6b..d926e6105a1 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1748,7 +1748,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo if (is_object($object) && $object->id > 0) { $ecmfile->src_object_id = $object->id; - $ecmfile->src_object_type = $object->element; + $ecmfile->src_object_type = $object->table_element; } if ($setsharekey) From a0d1e96bfde65d10742bdca67dafb7466d86cbd8 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 15 Oct 2020 11:37:44 +0200 Subject: [PATCH 3/9] fix table creation for intracom and change reserved name column name --- htdocs/core/lib/intracommreport.lib.php | 4 +++- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 4 ++-- htdocs/install/mysql/tables/llx_intracommreport.sql | 2 +- htdocs/intracommreport/admin/intracommreport.php | 6 +++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/intracommreport.lib.php b/htdocs/core/lib/intracommreport.lib.php index 425e53f3bcf..ce63b320983 100644 --- a/htdocs/core/lib/intracommreport.lib.php +++ b/htdocs/core/lib/intracommreport.lib.php @@ -54,9 +54,11 @@ function intracommReportAdminPrepareHead() /** * Prepare array with list of tabs * + * @param Object $object Object related to tabs + * * @return array Array of tabs to show */ -function intracommReportPrepareHead() +function intracommReportPrepareHead($object) { global $langs, $conf; diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 43868da4a1b..55cf12dc909 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -134,12 +134,12 @@ CREATE TABLE llx_intracommreport ref varchar(30) NOT NULL, -- report reference number entity integer DEFAULT 1 NOT NULL, -- multi company id type_declaration varchar(32), - period varchar(32), + periods varchar(32), mode varchar(32), content_xml text, type_export varchar(10), datec datetime, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP )ENGINE=innodb; ALTER TABLE llx_c_incoterms ADD COLUMN label varchar(100) NULL; diff --git a/htdocs/install/mysql/tables/llx_intracommreport.sql b/htdocs/install/mysql/tables/llx_intracommreport.sql index a09396920c7..9d89320c1fa 100644 --- a/htdocs/install/mysql/tables/llx_intracommreport.sql +++ b/htdocs/install/mysql/tables/llx_intracommreport.sql @@ -24,7 +24,7 @@ create table llx_intracommreport ref varchar(30) NOT NULL, -- report reference number entity integer DEFAULT 1 NOT NULL, -- multi company id type_declaration varchar(32), - period varchar(32), + periods varchar(32), mode varchar(32), content_xml text, type_export varchar(10), diff --git a/htdocs/intracommreport/admin/intracommreport.php b/htdocs/intracommreport/admin/intracommreport.php index c2209614a15..0560809e5a9 100644 --- a/htdocs/intracommreport/admin/intracommreport.php +++ b/htdocs/intracommreport/admin/intracommreport.php @@ -96,13 +96,13 @@ print load_fiche_titre($langs->trans("IntracommReportSetup"), $linkback, 'title_ $head = intracommReportAdminPrepareHead(); -dol_fiche_head($head, 'general', $langs->trans("IntracommReport"), -1, "intracommreport"); +print dol_get_fiche_head($head, 'general', $langs->trans("IntracommReport"), -1, "intracommreport"); print '
'; print ''; print ''; -print_fiche_titre($langs->trans("Parameters").' (DEB)'); +print load_fiche_titre($langs->trans("Parameters").' (DEB)'); print ''; print ''; @@ -168,7 +168,7 @@ print "\n"; print '
'; -print_fiche_titre($langs->trans("Parameters").' (DES)'); +print load_fiche_titre($langs->trans("Parameters").' (DES)'); print ''; print ''; From 0cb04d14d7f4ad23a630e73bfd570bd219131bd5 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 15 Oct 2020 12:20:37 +0200 Subject: [PATCH 4/9] NEW: Thirdparty module : box on customer/supplier tab for outsantding amount late --- htdocs/comm/card.php | 22 +++++++++++++++++++++- htdocs/fourn/card.php | 15 +++++++++++++++ htdocs/langs/en_US/companies.lang | 3 ++- htdocs/societe/class/societe.class.php | 6 +++++- 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 8dabe102066..cdef197cc77 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -639,10 +639,11 @@ if ($object->id > 0) if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { // Box factures - $tmp = $object->getOutstandingBills(); + $tmp = $object->getOutstandingBills('customer',0); $outstandingOpened = $tmp['opened']; $outstandingTotal = $tmp['total_ht']; $outstandingTotalIncTax = $tmp['total_ttc']; + $text = $langs->trans("OverAllInvoices"); $link = DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id; $icon = 'bill'; @@ -668,6 +669,25 @@ if ($object->id > 0) $boxstat .= ''.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.''; $boxstat .= ''; if ($link) $boxstat .= ''; + + $tmp = $object->getOutstandingBills('customer',1); + $outstandingOpenedLate = $tmp['opened']; + if ($outstandingOpened != $outstandingOpenedLate && !empty($outstandingOpenedLate)) { + $warn = ''; + if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingOpenedLate) { + $warn = ' ' . img_warning($langs->trans("OutstandingBillReached")); + } + $text = $langs->trans("CurrentOutstandingBillLate"); + $link = DOL_URL_ROOT . '/compta/recap-compta.php?socid=' . $object->id; + $icon = 'bill'; + if ($link) $boxstat .= ''; + $boxstat .= '
'; + $boxstat .= '' . img_object("", $icon) . ' ' . $text . '
'; + $boxstat .= ''.price($outstandingOpenedLate, 1, $langs, 1, -1, -1, $conf->currency) . $warn . ''; + $boxstat .= '
'; + if ($link) $boxstat .= '
'; + } + } $parameters = array(); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 9aeef877bab..37a2115e62f 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -417,6 +417,21 @@ if ($object->id > 0) $boxstat .= ''.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.''; $boxstat .= ''; if ($link) $boxstat .= ''; + + $tmp = $object->getOutstandingBills('supplier',1); + $outstandingOpenedLate = $tmp['opened']; + if ($outstandingOpened != $outstandingOpenedLate && !empty($outstandingOpenedLate)) { + $text = $langs->trans("CurrentOutstandingBillLate"); + $link = DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id; + $icon = 'bill'; + if ($link) $boxstat .= ''; + $boxstat .= '
'; + $boxstat .= '' . img_object("", $icon) . ' ' . $text . '
'; + $boxstat .= ''.price($outstandingOpenedLate, 1, $langs, 1, -1, -1, $conf->currency) . $warn . ''; + $boxstat .= '
'; + if ($link) $boxstat .= '
'; + } + } $boxstat .= '
'; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 4145d7184c5..98dc451b5bb 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -459,4 +459,5 @@ MulticurrencyUsed=Use Multicurrency MulticurrencyCurrency=Currency InEEC=Europe (EEC) RestOfEurope=Rest of Europe (EEC) -OutOfEurope=Out of Europe (EEC) \ No newline at end of file +OutOfEurope=Out of Europe (EEC) +CurrentOutstandingBillLate=Current outstanding bill late diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index fee36c3ff1b..5efabc066e4 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4092,9 +4092,10 @@ class Societe extends CommonObject * Return amount of bill not paid and total * * @param string $mode 'customer' or 'supplier' + * @param int $late 0 => all invoice, 1=> only late * @return array array('opened'=>Amount, 'total'=>Total amount) */ - public function getOutstandingBills($mode = 'customer') + public function getOutstandingBills($mode = 'customer', $late = 0) { $table = 'facture'; if ($mode == 'supplier') $table = 'facture_fourn'; @@ -4109,6 +4110,9 @@ class Societe extends CommonObject if ($mode == 'supplier') $sql = "SELECT rowid, total_ht as total_ht, total_ttc, paye, type, fk_statut as status, close_code FROM ".MAIN_DB_PREFIX.$table." as f"; else $sql = "SELECT rowid, total as total_ht, total_ttc, paye, fk_statut as status, close_code FROM ".MAIN_DB_PREFIX.$table." as f"; $sql .= " WHERE fk_soc = ".$this->id; + if (!empty($late)) { + $sql .= " AND date_lim_reglement < '".$this->db->idate(dol_now())."'"; + } if ($mode == 'supplier') { $sql .= " AND entity IN (".getEntity('facture_fourn').")"; } else { From cd5201e40a4022963d1cd5c413b9f6b0c4c78eb6 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 15 Oct 2020 10:24:00 +0000 Subject: [PATCH 5/9] Fixing style errors. --- htdocs/comm/card.php | 5 ++--- htdocs/fourn/card.php | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index cdef197cc77..3b0781a9e8a 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -639,7 +639,7 @@ if ($object->id > 0) if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { // Box factures - $tmp = $object->getOutstandingBills('customer',0); + $tmp = $object->getOutstandingBills('customer', 0); $outstandingOpened = $tmp['opened']; $outstandingTotal = $tmp['total_ht']; $outstandingTotalIncTax = $tmp['total_ttc']; @@ -670,7 +670,7 @@ if ($object->id > 0) $boxstat .= ''; if ($link) $boxstat .= ''; - $tmp = $object->getOutstandingBills('customer',1); + $tmp = $object->getOutstandingBills('customer', 1); $outstandingOpenedLate = $tmp['opened']; if ($outstandingOpened != $outstandingOpenedLate && !empty($outstandingOpenedLate)) { $warn = ''; @@ -687,7 +687,6 @@ if ($object->id > 0) $boxstat .= ''; if ($link) $boxstat .= ''; } - } $parameters = array(); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 37a2115e62f..1ad41c08da0 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -418,7 +418,7 @@ if ($object->id > 0) $boxstat .= ''; if ($link) $boxstat .= ''; - $tmp = $object->getOutstandingBills('supplier',1); + $tmp = $object->getOutstandingBills('supplier', 1); $outstandingOpenedLate = $tmp['opened']; if ($outstandingOpened != $outstandingOpenedLate && !empty($outstandingOpenedLate)) { $text = $langs->trans("CurrentOutstandingBillLate"); @@ -431,7 +431,6 @@ if ($object->id > 0) $boxstat .= ''; if ($link) $boxstat .= ''; } - } $boxstat .= ''; From 4727aee211f7227ab8abcba6c5c0c51c41d40549 Mon Sep 17 00:00:00 2001 From: Gustavo Novaro Date: Thu, 15 Oct 2020 13:44:54 +0200 Subject: [PATCH 6/9] Improve README.md adding 2 more shields - Add minimum php version - Latest release --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 648d5ef003d..919fc62ae5b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg) ![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) +[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg?style=flat-square)](https://php.net/) +[![GitHub release](https://img.shields.io/github/v/release/Dolibarr/dolibarr)](https://github.com/Dolibarr/dolibarr) Dolibarr ERP & CRM is a modern software package that helps manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). From 15dfcdb8e3e5f20468ca5dd3eb86b3db415799da Mon Sep 17 00:00:00 2001 From: jasson99 Date: Thu, 15 Oct 2020 17:22:47 +0545 Subject: [PATCH 7/9] window-size is kept fixed for acceptance tests run --- nightwatch.conf.js | 4 ++-- test/acceptance/setup.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nightwatch.conf.js b/nightwatch.conf.js index 24dfe971e32..eca78329a5a 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -18,9 +18,9 @@ module.exports = { browserName : 'chrome', javascriptEnabled : true, chromeOptions : { - args : ['disable-gpu'], + args : ['disable-gpu', 'window-size=1280,1024'], w3c : false - } + }, } } } diff --git a/test/acceptance/setup.js b/test/acceptance/setup.js index eeed97b3466..123d6b3c5ec 100644 --- a/test/acceptance/setup.js +++ b/test/acceptance/setup.js @@ -30,7 +30,7 @@ Before(async function getDolApiKey() { const params = new URLSearchParams() params.set('login', adminUsername) params.set('password', adminPassword) - const apiKey = `http://localhost/dolibarr/htdocs/api/index.php/login?${params.toString()}`; + const apiKey = client.globals.backend_url + `api/index.php/login?${params.toString()}`; header['Accept'] = 'application/json' await fetch(apiKey, { method: 'GET', @@ -74,4 +74,4 @@ After(async () => { }); } } -}); \ No newline at end of file +}); From 741700db7afc5a45073ef1bcabe33ef6511ff676 Mon Sep 17 00:00:00 2001 From: jasson99 Date: Thu, 15 Oct 2020 19:29:19 +0545 Subject: [PATCH 8/9] admin login stepdefinition moved from addUsersContext file to loginContext file --- nightwatch.conf.js | 2 +- test/acceptance/pageObjects/loginPage.js | 3 ++- test/acceptance/stepDefinitions/addUsersContext.js | 8 +------- test/acceptance/stepDefinitions/loginContext.js | 6 ++++++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/nightwatch.conf.js b/nightwatch.conf.js index eca78329a5a..e72febea918 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -20,7 +20,7 @@ module.exports = { chromeOptions : { args : ['disable-gpu', 'window-size=1280,1024'], w3c : false - }, + } } } } diff --git a/test/acceptance/pageObjects/loginPage.js b/test/acceptance/pageObjects/loginPage.js index 75195cc3746..b95fd1645ab 100644 --- a/test/acceptance/pageObjects/loginPage.js +++ b/test/acceptance/pageObjects/loginPage.js @@ -26,7 +26,8 @@ module.exports = { }, userIsLoggedIn: async function (login) { - await this.useXpath() + await this.waitForElementNotPresent('@loginTable') + .useXpath() .waitForElementVisible('@userLogin') .expect.element('@userLogin') .text.to.equal(login); diff --git a/test/acceptance/stepDefinitions/addUsersContext.js b/test/acceptance/stepDefinitions/addUsersContext.js index 385f731b8f7..076c5d24226 100644 --- a/test/acceptance/stepDefinitions/addUsersContext.js +++ b/test/acceptance/stepDefinitions/addUsersContext.js @@ -5,12 +5,6 @@ const assert = require('assert'); let response; let Login = {}; -Given('the administrator has logged in using the webUI', async function () { - await client.page.loginPage().navigate().waitForLoginPage(); - await client.page.loginPage().userLogsInWithUsernameAndPassword(client.globals.adminUsername, client.globals.adminPassword); - return client.page.loginPage().userIsLoggedIn(client.globals.adminUsername); -}); - Given('the administrator has browsed to the new users page', function () { return client.page.homePage().browsedToNewUserPage(); }); @@ -153,4 +147,4 @@ const getResponseMessage = async function (expectedResponseMessage) { const actualResponseMessage = json_response['error']['0']; return assert.strictEqual(actualResponseMessage, expectedResponseMessage, `the expected response message was ${expectedResponseMessage} but got ${actualResponseMessage}`); -}; \ No newline at end of file +}; diff --git a/test/acceptance/stepDefinitions/loginContext.js b/test/acceptance/stepDefinitions/loginContext.js index 428fd7b5dc7..ea9aa07949b 100644 --- a/test/acceptance/stepDefinitions/loginContext.js +++ b/test/acceptance/stepDefinitions/loginContext.js @@ -1,6 +1,12 @@ const { Given, When, Then } = require('cucumber') const { client } = require('nightwatch-api') +Given('the administrator has logged in using the webUI', async function () { + await client.page.loginPage().navigate().waitForLoginPage(); + await client.page.loginPage().userLogsInWithUsernameAndPassword(client.globals.adminUsername, client.globals.adminPassword); + return client.page.loginPage().userIsLoggedIn(client.globals.adminUsername); +}); + Given('the user has browsed to the login page', function () { return client.page.loginPage().navigate(); }); From 86887fc650370e3b7e26811b47ba13367b97ffe5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Oct 2020 20:18:00 +0200 Subject: [PATCH 9/9] Update intracommreport.php --- htdocs/intracommreport/admin/intracommreport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/intracommreport/admin/intracommreport.php b/htdocs/intracommreport/admin/intracommreport.php index 0560809e5a9..5c2246ec852 100644 --- a/htdocs/intracommreport/admin/intracommreport.php +++ b/htdocs/intracommreport/admin/intracommreport.php @@ -96,7 +96,7 @@ print load_fiche_titre($langs->trans("IntracommReportSetup"), $linkback, 'title_ $head = intracommReportAdminPrepareHead(); -print dol_get_fiche_head($head, 'general', $langs->trans("IntracommReport"), -1, "intracommreport"); +dol_fiche_head($head, 'general', $langs->trans("IntracommReport"), -1, "intracommreport"); print ''; print '';