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
ce8a024d
Commit
ce8a024d
authored
7 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix limit on margin pages
parent
460179a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/margin/agentMargins.php
+12
-10
12 additions, 10 deletions
htdocs/margin/agentMargins.php
htdocs/margin/customerMargins.php
+12
-6
12 additions, 6 deletions
htdocs/margin/customerMargins.php
htdocs/margin/productMargins.php
+14
-14
14 additions, 14 deletions
htdocs/margin/productMargins.php
with
38 additions
and
30 deletions
htdocs/margin/agentMargins.php
+
12
−
10
View file @
ce8a024d
...
...
@@ -44,8 +44,15 @@ if ($user->rights->margins->read->all) {
$mesg
=
''
;
$sortfield
=
GETPOST
(
"sortfield"
,
'alpha'
);
$sortorder
=
GETPOST
(
"sortorder"
,
'alpha'
);
// Load variable for pagination
$limit
=
GETPOST
(
'limit'
,
'int'
)
?
GETPOST
(
'limit'
,
'int'
)
:
$conf
->
liste_limit
;
$sortfield
=
GETPOST
(
'sortfield'
,
'alpha'
);
$sortorder
=
GETPOST
(
'sortorder'
,
'alpha'
);
$page
=
GETPOST
(
'page'
,
'int'
);
if
(
empty
(
$page
)
||
$page
==
-
1
)
{
$page
=
0
;
}
// If $page is not defined, or '' or -1
$offset
=
$limit
*
$page
;
$pageprev
=
$page
-
1
;
$pagenext
=
$page
+
1
;
if
(
!
$sortorder
)
$sortorder
=
"ASC"
;
if
(
!
$sortfield
)
{
...
...
@@ -54,11 +61,6 @@ if (! $sortfield)
else
$sortfield
=
"u.lastname"
;
}
$page
=
GETPOST
(
"page"
,
'int'
);
if
(
empty
(
$page
)
||
$page
==
-
1
)
{
$page
=
0
;
}
// If $page is not defined, or '' or -1
$offset
=
$conf
->
liste_limit
*
$page
;
$pageprev
=
$page
-
1
;
$pagenext
=
$page
+
1
;
$startdate
=
$enddate
=
''
;
...
...
@@ -170,13 +172,13 @@ if ($result)
$num
=
$db
->
num_rows
(
$result
);
print
'<br>'
;
print_barre_liste
(
$langs
->
trans
(
"MarginDetails"
),
$page
,
$_SERVER
[
"PHP_SELF"
],
""
,
$sortfield
,
$sortorder
,
''
,
$num
,
$num
,
''
);
print_barre_liste
(
$langs
->
trans
(
"MarginDetails"
),
$page
,
$_SERVER
[
"PHP_SELF"
],
""
,
$sortfield
,
$sortorder
,
''
,
$num
,
$num
,
''
,
0
,
''
,
''
,
0
,
1
);
if
(
$conf
->
global
->
MARGIN_TYPE
==
"1"
)
$labelcostprice
=
$langs
->
trans
(
'BuyingPrice'
);
else
// value is 'costprice' or 'pmp'
$labelcostprice
=
$langs
->
trans
(
'CostPrice'
);
$i
=
0
;
print
"<table class=
\"
noborder
\"
width=
\"
100%
\"
>"
;
...
...
@@ -220,7 +222,7 @@ if ($result)
$markRate
=
(
$pv
!=
0
)
?
(
100
*
$marge
/
$pv
)
:
''
;
}
print
'<tr class="oddeven">'
;
if
(
$agentid
>
0
)
{
...
...
This diff is collapsed.
Click to expand it.
htdocs/margin/customerMargins.php
+
12
−
6
View file @
ce8a024d
...
...
@@ -41,11 +41,17 @@ $result = restrictedArea($user, 'societe','','');
$mesg
=
''
;
$page
=
GETPOST
(
"page"
,
'int'
);
// Load variable for pagination
$limit
=
GETPOST
(
'limit'
,
'int'
)
?
GETPOST
(
'limit'
,
'int'
)
:
$conf
->
liste_limit
;
$sortfield
=
GETPOST
(
'sortfield'
,
'alpha'
);
$sortorder
=
GETPOST
(
'sortorder'
,
'alpha'
);
$page
=
GETPOST
(
'page'
,
'int'
);
if
(
empty
(
$page
)
||
$page
==
-
1
)
{
$page
=
0
;
}
// If $page is not defined, or '' or -1
$offset
=
$
conf
->
liste_
limit
*
$page
;
$offset
=
$limit
*
$page
;
$pageprev
=
$page
-
1
;
$pagenext
=
$page
+
1
;
if
(
!
$sortfield
)
$sortfield
=
"s.nom"
;
// Set here default search field
if
(
!
$sortorder
)
$sortorder
=
"ASC"
;
$startdate
=
$enddate
=
''
;
...
...
@@ -206,13 +212,13 @@ if ($result)
$num
=
$db
->
num_rows
(
$result
);
print
'<br>'
;
print_barre_liste
(
$langs
->
trans
(
"MarginDetails"
),
$page
,
$_SERVER
[
"PHP_SELF"
],
""
,
$sortfield
,
$sortorder
,
''
,
$num
,
$num
,
''
);
print_barre_liste
(
$langs
->
trans
(
"MarginDetails"
),
$page
,
$_SERVER
[
"PHP_SELF"
],
""
,
$sortfield
,
$sortorder
,
''
,
$num
,
$num
,
''
,
0
,
''
,
''
,
0
,
1
);
if
(
$conf
->
global
->
MARGIN_TYPE
==
"1"
)
$labelcostprice
=
$langs
->
trans
(
'BuyingPrice'
);
else
// value is 'costprice' or 'pmp'
$labelcostprice
=
$langs
->
trans
(
'CostPrice'
);
$i
=
0
;
print
"<table class=
\"
noborder
\"
width=
\"
100%
\"
>"
;
...
...
@@ -260,7 +266,7 @@ if ($result)
$markRate
=
(
$pv
!=
0
)
?
(
100
*
$marge
/
$pv
)
:
''
;
}
print
'<tr class="oddeven">'
;
if
(
$client
)
{
...
...
@@ -295,7 +301,7 @@ if ($result)
}
// affichage totaux marges
$totalMargin
=
$cumul_vente
-
$cumul_achat
;
/*if ($totalMargin < 0)
{
...
...
This diff is collapsed.
Click to expand it.
htdocs/margin/productMargins.php
+
14
−
14
View file @
ce8a024d
...
...
@@ -46,9 +46,15 @@ $result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','',
$mesg
=
''
;
$sortfield
=
GETPOST
(
"sortfield"
,
'alpha'
);
$sortorder
=
GETPOST
(
"sortorder"
,
'alpha'
);
if
(
!
$sortorder
)
$sortorder
=
"ASC"
;
// Load variable for pagination
$limit
=
GETPOST
(
'limit'
,
'int'
)
?
GETPOST
(
'limit'
,
'int'
)
:
$conf
->
liste_limit
;
$sortfield
=
GETPOST
(
'sortfield'
,
'alpha'
);
$sortorder
=
GETPOST
(
'sortorder'
,
'alpha'
);
$page
=
GETPOST
(
'page'
,
'int'
);
if
(
empty
(
$page
)
||
$page
==
-
1
)
{
$page
=
0
;
}
// If $page is not defined, or '' or -1
$offset
=
$limit
*
$page
;
$pageprev
=
$page
-
1
;
$pagenext
=
$page
+
1
;
if
(
!
$sortfield
)
{
if
(
$id
>
0
)
...
...
@@ -63,12 +69,6 @@ if (! $sortfield)
}
}
$page
=
GETPOST
(
"page"
,
'int'
);
if
(
empty
(
$page
)
||
$page
==
-
1
)
{
$page
=
0
;
}
// If $page is not defined, or '' or -1
$offset
=
$conf
->
liste_limit
*
$page
;
$pageprev
=
$page
-
1
;
$pagenext
=
$page
+
1
;
$startdate
=
$enddate
=
''
;
if
(
!
empty
(
$_POST
[
'startdatemonth'
]))
...
...
@@ -202,16 +202,16 @@ if ($result)
$num
=
$db
->
num_rows
(
$result
);
print
'<br>'
;
print_barre_liste
(
$langs
->
trans
(
"MarginDetails"
),
$page
,
$_SERVER
[
"PHP_SELF"
],
"&id="
.
$id
,
$sortfield
,
$sortorder
,
''
,
$num
,
$num
,
''
);
print_barre_liste
(
$langs
->
trans
(
"MarginDetails"
),
$page
,
$_SERVER
[
"PHP_SELF"
],
"&id="
.
$id
,
$sortfield
,
$sortorder
,
''
,
$num
,
$num
,
''
,
0
,
''
,
''
,
0
,
1
);
//var_dump($conf->global->MARGIN_TYPE);
if
(
$conf
->
global
->
MARGIN_TYPE
==
"1"
)
$labelcostprice
=
$langs
->
trans
(
'BuyingPrice'
);
else
// value is 'costprice' or 'pmp'
$labelcostprice
=
$langs
->
trans
(
'CostPrice'
);
$moreforfilter
=
''
;
$i
=
0
;
print
'<div class="div-table-responsive">'
;
print
'<table class="tagtable liste'
.
(
$moreforfilter
?
" listwithfilterbefore"
:
""
)
.
'">'
.
"
\n
"
;
...
...
@@ -260,7 +260,7 @@ if ($result)
$markRate
=
(
$pv
!=
0
)
?
(
100
*
$marge
/
$pv
)
:
''
;
}
print
'<tr class="oddeven">'
;
if
(
$id
>
0
)
{
...
...
@@ -308,7 +308,7 @@ if ($result)
}
// affichage totaux marges
$totalMargin
=
$cumul_vente
-
$cumul_achat
;
$marginRate
=
(
$cumul_achat
!=
0
)
?
(
100
*
$totalMargin
/
$cumul_achat
)
:
''
;
...
...
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