Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/accountancy/customer/index.php
	htdocs/accountancy/expensereport/index.php
	htdocs/compta/facture/class/facture-rec.class.php
	htdocs/fichinter/class/fichinter.class.php
	htdocs/societe/class/societe.class.php
	htdocs/societe/list.php
This commit is contained in:
Laurent Destailleur 2017-09-12 13:26:25 +02:00
commit a4665e17d4
21 changed files with 554 additions and 382 deletions

View File

@ -207,8 +207,8 @@ for($i = 1; $i <= 12; $i ++) {
} }
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,"; $sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
} }
@ -234,8 +234,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) { while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>'; print '<tr class="oddeven"><td>';
print '<td align="left">' . $row[1] . '</td>'; if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) { for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>'; print '<td align="right">' . price($row[$i]) . '</td>';
} }
@ -264,8 +276,8 @@ for($i = 1; $i <= 12; $i ++) {
} }
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,"; $sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
} }
@ -291,7 +303,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) { while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>'; print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
print '<td align="left">' . $row[1] . '</td>'; print '<td align="left">' . $row[1] . '</td>';
for($i = 2; $i <= 12; $i ++) { for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>'; print '<td align="right">' . price($row[$i]) . '</td>';
@ -360,6 +385,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print "</table>\n"; print "</table>\n";
print '</div>'; print '</div>';
if (! empty($conf->margin->enabled)) { if (! empty($conf->margin->enabled)) {
print "<br>\n"; print "<br>\n";
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';

View File

@ -184,8 +184,8 @@ for($i = 1; $i <= 12; $i ++) {
} }
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,"; $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; $sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
} }
@ -207,9 +207,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) { while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>'; print '<tr class="oddeven"><td>';
print '<td align="left">' . $row[1] . '</td>'; if ($row[0] == 'tobind')
for($i = 2; $i <= 12; $i ++) { {
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>'; print '<td align="right">' . price($row[$i]) . '</td>';
} }
print '<td align="right">' . price($row[13]) . '</td>'; print '<td align="right">' . price($row[13]) . '</td>';
@ -238,8 +250,8 @@ for($i = 1; $i <= 12; $i ++) {
} }
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,"; $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; $sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
} }
@ -261,9 +273,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) { while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>'; print '<tr class="oddeven"><td>';
print '<td align="left">' . $row[1] . '</td>'; if ($row[0] == 'tobind')
for($i = 2; $i <= 12; $i ++) { {
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>'; print '<td align="right">' . price($row[$i]) . '</td>';
} }
print '<td align="right">' . price($row[13]) . '</td>'; print '<td align="right">' . price($row[13]) . '</td>';

View File

@ -102,12 +102,15 @@ $idpays = $mysoc->country_id;
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,"; $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
$sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,"; $sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,";
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, bu1.type as typeop,"; $sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, bu1.type as typeop_company,";
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, bu2.type as typeop"; $sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, bu2.type as typeop_user,";
$sql .= " bu3.type as typeop_payment, bu4.type as typeop_payment_supplier";
$sql .= " FROM " . MAIN_DB_PREFIX . "bank as b"; $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid"; $sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='user'"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='user'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu4 ON bu4.fk_bank = b.rowid AND bu4.type='payment_supplier'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u on bu2.url_id=u.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u on bu2.url_id=u.rowid";
$sql .= " WHERE ba.fk_accountancy_journal=" . $id_journal; $sql .= " WHERE ba.fk_accountancy_journal=" . $id_journal;
@ -145,6 +148,7 @@ $result = $db->query($sql);
if ($result) { if ($result) {
$num = $db->num_rows($result); $num = $db->num_rows($result);
//print $sql;
// Variables // Variables
$account_supplier = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word $account_supplier = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
@ -170,13 +174,31 @@ if ($result) {
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
// Set accountancy code (for bank and thirdparty) $lineisapurchase = -1;
$lineisasale = -1;
// Old method to detect if it's a sale or purchase
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') $lineisapurchase=1;
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') $lineisasale=1;
// Try a more reliable method to detect if record is a supplier payment or a customer payment
if ($lineisapurchase < 0)
{
if ($obj->typeop_payment_supplier == 'payment_supplier') $lineisapurchase = 1;
}
if ($lineisasale < 0)
{
if ($obj->typeop_payment == 'payment') $lineisasale = 1;
}
//var_dump($obj->type_payment); var_dump($obj->type_payment_supplier);
//var_dump($lineisapurchase); //var_dump($lineisasale);
// Set accountancy code for bank
$compta_bank = $obj->account_number; $compta_bank = $obj->account_number;
// Set accountancy code for thirdparty
$compta_soc = 'NotDefined'; $compta_soc = 'NotDefined';
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') if ($lineisapurchase > 0)
$compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier); $compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier);
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') if ($lineisasale > 0)
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer); $compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer);
$tabcompany[$obj->rowid] = array ( $tabcompany[$obj->rowid] = array (
@ -185,6 +207,7 @@ if ($result) {
'code_compta' => $compta_soc, 'code_compta' => $compta_soc,
); );
// Set accountancy code for user
$compta_user = (! empty($obj->accountancy_code) ? $obj->accountancy_code : $account_employee); $compta_user = (! empty($obj->accountancy_code) ? $obj->accountancy_code : $account_employee);
$tabuser[$obj->rowid] = array ( $tabuser[$obj->rowid] = array (
@ -200,6 +223,7 @@ if ($result) {
$tabpay[$obj->rowid]["type_payment"] = $obj->fk_type; // CHQ, VIR, LIQ, CB, ... $tabpay[$obj->rowid]["type_payment"] = $obj->fk_type; // CHQ, VIR, LIQ, CB, ...
$tabpay[$obj->rowid]["ref"] = $obj->label; // By default. Not unique. May be changed later $tabpay[$obj->rowid]["ref"] = $obj->label; // By default. Not unique. May be changed later
$tabpay[$obj->rowid]["fk_bank"] = $obj->rowid; $tabpay[$obj->rowid]["fk_bank"] = $obj->rowid;
$tabpay[$obj->rowid]["bank_account_ref"] = $obj->baref;
$tabpay[$obj->rowid]["fk_bank_account"] = $obj->fk_account; $tabpay[$obj->rowid]["fk_bank_account"] = $obj->fk_account;
if (preg_match('/^\((.*)\)$/i', $obj->label, $reg)) { if (preg_match('/^\((.*)\)$/i', $obj->label, $reg)) {
$tabpay[$obj->rowid]["lib"] = $langs->trans($reg[1]); $tabpay[$obj->rowid]["lib"] = $langs->trans($reg[1]);
@ -212,7 +236,7 @@ if ($result) {
//var_dump($tabpay); //var_dump($tabpay);
// By default // By default
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or old record with no links in bank_url. $tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or any old record with no links in bank_url.
$tabtype[$obj->rowid] = 'unknown'; $tabtype[$obj->rowid] = 'unknown';
// get_url may return -1 which is not traversable // get_url may return -1 which is not traversable
@ -602,6 +626,8 @@ if (! $error && $action == 'writebookkeeping') {
} }
} }
// Export // Export
if ($action == 'exportcsv') { // ISO and not UTF8 ! if ($action == 'exportcsv') { // ISO and not UTF8 !
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
@ -735,6 +761,22 @@ if (empty($action) || $action == 'view') {
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
// Test that setup is complete
$sql='SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL';
$resql=$db->query($sql);
if ($resql)
{
$obj=$db->fetch_object($resql);
if ($obj->nb > 0)
{
print img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
print ' : '.$langs->trans("AccountancyAreaDescBank", 9, '<strong>'.$langs->transnoentitiesnoconv("MenuBankCash").'</strong>');
}
}
else dol_print_error($db);
// Button to write into Ledger // Button to write into Ledger
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1' if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|| empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1' || empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1'
@ -796,8 +838,10 @@ if (empty($action) || $action == 'view') {
// Bank // Bank
foreach ( $tabbq[$key] as $k => $mt ) foreach ( $tabbq[$key] as $k => $mt )
{ {
//var_dump($tabpay[$key]);
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td><!-- Bank bank.rowid=".$key."--></td>"; print "<td></td>";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $ref . "</td>"; print "<td>" . $ref . "</td>";
// Ledger account // Ledger account
@ -818,11 +862,14 @@ if (empty($action) || $action == 'view') {
} }
else print $accounttoshow;*/ else print $accounttoshow;*/
print "</td>"; print "</td>";
if ($val['soclib'] == '') { print "<td>";
print "<td>" . $langs->trans("Bank") . " - " . $reflabel . "</td>"; //var_dump($tabpay[$key]);
} else { print $langs->trans("Bank");
print "<td>" . $langs->trans("Bank") . " - " . $val['soclib'] . "</td>"; print ' '.$val['bank_account_ref'];
if (! empty($val['soclib'])) {
print " - " . $val['soclib'];
} }
print "</td>";
print "<td>" . $val["type_payment"] . "</td>"; print "<td>" . $val["type_payment"] . "</td>";
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>"; print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>"; print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
@ -833,14 +880,15 @@ if (empty($action) || $action == 'view') {
if (is_array($tabtp[$key])) { if (is_array($tabtp[$key])) {
foreach ( $tabtp[$key] as $k => $mt ) { foreach ( $tabtp[$key] as $k => $mt ) {
if ($k != 'type') { if ($k != 'type') {
print '<!-- Thirdparty bank.rowid='.$key.' -->';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td><!-- Thirdparty bank.rowid=".$key." --></td>"; print "<td></td>";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $ref . "</td>"; print "<td>" . $ref . "</td>";
// Ledger account // Ledger account
print "<td>"; print "<td>";
$account_ledger = $k; $account_ledger = $k;
// Try to force general ledger account depending on type
if ($tabtype[$key] == 'payment') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; if ($tabtype[$key] == 'payment') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
if ($tabtype[$key] == 'payment_supplier') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; if ($tabtype[$key] == 'payment_supplier') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
if ($tabtype[$key] == 'payment_expensereport') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; if ($tabtype[$key] == 'payment_expensereport') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
@ -877,7 +925,11 @@ if (empty($action) || $action == 'view') {
{ {
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined')
{ {
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>'; /*var_dump($tabpay[$key]);
var_dump($tabtype[$key]);
var_dump($tabbq[$key]);*/
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown").'</span>';
} }
else print $accounttoshowsubledger; else print $accounttoshowsubledger;
} }
@ -892,8 +944,9 @@ if (empty($action) || $action == 'view') {
} }
} else { } else {
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print '<!-- Wait bank.rowid='.$key.' -->';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td><!-- Wait bank.rowid=".$key." --></td>"; print "<td></td>";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $ref . "</td>"; print "<td>" . $ref . "</td>";
// Ledger account // Ledger account
@ -936,7 +989,7 @@ $db->close();
* Return source for doc_ref of a bank transaction * Return source for doc_ref of a bank transaction
* *
* @param string $val Array of val * @param string $val Array of val
* @param string $typerecord Type of record * @param string $typerecord Type of record ('payment', 'payment_supplier', 'payment_expensereport', 'payment_vat', ...)
* @return string|unknown * @return string|unknown
*/ */
function getSourceDocRef($val, $typerecord) function getSourceDocRef($val, $typerecord)

View File

@ -183,8 +183,8 @@ for($i = 1; $i <= 12; $i ++) {
} }
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,"; $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; $sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
} }
@ -206,8 +206,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) { while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>'; print '<tr class="oddeven"><td>';
print '<td align="left">' . $row[1] . '</td>'; if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) { for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>'; print '<td align="right">' . price($row[$i]) . '</td>';
} }
@ -237,8 +249,8 @@ for($i = 1; $i <= 12; $i ++) {
} }
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,"; $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; $sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
} }
@ -260,9 +272,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) { while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>'; print '<tr class="oddeven"><td>';
print '<td align="left">' . $row[1] . '</td>'; if ($row[0] == 'tobind')
for($i = 2; $i <= 12; $i ++) { {
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>'; print '<td align="right">' . price($row[$i]) . '</td>';
} }
print '<td align="right">' . price($row[13]) . '</td>'; print '<td align="right">' . price($row[13]) . '</td>';

View File

@ -1142,7 +1142,7 @@ if ($id)
} }
if ($id == 4) print '<td></td>'; if ($id == 4) print '<td></td>';
print '<td colspan="3" align="right">'; print '<td colspan="3" align="center">';
if ($action != 'edit') if ($action != 'edit')
{ {
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';

View File

@ -70,13 +70,13 @@ if (! empty($conf->global->MAIN_MOTD_SETUPPAGE))
print $langs->trans("SetupDescription1").' '; print $langs->trans("SetupDescription1").' ';
print $langs->trans("AreaForAdminOnly").' '; print $langs->trans("AreaForAdminOnly").' ';
print $langs->trans("SetupDescription2", $langs->trans("MenuCompanySetup"), $langs->trans("Modules"))."<br><br>"; print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"))."<br><br>";
print '<br>'; print '<br>';
// Show info setup company // Show info setup company
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1; if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->trans("Setup"), $langs->trans("MenuCompanySetup")); print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup"));
if (! empty($setupcompanynotcomplete)) if (! empty($setupcompanynotcomplete))
{ {
$langs->load("errors"); $langs->load("errors");
@ -88,7 +88,7 @@ print '<br>';
print '<br>'; print '<br>';
// Show info setup module // Show info setup module
print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->trans("Setup"), $langs->trans("Modules")); print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules"));
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled
{ {
$langs->load("errors"); $langs->load("errors");

View File

@ -1548,17 +1548,30 @@ class Categorie extends CommonObject
dol_mkdir($dir); dol_mkdir($dir);
} }
if (file_exists($dir)) if (file_exists($dir)) {
{ if (is_array($file['name']) && count($file['name']) > 0) {
$originImage = $dir . $file['name']; for($i = 0; $i <= count($file['name']); $i ++) {
// Cree fichier en taille origine $originImage = $dir . $file['name'][$i];
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
if (file_exists($originImage)) // Cree fichier en taille origine
{ dol_move_uploaded_file($file['tmp_name'][$i], $originImage, 1, 0, 0);
// Create thumbs
$this->addThumbs($originImage); if (file_exists($originImage)) {
// Create thumbs
$this->addThumbs($originImage);
}
}
} else {
$originImage = $dir . $file['name'];
// Cree fichier en taille origine
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
if (file_exists($originImage)) {
// Create thumbs
$this->addThumbs($originImage);
}
} }
} }
} }

View File

@ -3207,6 +3207,14 @@ else if ($id > 0 || ! empty($ref))
$facthatreplace->fetch($objectidnext); $facthatreplace->fetch($objectidnext);
print ' (' . $langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)) . ')'; print ' (' . $langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)) . ')';
} }
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, $object->id);
if ($result > 0){
print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'<br>';
}
}
print '</td></tr>'; print '</td></tr>';
// Relative and absolute discounts // Relative and absolute discounts

