';
}
- // Numero statement
+ // Numero statement
if (! empty($arrayfields['b.num_releve']['checked']))
{
print '
';
@@ -904,6 +912,7 @@ if ($resql)
if (! empty($arrayfields['ba.ref']['checked'])) print_liste_field_titre($arrayfields['ba.ref']['label'],$_SERVER['PHP_SELF'],'ba.ref','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['b.debit']['checked'])) print_liste_field_titre($arrayfields['b.debit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['b.credit']['checked'])) print_liste_field_titre($arrayfields['b.credit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['balancebefore']['checked'])) print_liste_field_titre($arrayfields['balancebefore']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['b.num_releve']['checked'])) print_liste_field_titre($arrayfields['b.num_releve']['label'],$_SERVER['PHP_SELF'],'b.num_releve','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['b.conciliated']['checked'])) print_liste_field_titre($arrayfields['b.conciliated']['label'],$_SERVER['PHP_SELF'],'b.rappro','',$param,'align="center"',$sortfield,$sortorder);
@@ -929,7 +938,7 @@ if ($resql)
$objp = $db->fetch_object($resql);
// If we are in a situation where we need/can show balance, we calculate the start of balance
- if (! $balancecalculated && ! empty($arrayfields['balance']['checked']) && $mode_balance_ok)
+ if (! $balancecalculated && (! empty($arrayfields['balancebefore']['checked']) || ! empty($arrayfields['balance']['checked'])) && $mode_balance_ok)
{
if (! $account)
{
@@ -970,7 +979,7 @@ if ($resql)
$balancefieldfound=false;
foreach($arrayfields as $key => $val)
{
- if ($key == 'balance')
+ if ($key == 'balancebefore' || $key == 'balance')
{
$balancefieldfound=true;
continue;
@@ -1284,25 +1293,46 @@ if ($resql)
if (! $i) $totalarray['totalcredfield']=$totalarray['nbfield'];
}
+ // Balance before
+ if (! empty($arrayfields['balancebefore']['checked']))
+ {
+ if ($mode_balance_ok)
+ {
+ $balancebefore = price2num($balance - ($sign * $objp->amount),'MT');
+ if ($balancebefore >= 0)
+ {
+ print '
'.price($balancebefore).'
';
+ }
+ else
+ {
+ print '
'.price($balancebefore).'
';
+ }
+ }
+ else
+ {
+ print '
-
';
+ }
+ if (! $i) $totalarray['nbfield']++;
+ }
// Balance
if (! empty($arrayfields['balance']['checked']))
{
- if ($mode_balance_ok)
- {
- if ($balance >= 0)
- {
- print '
'.price($balance).'
';
- }
- else
- {
- print '
'.price($balance).'
';
- }
- }
- else
- {
- print '
-
';
- }
- if (! $i) $totalarray['nbfield']++;
+ if ($mode_balance_ok)
+ {
+ if ($balance >= 0)
+ {
+ print '
';
}
// VAT
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 10a31b215f7..4bff96700d5 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -944,6 +944,7 @@ class FormFile
* @param int $disablemove 1=Disable move button, 0=Position move is possible.
* @param int $addfilterfields Add line with filters
* @return int <0 if KO, nb of files shown if OK
+ * @see list_of_autoecmfiles
*/
function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0)
{
@@ -1115,7 +1116,7 @@ class FormFile
// Preview link
if (! $editline) print $this->showPreview($file, $modulepart, $filepath);
// Public share link
- if (! $editline && ! empty($filearray[$key]['hashp'])) print 'ee';
+ //if (! $editline && ! empty($filearray[$key]['hashp'])) print pictowithlinktodirectdownload;
print "\n";
@@ -1236,7 +1237,7 @@ class FormFile
print "";
print '';
- if (! $editline && $nboflines > 1 && is_object($object)) {
+ if ($nboflines > 1 && is_object($object)) {
if (! empty($conf->use_javascript_ajax) && $permtoeditline) {
$table_element_line = 'ecm_files';
include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
@@ -1269,6 +1270,7 @@ class FormFile
* @param string $url Full url to use for click links ('' = autodetect)
* @param int $addfilterfields Add line with filters
* @return int <0 if KO, nb of files shown if OK
+ * @see list_of_documents
*/
function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0)
{
@@ -1475,7 +1477,8 @@ class FormFile
print dol_trunc($file['name'],$maxlength,'middle');
print '';
- print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$');
+ //print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$');
+ print $this->showPreview($file, $modulepart, $file['relativename']);
print "\n";
print '
'.dol_print_size($file['size'],1,1).'
';
@@ -1677,7 +1680,7 @@ class FormFile
/**
* Show detail icon with link for preview
*
- * @param array $file File
+ * @param array $file Array with data of file. Example: array('name'=>...)
* @param string $modulepart propal, facture, facture_fourn, ...
* @param string $relativepath Relative path of docs
* @param string $ruleforpicto Rule for picto: 0=Use the generic preview picto, 1=Use the picto of mime type of file)
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index d357141fa4d..577d6356752 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -159,7 +159,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
// if we're in a directory and we want recursive behavior, call this function again
if ($recursive)
{
- $file_list = array_merge($file_list, dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode, $nohook, ($relativename?$relativename.'/':'').$file));
+ $file_list = array_merge($file_list, dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode, $nohook, ($relativename!=''?$relativename.'/':'').$file));
}
}
else if (! $isdir && (($types == "files") || ($types == "all")))
diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php
index f50dc62fb9b..8380d5c23f5 100644
--- a/htdocs/core/tpl/document_actions_post_headers.tpl.php
+++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php
@@ -62,7 +62,7 @@ $savingdocmask='';
if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX))
{
//var_dump($modulepart);
- if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','supplier_proposal','ficheinter','contract','project','project_task','expensereport')))
+ if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','supplier_proposal','ficheinter','contract','project','project_task','expensereport','tax')))
{
$savingdocmask=dol_sanitizeFileName($object->ref).'-__file__';
}
@@ -87,7 +87,7 @@ $formfile->form_attach_new_file(
);
$disablemove=1;
-if (in_array($modulepart, array('product', 'produit', 'societe', 'user'))) $disablemove=0; // Drag and drop for up and down allowed on product
+if (in_array($modulepart, array('product', 'produit', 'societe', 'user'))) $disablemove=0; // Drag and drop for up and down allowed on product, thirdparty, ...
// List of document
$formfile->list_of_documents(
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 0641bdea8f3..0b59204f488 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -76,7 +76,7 @@ if ($nolinesbefore) {
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
{
?>
-
trans('SupplierProposalRefFourn'); ?>
+
trans('SupplierRef'); ?>
trans('VAT'); ?>
trans('PriceUHT'); ?>
@@ -285,7 +285,7 @@ else {
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
{
?>
-
">
+
">
0 if OK
*/
- function update($user=null, $notrigger=0)
+ function update($user, $notrigger=0)
{
global $conf, $langs;
$error=0;
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index 113f262e2a9..5f8c5787773 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -244,6 +244,8 @@ if ($object->id > 0)
print '';
print '';
+ print '';
+
dol_fiche_end();
diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php
index 3f4fa2d2910..5db07cd1412 100644
--- a/htdocs/install/repair.php
+++ b/htdocs/install/repair.php
@@ -1036,11 +1036,11 @@ if ($ok && GETPOST('force_utf8_on_tables','alpha'))
print '
';
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index 8c402d53705..e54d613628e 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -24,6 +24,7 @@ PaymentsNotLinkedToInvoice=Payments not linked to any invoice, so not linked to
PaymentsNotLinkedToUser=Payments not linked to any user
Profit=Profit
AccountingResult=Accounting result
+BalanceBefore=Balance (before)
Balance=Balance
Debit=Debit
Credit=Credit
diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php
index fe6731f10df..d7915512b2c 100644
--- a/htdocs/product/stock/class/productlot.class.php
+++ b/htdocs/product/stock/class/productlot.class.php
@@ -470,14 +470,15 @@ class Productlot extends CommonObject
* Return a link to the a lot card (with optionaly the picto)
* Use this->id,this->lastname, this->firstname
*
- * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
- * @param string $option On what the link point to
- * @param integer $notooltip 1=Disable tooltip
- * @param int $maxlen Max length of visible user name
- * @param string $morecss Add more css on link
- * @return string String with URL
+ * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
+ * @param string $option On what the link point to
+ * @param integer $notooltip 1=Disable tooltip
+ * @param int $maxlen Max length of visible user name
+ * @param string $morecss Add more css on link
+ * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
+ * @return string String with URL
*/
- function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='')
+ function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='', $save_lastsearch_value=-1)
{
global $langs, $conf, $db;
global $dolibarr_main_authentication, $dolibarr_main_demo;