'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
+
+ show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0);
+
+ print '
';
+ }
}
print "\n".'';
@@ -1213,9 +1269,10 @@ $db->close();
* @param string $newparam Parameters on current URL
* @param int $showinfo Add extended information (used by day and week view)
* @param int $minheight Minimum height for each event. 60px by default.
+ * @param string $nonew 0=Add "new entry button", 1=No "new entry button", -1=Only "new entry button"
* @return void
*/
-function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60)
+function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $nonew=0)
{
global $user, $conf, $langs;
global $action, $filter, $filtert, $status, $actioncode; // Filters used into search form
@@ -1230,26 +1287,35 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
print '';
@@ -1390,6 +1456,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
//print ' position: absolute; top: 40px; width: 50%;';
//print '"';
print '>';
+
//var_dump($event->userassigned);
//var_dump($event->transparency);
print '
';
if (! empty($arrayfields['a.label']['checked'])) print ' | ';
if (! empty($arrayfields['a.datep']['checked'])) {
- print '';
+ print ' | ';
print $form->select_date($datestart, 'datestart', 0, 0, 1, '', 1, 0, 1);
print ' | ';
}
if (! empty($arrayfields['a.datep2']['checked'])) {
- print '';
+ print ' | ';
print $form->select_date($dateend, 'dateend', 0, 0, 1, '', 1, 0, 1);
print ' | ';
}
@@ -517,8 +517,8 @@ if ($resql)
print '';
+ // Ref
if (! empty($arrayfields['a.id']['checked'])) {
- // Ref
print '| ';
print $actionstatic->getNomUrl(1,-1);
print ' | ';
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index d514bbaf603..7c49ff909d6 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -239,7 +239,7 @@ class Facture extends CommonInvoice
* @param int $forceduedate 1=Do not recalculate due date from payment condition but force it with value
* @return int <0 if KO, >0 if OK
*/
- function create($user,$notrigger=0,$forceduedate=0)
+ function create(User $user, $notrigger=0, $forceduedate=0)
{
global $langs,$conf,$mysoc,$hookmanager;
$error=0;
@@ -265,13 +265,13 @@ class Facture extends CommonInvoice
$this->multicurrency_tx = 1;
}
- dol_syslog(get_class($this)."::create user=".$user->id);
+ dol_syslog(get_class($this)."::create user=".$user->id." date=".$this->date);
// Check parameters
- if (empty($this->date) || empty($user->id))
+ if (empty($this->date))
{
- $this->error="ErrorBadParameter";
- dol_syslog(get_class($this)."::create Try to create an invoice with an empty parameter (user, date, ...)", LOG_ERR);
+ $this->error="Try to create an invoice with an empty parameter (date)";
+ dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
return -3;
}
$soc = new Societe($this->db);
@@ -2242,7 +2242,7 @@ class Facture extends CommonInvoice
// Validate
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
- $sql.= " SET facnumber='".$num."', fk_statut = ".self::STATUS_VALIDATED.", fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'";
+ $sql.= " SET facnumber='".$num."', fk_statut = ".self::STATUS_VALIDATED.", fk_user_valid = ".($user->id > 0 ? $user->id : "null").", date_valid = '".$this->db->idate($now)."'";
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date
{
$sql.= ", datef='".$this->db->idate($this->date)."'";
@@ -2365,9 +2365,12 @@ class Facture extends CommonInvoice
$final = ($this->lines[$i]->situation_percent == 100);
$i++;
}
- if ($final) {
- $this->setFinal($user);
- }
+
+ if (empty($final)) $this->situation_final = 0;
+ else $this->situation_final = 1;
+
+ $this->setFinal($user);
+
}
}
}
@@ -4070,7 +4073,6 @@ class Facture extends CommonInvoice
$this->db->begin();
- $this->situation_final = 1;
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture SET situation_final = ' . $this->situation_final . ' where rowid = ' . $this->id;
dol_syslog(__METHOD__, LOG_DEBUG);
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index e1b5af4e88d..8d955f1141d 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -1189,7 +1189,7 @@ if ($action == 'create')
$disableedit=1;
$disablemove=1;
$disableremove=1;
- $ret = $object->printObjectLines('', $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
+ $object->printObjectLines('', $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
}
print "
\n";
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index bacaddcffd4..625336a0fe4 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -701,19 +701,19 @@ if ($resql)
// Date invoice
if (! empty($arrayfields['f.date']['checked']))
{
- print '
';
+ print ' | ';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
print '';
- $formother->select_year($year?$year:-1,'year',1, 20, 5);
+ $formother->select_year($year?$year:-1,'year',1, 20, 5, 0, 0, '', 'width75');
print ' | ';
}
// Date due
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
{
- print '
';
+ print ' | ';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
print '';
- $formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5);
+ $formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5, 0, 0, '', 'width75');
print ' '.$langs->trans("Late");
print ' | ';
}
diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php
index 570942590c2..79a88d11c4d 100644
--- a/htdocs/compta/localtax/class/localtax.class.php
+++ b/htdocs/compta/localtax/class/localtax.class.php
@@ -132,7 +132,7 @@ class Localtax extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK
*/
- function update($user=null, $notrigger=0)
+ function update(User $user, $notrigger=0)
{
global $conf, $langs;
@@ -149,8 +149,8 @@ class Localtax extends CommonObject
$this->db->begin();
// Update request
- $sql = "UPDATE ".MAIN_DB_PREFIX."localtax SET";
- $sql.= " localtaxtype=".$this->ltt.",";
+ $sql = "UPDATE ".MAIN_DB_PREFIX."localtax SET";
+ $sql.= " localtaxtype=".$this->ltt.",";
$sql.= " tms='".$this->db->idate($this->tms)."',";
$sql.= " datep='".$this->db->idate($this->datep)."',";
$sql.= " datev='".$this->db->idate($this->datev)."',";
@@ -160,7 +160,7 @@ class Localtax extends CommonObject
$sql.= " fk_bank=".$this->fk_bank.",";
$sql.= " fk_user_creat=".$this->fk_user_creat.",";
$sql.= " fk_user_modif=".$this->fk_user_modif;
- $sql.= " WHERE rowid=".$this->id;
+ $sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -255,12 +255,12 @@ class Localtax extends CommonObject
}
- /**
- * Delete object in database
- *
- * @param User $user User that delete
- * @return int <0 if KO, >0 if OK
- */
+ /**
+ * Delete object in database
+ *
+ * @param User $user User that delete
+ * @return int <0 if KO, >0 if OK
+ */
function delete($user)
{
// Call trigger
@@ -285,11 +285,11 @@ class Localtax extends CommonObject
/**
- * Initialise an instance with random values.
- * Used to build previews or test instances.
- * id must be 0 if object instance is a specimen.
- *
- * @return void
+ * Initialise an instance with random values.
+ * Used to build previews or test instances.
+ * id must be 0 if object instance is a specimen.
+ *
+ * @return void
*/
function initAsSpecimen()
{
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 11751fe258b..4f17a4444f5 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -88,11 +88,11 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
- if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
+ if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm == 'yes'))
{
$error = 0;
- $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
+ $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
$paiement_id = 0;
$totalpayment = 0;
$multicurrency_totalpayment = 0;
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 42106c1cb13..4d23637dfe7 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -209,9 +209,10 @@ class Paiement extends CommonObject
$total = $totalamount_converted; // Maybe use price2num with MT for the converted value
$mtotal = $totalamount;
}
+ $note = ($this->note_public?$this->note_public:$this->note);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, fk_user_creat)";
- $sql.= " VALUES (".$conf->entity.", '".$this->ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")";
+ $sql.= " VALUES (".$conf->entity.", '".$this->ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($note)."', ".$user->id.")";
dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG);
$resql = $this->db->query($sql);
diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/tovalidate.php
similarity index 96%
rename from htdocs/compta/paiement/avalider.php
rename to htdocs/compta/paiement/tovalidate.php
index beb2fb77ecd..7e16b525233 100644
--- a/htdocs/compta/paiement/avalider.php
+++ b/htdocs/compta/paiement/tovalidate.php
@@ -17,9 +17,9 @@
*/
/**
- * \file htdocs/compta/paiement/avalider.php
+ * \file htdocs/compta/paiement/tovalidate.php
* \ingroup compta
- * \brief Page liste des paiements a valider des factures clients
+ * \brief Page list payment to validate. Visible in menu when option BILL_ADD_PAYMENT_VALIDATION is on.
*/
require '../../main.inc.php';
diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php
index c829b139436..64811c7604a 100644
--- a/htdocs/compta/prelevement/factures.php
+++ b/htdocs/compta/prelevement/factures.php
@@ -205,7 +205,7 @@ if ($result)
print_liste_field_titre("Bill",$_SERVER["PHP_SELF"],"p.ref",'',$param,'',$sortfield,$sortorder);
print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",'',$param,'',$sortfield,$sortorder);
print_liste_field_titre("AmountInvoice",$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
- print_liste_field_titre("AmountRequested",$_SERVER["PHP_SELF"],"pl.amount_requested","",$param,'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre("AmountRequested",$_SERVER["PHP_SELF"],"pl.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("StatusDebitCredit",$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print "\n";
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index fe7d927b6df..1bbeb9f2f29 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -255,7 +255,7 @@ if ($modecompta == 'BOOKKEEPING')
$sql.= " WHERE f.numero_compte = aa.account_number";
//$sql.= " AND fk_statut in (1,2)";
$sql.= " AND ".$predefinedgroupwhere;
- $sql.= " AND aa.fk_pcg_version = '".$charofaccountstring."'";
+ $sql.= " AND f.entity = ".$conf->entity;
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND f.doc_date >= '".$db->idate($date_start)."' AND f.doc_date <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY pcg_type, pcg_subtype, name, socid";
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index 156576fa4bc..26f12e3f7c5 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -828,7 +828,6 @@ if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING'))
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND b.doc_date >= '".$db->idate($date_start)."' AND b.doc_date <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, dm";
-
//print $sql;
dol_syslog("get bookkeeping record");
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index 335cf581740..598de2ba490 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -142,9 +142,7 @@ else if ($modecompta=="BOOKKEEPING")
$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'
','').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$periodlink=($year_start?"
".img_previous()." ".img_next()."":"");
- $description=$langs->trans("RulesCADue");
- if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
- else $description.= $langs->trans("DepositsAreIncluded");
+ $description=$langs->trans("RulesCATotalSaleJournal");
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
@@ -187,15 +185,14 @@ if ($socid) $sql.= " AND f.fk_soc = ".$socid;
else if ($modecompta=="BOOKKEEPING")
{
$sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc";
- $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
- $sql.= " WHERE b.numero_compte IN (SELECT a.account_number" ;
- $sql.= " FROM ".MAIN_DB_PREFIX."accounting_account as a";
- $sql.= " WHERE a.fk_accounting_category = 1 ) " ; // todo sql with accounting category, but we need to define category in turnover
+ $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj";
+ $sql.= " WHERE b.entity = ".$conf->entity;
+ $sql.= " AND b.code_journal = aj.code AND aj.nature = 2" ; // @TODO currently count amount in sale journal, but we need to define a category group for turnover
}
-
$sql.= " GROUP BY dm";
$sql.= " ORDER BY dm";
+//print $sql;
$result = $db->query($sql);
if ($result)
@@ -221,7 +218,7 @@ else {
}
// On ajoute les paiements anciennes version, non lies par paiement_facture (very old versions)
-if ($modecompta != 'CREANCES-DETTES')
+if ($modecompta == 'RECETTES-DEPENSES')
{
$sql = "SELECT date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
@@ -269,10 +266,11 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
if ($modecompta == 'CREANCES-DETTES') print '
';
else print ' | ';
- print '';
+ if ($modecompta != 'BOOKKEEPING') print '';
print $annee;
if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1);
- print ' | ';
+ if ($modecompta != 'BOOKKEEPING') print '';
+ print '';
if ($annee != $year_end) print '
| ';
}
print '';
@@ -336,7 +334,9 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
if ($cum[$case])
{
$now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre.
- print '
'.price($cum[$case],1).'';
+ if ($modecompta != 'BOOKKEEPING') print '
';
+ print price($cum[$case], 1);
+ if ($modecompta != 'BOOKKEEPING') print '';
}
else
{
diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php
index 7f938ba9b6c..6e5ac327e9b 100644
--- a/htdocs/core/actions_linkedfiles.inc.php
+++ b/htdocs/core/actions_linkedfiles.inc.php
@@ -176,11 +176,11 @@ elseif ($action == 'confirm_updateline' && GETPOST('save','alpha') && GETPOST('l
}
elseif ($action == 'renamefile' && GETPOST('renamefilesave','alpha'))
{
- // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
- if (! empty($upload_dir))
- {
- $filenamefrom=dol_sanitizeFileName(GETPOST('renamefilefrom','alpha'), '_', 0); // Do not remove accents
- $filenameto=dol_sanitizeFileName(GETPOST('renamefileto','alpha'), '_', 0); // Do not remove accents
+ // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
+ if (! empty($upload_dir))
+ {
+ $filenamefrom=dol_sanitizeFileName(GETPOST('renamefilefrom','alpha'), '_', 0); // Do not remove accents
+ $filenameto=dol_sanitizeFileName(GETPOST('renamefileto','alpha'), '_', 0); // Do not remove accents
if ($filenamefrom != $filenameto)
{
@@ -197,23 +197,38 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave','alpha'))
$srcpath = $upload_dir.'/'.$filenamefrom;
$destpath = $upload_dir.'/'.$filenameto;
- $result = dol_move($srcpath, $destpath);
- if ($result)
+ $reshook=$hookmanager->initHooks(array('actionlinkedfiles'));
+ $parameters=array('filenamefrom' => $filenamefrom, 'filenameto' => $filenameto, 'upload_dir' => $upload_dir);
+ $reshook=$hookmanager->executeHooks('renameUploadedFile', $parameters, $object);
+
+ if (empty($reshook))
{
- if ($object->id)
+ if (! file_exists($destpath))
{
- $object->addThumbs($destpath);
+ $result = dol_move($srcpath, $destpath);
+ if ($result)
+ {
+ if ($object->id)
+ {
+ $object->addThumbs($destpath);
+ }
+
+ // TODO Add revert function of addThumbs to remove for old name
+ //$object->delThumbs($srcpath);
+
+ setEventMessages($langs->trans("FileRenamed"), null);
+ }
+ else
+ {
+ $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now.
+ setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors');
+ }
+ }
+ else
+ {
+ $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now.
+ setEventMessages($langs->trans("ErrorDestinationAlreadyExists", $filenameto), null, 'errors');
}
-
- // TODO Add revert function of addThumbs to remove for old name
- //$object->delThumbs($srcpath);
-
- setEventMessages($langs->trans("FileRenamed"), null);
- }
- else
- {
- $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now.
- setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors');
}
}
}
diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php
index 9e1e89d60fc..9bbde140dbe 100644
--- a/htdocs/core/boxes/box_commandes.php
+++ b/htdocs/core/boxes/box_commandes.php
@@ -136,7 +136,7 @@ class box_commandes extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="tdoverflowmax100"',
+ 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $societestatic->getNomUrl(1),
'asis' => 1,
);
diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php
index 59db96b08aa..49d6df67d7f 100644
--- a/htdocs/core/boxes/box_contracts.php
+++ b/htdocs/core/boxes/box_contracts.php
@@ -128,7 +128,7 @@ class box_contracts extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
+ 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $thirdpartytmp->getNomUrl(1),
'asis'=>1
);
diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php
index 4c95d446f8a..d665d70da56 100644
--- a/htdocs/core/boxes/box_graph_invoices_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_permonth.php
@@ -91,6 +91,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
if ($user->rights->facture->lire)
{
+ $mesg = '';
+
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
$param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
$param_showtot='DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php
index 3261572460e..53449afceeb 100644
--- a/htdocs/core/boxes/box_produits.php
+++ b/htdocs/core/boxes/box_produits.php
@@ -131,13 +131,13 @@ class box_produits extends ModeleBoxes
$productstatic->entity = $objp->entity;
$this->info_box_contents[$line][] = array(
- 'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
+ 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $productstatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
+ 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $objp->label,
);
diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php
index 9dc75612773..ee49e9e4534 100644
--- a/htdocs/core/boxes/box_produits_alerte_stock.php
+++ b/htdocs/core/boxes/box_produits_alerte_stock.php
@@ -144,7 +144,7 @@ class box_produits_alerte_stock extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
+ 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $objp->label,
);
diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php
index a94ee0c1f08..8dad41f64a1 100644
--- a/htdocs/core/boxes/box_propales.php
+++ b/htdocs/core/boxes/box_propales.php
@@ -131,13 +131,13 @@ class box_propales extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="tdoverflowmax100"',
+ 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $societestatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
+ 'td' => 'class="right nowraponall"',
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);
diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php
index 0cc4e68682b..44a1ca020b5 100644
--- a/htdocs/core/boxes/box_services_contracts.php
+++ b/htdocs/core/boxes/box_services_contracts.php
@@ -177,7 +177,7 @@ class box_services_contracts extends ModeleBoxes
}
- $this->info_box_contents[$i][] = array('td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
+ $this->info_box_contents[$i][] = array('td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $s,
'asis' => 1
);
@@ -187,7 +187,7 @@ class box_services_contracts extends ModeleBoxes
'asis' => 1
);
- $this->info_box_contents[$i][] = array('td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
+ $this->info_box_contents[$i][] = array('td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $thirdpartytmp->getNomUrl(1),
'asis' => 1
);
diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php
index f123872b85b..72d4390a2e2 100644
--- a/htdocs/core/boxes/box_services_expired.php
+++ b/htdocs/core/boxes/box_services_expired.php
@@ -126,7 +126,7 @@ class box_services_expired extends ModeleBoxes
'asis' => 1
);
- $this->info_box_contents[$i][] = array('td' => 'class="tdoverflowmax100 maxwidth100onsmartphone" align="left"',
+ $this->info_box_contents[$i][] = array('td' => 'class="tdoverflowmax150 maxwidth150onsmartphone" align="left"',
'text' => $thirdpartytmp->getNomUrl(1, 'customer'),
'asis' => 1
);
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index 025cfba71a5..74f0ffc9d9d 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -248,7 +248,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
$out.= '>';
if ($conf->use_javascript_ajax)
{
- $out.= '
';
+ $out.= '| ';
}
if (! empty($head['text']))
{
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index f5a16aa540b..a4ea3a70447 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -319,7 +319,7 @@ abstract class CommonDocGenerator
foreach($conf->global as $key => $val)
{
- if (preg_match('/(_pass|password|secret|_key|key$)/i', $keyfound)) $newval = '*****forbidden*****';
+ if (preg_match('/(_pass|password|secret|_key|key$)/i', $key)) $newval = '*****forbidden*****';
else $newval = $val;
$array_other['__['.$key.']__'] = $newval;
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index c7335298bdd..7e565e0222f 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2739,7 +2739,7 @@ abstract class CommonObject
* @param string $targettype Object target type (if not defined, elemennt name of object)
* @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
* @param int $alsosametype 0=Return only links to object that differs from source. 1=Include also link to objects of same type.
- * @return void
+ * @return int <0 if KO, >0 if OK
* @see add_object_linked, updateObjectLinked, deleteObjectLinked
*/
function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targettype='',$clause='OR',$alsosametype=1)
@@ -2920,10 +2920,12 @@ abstract class CommonObject
}
}
}
+ return 1;
}
else
{
dol_print_error($this->db);
+ return -1;
}
}
@@ -3582,7 +3584,7 @@ abstract class CommonObject
* Return HTML table for object lines
* TODO Move this into an output class file (htmlline.class.php)
* If lines are into a template, title must also be into a template
- * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
+ * But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
*
* @param string $action Action code
* @param string $seller Object of seller third party
@@ -4518,6 +4520,7 @@ abstract class CommonObject
}
else
{
+ global $extrafields;
dol_syslog("Warning: fetch_optionals was called with param optionsArray defined when you should pass null now", LOG_WARNING);
}
@@ -4691,7 +4694,8 @@ abstract class CommonObject
if ($this->array_options[$key] != '' && is_array($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']))
{
// If there is an encryption choice, we use it to crypt data before insert
- $algo=reset(array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']));
+ $tmparrays = array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']);
+ $algo=reset($tmparrays);
if ($algo != '')
{
//global $action; // $action may be 'create', 'update', 'update_extras'...
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 4477a4812da..861848e6924 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -235,6 +235,7 @@ class ExtraFields
$lengthdb='11';
} elseif ($type=='html') {
$typedb='text';
+ $lengthdb=$length;
} elseif($type=='password') {
$typedb='varchar';
$lengthdb='128';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index df26e44e080..7b74fc05850 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3421,7 +3421,8 @@ class Form
}
else
{
- print $langs->trans("NoActiveBankAccountDefined");
+ if ($statut == 0) print $langs->trans("NoActiveBankAccountDefined");
+ else print $langs->trans("NoBankAccountFound");
}
}
else {
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index 2d66661c839..f254fe44b9d 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -194,6 +194,7 @@ class FormActions
$projectid = $object->fk_project;
if ($typeelement == 'project') $projectid = $object->id;
+ $buttontoaddnewevent='';
if (! empty($conf->agenda->enabled))
{
$buttontoaddnewevent = '';
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index d3990acc9c8..faa548a5d16 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -545,9 +545,10 @@ class FormCompany
* @param array $limitto Disable answers that are not id in this array list
* @param int $forceid This is to force another object id than object->id
* @param string $moreparam String with more param to add into url when noajax search is used.
+ * @param string $morecss More CSS on select component
* @return int The selected third party ID
*/
- function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname='newcompany', $limitto='', $forceid=0, $moreparam='')
+ function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname='newcompany', $limitto='', $forceid=0, $moreparam='', $morecss='')
{
global $conf, $langs;
@@ -649,7 +650,7 @@ class FormCompany
$resql = $this->db->query($sql);
if ($resql)
{
- print ' | ';
$boxstat.=' ';
@@ -583,12 +583,12 @@ if (! empty($valid_dashboardlines))
$boxwork .="\n";
}
- $boxwork .='';
- $boxwork .='';
- $boxwork .='';
- $boxwork .='';
- $boxwork .='';
- $boxwork .='';
+ $boxwork .='';
+ $boxwork .='';
+ $boxwork .='';
+ $boxwork .='';
+ $boxwork .='';
+ $boxwork .='';
$boxwork .=' |
';
}
else
diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql
index ccc1f9b77bd..35077eb5bc5 100644
--- a/htdocs/install/mysql/data/llx_c_action_trigger.sql
+++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql
@@ -74,7 +74,9 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',24);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_CREATE','Member subscribtion recorded','Executed when a member subscribtion is deleted','member',24);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_MODIFY','Member subscribtion modified','Executed when a member subscribtion is modified','member',24);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_DELETE','Member subscribtion deleted','Executed when a member subscribtion is deleted','member',24);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',25);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',26);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',30);
diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
index e3e78d4a338..442b99fbfb1 100644
--- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
+++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
@@ -94,6 +94,11 @@ ALTER TABLE llx_website_page ADD COLUMN type_container varchar(16) NOT NULL DEFA
-- For 7.0
+delete from llx_c_action_trigger where code = 'MEMBER_SUBSCRIPTION';
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_CREATE','Member subscribtion recorded','Executed when a member subscribtion is deleted','member',24);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_MODIFY','Member subscribtion modified','Executed when a member subscribtion is modified','member',24);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_DELETE','Member subscribtion deleted','Executed when a member subscribtion is deleted','member',24);
+
ALTER TABLE llx_product_attribute_value DROP INDEX unique_ref;
ALTER TABLE llx_product_attribute_value ADD UNIQUE INDEX uk_product_attribute_value (fk_product_attribute, ref);
@@ -437,7 +442,7 @@ CREATE TABLE llx_expensereport_rules (
fk_usergroup integer DEFAULT NULL,
fk_c_type_fees integer NOT NULL,
code_expense_rules_type varchar(50) NOT NULL,
- is_for_all tinyint DEFAULT '0',
+ is_for_all tinyint DEFAULT 0,
entity integer DEFAULT 1
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_expensereport_rules.sql b/htdocs/install/mysql/tables/llx_expensereport_rules.sql
index 3aaca6f00b5..feacf572c1f 100644
--- a/htdocs/install/mysql/tables/llx_expensereport_rules.sql
+++ b/htdocs/install/mysql/tables/llx_expensereport_rules.sql
@@ -29,6 +29,6 @@ CREATE TABLE llx_expensereport_rules (
fk_usergroup integer DEFAULT NULL,
fk_c_type_fees integer NOT NULL,
code_expense_rules_type varchar(50) NOT NULL,
- is_for_all tinyint DEFAULT '0',
+ is_for_all tinyint DEFAULT 0,
entity integer DEFAULT 1
) ENGINE=InnoDB;
\ No newline at end of file
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 0c5962c1183..d6514db4d2c 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -420,7 +420,6 @@ ExtrafieldParamHelpsellist=List of values comes from a table
Syntax : table_n
ExtrafieldParamHelpchkbxlst=List of values comes from a table
Syntax : table_name:label_field:id_field::filter
Example : c_typent:libelle:id::filter
filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)
In order to have the list depending on another complementary attribute list :
c_typent:libelle:id:options_parent_list_code|parent_column:filter
In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
Syntax : ObjectName:Classpath
Examples :
Societe:societe/class/societe.class.php
Contact:contact/class/contact.class.php
LibraryToBuildPDF=Library used for PDF generation
-WarningUsingFPDF=Warning: Your conf.php contains directive dolibarr_pdf_force_fpdf=1. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.
To solve this and have a full support of PDF generation, please download TCPDF library, then comment or remove the line $dolibarr_pdf_force_fpdf=1, and add instead $dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:
1 : local tax apply on products and services without vat (localtax is calculated on amount without tax)
2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax)
3 : local tax apply on products without vat (localtax is calculated on amount without tax)
4 : local tax apply on products including vat (localtax is calculated on amount + main vat)
5 : local tax apply on services without vat (localtax is calculated on amount without tax)
6 : local tax apply on services including vat (localtax is calculated on amount + tax)
SMS=SMS
LinkToTestClickToDial=Enter a phone number to call to show a link to test the ClickToDial url for user %s
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index 0c70a160204..4ab64a98224 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -53,7 +53,9 @@ MemberValidatedInDolibarr=Member %s validated
MemberModifiedInDolibarr=Member %s modified
MemberResiliatedInDolibarr=Member %s terminated
MemberDeletedInDolibarr=Member %s deleted
-MemberSubscriptionAddedInDolibarr=Subscription for member %s added
+MemberSubscriptionAddedInDolibarr=Subscription %s for member %s added
+MemberSubscriptionModifiedInDolibarr=Subscription %s for member %s modified
+MemberSubscriptionDeletedInDolibarr=Subscription %s for member %s deleted
ShipmentValidatedInDolibarr=Shipment %s validated
ShipmentClassifyClosedInDolibarr=Shipment %s classified billed
ShipmentUnClassifyCloseddInDolibarr=Shipment %s classified reopened
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index 632ef67feb9..d1413fb0454 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -157,6 +157,7 @@ RulesResultDue=- It includes outstanding invoices, expenses, VAT, donations whet
RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT and salaries.
- It is based on the payment dates of the invoices, expenses, VAT and salaries. The donation date for donation.
RulesCADue=- It includes the client's due invoices whether they are paid or not.
- It is based on the validation date of these invoices.
RulesCAIn=- It includes all the effective payments of invoices received from clients.
- It is based on the payment date of these invoices
+RulesCATotalSaleJournal=It includes all credit lines from the Sale journal.
RulesAmountOnInOutBookkeepingRecord=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME"
RulesResultBookkeepingPredefined=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME"
RulesResultBookkeepingPersonalized=It show record in your Ledger with accounting accounts grouped by personalized groups
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 41891a9e091..d2c057b6983 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -430,6 +430,9 @@ ActionsOnCompany=Events about this third party
ActionsOnMember=Events about this member
ActionsOnProduct=Events about this product
NActionsLate=%s late
+ToDo=To do
+Completed=Completed
+Running=In progress
RequestAlreadyDone=Request already recorded
Filter=Filter
FilterOnInto=Search criteria '%s' into fields %s
@@ -707,6 +710,8 @@ WarningYouAreInMaintenanceMode=Warning, you are in a maintenance mode, so only l
CoreErrorTitle=System error
CoreErrorMessage=Sorry, an error occurred. Contact your system administrator to check the logs or disable $dolibarr_main_prod=1 to get more information.
CreditCard=Credit card
+ValidatePayment=Validate payment
+CreditOrDebitCard=Credit or debit card
FieldsWithAreMandatory=Fields with %s are mandatory
FieldsWithIsForPublic=Fields with %s are shown on public list of members. If you don't want this, check off the "public" box.
AccordingToGeoIPDatabase=(according to GeoIP convertion)
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index d90bfb35032..066f761bb32 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -80,8 +80,8 @@ LinkedObject=Linked object
NbOfActiveNotifications=Number of notifications (nb of recipient emails)
PredefinedMailTest=__(Hello)__\nThis is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__USER_SIGNATURE__
PredefinedMailTestHtml=__(Hello)__\nThis is a test mail (the word test must be in bold).
The two lines are separated by a carriage return.
__USER_SIGNATURE__
-PredefinedMailContentSendInvoice=__(Hello)__\n\nYou will find here the invoice __REF__\n\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
-PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nWe would like to warn you that the invoice __REF__ seems to not be payed. So this is the invoice in attachment again, as a reminder.\n\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendInvoice=__(Hello)__\n\nYou will find here the invoice __REF__\n\nThis is the link to make your online payment if this invoice is not already payed:\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nWe would like to warn you that the invoice __REF__ seems to not be payed. So this is the invoice in attachment again, as a reminder.\n\nThis is the link to make your online payment:\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendProposal=__(Hello)__\n\nYou will find here the commercial proposal __PREF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendSupplierProposal=__(Hello)__\n\nYou will find here the price request __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendOrder=__(Hello)__\n\nYou will find here the order __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang
index e1db55d5668..25f06dacd42 100644
--- a/htdocs/langs/en_US/paypal.lang
+++ b/htdocs/langs/en_US/paypal.lang
@@ -30,4 +30,6 @@ ErrorCode=Error Code
ErrorSeverityCode=Error Severity Code
OnlinePaymentSystem=Online payment system
PaypalLiveEnabled=Paypal live enabled (otherwise test/sandbox mode)
-PaypalImportPayment=Import Paypal payments
\ No newline at end of file
+PaypalImportPayment=Import Paypal payments
+PostActionAfterPayment=Post actions after payments
+ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions. You must complete post actions manually if they are necessary.
\ No newline at end of file
diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang
index ff6b4a58608..2b5823c28fb 100644
--- a/htdocs/langs/en_US/stripe.lang
+++ b/htdocs/langs/en_US/stripe.lang
@@ -38,4 +38,5 @@ STRIPE_TEST_PUBLISHABLE_KEY=Publishable test key
STRIPE_LIVE_SECRET_KEY=Secret live key
STRIPE_LIVE_PUBLISHABLE_KEY=Publishable live key
StripeLiveEnabled=Stripe live enabled (otherwise test/sandbox mode)
-StripeImportPayment=Import Stripe payments
\ No newline at end of file
+StripeImportPayment=Import Stripe payments
+ExampleOfTestCreditCard=Example of credit card for test: %s (valid), %s (error CVC), %s (expired), %s (charge fails)
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/accountancy.lang b/htdocs/langs/fr_FR/accountancy.lang
index 85d1f6a5b58..ff24ea0c023 100644
--- a/htdocs/langs/fr_FR/accountancy.lang
+++ b/htdocs/langs/fr_FR/accountancy.lang
@@ -224,8 +224,8 @@ GeneralLedgerSomeRecordWasNotRecorded=Certaines des opérations n'ont pu être e
NoNewRecordSaved=Plus d'enregistrements à journaliser
ListOfProductsWithoutAccountingAccount=Liste des produits non liés à un compte comptable
ChangeBinding=Changer les liens
-Accounted=Comptabilisé dans le grand livre
-NotYetAccounted=Pas encore comptabilisé dans le grand livre
+Accounted=Comptabilisé
+NotYetAccounted=Pas encore comptabilisé
## Admin
ApplyMassCategories=Application en masse des catégories
diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang
index 610a4f59ab3..d34ca3c3498 100644
--- a/htdocs/langs/fr_FR/other.lang
+++ b/htdocs/langs/fr_FR/other.lang
@@ -78,8 +78,8 @@ LinkedObject=Objet lié
NbOfActiveNotifications=Nombre de notifications (nb de destinataires emails)
PredefinedMailTest=__(Hello)__,\nCeci est un mail de test envoyé à __EMAIL__.\nLes deux lignes sont séparées par un saut de ligne.\n\n__USER_SIGNATURE__
PredefinedMailTestHtml=__(Hello)__\nCeci est un message de test (le mot test doit être en gras).
Les 2 lignes sont séparées par un retour à la ligne.
__SIGNATURE__
-PredefinedMailContentSendInvoice=__(Hello)__\n\nVeuillez trouver, ci-joint, la facture __REF__\n\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
-PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nNous voulons porter à votre connaissance le fait que la facture __REF__ semble non payée. Aussi, voici la facture à nouveau en pièce jointe pour rappel.\n\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendInvoice=__(Hello)__\n\nVeuillez trouver, ci-joint, la facture __REF__\n\nVoici le lien pour un paiement en ligne au cas ou celle-ci n'aurait pas encore été payé:\n\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nNous voulons porter à votre connaissance le fait que la facture __REF__ semble non payée. Aussi, voici la facture à nouveau en pièce jointe pour rappel.\n\nVoici le lien pour un paiement en ligne:\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendProposal=__(Hello)__\n\nVeuillez trouver, ci-joint, la proposition commerciale __PREF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendSupplierProposal=__(Hello)__\n\nVeuillez trouver, ci-joint, une demande de prix avec la référence __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendOrder=__(Hello)__\n\nVeuillez trouver, ci-joint, la commande __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php
index 79a6a62ad2a..1db6c1906a3 100644
--- a/htdocs/paybox/admin/paybox.php
+++ b/htdocs/paybox/admin/paybox.php
@@ -55,6 +55,8 @@ if ($action == 'setvalue' && $user->admin)
$result=dolibarr_set_const($db, "PAYBOX_PBX_IDENTIFIANT",GETPOST('PAYBOX_PBX_IDENTIFIANT','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR",GETPOST('ONLINE_PAYMENT_CREDITOR','alpha'),'chaine',0,'',$conf->entity);
+ if (! $result > 0) $error++;
+ $result=dolibarr_set_const($db, "PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS",GETPOST('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS','int'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
@@ -183,6 +185,15 @@ print '
'.$langs->trans("Example").': '.$mysoc->name;
print '';
+if (! empty($conf->banque->enabled))
+{
+ print '| ';
+ print $langs->trans("BankAccount").' | ';
+ print $form->select_comptes($conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1);
+ print ' |
';
+}
+
+
print '| ';
print $langs->trans("CSSUrlForPaymentForm").' | ';
print '';
diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php
index 711f898901c..23bf26d375f 100644
--- a/htdocs/paypal/admin/paypal.php
+++ b/htdocs/paypal/admin/paypal.php
@@ -55,6 +55,8 @@ if ($action == 'setvalue' && $user->admin)
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR",GETPOST('ONLINE_PAYMENT_CREDITOR','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
+ $result=dolibarr_set_const($db, "PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS",GETPOST('PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS','int'),'chaine',0,'',$conf->entity);
+ if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "PAYPAL_API_INTEGRAL_OR_PAYPALONLY",GETPOST('PAYPAL_API_INTEGRAL_OR_PAYPALONLY','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity);
@@ -210,6 +212,13 @@ print 'name;
print ' |
';
+if (! empty($conf->banque->enabled))
+{
+ print '| ';
+ print $langs->trans("BankAccount").' | ';
+ print $form->select_comptes($conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1);
+ print ' |
';
+}
print '| ';
print $langs->trans("CSSUrlForPaymentForm").' | ';
diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php
index ecdd2f4fc3e..c34e964c522 100644
--- a/htdocs/paypal/lib/paypal.lib.php
+++ b/htdocs/paypal/lib/paypal.lib.php
@@ -192,7 +192,7 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f
* @param string $returnURL Url to use if payment is OK
* @param string $cancelURL Url to use if payment is KO
* @param string $tag Full tag
- * @return void
+ * @return string No return (a redirect is done) if OK, or Error message if KO
*/
function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$returnURL,$cancelURL,$tag)
{
@@ -272,11 +272,20 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re
$ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]);
$ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]);
- echo $langs->trans('SetExpressCheckoutAPICallFailed') . " \n";
- echo $langs->trans('DetailedErrorMessage') . ": " . $ErrorLongMsg." \n";
- echo $langs->trans('ShortErrorMessage') . ": " . $ErrorShortMsg." \n";
- echo $langs->trans('ErrorCode') . ": " . $ErrorCode." \n";
- echo $langs->trans('ErrorSeverityCode') . ": " . $ErrorSeverityCode." \n";
+ if ($ErrorCode == 10729)
+ {
+ $mesg.= "PayPal can't accept payments for this thirdparty. An address is defined but is not complete (missing State). Ask system administrator to fix address or to setup Paypal module to accept payments even on not complete addresses (remove option PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS). \n";
+ }
+ else
+ {
+ $mesg = $langs->trans('SetExpressCheckoutAPICallFailed') . " \n";
+ $mesg.= $langs->trans('DetailedErrorMessage') . ": " . $ErrorLongMsg." \n";
+ $mesg.= $langs->trans('ShortErrorMessage') . ": " . $ErrorShortMsg." \n";
+ $mesg.= $langs->trans('ErrorCode') . ": " . $ErrorCode." \n";
+ $mesg.= $langs->trans('ErrorSeverityCode') . ": " . $ErrorSeverityCode." \n";
+ }
+
+ return $mesg;
}
}
@@ -300,6 +309,7 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re
* phoneNum: the phoneNum entered on the merchant's site
* email: the buyer email
* desc: Product description
+ * See https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
*
* @param double $paymentAmount Payment amount
* @param string $currencyCodeType Currency
@@ -307,8 +317,8 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re
* @param string $returnURL Return Url
* @param string $cancelURL Cancel Url
* @param string $tag Full tag
- * @param string $solutionType Type
- * @param string $landingPage Landing page
+ * @param string $solutionType Type ('Mark' or 'Sole')
+ * @param string $landingPage Landing page ('Login' or 'Billing')
* @param string $shipToName Ship to name
* @param string $shipToStreet Ship to street
* @param string $shipToCity Ship to city
@@ -327,38 +337,86 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType,
// Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation
//declaring of global variables
- global $conf, $langs;
+ global $conf, $langs, $mysoc;
global $API_Endpoint, $API_Url, $API_version, $USE_PROXY, $PROXY_HOST, $PROXY_PORT;
global $PAYPAL_API_USER, $PAYPAL_API_PASSWORD, $PAYPAL_API_SIGNATURE;
$nvpstr = '';
- $nvpstr = $nvpstr . "&AMT=". urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT
- $nvpstr = $nvpstr . "&PAYMENTACTION=" . urlencode($paymentType); // PAYMENTACTION deprecated by paypal -> PAYMENTREQUEST_n_PAYMENTACTION
+ //$nvpstr = $nvpstr . "&VERSION=".$API_version; // Already added by hash_call
$nvpstr = $nvpstr . "&RETURNURL=" . urlencode($returnURL);
$nvpstr = $nvpstr . "&CANCELURL=" . urlencode($cancelURL);
- $nvpstr = $nvpstr . "&CURRENCYCODE=" . urlencode($currencyCodeType); // CURRENCYCODE deprecated by paypal -> PAYMENTREQUEST_n_CURRENCYCODE
- $nvpstr = $nvpstr . "&ADDROVERRIDE=1";
- //$nvpstr = $nvpstr . "&ALLOWNOTE=0";
- $nvpstr = $nvpstr . "&SHIPTONAME=" . urlencode($shipToName); // SHIPTONAME deprecated by paypal -> PAYMENTREQUEST_n_SHIPTONAME
- $nvpstr = $nvpstr . "&SHIPTOSTREET=" . urlencode($shipToStreet); //
- $nvpstr = $nvpstr . "&SHIPTOSTREET2=" . urlencode($shipToStreet2);
- $nvpstr = $nvpstr . "&SHIPTOCITY=" . urlencode($shipToCity);
- $nvpstr = $nvpstr . "&SHIPTOSTATE=" . urlencode($shipToState);
- $nvpstr = $nvpstr . "&SHIPTOCOUNTRYCODE=" . urlencode($shipToCountryCode);
- $nvpstr = $nvpstr . "&SHIPTOZIP=" . urlencode($shipToZip);
- $nvpstr = $nvpstr . "&PHONENUM=" . urlencode($phoneNum);
+ if (! empty($conf->global->PAYPAL_ALLOW_NOTES))
+ {
+ $nvpstr = $nvpstr . "&ALLOWNOTE=0";
+ }
+ if (empty($conf->global->PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS))
+ {
+ $nvpstr = $nvpstr . "&NOSHIPPING=1"; // An empty or not complete shipping address will be accepted
+ }
+ else
+ {
+ $nvpstr = $nvpstr . "&NOSHIPPING=0"; // A valid shipping address is required (full required fields mandatory)
+ }
$nvpstr = $nvpstr . "&SOLUTIONTYPE=" . urlencode($solutionType);
$nvpstr = $nvpstr . "&LANDINGPAGE=" . urlencode($landingPage);
- //$nvpstr = $nvpstr . "&CUSTOMERSERVICENUMBER=" . urlencode($tag); // Hotline phone number
- $nvpstr = $nvpstr . "&INVNUM=" . urlencode($tag);
- if (! empty($email)) $nvpstr = $nvpstr . "&EMAIL=" . urlencode($email);
- if (! empty($desc)) $nvpstr = $nvpstr . "&DESC=" . urlencode($desc); // DESC deprecated by paypal -> PAYMENTREQUEST_n_DESC
+ if (! empty($conf->global->PAYPAL_CUSTOMER_SERVICE_NUMBER))
+ {
+ $nvpstr = $nvpstr . "&CUSTOMERSERVICENUMBER=" . urlencode($conf->global->PAYPAL_CUSTOMER_SERVICE_NUMBER); // Hotline phone number
+ }
+ $paypalprefix = 'PAYMENTREQUEST_0_';
+ //$paypalprefix = '';
+ if (! empty($paypalprefix) && $paymentType == 'Sole') $paymentType='Sale';
+
+ $nvpstr = $nvpstr . "&AMT=". urlencode($paymentAmount); // Total for all elements
+
+ $nvpstr = $nvpstr . "&".$paypalprefix."INVNUM=" . urlencode($tag);
+ $nvpstr = $nvpstr . "&".$paypalprefix."AMT=". urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT
+ $nvpstr = $nvpstr . "&".$paypalprefix."ITEMAMT=". urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT
+ $nvpstr = $nvpstr . "&".$paypalprefix."PAYMENTACTION=" . urlencode($paymentType); // PAYMENTACTION deprecated by paypal -> PAYMENTREQUEST_n_PAYMENTACTION
+ $nvpstr = $nvpstr . "&".$paypalprefix."CURRENCYCODE=" . urlencode($currencyCodeType); // CURRENCYCODE deprecated by paypal -> PAYMENTREQUEST_n_CURRENCYCODE
+
+ $nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_QTY0=1";
+ $nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_AMT0=".urlencode($paymentAmount);
+ $nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_NAME0=".urlencode($desc);
+ $nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_NUMBER0=0";
+
+ $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTONAME=" . urlencode($shipToName); // SHIPTONAME deprecated by paypal -> PAYMENTREQUEST_n_SHIPTONAME
+ $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOSTREET=" . urlencode($shipToStreet); //
+ $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOSTREET2=" . urlencode($shipToStreet2);
+ $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOCITY=" . urlencode($shipToCity);
+ $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOSTATE=" . urlencode($shipToState);
+ $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOCOUNTRYCODE=" . urlencode($shipToCountryCode);
+ $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOZIP=" . urlencode($shipToZip);
+ $nvpstr = $nvpstr . "&".$paypalprefix."PHONENUM=" . urlencode($phoneNum);
+ if (! empty($email)) $nvpstr = $nvpstr . "&".$paypalprefix."EMAIL=" . urlencode($email); // EMAIL deprecated by paypal -> PAYMENTREQUEST_n_EMAIL
+ if (! empty($desc)) $nvpstr = $nvpstr . "&".$paypalprefix."DESC=" . urlencode($desc); // DESC deprecated by paypal -> PAYMENTREQUEST_n_DESC
+
+ if (! empty($conf->global->PAYPAL_LOGOIMG) && $mysoc->logo)
+ {
+ global $dolibarr_main_url_root;
+
+ // Define $urlwithroot
+ $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
+ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
+ //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
+
+ $urllogo=$urlwithroot."/viewimage.php?modulepart=mycompany&file=".$mysoc->logo;
+ $nvpstr = $nvpstr . "&LOGOIMG=" . urlencode($urllogo);
+ }
+ if (! empty($conf->global->PAYPAL_BRANDNAME))
+ {
+ $nvpstr = $nvpstr . "&BRANDNAME=" . urlencode($conf->global->PAYPAL_BRANDNAME); // BRANDNAME
+ }
+ if (! empty($conf->global->PAYPAL_NOTETOBUYER))
+ {
+ $nvpstr = $nvpstr . "&NOTETOBUYER=" . urlencode($conf->global->PAYPAL_NOTETOBUYER); // PAYPAL_NOTETOBUYER
+ }
$_SESSION["FinalPaymentAmt"] = $paymentAmount;
$_SESSION["currencyCodeType"] = $currencyCodeType;
- $_SESSION["PaymentType"] = $paymentType;
- $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR ']; // Payer ip
+ $_SESSION["PaymentType"] = $paymentType; // 'Mark', 'Sole'
+ $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; // Payer ip
//'---------------------------------------------------------------------------------------------------------------
//' Make the API call to PayPal
@@ -534,7 +592,7 @@ function hash_call($methodName,$nvpStr)
global $PAYPAL_API_USER, $PAYPAL_API_PASSWORD, $PAYPAL_API_SIGNATURE;
// TODO problem with triggers
- $API_version="56";
+ $API_version="98.0";
if (! empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha')) // We can force sand box with param 'forcesandbox'
{
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php
index e7329f1d44a..b41a990fbc1 100644
--- a/htdocs/product/stock/mouvement.php
+++ b/htdocs/product/stock/mouvement.php
@@ -101,8 +101,9 @@ $arrayfields=array(
'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1),
'm.label'=>array('label'=>$langs->trans("LabelMovement"), 'checked'=>1),
'origin'=>array('label'=>$langs->trans("Origin"), 'checked'=>1),
- 'm.value'=>array('label'=>$langs->trans("Qty"), 'checked'=>1),
- //'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
+ 'm.value'=>array('label'=>$langs->trans("Qty"), 'checked'=>1),
+ 'm.price'=>array('label'=>$langs->trans("UnitPurchaseValue"), 'checked'=>0),
+ //'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
//'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
);
@@ -417,7 +418,7 @@ if (!empty($conf->projet->enabled)) $formproject=new FormProjets($db);
$sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.fk_product_type as type, p.entity,";
$sql.= " e.ref as stock, e.rowid as entrepot_id, e.lieu,";
$sql.= " m.rowid as mid, m.value as qty, m.datem, m.fk_user_author, m.label, m.inventorycode, m.fk_origin, m.origintype,";
-$sql.= " m.batch,";
+$sql.= " m.batch, m.price,";
$sql.= " pl.rowid as lotid, pl.eatby, pl.sellby,";
$sql.= " u.login, u.photo, u.lastname, u.firstname";
// Add fields from extrafields
@@ -634,7 +635,7 @@ if ($resql)
/* */
/* ************************************************************************** */
- if (empty($action) && $id > 0)
+ if ((empty($action) || $action == 'list') && $id > 0)
{
print "\n";
@@ -810,8 +811,17 @@ if ($resql)
print '';
print ' | ';
}
+ if (! empty($arrayfields['m.price']['checked']))
+ {
+ // Price
+ print '';
+ print ' ';
+ print ' | ';
+ }
+
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
+
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
@@ -849,8 +859,11 @@ if ($resql)
if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'],$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
if (! empty($arrayfields['origin']['checked'])) print_liste_field_titre($arrayfields['origin']['label'],$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder);
if (! empty($arrayfields['m.value']['checked'])) print_liste_field_titre($arrayfields['m.value']['label'],$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['m.price']['checked'])) print_liste_field_titre($arrayfields['m.price']['label'],$_SERVER["PHP_SELF"], "m.price","",$param,'align="right"',$sortfield,$sortorder);
+
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
+
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
@@ -976,6 +989,13 @@ if ($resql)
print $objp->qty;
print '';
}
+ if (! empty($arrayfields['m.price']['checked']))
+ {
+ // Price
+ print '';
+ print price($objp->price);
+ print ' | ';
+ }
// Action column
print '';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php
index 732fa8c889d..d946a23bf70 100644
--- a/htdocs/product/stock/tpl/stockcorrection.tpl.php
+++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php
@@ -68,8 +68,8 @@ if (empty($conf) || ! is_object($conf))
print ' |
';
if ($object->element == 'product')
{
- print '| '.$langs->trans("Warehouse").' | ';
- print '';
+ print ' | '.$langs->trans("Warehouse").' | ';
+ print '';
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
print ' ';
print '';
@@ -79,28 +79,28 @@ if (empty($conf) || ! is_object($conf))
}
if ($object->element == 'stock')
{
- print '| '.$langs->trans("Product").' | ';
- print '';
- print $form->select_produits(GETPOST('product_id'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 20, 0, -1);
+ print ' | '.$langs->trans("Product").' | ';
+ print '';
+ print $form->select_produits(GETPOST('product_id'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 20, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
print ' ';
print '';
print '';
print '';
print ' | ';
}
- print ''.$langs->trans("NumberOfUnit").' | ';
- print ' | ';
+ print ''.$langs->trans("NumberOfUnit").' | ';
+ print ' | ';
print ' |
';
// Purchase price
print '';
- print '| '.$langs->trans("UnitPurchaseValue").' | ';
+ print ''.$langs->trans("UnitPurchaseValue").' | ';
print ' | ';
if (! empty($conf->projet->enabled))
{
print ''.$langs->trans('Project').' | ';
print '';
- $formproject->select_projects();
+ $formproject->select_projects(0, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300');
print ' | ';
}
print '
';
@@ -133,7 +133,7 @@ if (empty($conf) || ! is_object($conf))
print '';
print '| '.$langs->trans("MovementLabel").' | ';
print '';
- print '';
+ print '';
print ' | ';
print ''.$langs->trans("InventoryCode").' | | ';
print '
';
diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php
index 18f6b831cf2..4c89b97622f 100644
--- a/htdocs/product/stock/tpl/stocktransfer.tpl.php
+++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php
@@ -72,20 +72,20 @@ if (empty($conf) || ! is_object($conf))
print '';
if ($object->element == 'product')
{
- print '| '.$langs->trans("WarehouseSource").' | ';
- print '';
+ print ' | '.$langs->trans("WarehouseSource").' | ';
+ print '';
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')), 'id_entrepot', 'warehouseopen,warehouseinternal', 1);
print ' | ';
}
if ($object->element == 'stock')
{
- print ''.$langs->trans("Product").' | ';
- print '';
- print $form->select_produits(GETPOST('product_id'),'product_id',(empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''));
+ print ' | '.$langs->trans("Product").' | ';
+ print '';
+ print $form->select_produits(GETPOST('product_id'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 20, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
print ' | ';
}
- print ''.$langs->trans("WarehouseTarget").' | ';
+ print ' | '.$langs->trans("WarehouseTarget").' | ';
print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1);
print ' |
';
print '| '.$langs->trans("NumberOfUnit").' | | ';
@@ -125,11 +125,11 @@ if (empty($conf) || ! is_object($conf))
// Label
$valformovementlabel=(GETPOST("label")?GETPOST("label"):$langs->trans("MovementTransferStock", $productref));
print '
';
- print '| '.$langs->trans("MovementLabel").' | ';
+ print ''.$langs->trans("MovementLabel").' | ';
print '';
- print '';
+ print '';
print ' | ';
- print ''.$langs->trans("InventoryCode").' | | ';
+ print ''.$langs->trans("InventoryCode").' | | ';
print '
';
print '
';
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index eeacf27aaec..28b3c9b12f3 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -1696,7 +1696,7 @@ class Task extends CommonObject
*/
function getLibStatut($mode=0)
{
- return $this->LibStatut($this->fk_statut,$mode);
+ return $this->LibStatut($this->fk_statut, $mode);
}
/**
@@ -1706,18 +1706,18 @@ class Task extends CommonObject
* @param integer $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/
- function LibStatut($statut,$mode=0)
+ function LibStatut($statut, $mode=0)
{
// list of Statut of the task
$this->statuts[0]='Draft';
- $this->statuts[1]='Validated';
+ $this->statuts[1]='ToDo';
$this->statuts[2]='Running';
$this->statuts[3]='Finish';
$this->statuts[4]='Transfered';
$this->statuts_short[0]='Draft';
- $this->statuts_short[1]='Validated';
+ $this->statuts_short[1]='ToDo';
$this->statuts_short[2]='Running';
- $this->statuts_short[3]='Finish';
+ $this->statuts_short[3]='Completed';
$this->statuts_short[4]='Transfered';
global $langs;
@@ -1735,7 +1735,7 @@ class Task extends CommonObject
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts_short[$statut]);
- if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
+ if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts_short[$statut]);
}
@@ -1744,7 +1744,7 @@ class Task extends CommonObject
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
- if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
+ if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
}
@@ -1753,27 +1753,31 @@ class Task extends CommonObject
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
- if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
+ if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]);
}
if ($mode == 5)
- {
- if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
- if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
- if ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
- if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
- if ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
- if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
- }
- if ($mode == 6)
{
/*if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
if ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
- if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
+ if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
- if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');*/
+ if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
+ */
+ //return $this->progress.' %';
+ return ' ';
+ }
+ if ($mode == 6)
+ {
+ /*if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
+ if ($statut==1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
+ if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
+ if ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
+ if ($statut==4) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
+ if ($statut==5) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
+ */
//return $this->progress.' %';
return ' ';
}
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index a2bb784c062..a2db82fc0ed 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -285,7 +285,7 @@ if ($id > 0 || ! empty($ref))
//$arrayofuseridoftask=$object->getListContactId('internal');
$head = task_prepare_head($object);
- dol_fiche_head($head, 'task_contact', $langs->trans("Task"), -1, 'projecttask');
+ dol_fiche_head($head, 'task_contact', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
$param=(GETPOST('withproject')?'&withproject=1':'');
diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php
index 7fc0b981902..1cb5acb73b5 100644
--- a/htdocs/projet/tasks/document.php
+++ b/htdocs/projet/tasks/document.php
@@ -224,7 +224,7 @@ if ($object->id > 0)
}
$head = task_prepare_head($object);
- dol_fiche_head($head, 'task_document', $langs->trans("Task"), -1, 'projecttask');
+ dol_fiche_head($head, 'task_document', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
// Files list constructor
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php
index da33b8b7607..f915aaf836a 100644
--- a/htdocs/projet/tasks/note.php
+++ b/htdocs/projet/tasks/note.php
@@ -202,7 +202,7 @@ if ($object->id > 0)
}
$head = task_prepare_head($object);
- dol_fiche_head($head, 'task_notes', $langs->trans('Task'), -1, 'projecttask');
+ dol_fiche_head($head, 'task_notes', $langs->trans('Task'), -1, 'projecttask', 0, '', 'reposition');
$param=(GETPOST('withproject')?'&withproject=1':'');
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index b70c09cb2bd..10f64869257 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -221,7 +221,7 @@ if ($id > 0 || ! empty($ref))
// Tabs for project
$tab='tasks';
$head=project_prepare_head($projectstatic);
- dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public?'projectpub':'project'));
+ dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public?'projectpub':'project'), 0, '', '');
$param=($mode=='mine'?'&mode=mine':'');
@@ -352,7 +352,7 @@ if ($id > 0 || ! empty($ref))
print '
';
print '
';
- dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask');
+ dol_fiche_head($head, 'task_task', $langs->trans("Task"), 0, 'projecttask', 0, '', '');
print '
';
@@ -437,7 +437,7 @@ if ($id > 0 || ! empty($ref))
$param=($withproject?'&withproject=1':'');
$linkback=$withproject?''.$langs->trans("BackToList").'':'';
- dol_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask');
+ dol_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
if ($action == 'delete')
{
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 174da003e14..5f826baf03e 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -436,7 +436,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
if (empty($projectidforalltimes))
{
$head=task_prepare_head($object);
- dol_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask');
+ dol_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
if ($action == 'deleteline')
{
@@ -547,6 +547,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print '';
print '';
+ print '
';
+ print '
';
+
+ print '';
print '';
if (! empty($conf->global->MEMBER_NEWFORM_TEXT)) print $langs->trans($conf->global->MEMBER_NEWFORM_TEXT)."
\n";
else print $langs->trans("NewSubscriptionDesc",$conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n";
+print '
';
dol_htmloutput_errors($errmsg);
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 74ffcfd120a..37873033535 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -264,6 +264,7 @@ else if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$param
* Actions
*/
+// Action dopayment is called after choosing the payment mode
if ($action == 'dopayment')
{
if ($paymentmethod == 'paypal')
@@ -284,10 +285,18 @@ if ($action == 'dopayment')
$desc=GETPOST("desc",'alpha');
$mesg='';
- if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount"));
+ if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE))
+ {
+ $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount"));
+ $action='';
+ }
//elseif (empty($EMAIL)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail"));
//elseif (! isValidEMail($EMAIL)) $mesg=$langs->trans("ErrorBadEMail",$EMAIL);
- elseif (! $origfulltag) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode"));
+ elseif (! $origfulltag)
+ {
+ $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode"));
+ $action='';
+ }
//var_dump($_POST);
if (empty($mesg))
@@ -310,6 +319,7 @@ if ($action == 'dopayment')
dol_syslog("PAYPAL_API_KO: $PAYPAL_API_KO", LOG_DEBUG);
dol_syslog("PAYPAL_API_PRICE: $PAYPAL_API_PRICE", LOG_DEBUG);
dol_syslog("PAYPAL_API_DEVISE: $PAYPAL_API_DEVISE", LOG_DEBUG);
+ // All those fields may be empty when making a payment for a free amount for example
dol_syslog("shipToName: $shipToName", LOG_DEBUG);
dol_syslog("shipToStreet: $shipToStreet", LOG_DEBUG);
dol_syslog("shipToCity: $shipToCity", LOG_DEBUG);
@@ -327,9 +337,10 @@ if ($action == 'dopayment')
//$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE;
// A redirect is added if API call successfull
- print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG);
+ $mesg = print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG);
- exit;
+ // If we are here, it means the Paypal redirect was not done, so we show error message
+ $action = '';
}
}
@@ -379,10 +390,12 @@ if ($action == 'dopayment')
// Called when choosing Stripe mode, after the 'dopayment'
if ($action == 'charge')
{
+ $amountstripe = $amount;
+
// Correct the amount according to unit of currency
// See https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
- if (! in_array($currency, $arrayzerounitcurrency)) $amount=$amount * 100;
+ if (! in_array($currency, $arrayzerounitcurrency)) $amountstripe=$amountstripe * 100;
dol_syslog("POST keys : ".join(',', array_keys($_POST)), LOG_DEBUG, 0, '_stripe');
dol_syslog("POST values: ".join(',', $_POST), LOG_DEBUG, 0, '_stripe');
@@ -411,7 +424,7 @@ if ($action == 'charge')
dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe');
$charge = \Stripe\Charge::create(array(
'customer' => $customer->id,
- 'amount' => price2num($amount, 'MU'),
+ 'amount' => price2num($amountstripe, 'MU'),
'currency' => $currency,
'description' => 'Stripe payment: '.$FULLTAG,
'metadata' => array("FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name),
@@ -850,7 +863,7 @@ if ($source == 'invoice')
print ''."\n";
// Amount
- print '