diff --git a/ChangeLog b/ChangeLog
index e048f09a897..57263615ebb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.3 compared to 3.2 *****
For users:
+- New: If field "signature" is filled into user table, text is added
+ at end of predefined email texts. If option MAIL_DO_NOT_USE_SIGN is on, this
+ feautre is disabled.
- New: Add link "Back to list" on all cards.
- New: After first install, warning are visible onto mandatory setup not
configured. Show also total number of activated modules.
@@ -26,10 +29,11 @@ For users:
- New: Suggest a method to generate a backup file for user with no access
to mysqldump binary.
- New: Can correct stock of a warehouse from warehouse card.
-- New: task #185 : Can input amount when correcting stock to recalculate PMP.
-- New: [ task #454 ] Add "No category" into filters on category.
-- New: Update language files (de, tr, pt).
+- New: [ task #185 ]: Can input amount when correcting stock to recalculate PMP.
+- New: [ task #454 ]: Add "No category" into filters on category.
+- New: Update language files (de, tr, pt, ca_ES, es_ES).
- New: Auto check box on page to edit interface options of user.
+- New: More surface control on stock correction page.
- New: Add great britain provinces.
- New: Update libs/tools/logo for DoliWamp.
- Fix: No images into product description lines as PDF generation does
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 76cdd822ce5..11ce0f53b4b 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -280,7 +280,7 @@ class Commande extends CommonOrder
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
- dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'.*');
+ dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'*.*');
}
}
}
diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php
index 5efeaad7b04..9416732af77 100644
--- a/htdocs/commande/liste.php
+++ b/htdocs/commande/liste.php
@@ -98,7 +98,8 @@ $formother = new FormOther($db);
$formfile = new FormFile($db);
$companystatic = new Societe($db);
-llxHeader();
+$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
+llxHeader('',$langs->trans("Orders"),$help_url);
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index cae2461a780..b99b92391a9 100755
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -29,10 +29,12 @@
require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
-require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php");
+require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
+require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/report.lib.php");
+if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
$langs->load('orders');
$langs->load('deliveries');
@@ -73,10 +75,9 @@ if ($action == 'create')
}
}
$now=dol_now();
-$html = new Form($db);
-$formfile = new FormFile($db);
-$companystatic = new Societe($db);
-$htmlother = new FormOther($db);
+
+$viewstatut=GETPOST('viewstatut');
+
/*
* Actions
@@ -267,30 +268,30 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
{
$fk_parent_line = 0;
}
- $result = $object->addline(
- $id,
- $desc,
- $lines[$i]->subprice,
- $lines[$i]->qty,
- $lines[$i]->tva_tx,
- $lines[$i]->localtax1_tx,
- $lines[$i]->localtax2_tx,
- $lines[$i]->fk_product,
- $lines[$i]->remise_percent,
- $date_start,
- $date_end,
- 0,
- $lines[$i]->info_bits,
- $lines[$i]->fk_remise_except,
- 'HT',
- 0,
- $product_type,
- $lines[$i]->rang,
- $lines[$i]->special_code,
- $object->origin,
- $lines[$i]->rowid,
- $fk_parent_line
- );
+ $result = $object->addline(
+ $id,
+ $desc,
+ $lines[$i]->subprice,
+ $lines[$i]->qty,
+ $lines[$i]->tva_tx,
+ $lines[$i]->localtax1_tx,
+ $lines[$i]->localtax2_tx,
+ $lines[$i]->fk_product,
+ $lines[$i]->remise_percent,
+ $date_start,
+ $date_end,
+ 0,
+ $lines[$i]->info_bits,
+ $lines[$i]->fk_remise_except,
+ 'HT',
+ 0,
+ $product_type,
+ $lines[$i]->rang,
+ $lines[$i]->special_code,
+ $object->origin,
+ $lines[$i]->rowid,
+ $fk_parent_line
+ );
if ($result > 0)
{
$lineid=$result;
@@ -342,146 +343,149 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$mesgs[]='
'.$object->error.'
';
}
}
+}
- /*
- * View
- */
- $html = new Form($db);
- $htmlother = new FormOther($db);
- $formfile = new FormFile($db);
- $now=dol_now();
- // Mode creation
- if ($action == 'create')
+/*
+ * View
+ */
+
+$html = new Form($db);
+$htmlother = new FormOther($db);
+$formfile = new FormFile($db);
+$companystatic = new Societe($db);
+
+// Mode creation
+if ($action == 'create')
+{
+ $facturestatic=new Facture($db);
+
+ llxHeader();
+ print_fiche_titre($langs->trans('NewBill'));
+
+ $soc = new Societe($db);
+ if ($socid) $res=$soc->fetch($socid);
+ if ($res)
{
- $facturestatic=new Facture($db);
+ $cond_reglement_id = $soc->cond_reglement_id;
+ $mode_reglement_id = $soc->mode_reglement_id;
+ $remise_percent = $soc->remise_percent;
+ }
+ $remise_absolue = 0;
+ $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
- llxHeader();
- print_fiche_titre($langs->trans('NewBill'));
+ $absolute_discount=$soc->getAvailableDiscounts();
+ print '\n";
}
+
//Mode liste
-else
+if (($action != 'create' && $action != 'add') || ! empty($mesgs))
{
llxHeader();
?>
-
rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ' WHERE c.fk_soc = s.rowid';
- $sql.= ' AND c.fk_statut in (1, 2) AND c.facture = 0';
+ // Which invoice to show
+ if ($viewstatut <> '')
+ {
+ if ($viewstatut < 4 && $viewstatut > -2)
+ {
+ $sql.= ' AND c.fk_statut ='.$viewstatut; // brouillon, validee, en cours, annulee
+ if ($viewstatut == 3)
+ {
+ $sql.= ' AND c.facture = 0'; // need to create invoice
+ }
+ }
+ if ($viewstatut == 4)
+ {
+ $sql.= ' AND c.facture = 1'; // invoice created
+ }
+ if ($viewstatut == -2) // To process
+ {
+ //$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0';
+ $sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
+ }
+ }
$sql.= ' AND s.entity = '.$conf->entity;
if ($socid) $sql.= ' AND s.rowid = '.$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
@@ -511,18 +535,18 @@ else
{
$sql.= " AND (c.ref LIKE '%".$db->escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')";
}
-
+
//Date filter
if ($date_start && $date_end) $sql.= " AND c.date_commande >= '".$db->idate($date_start)."' AND c.date_commande <= '".$db->idate($date_end)."'";
if ($date_starty && $date_endy) $sql.= " AND c.date_livraison >= '".$db->idate($date_starty)."' AND c.date_livraison <= '".$db->idate($date_endy)."'";
-
+
if (!empty($sref_client))
{
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
}
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
$resql = $db->query($sql);
-
+
if ($resql)
{
if ($socid)
@@ -545,7 +569,7 @@ else
print '';
$companystatic->id=$socid;
$companystatic->nom=$soc->nom;
-
+
print $companystatic->getNomUrl(1,'customer');
print '
';
print '';
@@ -557,7 +581,7 @@ else
print_liste_field_titre($langs->trans('Status'),'','','','','align="right"');
print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"');
print '';
-
+
// Lignes des champs de filtre
print '';
-
+
print '
';
-
+
/*
- * Boutons actions
+ * Boutons actions
*/
print '';
print '
';
diff --git a/htdocs/commissions/index.php b/htdocs/commissions/index.php
index d7e024990d0..d36a075bcc2 100644
--- a/htdocs/commissions/index.php
+++ b/htdocs/commissions/index.php
@@ -160,8 +160,6 @@ else
$sql.= " AND f.fk_statut > 1";
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND d.fk_facture = f.rowid";
-if ($conf->global->COMMISSION_BASE == "MARGIN")
- $sql.= " AND d.buy_price_ht IS NOT NULL AND d.buy_price_ht <> 0";
if ($agentid > 0)
$sql.= " AND sc.fk_user = $agentid";
if (!empty($startdate))
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index a8e10747977..87405b5e0be 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1724,7 +1724,7 @@ class Facture extends CommonInvoice
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
- dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'.*');
+ dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'*.*');
}
}
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 29433cfb63b..d990ce99586 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1424,7 +1424,7 @@ class Form
$outval='';
$opt = '