View File

@ -1355,7 +1355,6 @@ class FactureRec extends CommonInvoice
*/ */
class FactureLigneRec extends CommonInvoiceLine class FactureLigneRec extends CommonInvoiceLine
{ {
public $element='facturedetrec'; public $element='facturedetrec';
public $table_element='facturedet_rec'; public $table_element='facturedet_rec';
@ -1364,36 +1363,40 @@ class FactureLigneRec extends CommonInvoiceLine
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete() function delete(User $user, $notrigger = false)
{ {
global $conf,$langs,$user; $error=0;
$error=0; $this->db->begin();
$this->db->begin(); if (! $error) {
if (! $notrigger) {
// Call triggers
$result=$this->call_trigger('LINEBILLREC_DELETE', $user);
if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail
// End call triggers
}
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".($this->rowid > 0 ? $this->rowid : $this->id); if (! $error)
dol_syslog(get_class($this)."::delete", LOG_DEBUG); {
if ($this->db->query($sql) ) $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id;
{
// Call trigger
$result=$this->call_trigger('LINEBILLREC_DELETE',$user);
if ($result < 0)
{
$this->db->rollback();
return -1;
}
// End call triggers
$this->db->commit(); $res = $this->db->query($sql);
return 1; if($res===false) {
} $error++;
else $this->errors[] = $this->db->lasterror();
{ }
$this->error=$this->db->error()." sql=".$sql; }
$this->db->rollback();
return -1; // Commit or rollback
} if ($error) {
$this->db->rollback();
return -1;
} else {
$this->db->commit();
return 1;
}
} }
@ -1551,4 +1554,6 @@ class FactureLigneRec extends CommonInvoiceLine
} }
=======
>>>>>>> branch '6.0' of git@github.com:Dolibarr/dolibarr.git
} }

