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:
commit
a4665e17d4
@ -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">';
|
||||||
|
|||||||
@ -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,8 +207,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/expensereport/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>';
|
||||||
}
|
}
|
||||||
@ -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,8 +273,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/expensereport/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>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -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,8 +272,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>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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").'">';
|
||||||
|
|||||||
@ -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");
|
||||||
|
|||||||
@ -1548,20 +1548,33 @@ 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) {
|
||||||
|
for($i = 0; $i <= count($file['name']); $i ++) {
|
||||||
|
|
||||||
|
$originImage = $dir . $file['name'][$i];
|
||||||
|
|
||||||
|
// Cree fichier en taille origine
|
||||||
|
dol_move_uploaded_file($file['tmp_name'][$i], $originImage, 1, 0, 0);
|
||||||
|
|
||||||
|
if (file_exists($originImage)) {
|
||||||
|
// Create thumbs
|
||||||
|
$this->addThumbs($originImage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$originImage = $dir . $file['name'];
|
$originImage = $dir . $file['name'];
|
||||||
|
|
||||||
// Cree fichier en taille origine
|
// Cree fichier en taille origine
|
||||||
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
|
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
|
||||||
|
|
||||||
if (file_exists($originImage))
|
if (file_exists($originImage)) {
|
||||||
{
|
|
||||||
// Create thumbs
|
// Create thumbs
|
||||||
$this->addThumbs($originImage);
|
$this->addThumbs($originImage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return tableau de toutes les photos de la categorie
|
* Return tableau de toutes les photos de la categorie
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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();
|
||||||
|
|
||||||
$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 (! $notrigger) {
|
||||||
if ($this->db->query($sql) )
|
// Call triggers
|
||||||
{
|
|
||||||
// Call trigger
|
|
||||||
$result=$this->call_trigger('LINEBILLREC_DELETE', $user);
|
$result=$this->call_trigger('LINEBILLREC_DELETE', $user);
|
||||||
if ($result < 0)
|
if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id;
|
||||||
|
|
||||||
|
$res = $this->db->query($sql);
|
||||||
|
if($res===false) {
|
||||||
|
$error++;
|
||||||
|
$this->errors[] = $this->db->lasterror();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commit or rollback
|
||||||
|
if ($error) {
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
} else {
|
||||||
// End call triggers
|
|
||||||
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->error=$this->db->error()." sql=".$sql;
|
|
||||||
$this->db->rollback();
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1551,4 +1554,6 @@ class FactureLigneRec extends CommonInvoiceLine
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> branch '6.0' of git@github.com:Dolibarr/dolibarr.git
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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++;
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -88,6 +88,7 @@ class Conf
|
|||||||
$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
|
||||||
@ -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
|
||||||
|
|||||||
@ -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))
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -422,10 +422,11 @@ 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;
|
||||||
|
|||||||
@ -90,7 +90,7 @@ if ($permission) {
|
|||||||
echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal');
|
echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal');
|
||||||
?></div>
|
?></div>
|
||||||
<div class="tagtd"> </div>
|
<div class="tagtd"> </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"> </div>
|
<div class="tagtd noborderbottom"> </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>
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -400,6 +400,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
|
|||||||
'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)
|
||||||
);
|
);
|
||||||
@ -4136,7 +4137,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0)
|
|||||||
'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'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4306,6 +4308,16 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0)
|
|||||||
$mod->init($reloadmode);
|
$mod->init($reloadmode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($moduletoreload == 'MAIN_MODULE_SALARIES') // Permission has changed into 6.0
|
||||||
|
{
|
||||||
|
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Salaries module");
|
||||||
|
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSalaries.class.php';
|
||||||
|
if ($res) {
|
||||||
|
$mod=new modSalaries($db);
|
||||||
|
//$mod->remove('noboxes');
|
||||||
|
$mod->init($reloadmode);
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0
|
if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0
|
||||||
{
|
{
|
||||||
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate User module");
|
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate User module");
|
||||||
|
|||||||
@ -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.
|
||||||
|
|||||||
@ -995,7 +995,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['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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user