diff --git a/README.md b/README.md
index 648d5ef003d..919fc62ae5b 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@


+[](https://php.net/)
+[](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…).
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 8dabe102066..3b0781a9e8a 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,24 @@ 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/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 eafba42624a..84cb8c1dc6f 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 7e4e582b3d5..de672af203b 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 8e00c25eac4..a42d2471adf 100644
--- a/htdocs/compta/payment_sc/card.php
+++ b/htdocs/compta/payment_sc/card.php
@@ -131,7 +131,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
@@ -235,7 +235,7 @@ if ($resql)
/*
- * Boutons Actions
+ * Actions Buttons
*/
print '
';
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)
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/fourn/card.php b/htdocs/fourn/card.php
index 9aeef877bab..1ad41c08da0 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -417,6 +417,20 @@ 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/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..5c2246ec852 100644
--- a/htdocs/intracommreport/admin/intracommreport.php
+++ b/htdocs/intracommreport/admin/intracommreport.php
@@ -102,7 +102,7 @@ print '