Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
4ee70e49
Commit
4ee70e49
authored
7 years ago
by
Laurent Destailleur
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #7143 from hregis/6.0_bug
Fix: missing entity filter (multicompany)
parents
74e29a3f
94309525
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/comm/card.php
+61
-62
61 additions, 62 deletions
htdocs/comm/card.php
htdocs/societe/class/societe.class.php
+119
-104
119 additions, 104 deletions
htdocs/societe/class/societe.class.php
with
180 additions
and
166 deletions
htdocs/comm/card.php
+
61
−
62
View file @
4ee70e49
...
...
@@ -3,7 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-201
2
Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-201
7
Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
...
...
@@ -534,74 +534,73 @@ if ($id > 0)
$boxstat
.
=
'<table summary="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"DolibarrStateBoard"
))
.
'" class="noborder boxtable boxtablenobottom" width="100%">'
;
$boxstat
.
=
'<tr class="impair"><td colspan="2" class="tdboxstats nohover">'
;
if
(
$conf
->
propal
->
enabled
)
if
(
!
empty
(
$conf
->
propal
->
enabled
)
)
{
// Box proposals
$tmp
=
$object
->
getOutstandingProposals
();
$outstandingOpened
=
$tmp
[
'opened'
];
$outstandingTotal
=
$tmp
[
'total_ht'
];
$outstandingTotalIncTax
=
$tmp
[
'total_ttc'
];
$text
=
$langs
->
trans
(
"OverAllProposals"
);
$link
=
''
;
$icon
=
'bill'
;
if
(
$link
)
$boxstat
.
=
'<a href="'
.
$link
.
'" class="boxstatsindicator thumbstat nobold nounderline">'
;
$boxstat
.
=
'<div class="boxstats">'
;
$boxstat
.
=
'<span class="boxstatstext">'
.
img_object
(
""
,
$icon
)
.
' '
.
$text
.
'</span><br>'
;
$boxstat
.
=
'<span class="boxstatsindicator">'
.
price
(
$outstandingTotal
,
1
,
$langs
,
1
,
-
1
,
-
1
,
$conf
->
currency
)
.
'</span>'
;
$boxstat
.
=
'</div>'
;
if
(
$link
)
$boxstat
.
=
'</a>'
;
// Box proposals
$tmp
=
$object
->
getOutstandingProposals
();
$outstandingOpened
=
$tmp
[
'opened'
];
$outstandingTotal
=
$tmp
[
'total_ht'
];
$outstandingTotalIncTax
=
$tmp
[
'total_ttc'
];
$text
=
$langs
->
trans
(
"OverAllProposals"
);
$link
=
''
;
$icon
=
'bill'
;
if
(
$link
)
$boxstat
.
=
'<a href="'
.
$link
.
'" class="boxstatsindicator thumbstat nobold nounderline">'
;
$boxstat
.
=
'<div class="boxstats">'
;
$boxstat
.
=
'<span class="boxstatstext">'
.
img_object
(
""
,
$icon
)
.
' '
.
$text
.
'</span><br>'
;
$boxstat
.
=
'<span class="boxstatsindicator">'
.
price
(
$outstandingTotal
,
1
,
$langs
,
1
,
-
1
,
-
1
,
$conf
->
currency
)
.
'</span>'
;
$boxstat
.
=
'</div>'
;
if
(
$link
)
$boxstat
.
=
'</a>'
;
}
if
(
$conf
->
commande
->
enabled
)
if
(
!
empty
(
$conf
->
commande
->
enabled
)
)
{
// Box proposals
$tmp
=
$object
->
getOutstandingOrders
();
$outstandingOpened
=
$tmp
[
'opened'
];
$outstandingTotal
=
$tmp
[
'total_ht'
];
$outstandingTotalIncTax
=
$tmp
[
'total_ttc'
];
$text
=
$langs
->
trans
(
"OverAllOrders"
);
$link
=
''
;
$icon
=
'bill'
;
if
(
$link
)
$boxstat
.
=
'<a href="'
.
$link
.
'" class="boxstatsindicator thumbstat nobold nounderline">'
;
$boxstat
.
=
'<div class="boxstats">'
;
$boxstat
.
=
'<span class="boxstatstext">'
.
img_object
(
""
,
$icon
)
.
' '
.
$text
.
'</span><br>'
;
$boxstat
.
=
'<span class="boxstatsindicator">'
.
price
(
$outstandingTotal
,
1
,
$langs
,
1
,
-
1
,
-
1
,
$conf
->
currency
)
.
'</span>'
;
$boxstat
.
=
'</div>'
;
if
(
$link
)
$boxstat
.
=
'</a>'
;
// Box proposals
$tmp
=
$object
->
getOutstandingOrders
();
$outstandingOpened
=
$tmp
[
'opened'
];
$outstandingTotal
=
$tmp
[
'total_ht'
];
$outstandingTotalIncTax
=
$tmp
[
'total_ttc'
];
$text
=
$langs
->
trans
(
"OverAllOrders"
);
$link
=
''
;
$icon
=
'bill'
;
if
(
$link
)
$boxstat
.
=
'<a href="'
.
$link
.
'" class="boxstatsindicator thumbstat nobold nounderline">'
;
$boxstat
.
=
'<div class="boxstats">'
;
$boxstat
.
=
'<span class="boxstatstext">'
.
img_object
(
""
,
$icon
)
.
' '
.
$text
.
'</span><br>'
;
$boxstat
.
=
'<span class="boxstatsindicator">'
.
price
(
$outstandingTotal
,
1
,
$langs
,
1
,
-
1
,
-
1
,
$conf
->
currency
)
.
'</span>'
;
$boxstat
.
=
'</div>'
;
if
(
$link
)
$boxstat
.
=
'</a>'
;
}
if
(
$conf
->
facture
->
enabled
)
if
(
!
empty
(
$conf
->
facture
->
enabled
)
)
{
$tmp
=
$object
->
getOutstandingBills
();
$outstandingOpened
=
$tmp
[
'opened'
];
$outstandingTotal
=
$tmp
[
'total_ht'
];
$outstandingTotalIncTax
=
$tmp
[
'total_ttc'
];
$text
=
$langs
->
trans
(
"OverAllInvoices"
);
$link
=
''
;
$icon
=
'bill'
;
if
(
$link
)
$boxstat
.
=
'<a href="'
.
$link
.
'" class="boxstatsindicator thumbstat nobold nounderline">'
;
$boxstat
.
=
'<div class="boxstats">'
;
$boxstat
.
=
'<span class="boxstatstext">'
.
img_object
(
""
,
$icon
)
.
' '
.
$text
.
'</span><br>'
;
$boxstat
.
=
'<span class="boxstatsindicator">'
.
price
(
$outstandingTotal
,
1
,
$langs
,
1
,
-
1
,
-
1
,
$conf
->
currency
)
.
'</span>'
;
$boxstat
.
=
'</div>'
;
if
(
$link
)
$boxstat
.
=
'</a>'
;
// Box outstanding bill
$warn
=
''
;
if
(
$object
->
outstanding_limit
!=
''
&&
$object
->
outstanding_limit
<
$outstandingOpened
)
{
$warn
=
' '
.
img_warning
(
$langs
->
trans
(
"OutstandingBillReached"
));
}
$text
=
$langs
->
trans
(
"CurrentOutstandingBill"
);
$link
=
DOL_URL_ROOT
.
'/compta/recap-compta.php?socid='
.
$object
->
id
;
$icon
=
'bill'
;
if
(
$link
)
$boxstat
.
=
'<a href="'
.
$link
.
'" class="boxstatsindicator thumbstat nobold nounderline">'
;
$boxstat
.
=
'<div class="boxstats">'
;
$boxstat
.
=
'<span class="boxstatstext">'
.
img_object
(
""
,
$icon
)
.
' '
.
$text
.
'</span><br>'
;
$boxstat
.
=
'<span class="boxstatsindicator'
.
(
$outstandingOpened
>
0
?
' amountremaintopay'
:
''
)
.
'">'
.
price
(
$outstandingOpened
,
1
,
$langs
,
1
,
-
1
,
-
1
,
$conf
->
currency
)
.
$warn
.
'</span>'
;
$boxstat
.
=
'</div>'
;
if
(
$link
)
$boxstat
.
=
'</a>'
;
$tmp
=
$object
->
getOutstandingBills
();
$outstandingOpened
=
$tmp
[
'opened'
];
$outstandingTotal
=
$tmp
[
'total_ht'
];
$outstandingTotalIncTax
=
$tmp
[
'total_ttc'
];
$text
=
$langs
->
trans
(
"OverAllInvoices"
);
$link
=
''
;
$icon
=
'bill'
;
if
(
$link
)
$boxstat
.
=
'<a href="'
.
$link
.
'" class="boxstatsindicator thumbstat nobold nounderline">'
;
$boxstat
.
=
'<div class="boxstats">'
;
$boxstat
.
=
'<span class="boxstatstext">'
.
img_object
(
""
,
$icon
)
.
' '
.
$text
.
'</span><br>'
;
$boxstat
.
=
'<span class="boxstatsindicator">'
.
price
(
$outstandingTotal
,
1
,
$langs
,
1
,
-
1
,
-
1
,
$conf
->
currency
)
.
'</span>'
;
$boxstat
.
=
'</div>'
;
if
(
$link
)
$boxstat
.
=
'</a>'
;
// Box outstanding bill
$warn
=
''
;
if
(
$object
->
outstanding_limit
!=
''
&&
$object
->
outstanding_limit
<
$outstandingOpened
)
{
$warn
=
' '
.
img_warning
(
$langs
->
trans
(
"OutstandingBillReached"
));
}
$text
=
$langs
->
trans
(
"CurrentOutstandingBill"
);
$link
=
DOL_URL_ROOT
.
'/compta/recap-compta.php?socid='
.
$object
->
id
;
$icon
=
'bill'
;
if
(
$link
)
$boxstat
.
=
'<a href="'
.
$link
.
'" class="boxstatsindicator thumbstat nobold nounderline">'
;
$boxstat
.
=
'<div class="boxstats">'
;
$boxstat
.
=
'<span class="boxstatstext">'
.
img_object
(
""
,
$icon
)
.
' '
.
$text
.
'</span><br>'
;
$boxstat
.
=
'<span class="boxstatsindicator'
.
(
$outstandingOpened
>
0
?
' amountremaintopay'
:
''
)
.
'">'
.
price
(
$outstandingOpened
,
1
,
$langs
,
1
,
-
1
,
-
1
,
$conf
->
currency
)
.
$warn
.
'</span>'
;
$boxstat
.
=
'</div>'
;
if
(
$link
)
$boxstat
.
=
'</a>'
;
}
$boxstat
.
=
'</td></tr>'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/societe/class/societe.class.php
+
119
−
104
View file @
4ee70e49
...
...
@@ -4,7 +4,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-201
6
Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-201
7
Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
...
...
@@ -3346,31 +3346,36 @@ class Societe extends CommonObject
*/
function
getOutstandingProposals
(
$mode
=
'customer'
)
{
$table
=
'propal'
;
if
(
$mode
==
'supplier'
)
$table
=
'supplier_proposal'
;
$table
=
'propal'
;
if
(
$mode
==
'supplier'
)
$table
=
'supplier_proposal'
;
$sql
=
"SELECT rowid, total_ht, total as total_ttc, fk_statut FROM "
.
MAIN_DB_PREFIX
.
$table
.
" as f"
;
$sql
.
=
" WHERE fk_soc = "
.
$this
->
id
;
$sql
=
"SELECT rowid, total_ht, total as total_ttc, fk_statut FROM "
.
MAIN_DB_PREFIX
.
$table
.
" as f"
;
$sql
.
=
" WHERE fk_soc = "
.
$this
->
id
;
if
(
$mode
==
'supplier'
)
{
$sql
.
=
" AND entity IN ("
.
getEntity
(
'supplier_proposal'
)
.
")"
;
}
else
{
$sql
.
=
" AND entity IN ("
.
getEntity
(
'propal'
)
.
")"
;
}
dol_syslog
(
"getOutstandingProposals"
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
$outstandingOpened
=
0
;
$outstandingTotal
=
0
;
$outstandingTotalIncTax
=
0
;
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
$outstandingTotal
+=
$obj
->
total_ht
;
$outstandingTotalIncTax
+=
$obj
->
total_ttc
;
if
(
$obj
->
fk_statut
!=
0
)
// Not a draft
{
$outstandingOpened
+=
$obj
->
total_ttc
;
}
}
return
array
(
'opened'
=>
$outstandingOpened
,
'total_ht'
=>
$outstandingTotal
,
'total_ttc'
=>
$outstandingTotalIncTax
);
}
else
return
array
();
dol_syslog
(
"getOutstandingProposals"
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
$outstandingOpened
=
0
;
$outstandingTotal
=
0
;
$outstandingTotalIncTax
=
0
;
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
$outstandingTotal
+=
$obj
->
total_ht
;
$outstandingTotalIncTax
+=
$obj
->
total_ttc
;
if
(
$obj
->
fk_statut
!=
0
)
// Not a draft
{
$outstandingOpened
+=
$obj
->
total_ttc
;
}
}
return
array
(
'opened'
=>
$outstandingOpened
,
'total_ht'
=>
$outstandingTotal
,
'total_ttc'
=>
$outstandingTotalIncTax
);
}
else
return
array
();
}
/**
...
...
@@ -3381,31 +3386,36 @@ class Societe extends CommonObject
*/
function
getOutstandingOrders
(
$mode
=
'customer'
)
{
$table
=
'commande'
;
if
(
$mode
==
'supplier'
)
$table
=
'commande_fournisseur'
;
$table
=
'commande'
;
if
(
$mode
==
'supplier'
)
$table
=
'commande_fournisseur'
;
$sql
=
"SELECT rowid, total_ht, total_ttc, fk_statut FROM "
.
MAIN_DB_PREFIX
.
$table
.
" as f"
;
$sql
.
=
" WHERE fk_soc = "
.
$this
->
id
;
$sql
=
"SELECT rowid, total_ht, total_ttc, fk_statut FROM "
.
MAIN_DB_PREFIX
.
$table
.
" as f"
;
$sql
.
=
" WHERE fk_soc = "
.
$this
->
id
;
if
(
$mode
==
'supplier'
)
{
$sql
.
=
" AND entity IN ("
.
getEntity
(
'supplier_order'
)
.
")"
;
}
else
{
$sql
.
=
" AND entity IN ("
.
getEntity
(
'commande'
)
.
")"
;
}
dol_syslog
(
"getOutstandingOrders"
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
$outstandingOpened
=
0
;
$outstandingTotal
=
0
;
$outstandingTotalIncTax
=
0
;
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
$outstandingTotal
+=
$obj
->
total_ht
;
$outstandingTotalIncTax
+=
$obj
->
total_ttc
;
if
(
$obj
->
fk_statut
!=
0
)
// Not a draft
{
$outstandingOpened
+=
$obj
->
total_ttc
;
}
}
return
array
(
'opened'
=>
$outstandingOpened
,
'total_ht'
=>
$outstandingTotal
,
'total_ttc'
=>
$outstandingTotalIncTax
);
}
else
return
array
();
dol_syslog
(
"getOutstandingOrders"
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
$outstandingOpened
=
0
;
$outstandingTotal
=
0
;
$outstandingTotalIncTax
=
0
;
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
$outstandingTotal
+=
$obj
->
total_ht
;
$outstandingTotalIncTax
+=
$obj
->
total_ttc
;
if
(
$obj
->
fk_statut
!=
0
)
// Not a draft
{
$outstandingOpened
+=
$obj
->
total_ttc
;
}
}
return
array
(
'opened'
=>
$outstandingOpened
,
'total_ht'
=>
$outstandingTotal
,
'total_ttc'
=>
$outstandingTotalIncTax
);
}
else
return
array
();
}
/**
...
...
@@ -3416,64 +3426,69 @@ class Societe extends CommonObject
*/
function
getOutstandingBills
(
$mode
=
'customer'
)
{
$table
=
'facture'
;
if
(
$mode
==
'supplier'
)
$table
=
'facture_fourn'
;
/* Accurate value of remain to pay is to sum remaintopay for each invoice
$paiement = $invoice->getSommePaiement();
$creditnotes=$invoice->getSumCreditNotesUsed();
$deposits=$invoice->getSumDepositsUsed();
$alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT');
$remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
*/
if
(
$mode
==
'supplier'
)
$sql
=
"SELECT rowid, total_ht as total_ht, total_ttc, paye, fk_statut, close_code FROM "
.
MAIN_DB_PREFIX
.
$table
.
" as f"
;
else
$sql
=
"SELECT rowid, total as total_ht, total_ttc, paye, fk_statut, close_code FROM "
.
MAIN_DB_PREFIX
.
$table
.
" as f"
;
$sql
.
=
" WHERE fk_soc = "
.
$this
->
id
;
$table
=
'facture'
;
if
(
$mode
==
'supplier'
)
$table
=
'facture_fourn'
;
/* Accurate value of remain to pay is to sum remaintopay for each invoice
$paiement = $invoice->getSommePaiement();
$creditnotes=$invoice->getSumCreditNotesUsed();
$deposits=$invoice->getSumDepositsUsed();
$alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT');
$remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
*/
if
(
$mode
==
'supplier'
)
$sql
=
"SELECT rowid, total_ht as total_ht, total_ttc, paye, fk_statut, close_code FROM "
.
MAIN_DB_PREFIX
.
$table
.
" as f"
;
else
$sql
=
"SELECT rowid, total as total_ht, total_ttc, paye, fk_statut, close_code FROM "
.
MAIN_DB_PREFIX
.
$table
.
" as f"
;
$sql
.
=
" WHERE fk_soc = "
.
$this
->
id
;
if
(
$mode
==
'supplier'
)
{
$sql
.
=
" AND entity IN ("
.
getEntity
(
'facture_fourn'
)
.
")"
;
}
else
{
$sql
.
=
" AND entity IN ("
.
getEntity
(
'facture'
)
.
")"
;
}
dol_syslog
(
"getOutstandingBills"
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
$outstandingOpened
=
0
;
$outstandingTotal
=
0
;
$outstandingTotalIncTax
=
0
;
if
(
$mode
==
'supplier'
)
{
require_once
DOL_DOCUMENT_ROOT
.
'/fourn/class/fournisseur.facture.class.php'
;
$tmpobject
=
new
FactureFournisseur
(
$this
->
db
);
}
else
{
require_once
DOL_DOCUMENT_ROOT
.
'/compta/facture/class/facture.class.php'
;
$tmpobject
=
new
Facture
(
$this
->
db
);
}
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
$tmpobject
->
id
=
$obj
->
rowid
;
if
(
$obj
->
fk_statut
!=
0
// Not a draft
&&
!
(
$obj
->
fk_statut
==
3
&&
$obj
->
close_code
==
'replaced'
)
// Not a replaced invoice
)
{
$outstandingTotal
+=
$obj
->
total_ht
;
$outstandingTotalIncTax
+=
$obj
->
total_ttc
;
}
if
(
$obj
->
paye
==
0
&&
$obj
->
fk_statut
!=
0
// Not a draft
&&
$obj
->
fk_statut
!=
3
// Not abandonned
&&
$obj
->
fk_statut
!=
2
)
// Not classified as paid
//$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason
{
$paiement
=
$tmpobject
->
getSommePaiement
();
$creditnotes
=
$tmpobject
->
getSumCreditNotesUsed
();
$deposits
=
$tmpobject
->
getSumDepositsUsed
();
$outstandingOpened
+=
$obj
->
total_ttc
-
$paiement
-
$creditnotes
-
$deposits
;
}
}
return
array
(
'opened'
=>
$outstandingOpened
,
'total_ht'
=>
$outstandingTotal
,
'total_ttc'
=>
$outstandingTotalIncTax
);
}
else
{
return
array
();
}
dol_syslog
(
"getOutstandingBills"
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
$outstandingOpened
=
0
;
$outstandingTotal
=
0
;
$outstandingTotalIncTax
=
0
;
if
(
$mode
==
'supplier'
)
{
require_once
DOL_DOCUMENT_ROOT
.
'/fourn/class/fournisseur.facture.class.php'
;
$tmpobject
=
new
FactureFournisseur
(
$this
->
db
);
}
else
{
require_once
DOL_DOCUMENT_ROOT
.
'/compta/facture/class/facture.class.php'
;
$tmpobject
=
new
Facture
(
$this
->
db
);
}
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
$tmpobject
->
id
=
$obj
->
rowid
;
if
(
$obj
->
fk_statut
!=
0
// Not a draft
&&
!
(
$obj
->
fk_statut
==
3
&&
$obj
->
close_code
==
'replaced'
)
// Not a replaced invoice
)
{
$outstandingTotal
+=
$obj
->
total_ht
;
$outstandingTotalIncTax
+=
$obj
->
total_ttc
;
}
if
(
$obj
->
paye
==
0
&&
$obj
->
fk_statut
!=
0
// Not a draft
&&
$obj
->
fk_statut
!=
3
// Not abandonned
&&
$obj
->
fk_statut
!=
2
)
// Not classified as paid
//$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason
{
$paiement
=
$tmpobject
->
getSommePaiement
();
$creditnotes
=
$tmpobject
->
getSumCreditNotesUsed
();
$deposits
=
$tmpobject
->
getSumDepositsUsed
();
$outstandingOpened
+=
$obj
->
total_ttc
-
$paiement
-
$creditnotes
-
$deposits
;
}
}
return
array
(
'opened'
=>
$outstandingOpened
,
'total_ht'
=>
$outstandingTotal
,
'total_ttc'
=>
$outstandingTotalIncTax
);
}
else
{
return
array
();
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment