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
d1a6c9ca
Commit
d1a6c9ca
authored
20 years ago
by
Rodolphe Quiedeville
Browse files
Options
Downloads
Patches
Plain Diff
Ajout des graph de lignes
parent
ab3f13fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/telephonie/stats/graph/gain.class.php
+20
-14
20 additions, 14 deletions
htdocs/telephonie/stats/graph/gain.class.php
with
20 additions
and
14 deletions
htdocs/telephonie/stats/graph/gain.class.php
+
20
−
14
View file @
d1a6c9ca
...
...
@@ -32,6 +32,7 @@ class GraphGain extends GraphBrouzouf{
$this
->
client
=
0
;
$this
->
contrat
=
0
;
$this
->
ligne
=
0
;
$this
->
titre
=
"Gain (euros HT)"
;
$this
->
barcolor
=
"blue"
;
...
...
@@ -41,34 +42,39 @@ class GraphGain extends GraphBrouzouf{
Function
GraphDraw
()
{
$num
=
0
;
$sql
=
"SELECT tf.date, sum(tf.gain)"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"telephonie_facture as tf"
;
if
(
$this
->
client
==
0
&&
$this
->
contrat
==
0
)
if
(
$this
->
client
==
0
&&
$this
->
contrat
==
0
&&
$this
->
ligne
==
0
)
{
$sql
=
"SELECT date, sum(gain)"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"telephonie_facture"
;
$sql
.
=
" WHERE fk_facture is not null"
;
$sql
.
=
" GROUP BY date ASC"
;
$sql
.
=
" WHERE tf.fk_facture is not null"
;
$sql
.
=
" GROUP BY tf.date ASC"
;
}
elseif
(
$this
->
client
>
0
&&
$this
->
contrat
==
0
)
elseif
(
$this
->
client
>
0
&&
$this
->
contrat
==
0
&&
$this
->
ligne
==
0
)
{
$sql
=
"SELECT date, sum(gain)"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"telephonie_facture"
;
$sql
.
=
" , "
.
MAIN_DB_PREFIX
.
"telephonie_societe_ligne as s"
;
$sql
.
=
" WHERE fk_facture is not null"
;
$sql
.
=
" AND s.rowid = fk_ligne"
;
$sql
.
=
" WHERE
tf.
fk_facture is not null"
;
$sql
.
=
" AND s.rowid =
tf.
fk_ligne"
;
$sql
.
=
" AND s.fk_client_comm = "
.
$this
->
client
;
$sql
.
=
" GROUP BY date ASC"
;
$sql
.
=
" GROUP BY
tf.
date ASC"
;
}
elseif
(
$this
->
client
==
0
&&
$this
->
contrat
>
0
)
elseif
(
$this
->
client
==
0
&&
$this
->
contrat
>
0
&&
$this
->
ligne
==
0
)
{
$sql
=
"SELECT tf.date, sum(tf.gain)"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"telephonie_facture as tf"
;
$sql
.
=
" , "
.
MAIN_DB_PREFIX
.
"telephonie_societe_ligne as s"
;
$sql
.
=
" WHERE tf.fk_facture is not null"
;
$sql
.
=
" AND s.rowid = tf.fk_ligne"
;
$sql
.
=
" AND s.fk_contrat = "
.
$this
->
contrat
;
$sql
.
=
" GROUP BY tf.date ASC"
;
}
elseif
(
$this
->
client
==
0
&&
$this
->
contrat
==
0
&&
$this
->
ligne
>
0
)
{
$sql
.
=
" , "
.
MAIN_DB_PREFIX
.
"telephonie_societe_ligne as s"
;
$sql
.
=
" WHERE tf.fk_facture is not null"
;
$sql
.
=
" AND s.rowid = tf.fk_ligne"
;
$sql
.
=
" AND s.rowid = "
.
$this
->
ligne
;
$sql
.
=
" GROUP BY tf.date ASC"
;
}
$result
=
$this
->
db
->
query
(
$sql
);
...
...
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