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
dc284b98
Commit
dc284b98
authored
20 years ago
by
Rodolphe Quiedeville
Browse files
Options
Downloads
Patches
Plain Diff
Permet maintenant de générer les contrats
parent
82363add
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/telephonie/stats/graph/gain.class.php
+18
-19
18 additions, 19 deletions
htdocs/telephonie/stats/graph/gain.class.php
with
18 additions
and
19 deletions
htdocs/telephonie/stats/graph/gain.class.php
+
18
−
19
View file @
dc284b98
...
@@ -31,6 +31,7 @@ class GraphGain extends GraphBrouzouf{
...
@@ -31,6 +31,7 @@ class GraphGain extends GraphBrouzouf{
$this
->
file
=
$file
;
$this
->
file
=
$file
;
$this
->
client
=
0
;
$this
->
client
=
0
;
$this
->
contrat
=
0
;
$this
->
titre
=
"Gain (euros HT)"
;
$this
->
titre
=
"Gain (euros HT)"
;
$this
->
barcolor
=
"blue"
;
$this
->
barcolor
=
"blue"
;
...
@@ -40,18 +41,17 @@ class GraphGain extends GraphBrouzouf{
...
@@ -40,18 +41,17 @@ class GraphGain extends GraphBrouzouf{
Function
GraphDraw
()
Function
GraphDraw
()
{
{
$num
=
0
;
$num
=
0
;
$ligne
=
new
LigneTel
(
$this
->
db
);
if
(
$this
->
client
==
0
)
if
(
$this
->
client
==
0
&&
$this
->
contrat
==
0
)
{
{
$sql
=
"SELECT date, sum(gain)
, sum(cout_vente), sum(fourn_montant)
"
;
$sql
=
"SELECT date, sum(gain)"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"telephonie_facture"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"telephonie_facture"
;
$sql
.
=
" WHERE fk_facture is not null"
;
$sql
.
=
" WHERE fk_facture is not null"
;
$sql
.
=
" GROUP BY date ASC"
;
$sql
.
=
" GROUP BY date ASC"
;
}
}
else
else
if
(
$this
->
client
>
0
&&
$this
->
contrat
==
0
)
{
{
$sql
=
"SELECT date, sum(gain)
, sum(cout_vente), sum(fourn_montant)
"
;
$sql
=
"SELECT date, sum(gain)"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"telephonie_facture"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"telephonie_facture"
;
$sql
.
=
" , "
.
MAIN_DB_PREFIX
.
"telephonie_societe_ligne as s"
;
$sql
.
=
" , "
.
MAIN_DB_PREFIX
.
"telephonie_societe_ligne as s"
;
$sql
.
=
" WHERE fk_facture is not null"
;
$sql
.
=
" WHERE fk_facture is not null"
;
...
@@ -59,6 +59,16 @@ class GraphGain extends GraphBrouzouf{
...
@@ -59,6 +59,16 @@ class GraphGain extends GraphBrouzouf{
$sql
.
=
" AND s.fk_client_comm = "
.
$this
->
client
;
$sql
.
=
" AND s.fk_client_comm = "
.
$this
->
client
;
$sql
.
=
" GROUP BY date ASC"
;
$sql
.
=
" GROUP BY date ASC"
;
}
}
elseif
(
$this
->
client
==
0
&&
$this
->
contrat
>
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"
;
}
$result
=
$this
->
db
->
query
(
$sql
);
$result
=
$this
->
db
->
query
(
$sql
);
...
@@ -66,29 +76,19 @@ class GraphGain extends GraphBrouzouf{
...
@@ -66,29 +76,19 @@ class GraphGain extends GraphBrouzouf{
{
{
$num
=
$this
->
db
->
num_rows
();
$num
=
$this
->
db
->
num_rows
();
$i
=
0
;
$i
=
0
;
$j
=
-
1
;
$labels
=
array
();
$labels
=
array
();
$cf
=
array
();
$cv
=
array
();
$gg
=
array
();
$this
->
total_gain
=
0
;
$this
->
total_gain
=
0
;
$this
->
total_ca
=
0
;
$this
->
total_cout
=
0
;
while
(
$i
<
$num
)
while
(
$i
<
$num
)
{
{
$row
=
$this
->
db
->
fetch_row
(
$i
);
$row
=
$this
->
db
->
fetch_row
();
$cf
[
$i
]
=
$row
[
3
];
$cv
[
$i
]
=
$row
[
2
];
$g
[
$i
]
=
$row
[
1
];
$g
[
$i
]
=
$row
[
1
];
$labels
[
$i
]
=
substr
(
$row
[
0
],
5
,
2
)
.
"/"
.
substr
(
$row
[
0
],
2
,
2
);
$labels
[
$i
]
=
substr
(
$row
[
0
],
5
,
2
)
.
"/"
.
substr
(
$row
[
0
],
2
,
2
);
$this
->
total_gain
+=
$row
[
1
];
$this
->
total_gain
+=
$row
[
1
];
$this
->
total_ca
+=
$row
[
2
];
$this
->
total_cout
+=
$row
[
3
];
$i
++
;
$i
++
;
}
}
...
@@ -139,7 +139,6 @@ class GraphGain extends GraphBrouzouf{
...
@@ -139,7 +139,6 @@ class GraphGain extends GraphBrouzouf{
print
$this
->
client
.
" "
.
$g
[
$i
-
1
]
.
"
\n
"
;
print
$this
->
client
.
" "
.
$g
[
$i
-
1
]
.
"
\n
"
;
}
}
if
(
$num
>
0
)
if
(
$num
>
0
)
{
{
$this
->
GraphMakeGraph
(
$g
,
$labels
);
$this
->
GraphMakeGraph
(
$g
,
$labels
);
...
...
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