View File

@ -439,7 +439,6 @@ class Facture extends CommonInvoice
$sql.= ", ".(double) $this->multicurrency_tx; $sql.= ", ".(double) $this->multicurrency_tx;
$sql.=")"; $sql.=")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -449,7 +448,6 @@ class Facture extends CommonInvoice
$this->ref='(PROV'.$this->id.')'; $this->ref='(PROV'.$this->id.')';
$sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id; $sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if (! $resql) $error++; if (! $resql) $error++;

View File

@ -665,7 +665,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
} }
} }
// Hook fields // Hook fields
$parameters=array('arrayfields'=>$arrayfields); $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);

View File

@ -83,11 +83,12 @@ class Conf
$this->file = new stdClass(); $this->file = new stdClass();
$this->db = new stdClass(); $this->db = new stdClass();
$this->global = new stdClass(); $this->global = new stdClass();
$this->mycompany = new stdClass(); $this->mycompany = new stdClass();
$this->admin = new stdClass(); $this->admin = new stdClass();
$this->user = new stdClass(); $this->user = new stdClass();
$this->syslog = new stdClass(); $this->syslog = new stdClass();
$this->browser = new stdClass(); $this->browser = new stdClass();
$this->medias = new stdClass();
$this->multicompany = new stdClass(); $this->multicompany = new stdClass();
//! Charset for HTML output and for storing data in memory //! Charset for HTML output and for storing data in memory
@ -96,7 +97,7 @@ class Conf
// First level object // First level object
// TODO Remove this part. // TODO Remove this part.
$this->expedition_bon = new stdClass(); $this->expedition_bon = new stdClass();
$this->livraison_bon = new stdClass(); $this->livraison_bon = new stdClass();
$this->fournisseur = new stdClass(); $this->fournisseur = new stdClass();
$this->product = new stdClass(); $this->product = new stdClass();
$this->service = new stdClass(); $this->service = new stdClass();
@ -106,12 +107,12 @@ class Conf
$this->propal = new stdClass(); $this->propal = new stdClass();
$this->facture = new stdClass(); $this->facture = new stdClass();
$this->contrat = new stdClass(); $this->contrat = new stdClass();
$this->usergroup = new stdClass(); $this->usergroup = new stdClass();
$this->adherent = new stdClass(); $this->adherent = new stdClass();
$this->bank = new stdClass(); $this->bank = new stdClass();
$this->notification = new stdClass(); $this->notification = new stdClass();
$this->mailing = new stdClass(); $this->mailing = new stdClass();
$this->expensereport = new stdClass(); $this->expensereport = new stdClass();
} }
@ -322,6 +323,10 @@ class Conf
$this->propal->dir_output=$rootfordata."/propale"; $this->propal->dir_output=$rootfordata."/propale";
$this->propal->dir_temp=$rootfordata."/propale/temp"; $this->propal->dir_temp=$rootfordata."/propale/temp";
// For medias storage
$this->medias->multidir_output = array($this->entity => $rootfordata."/medias");
$this->medias->multidir_temp = array($this->entity => $rootfordata."/medias/temp");
// Exception: Some dir are not the name of module. So we keep exception here for backward compatibility. // Exception: Some dir are not the name of module. So we keep exception here for backward compatibility.
// Sous module bons d'expedition // Sous module bons d'expedition

