';
print '';
-print '| ' . $langs->trans('OtherOptions') . ' | ';
+print '' . $langs->trans('OtherOptions') . ' | ';
print "
\n";
-foreach ( $list as $key ) {
- $var = ! $var;
-
- print '';
-
- // Param
- $label = $langs->trans($key);
- print ' | ';
-
- // Value
- print '';
- print '';
- print ' |
';
+if (! empty($user->admin))
+{
+ // TO DO Mutualize code for yes/no constants
+ $var = ! $var;
+ print "";
+ print '| ' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . ' | ';
+ if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
+ print '';
+ print img_picto($langs->trans("Activated"), 'switch_on');
+ print ' | ';
+ } else {
+ print '';
+ print img_picto($langs->trans("Disabled"), 'switch_off');
+ print ' | ';
+ }
+ print '
';
+
+ $var = ! $var;
+ print "";
+ print '| ' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . ' | ';
+ if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
+ print '';
+ print img_picto($langs->trans("Activated"), 'switch_on');
+ print ' | ';
+ } else {
+ print '';
+ print img_picto($langs->trans("Disabled"), 'switch_off');
+ print ' | ';
+ }
+ print '
';
+
+ $var = ! $var;
+ print "";
+ print '| ' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ' | ';
+ if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
+ print '';
+ print img_picto($langs->trans("Activated"), 'switch_on');
+ print ' | ';
+ } else {
+ print '';
+ print img_picto($langs->trans("Disabled"), 'switch_off');
+ print ' | ';
+ }
+ print '
';
}
-foreach ( $list_account as $key ) {
- $var = ! $var;
-
- print '';
-
- // Param
- $label = $langs->trans($key);
- print ' | ';
-
- // Value
- print '';
- print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
- print ' |
';
-}
+// Param a user $user->rights->accountancy->chartofaccount can access
+if (! empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount))
+{
+ foreach ( $list as $key ) {
+ $var = ! $var;
+
+ if ($key != 'ACCOUNTING_MANAGE_ZERO')
+ {
+ print '';
+
+ // Param
+ $label = $langs->trans($key);
+ print ' | ';
+
+ // Value
+ print '';
+ print '';
+ print ' |
';
+ }
+ if ($key == 'ACCOUNTING_MANAGE_ZERO')
+ {
+ $var = ! $var;
+ print "";
+ print '| ' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ' | ';
+ if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
+ print '';
+ print img_picto($langs->trans("Activated"), 'switch_on');
+ print ' | ';
+ } else {
+ print '';
+ print img_picto($langs->trans("Disabled"), 'switch_off');
+ print ' | ';
+ }
+ print '
';
+ }
+ }
-// TO DO Mutualize code for yes/no constants
-$var = ! $var;
-print "";
-print '| ' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . ' | ';
-if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
- print '';
- print img_picto($langs->trans("Activated"), 'switch_on');
- print ' | ';
-} else {
- print '';
- print img_picto($langs->trans("Disabled"), 'switch_off');
- print ' | ';
+ foreach ( $list_account as $key ) {
+ $var = ! $var;
+
+ print '
';
+
+ // Param
+ $label = $langs->trans($key);
+ print ' | ';
+
+ // Value
+ print '';
+ print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
+ print ' |
';
+ }
}
-print '';
-
-$var = ! $var;
-print "";
-print '| ' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . ' | ';
-if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
- print '';
- print img_picto($langs->trans("Activated"), 'switch_on');
- print ' | ';
-} else {
- print '';
- print img_picto($langs->trans("Disabled"), 'switch_off');
- print ' | ';
-}
-print '
';
-
-$var = ! $var;
-print "";
-print '| ' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ' | ';
-if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
- print '';
- print img_picto($langs->trans("Activated"), 'switch_on');
- print ' | ';
-} else {
- print '';
- print img_picto($langs->trans("Disabled"), 'switch_off');
- print ' | ';
-}
-print '
';
-
-$var = ! $var;
-print "";
-print '| ' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ' | ';
-if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
- print '';
- print img_picto($langs->trans("Activated"), 'switch_on');
- print ' | ';
-} else {
- print '';
- print img_picto($langs->trans("Disabled"), 'switch_off');
- print ' | ';
-}
-print '
';
print "
\n";
diff --git a/htdocs/accountancy/admin/journal.php b/htdocs/accountancy/admin/journal.php
index b511c6dfd1a..ac3cceee2d5 100644
--- a/htdocs/accountancy/admin/journal.php
+++ b/htdocs/accountancy/admin/journal.php
@@ -38,8 +38,10 @@ require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
$langs->load("accountancy");
// Security check
-if (! $user->admin)
- accessforbidden();
+if (empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount))
+{
+ accessforbidden();
+}
$action = GETPOST('action', 'alpha');
diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php
index 554a1677c2a..7d640968eb1 100644
--- a/htdocs/accountancy/admin/productaccount.php
+++ b/htdocs/accountancy/admin/productaccount.php
@@ -45,7 +45,7 @@ $langs->load("accountancy");
if (empty($conf->accounting->enabled)) {
accessforbidden();
}
-if (! $user->rights->accounting->ventilation->read)
+if (! $user->rights->accounting->bind->write)
accessforbidden();
// search & action GETPOST
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 903b3bdf9f1..9e1022ae5cc 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -225,7 +225,7 @@ if ($action == 'delbookkeepingyearconfirm') {
}
else
{
- setEventMessages("NothingDeleted", null, 'warnings');
+ setEventMessages("NoRecordDeleted", null, 'warnings');
Header("Location: list.php");
exit;
}
@@ -321,7 +321,7 @@ if ($action == 'delbookkeepingyear') {
'default' => $deljournal
);
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250);
print $formconfirm;
}
diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index 3a8dd3bec51..8d9aad6d7a3 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -202,7 +202,7 @@ if ($action == 'delbookkeepingyear') {
'default' => $delyear
);
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250);
print $formconfirm;
}
diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php
index c49dd7ce78a..8d2a838a151 100644
--- a/htdocs/accountancy/customer/card.php
+++ b/htdocs/accountancy/customer/card.php
@@ -43,7 +43,7 @@ if ($user->societe_id > 0)
/*
* Actions
*/
-if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
+if ($action == 'ventil' && $user->rights->accounting->bind->write) {
if (! GETPOST('cancel', 'alpha')) {
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
$sql .= " SET fk_code_ventilation = " . $codeventil;
diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index 5d52c8b75d5..586d08acad0 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -43,7 +43,7 @@ if (empty($conf->accounting->enabled)) {
}
if ($user->societe_id > 0)
accessforbidden();
-if (! $user->rights->accounting->ventilation->read)
+if (! $user->rights->accounting->bind->write)
accessforbidden();
// Filter
diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php
index 2a69c4ee91e..faa1ce7cd62 100644
--- a/htdocs/accountancy/customer/lines.php
+++ b/htdocs/accountancy/customer/lines.php
@@ -82,7 +82,7 @@ if (! $sortorder) {
// Security check
if ($user->societe_id > 0)
accessforbidden();
-if (! $user->rights->accounting->ventilation->dispatch)
+if (! $user->rights->accounting->bind->write)
accessforbidden();
$formventilation = new FormVentilation($db);
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index 0145a803778..2e149437cd5 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -84,7 +84,7 @@ if (! $sortorder) {
// Security check
if ($user->societe_id > 0)
accessforbidden();
-if (! $user->rights->accounting->ventilation->dispatch)
+if (! $user->rights->accounting->bind->write)
accessforbidden();
$formventilation = new FormVentilation($db);
diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php
index 28ca975f089..d23f0eb8081 100644
--- a/htdocs/accountancy/index.php
+++ b/htdocs/accountancy/index.php
@@ -75,10 +75,6 @@ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step,
print "';
print '| '.$arraytitle.' | ';
print ''.$langs->trans('Date').' | ';
- print ''.$langs->trans('AmountTTC').' | ';
+ if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('Currency').' | ';
if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyAmountTTC').' | ';
- print ''.$alreadypayedlabel.' | ';
if (!empty($conf->multicurrency->enabled)) print ''.$multicurrencyalreadypayedlabel.' | ';
- print ''.$remaindertopay.' | ';
if (!empty($conf->multicurrency->enabled)) print ''.$multicurrencyremaindertopay.' | ';
+ print ''.$langs->trans('AmountTTC').' | ';
+ print ''.$alreadypayedlabel.' | ';
+ print ''.$remaindertopay.' | ';
print ''.$langs->trans('PaymentAmount').' | ';
if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyPaymentAmount').' | ';
print ' | ';
@@ -624,12 +628,35 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Date
print ''.dol_print_date($db->jdate($objp->df),'day')." | \n";
-
- // Price
- print ''.price($sign * $objp->total_ttc).' | ';
-
+
+ // Currency
+ print ''.$objp->multicurrency_code." | \n";
+
// Multicurrency Price
- if (!empty($conf->multicurrency->enabled)) print ''.price($sign * $objp->multicurrency_total_ttc).' | ';
+ if (!empty($conf->multicurrency->enabled))
+ {
+ print '';
+ if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $objp->multicurrency_total_ttc);
+ print ' | ';
+
+ // Multicurrency Price
+ print '';
+ if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
+ {
+ print price($sign * $multicurrency_payment);
+ if ($multicurrency_creditnotes) print '+'.price($multicurrency_creditnotes);
+ if ($multicurrency_deposits) print '+'.price($multicurrency_deposits);
+ }
+ print ' | ';
+
+ // Multicurrency Price
+ print '';
+ if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay);
+ print ' | ';
+ }
+
+ // Price
+ print ''.price($sign * $objp->total_ttc).' | ';
// Received or paid back
print ''.price($sign * $paiement);
@@ -637,25 +664,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if ($deposits) print '+'.price($deposits);
print ' | ';
- // Multicurrency Price
- if (!empty($conf->multicurrency->enabled))
- {
- print ''.price($sign * $multicurrency_payment);
- if ($multicurrency_creditnotes) print '+'.price($multicurrency_creditnotes);
- if ($multicurrency_deposits) print '+'.price($multicurrency_deposits);
- print ' | ';
- }
-
// Remain to take or to pay back
print ''.price($sign * $remaintopay).' | ';
//$test= price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits));
- // Multicurrency Price
- if (!empty($conf->multicurrency->enabled))
- {
- print ''.price($sign * $multicurrency_remaintopay).' | ';
- }
-
// Amount
print '';
@@ -665,7 +677,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if ($action != 'add_paiement')
{
- if(!empty($conf->global->INVOICE_AUTO_FILLJS))
+ if (!empty($conf->use_javascript_ajax))
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'");
print '';
print '';
@@ -678,7 +690,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print " | ";
// Multicurrency Price
- if (!empty($conf->multicurrency->enabled))
+ if (! empty($conf->multicurrency->enabled))
{
print '';
@@ -686,17 +698,20 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$namef = 'multicurrency_amount_'.$objp->facid;
$nameRemain = 'multicurrency_remain_'.$objp->facid;
- if ($action != 'add_paiement')
+ if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
{
- if(!empty($conf->global->INVOICE_AUTO_FILLJS))
- print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
- print '';
- print '';
- }
- else
- {
- print '';
- print '';
+ if ($action != 'add_paiement')
+ {
+ if (!empty($conf->use_javascript_ajax))
+ print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
+ print '';
+ print '';
+ }
+ else
+ {
+ print '';
+ print '';
+ }
}
print " | ";
}
@@ -727,16 +742,16 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{
// Print total
print '
';
- print '| '.$langs->trans('TotalTTC').' | ';
- print ''.price($sign * $total_ttc).' | ';
+ print ''.$langs->trans('TotalTTC').' | ';
if (!empty($conf->multicurrency->enabled)) print ' | ';
+ if (!empty($conf->multicurrency->enabled)) print ' | ';
+ if (!empty($conf->multicurrency->enabled)) print ' | ';
+ print ''.price($sign * $total_ttc).' | ';
print ''.price($sign * $totalrecu);
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
if ($totalrecudeposits) print '+'.price($totalrecudeposits);
print ' | ';
- if (!empty($conf->multicurrency->enabled)) print ' | ';
print ''.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).' | ';
- if (!empty($conf->multicurrency->enabled)) print ' | ';
print ' | ';
if (!empty($conf->multicurrency->enabled)) print ' | ';
print ' | ';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 871f6a2d209..ceac1fc4b44 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -4102,6 +4102,11 @@ class Form
$out='';
$out.= '