Code comment
This commit is contained in:
parent
cc05bb3c8c
commit
9b5f7099f7
@ -119,10 +119,15 @@ $sql .= " WHERE ba.fk_accountancy_journal=" . $id_journal;
|
||||
$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND b.dateo >= '" . $db->idate($date_start) . "' AND b.dateo <= '" . $db->idate($date_end) . "'";
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already')
|
||||
{
|
||||
$sql .= " AND (b.rowid IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
|
||||
}
|
||||
if ($in_bookkeeping == 'notyet')
|
||||
{
|
||||
$sql .= " AND (b.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
|
||||
}
|
||||
$sql .= " ORDER BY b.datev";
|
||||
//print $sql;
|
||||
|
||||
|
||||
@ -101,10 +101,15 @@ $sql .= " AND erd.fk_code_ventilation > 0";
|
||||
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND er.date_debut >= '" . $db->idate($date_start) . "' AND er.date_debut <= '" . $db->idate($date_end) . "'";
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already')
|
||||
{
|
||||
$sql .= " AND er.rowid IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='expense_report')";
|
||||
}
|
||||
if ($in_bookkeeping == 'notyet')
|
||||
{
|
||||
$sql .= " AND er.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='expense_report')";
|
||||
}
|
||||
$sql .= " ORDER BY er.date_debut";
|
||||
|
||||
dol_syslog('accountancy/journal/expensereportsjournal.php', LOG_DEBUG);
|
||||
|
||||
@ -115,10 +115,15 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
}
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already')
|
||||
$sql .= " AND f.rowid IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='supplier_invoice')";
|
||||
{
|
||||
$sql .= " AND f.rowid IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='supplier_invoice')";
|
||||
}
|
||||
if ($in_bookkeeping == 'notyet')
|
||||
$sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='supplier_invoice')";
|
||||
{
|
||||
$sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='supplier_invoice')";
|
||||
}
|
||||
$sql .= " ORDER BY f.datef";
|
||||
|
||||
dol_syslog('accountancy/journal/purchasesjournal.php', LOG_DEBUG);
|
||||
|
||||
@ -111,10 +111,15 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND fd.product_type IN (0,1)";
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already')
|
||||
$sql .= " AND f.rowid IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')";
|
||||
{
|
||||
$sql .= " AND f.rowid IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')";
|
||||
}
|
||||
if ($in_bookkeeping == 'notyet')
|
||||
$sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')";
|
||||
{
|
||||
$sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')";
|
||||
}
|
||||
$sql .= " ORDER BY f.datef";
|
||||
|
||||
dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG);
|
||||
|
||||
@ -3107,7 +3107,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
if ($action == 'paid' && $resteapayer > 0) {
|
||||
// Code
|
||||
$i = 0;
|
||||
$close [$i] ['code'] = 'discount_vat';
|
||||
$close [$i] ['code'] = 'discount_vat'; // escompte
|
||||
$i ++;
|
||||
$close [$i] ['code'] = 'badcustomer';
|
||||
$i ++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user