View File

@ -64,7 +64,7 @@ class DiscountAbsolute
* @param int $fk_facture_source fk_facture_source * @param int $fk_facture_source fk_facture_source
* @return int <0 if KO, =0 if not found, >0 if OK * @return int <0 if KO, =0 if not found, >0 if OK
*/ */
function fetch($rowid,$fk_facture_source=0) function fetch($rowid, $fk_facture_source=0)
{ {
global $conf; global $conf;

View File

@ -1964,7 +1964,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($modulepart == 'medias' && !empty($dolibarr_main_data_root)) if ($modulepart == 'medias' && !empty($dolibarr_main_data_root))
{ {
$accessallowed=1; $accessallowed=1;
$original_file=$dolibarr_main_data_root.'/medias/'.$original_file; $original_file=$conf->medias->multidir_output[$entity].'/'.$original_file;
} }
// Wrapping for *.log files, like when used with url http://.../document.php?modulepart=logs&file=dolibarr.log // Wrapping for *.log files, like when used with url http://.../document.php?modulepart=logs&file=dolibarr.log
elseif ($modulepart == 'logs' && !empty($dolibarr_main_data_root)) elseif ($modulepart == 'logs' && !empty($dolibarr_main_data_root))

View File

@ -81,15 +81,15 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
*/ */
public function checkConfiguration() public function checkConfiguration()
{ {
global $langs; global $conf, $langs;
$errors = array(); $errors = array();
$facility = SYSLOG_FACILITY; $facility = constant($conf->global->SYSLOG_FACILITY);
if ($facility) if ($facility)
{ {
// Only LOG_USER supported on Windows // Only LOG_USER supported on Windows
if (! empty($_SERVER["WINDIR"])) $facility='LOG_USER'; if (! empty($_SERVER["WINDIR"])) $facility=constant('LOG_USER');
dol_syslog("admin/syslog: facility ".$facility); dol_syslog("admin/syslog: facility ".$facility);
} }

View File

@ -422,12 +422,13 @@ class doc_generic_user_odt extends ModelePDFUser
return -1; return -1;
} }
function get_substitutionarray_object($object,$outputlangs) { function get_substitutionarray_object($object,$outputlangs,$array_key='object') {
$array_other=array();
foreach($object as $key => $value) { foreach($object as $key => $value) {
if(!is_array($value) && !is_object($value)) { if (!is_array($value) && !is_object($value)) {
$array_other['object_'.$key] = $value; $array_other[$array_key.'_'.$key] = $value;
} }
} }
return $array_other; return $array_other;
} }

View File

@ -90,7 +90,7 @@ if ($permission) {
echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal'); echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal');
?></div> ?></div>
<div class="tagtd">&nbsp;</div> <div class="tagtd">&nbsp;</div>
<div class="tagtd right"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div> <div class="tagtd center"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div>
</form> </form>
<?php <?php
@ -129,7 +129,7 @@ if ($permission) {
$formcompany->selectTypeContact($tmpobject, '', 'type','external'); ?> $formcompany->selectTypeContact($tmpobject, '', 'type','external'); ?>
</div> </div>
<div class="tagtd noborderbottom">&nbsp;</div> <div class="tagtd noborderbottom">&nbsp;</div>
<div class="tagtd right noborderbottom"> <div class="tagtd center noborderbottom">
<input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (! $nbofcontacts) echo ' disabled'; ?>> <input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (! $nbofcontacts) echo ' disabled'; ?>>
</div> </div>
</form> </form>

View File

@ -579,6 +579,7 @@ class Fichinter extends CommonObject
return price2num($amount, 'MT'); return price2num($amount, 'MT');
} }
/** /**
* Create a document onto disk according to template module. * Create a document onto disk according to template module.
* *
@ -597,12 +598,12 @@ class Fichinter extends CommonObject
if (! dol_strlen($modele)) { if (! dol_strlen($modele)) {
$modele = 'azur'; $modele = 'soleil';
if ($this->modelpdf) { if ($this->modelpdf) {
$modele = $this->modelpdf; $modele = $this->modelpdf;
} elseif (! empty($conf->global->PROPALE_ADDON_PDF)) { } elseif (! empty($conf->global->FICHEINTER_ADDON_PDF)) {
$modele = $conf->global->PROPALE_ADDON_PDF; $modele = $conf->global->FICHEINTER_ADDON_PDF;
} }
} }

View File

@ -375,39 +375,40 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
} }
} }
// Code executed only if migrate is LAST ONE. Must always be done. // Code executed only if migrate is LAST ONE. Must always be done.
if (versioncompare($versiontoarray,$versionranarray) >= 0 || versioncompare($versiontoarray,$versionranarray) <= -3) if (versioncompare($versiontoarray,$versionranarray) >= 0 || versioncompare($versiontoarray,$versionranarray) <= -3)
{ {
// Reload modules (this must be always done and only into last targeted version, because code to reload module may need table structure of last version) // Reload modules (this must be always done and only into last targeted version, because code to reload module may need table structure of last version)
$listofmodule=array( $listofmodule=array(
'MAIN_MODULE_AGENDA'=>'newboxdefonly', 'MAIN_MODULE_AGENDA'=>'newboxdefonly',
'MAIN_MODULE_BARCODE'=>'newboxdefonly', 'MAIN_MODULE_BARCODE'=>'newboxdefonly',
'MAIN_MODULE_CRON'=>'newboxdefonly', 'MAIN_MODULE_CRON'=>'newboxdefonly',
'MAIN_MODULE_COMMANDE'=>'newboxdefonly', 'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly', 'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly', 'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly', 'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly', 'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly', 'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly', 'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly', 'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly',
'MAIN_MODULE_PAYBOX'=>'newboxdefonly', 'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
'MAIN_MODULE_PRODUIT'=>'newboxdefonly', 'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
'MAIN_MODULE_SOCIETE'=>'newboxdefonly', 'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
'MAIN_MODULE_SERVICE'=>'newboxdefonly', 'MAIN_MODULE_SERVICE'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly', 'MAIN_MODULE_USER'=>'newboxdefonly',
'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly', 'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly',
'MAIN_MODULE_BARCODE'=>'newboxdefonly', 'MAIN_MODULE_BARCODE'=>'newboxdefonly',
'MAIN_MODULE_CRON'=>'newboxdefonly', 'MAIN_MODULE_CRON'=>'newboxdefonly',
'MAIN_MODULE_PRINTING'=>'newboxdefonly', 'MAIN_MODULE_PRINTING'=>'newboxdefonly',
'MAIN_MODULE_SALARIES'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly', //This one must be always done and only into last targeted version) 'MAIN_MODULE_USER'=>'newboxdefonly', //This one must be always done and only into last targeted version)
); );
migrate_reload_modules($db,$langs,$conf,$listofmodule); migrate_reload_modules($db,$langs,$conf,$listofmodule);
// Reload menus (this must be always and only into last targeted version) // Reload menus (this must be always and only into last targeted version)
migrate_reload_menu($db,$langs,$conf,$versionto); migrate_reload_menu($db,$langs,$conf,$versionto);
} }
// Can force activation of some module during migration with paramater 'enablemodules=MAIN_MODULE_XXX,MAIN_MODULE_YYY,...' // Can force activation of some module during migration with paramater 'enablemodules=MAIN_MODULE_XXX,MAIN_MODULE_YYY,...'
if (! $error && $enablemodules) if (! $error && $enablemodules)
@ -4117,216 +4118,227 @@ function migrate_delete_old_dir($db,$langs,$conf)
*/ */
function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0)
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force); dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force);
// If no info is provided, we reload all modules with mode newboxdefonly. // If no info is provided, we reload all modules with mode newboxdefonly.
if (count($listofmodule) == 0) if (count($listofmodule) == 0)
{ {
$listofmodule=array( $listofmodule=array(
'MAIN_MODULE_AGENDA'=>'newboxdefonly', 'MAIN_MODULE_AGENDA'=>'newboxdefonly',
'MAIN_MODULE_SOCIETE'=>'newboxdefonly', 'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
'MAIN_MODULE_PRODUIT'=>'newboxdefonly', 'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
'MAIN_MODULE_SERVICE'=>'newboxdefonly', 'MAIN_MODULE_SERVICE'=>'newboxdefonly',
'MAIN_MODULE_COMMANDE'=>'newboxdefonly', 'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly', 'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly', 'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly', 'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly', 'MAIN_MODULE_USER'=>'newboxdefonly',
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly', 'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly', 'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly', 'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_PAYBOX'=>'newboxdefonly', 'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly' 'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly',
); 'MAIN_MODULE_SALARIES'=>'newboxdefonly'
} );
}
foreach($listofmodule as $moduletoreload => $reloadmode) foreach($listofmodule as $moduletoreload => $reloadmode)
{ {
if (empty($moduletoreload) || (empty($conf->global->$moduletoreload) && ! $force)) continue; // Discard reload if module not enabled if (empty($moduletoreload) || (empty($conf->global->$moduletoreload) && ! $force)) continue; // Discard reload if module not enabled
$mod=null; $mod=null;
if ($moduletoreload == 'MAIN_MODULE_AGENDA') if ($moduletoreload == 'MAIN_MODULE_AGENDA')
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Agenda module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Agenda module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modAgenda.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modAgenda.class.php';
if ($res) { if ($res) {
$mod=new modAgenda($db); $mod=new modAgenda($db);
$mod->remove('noboxes'); $mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_API') if ($moduletoreload == 'MAIN_MODULE_API')
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Rest API module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Rest API module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modApi.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modApi.class.php';
if ($res) { if ($res) {
$mod=new modApi($db); $mod=new modApi($db);
//$mod->remove('noboxes'); //$mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_BARCODE') if ($moduletoreload == 'MAIN_MODULE_BARCODE')
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Barcode module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Barcode module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modBarcode.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modBarcode.class.php';
if ($res) { if ($res) {
$mod=new modBarcode($db); $mod=new modBarcode($db);
$mod->remove('noboxes'); $mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_CRON') if ($moduletoreload == 'MAIN_MODULE_CRON')
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Cron module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Cron module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCron.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCron.class.php';
if ($res) { if ($res) {
$mod=new modCron($db); $mod=new modCron($db);
$mod->remove('noboxes'); $mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_SOCIETE') if ($moduletoreload == 'MAIN_MODULE_SOCIETE')
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Societe module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Societe module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php';
if ($res) { if ($res) {
$mod=new modSociete($db); $mod=new modSociete($db);
$mod->remove('noboxes'); $mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_PRODUIT') // Permission has changed into 2.7 if ($moduletoreload == 'MAIN_MODULE_PRODUIT') // Permission has changed into 2.7
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Produit module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Produit module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php';
if ($res) { if ($res) {
$mod=new modProduct($db); $mod=new modProduct($db);
//$mod->remove('noboxes'); //$mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7 if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Service module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Service module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
if ($res) { if ($res) {
$mod=new modService($db); $mod=new modService($db);
//$mod->remove('noboxes'); //$mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9 if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Commande module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Commande module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
if ($res) { if ($res) {
$mod=new modCommande($db); $mod=new modCommande($db);
//$mod->remove('noboxes'); //$mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9 if ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Facture module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Facture module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
if ($res) { if ($res) {
$mod=new modFacture($db); $mod=new modFacture($db);
//$mod->remove('noboxes'); //$mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_FOURNISSEUR') // Permission has changed into 2.9 if ($moduletoreload == 'MAIN_MODULE_FOURNISSEUR') // Permission has changed into 2.9
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Fournisseur module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Fournisseur module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
if ($res) { if ($res) {
$mod=new modFournisseur($db); $mod=new modFournisseur($db);
//$mod->remove('noboxes'); //$mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_HOLIDAY') // Permission and tabs has changed into 3.8 if ($moduletoreload == 'MAIN_MODULE_HOLIDAY') // Permission and tabs has changed into 3.8
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Leave Request module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Leave Request module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modHoliday.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modHoliday.class.php';
if ($res) { if ($res) {
$mod=new modHoliday($db); $mod=new modHoliday($db);
$mod->remove('noboxes'); $mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0 if ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Deplacement module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Deplacement module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php';
if ($res) { if ($res) {
$mod=new modDeplacement($db); $mod=new modDeplacement($db);
//$mod->remove('noboxes'); //$mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0 if ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php';
if ($res) { if ($res) {
$mod=new modDon($db); $mod=new modDon($db);
//$mod->remove('noboxes'); //$mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1 if ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate ECM module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate ECM module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
if ($res) { if ($res) {
$mod=new modECM($db); $mod=new modECM($db);
$mod->remove('noboxes'); // We need to remove because a permission id has been removed $mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_PAYBOX') // Permission has changed into 3.0 if ($moduletoreload == 'MAIN_MODULE_PAYBOX') // Permission has changed into 3.0
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Paybox module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Paybox module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php';
if ($res) { if ($res) {
$mod=new modPaybox($db); $mod=new modPaybox($db);
$mod->remove('noboxes'); // We need to remove because id of module has changed $mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0 if ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Opensurvey module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Opensurvey module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modOpenSurvey.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modOpenSurvey.class.php';
if ($res) { if ($res) {
$mod=new modOpenSurvey($db); $mod=new modOpenSurvey($db);
$mod->remove('noboxes'); // We need to remove because menu entries has changed $mod->remove('noboxes'); // We need to remove because menu entries has changed
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0 if ($moduletoreload == 'MAIN_MODULE_SALARIES') // Permission has changed into 6.0
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate User module"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Salaries module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php'; $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSalaries.class.php';
if ($res) { if ($res) {
$mod=new modUser($db); $mod=new modSalaries($db);
//$mod->remove('noboxes'); //$mod->remove('noboxes');
$mod->init($reloadmode); $mod->init($reloadmode);
} }
} }
if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate User module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php';
if ($res) {
$mod=new modUser($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if (! empty($mod) && is_object($mod)) if (! empty($mod) && is_object($mod))
{ {
print '<tr><td colspan="4">'; print '<tr><td colspan="4">';
print '<b>'.$langs->trans('Upgrade').'</b>: '; print '<b>'.$langs->trans('Upgrade').'</b>: ';
print $langs->trans('MigrationReloadModule').' '.$mod->getName(); // We keep getName outside of trans because getName is already encoded/translated print $langs->trans('MigrationReloadModule').' '.$mod->getName(); // We keep getName outside of trans because getName is already encoded/translated
print "<!-- (".$reloadmode.") -->"; print "<!-- (".$reloadmode.") -->";
print "<br>\n"; print "<br>\n";
print '</td></tr>'; print '</td></tr>';
} }
} }
} }

View File

@ -57,7 +57,7 @@ AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for speci
AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this, use the menu entry %s. AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this, use the menu entry %s.
AccountancyAreaDescMisc=STEP %s: Define mandatory default account and default accounting accounts for miscellaneous transactions. For this, use the menu entry %s. AccountancyAreaDescMisc=STEP %s: Define mandatory default account and default accounting accounts for miscellaneous transactions. For this, use the menu entry %s.
AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this, use the menu entry %s. AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this, use the menu entry %s.
AccountancyAreaDescBank=STEP %s: Define accounting accounts for each bank and financial accounts. For this, go on the card of each financial account. You can start from page %s. AccountancyAreaDescBank=STEP %s: Define accounting accounts and journal code for each bank and financial accounts. For this, go on the card of each financial account. You can start from page %s.
AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products/services. For this, use the menu entry %s. AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products/services. For this, use the menu entry %s.
AccountancyAreaDescBind=STEP %s: Check the binding between existing %s lines and accounting account is done, so application will be able to journalize transactions in Ledger in one click. Complete missing bindings. For this, use the menu entry %s. AccountancyAreaDescBind=STEP %s: Check the binding between existing %s lines and accounting account is done, so application will be able to journalize transactions in Ledger in one click. Complete missing bindings. For this, use the menu entry %s.
@ -66,6 +66,7 @@ AccountancyAreaDescAnalyze=STEP %s: Add or edit existing transactions and genera
AccountancyAreaDescClosePeriod=STEP %s: Close period so we can't make modification in a future. AccountancyAreaDescClosePeriod=STEP %s: Close period so we can't make modification in a future.
TheJournalCodeIsNotDefinedOnSomeBankAccount=A mandatory step in setup was not complete (accountancy code journal not defined for all bank accounts)
MenuAccountancy=Accountancy MenuAccountancy=Accountancy
Selectchartofaccounts=Select active chart of accounts Selectchartofaccounts=Select active chart of accounts
ChangeAndLoad=Change and load ChangeAndLoad=Change and load
@ -281,5 +282,6 @@ BookeppingLineAlreayExists=Lines already existing into bookeeping
NoJournalDefined=No journal defined NoJournalDefined=No journal defined
Binded=Lines bound Binded=Lines bound
ToBind=Lines to bind ToBind=Lines to bind
UseMenuToSetBindindManualy=Autodection not possible, use menu <a href="%s">%s</a> to make the binding manually
WarningReportNotReliable=Warning, this report is not based on the Ledger, so does not contains transaction modified manualy in the Ledger. If your journalization is up to date, the bookkeeping view is more accurate. WarningReportNotReliable=Warning, this report is not based on the Ledger, so does not contains transaction modified manualy in the Ledger. If your journalization is up to date, the bookkeeping view is more accurate.

View File

@ -217,8 +217,8 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook)) if (empty($reshook))
{ {
// Selection of new fields // Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Did we click on purge search criteria ? // Did we click on purge search criteria ?
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
@ -259,24 +259,24 @@ if (empty($reshook))
$search_array_options=array(); $search_array_options=array();
} }
// Mass actions // Mass actions
$objectclass='Societe'; $objectclass='Societe';
$objectlabel='ThirdParty'; $objectlabel='ThirdParty';
$permtoread = $user->rights->societe->lire; $permtoread = $user->rights->societe->lire;
$permtodelete = $user->rights->societe->supprimer; $permtodelete = $user->rights->societe->supprimer;
$uploaddir = $conf->societe->dir_output; $uploaddir = $conf->societe->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
if ($action == 'setstcomm') if ($action == 'setstcomm')
{ {
$object = new Client($db); $object = new Client($db);
$result=$object->fetch(GETPOST('stcommsocid')); $result=$object->fetch(GETPOST('stcommsocid'));
$object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm'); $object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm');
$result=$object->update($object->id, $user); $result=$object->update($object->id, $user);
if ($result < 0) setEventMessages($object->error,$object->errors,'errors'); if ($result < 0) setEventMessages($object->error,$object->errors,'errors');
$action=''; $action='';
} }
} }
if ($search_status=='') $search_status=1; // always display active thirdparty first if ($search_status=='') $search_status=1; // always display active thirdparty first
@ -995,12 +995,12 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
} }
} }
// Hook fields // Hook fields
$parameters=array('arrayfields'=>$arrayfields); $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($arrayfields['s.datec']['label'],$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($arrayfields['s.datec']['label'],$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($arrayfields['s.tms']['label'],$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($arrayfields['s.tms']['label'],$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($arrayfields['s.status']['label'],$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($arrayfields['s.status']['label'],$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['s.import_key']['checked'])) print_liste_field_titre($arrayfields['s.import_key']['label'],$_SERVER["PHP_SELF"],"s.import_key","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['s.import_key']['checked'])) print_liste_field_titre($arrayfields['s.import_key']['label'],$_SERVER["PHP_SELF"],"s.import_key","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";