Skip to content

Commit

Permalink
Merge branch 'develop' into 8.0-a6_vat
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 7, 2018
2 parents 4a46ffc + 1ca5c70 commit f597e08
Show file tree
Hide file tree
Showing 99 changed files with 1,503 additions and 716 deletions.
24 changes: 13 additions & 11 deletions htdocs/accountancy/admin/journals_list.php
Expand Up @@ -177,6 +177,11 @@
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
}*/
}
if (! GETPOST('label','alpha'))
{
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors');
$ok=0;
}

// Clean some parameters
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null
Expand Down Expand Up @@ -208,7 +213,7 @@
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
$sql.= $tabrowid[$id].",";
$sql.= $tabfieldinsert[$id];
$sql.=",active)";
$sql.=",active,entity)";
$sql.= " VALUES(";

// List of values
Expand All @@ -221,11 +226,11 @@
$_POST[$listfieldvalue[$i]] = $conf->entity;
}
if ($i) $sql.=",";
if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = ''
if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; // For vat, we want/accept code = ''
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
$i++;
}
$sql.=",1)";
$sql.=",1,".$conf->entity.")";

dol_syslog("actionadd", LOG_DEBUG);
$result = $db->query($sql);
Expand Down Expand Up @@ -275,6 +280,7 @@
$i++;
}
$sql.= " WHERE ".$rowidcol." = '".$rowid."'";
$sql.=" AND entity = ".$conf->entity;

dol_syslog("actionmodify", LOG_DEBUG);
//print $sql;
Expand All @@ -298,6 +304,7 @@
else { $rowidcol="rowid"; }

$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'";
$sql.=" AND entity = ".$conf->entity;

dol_syslog("delete", LOG_DEBUG);
$result = $db->query($sql);
Expand Down Expand Up @@ -326,6 +333,7 @@
elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$code."'";
}
$sql.=" AND entity = ".$conf->entity;

$result = $db->query($sql);
if (!$result)
Expand All @@ -346,6 +354,7 @@
elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$code."'";
}
$sql.=" AND entity = ".$conf->entity;

$result = $db->query($sql);
if (!$result)
Expand Down Expand Up @@ -389,13 +398,7 @@
{
// Complete requete recherche valeurs avec critere de tri
$sql=$tabsql[$id];

if ($search_country_id > 0)
{
if (preg_match('/ WHERE /',$sql)) $sql.= " AND ";
else $sql.=" WHERE ";
$sql.= " c.rowid = ".$search_country_id;
}
$sql.= " WHERE a.entity = ".$conf->entity;

if ($sortfield)
{
Expand All @@ -416,7 +419,6 @@
}
$sql.=$tabsqlsort[$id];
$sql.=$db->plimit($listlimit+1,$offset);
//print $sql;

$fieldlist=explode(',',$tabfield[$id]);

Expand Down
5 changes: 3 additions & 2 deletions htdocs/accountancy/journal/bankjournal.php
Expand Up @@ -455,6 +455,7 @@
// No subledger_account value for the bank line but add a specific label_operation
$bookkeeping->subledger_account = '';
$bookkeeping->label_operation = $reflabel;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down Expand Up @@ -561,8 +562,8 @@
$bookkeeping->label_compte = '';
}
}

$bookkeeping->label_operation = $reflabel;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down Expand Up @@ -608,8 +609,8 @@
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->date_create = $now;
$bookkeeping->label_compte = '';

$bookkeeping->label_operation = $reflabel;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down
3 changes: 3 additions & 0 deletions htdocs/accountancy/journal/expensereportsjournal.php
Expand Up @@ -216,6 +216,7 @@
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down Expand Up @@ -265,6 +266,7 @@
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down Expand Up @@ -320,6 +322,7 @@
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down
4 changes: 4 additions & 0 deletions htdocs/accountancy/journal/purchasesjournal.php
Expand Up @@ -318,6 +318,7 @@
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down Expand Up @@ -371,6 +372,7 @@
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down Expand Up @@ -430,6 +432,7 @@
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down Expand Up @@ -482,6 +485,7 @@
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down
4 changes: 4 additions & 0 deletions htdocs/accountancy/journal/sellsjournal.php
Expand Up @@ -121,6 +121,7 @@
// $sql .= " AND fd.rowid NOT IN (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // Useless, we save one line for all products with same account
}
$sql .= " ORDER BY f.datef";
//print $sql;

dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG);
$result = $db->query($sql);
Expand Down Expand Up @@ -319,6 +320,7 @@
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down Expand Up @@ -372,6 +374,7 @@
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down Expand Up @@ -430,6 +433,7 @@
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->entity = $conf->entity;

$totaldebit += $bookkeeping->debit;
$totalcredit += $bookkeeping->credit;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/card.php
Expand Up @@ -1822,7 +1822,7 @@ function initfieldrequired()

// Presend form
$modelmail='member';
$defaulttopic='SendMemberRef';
$defaulttopic='CardContent';
$diroutput = $conf->adherent->dir_output;
$trackid = 'mem'.$object->id;

Expand Down

0 comments on commit f597e08

Please sign in to comment.