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
e4bff59f
Commit
e4bff59f
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: pgsql compatibility. No upper cas into field names.
parent
643fc6c6
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/societe/consumption.php
+14
-14
14 additions, 14 deletions
htdocs/societe/consumption.php
with
14 additions
and
14 deletions
htdocs/societe/consumption.php
+
14
−
14
View file @
e4bff59f
...
...
@@ -48,7 +48,7 @@ if ($page == -1) {
}
$offset
=
$conf
->
liste_limit
*
$page
;
if
(
!
$sortorder
)
$sortorder
=
'DESC'
;
if
(
!
$sortfield
)
$sortfield
=
'date
P
rint'
;
if
(
!
$sortfield
)
$sortfield
=
'date
p
rint'
;
$limit
=
$conf
->
liste_limit
;
// Search fields
...
...
@@ -168,12 +168,12 @@ if ($type_element == 'invoice')
{
// Customer : show products from invoices
require_once
DOL_DOCUMENT_ROOT
.
'/compta/facture/class/facture.class.php'
;
$documentstatic
=
new
Facture
(
$db
);
$sql_select
=
'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as date
P
rint, '
;
$sql_select
=
'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as date
p
rint, '
;
$tables_from
=
MAIN_DB_PREFIX
.
"facture as f,"
.
MAIN_DB_PREFIX
.
"facturedet as d"
;
$where
=
" WHERE f.fk_soc = s.rowid AND s.rowid = "
.
$socid
;
$where
.
=
" AND d.fk_facture = f.rowid"
;
$where
.
=
" AND f.entity = "
.
$conf
->
entity
;
$date
P
rint
=
'f.datef'
;
$date
p
rint
=
'f.datef'
;
$doc_number
=
'f.facnumber'
;
$thirdTypeSelect
=
'customer'
;
}
...
...
@@ -181,12 +181,12 @@ if ($type_element == 'order')
{
require_once
DOL_DOCUMENT_ROOT
.
'/commande/class/commande.class.php'
;
$documentstatic
=
new
Commande
(
$db
);
$sql_select
=
'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as date
P
rint, '
;
$sql_select
=
'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as date
p
rint, '
;
$tables_from
=
MAIN_DB_PREFIX
.
"commande as c,"
.
MAIN_DB_PREFIX
.
"commandedet as d"
;
$where
=
" WHERE c.fk_soc = s.rowid AND s.rowid = "
.
$socid
;
$where
.
=
" AND d.fk_commande = c.rowid"
;
$where
.
=
" AND c.entity = "
.
$conf
->
entity
;
$date
P
rint
=
'c.datef'
;
$date
p
rint
=
'c.datef'
;
$doc_number
=
'c.ref'
;
$thirdTypeSelect
=
'customer'
;
}
...
...
@@ -194,11 +194,11 @@ if ($type_element == 'supplier_invoice')
{
// Supplier : Show products from invoices.
require_once
DOL_DOCUMENT_ROOT
.
'/fourn/class/fournisseur.facture.class.php'
;
$documentstatic
=
new
FactureFournisseur
(
$db
);
$sql_select
=
'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as date
P
rint, '
;
$sql_select
=
'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as date
p
rint, '
;
$tables_from
=
MAIN_DB_PREFIX
.
"facture_fourn as f,"
.
MAIN_DB_PREFIX
.
"facture_fourn_det as d"
;
$where
=
" WHERE f.fk_soc = s.rowid AND s.rowid = "
.
$socid
;
$where
.
=
" AND d.fk_facture_fourn = f.rowid"
;
$date
P
rint
=
'f.datef'
;
$date
p
rint
=
'f.datef'
;
$doc_number
=
'f.ref'
;
$thirdTypeSelect
=
'supplier'
;
}
...
...
@@ -206,11 +206,11 @@ if ($type_element == 'supplier_order')
{
// Supplier : Show products from orders.
require_once
DOL_DOCUMENT_ROOT
.
'/fourn/class/fournisseur.commande.class.php'
;
$documentstatic
=
new
CommandeFournisseur
(
$db
);
$sql_select
=
'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as date
P
rint, '
;
$sql_select
=
'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as date
p
rint, '
;
$tables_from
=
MAIN_DB_PREFIX
.
"commande_fournisseur as c,"
.
MAIN_DB_PREFIX
.
"commande_fournisseurdet as d"
;
$where
=
" WHERE c.fk_soc = s.rowid AND s.rowid = "
.
$socid
;
$where
.
=
" AND d.fk_commande = c.rowid"
;
$date
P
rint
=
'c.date_valid'
;
$date
p
rint
=
'c.date_valid'
;
$doc_number
=
'c.ref'
;
$thirdTypeSelect
=
'supplier'
;
}
...
...
@@ -226,14 +226,14 @@ if ($month > 0) {
if
(
$year
>
0
)
{
$start
=
dol_mktime
(
0
,
0
,
0
,
$month
,
1
,
$year
);
$end
=
dol_time_plus_duree
(
$start
,
1
,
'm'
)
-
1
;
$sql
.
=
" AND "
.
$date
P
rint
.
" BETWEEN '"
.
$db
->
idate
(
$start
)
.
"' AND '"
.
$db
->
idate
(
$end
)
.
"'"
;
$sql
.
=
" AND "
.
$date
p
rint
.
" BETWEEN '"
.
$db
->
idate
(
$start
)
.
"' AND '"
.
$db
->
idate
(
$end
)
.
"'"
;
}
else
{
$sql
.
=
" AND date_format("
.
$date
P
rint
.
", '%m') = '"
.
sprintf
(
'%02d'
,
$month
)
.
"'"
;
$sql
.
=
" AND date_format("
.
$date
p
rint
.
", '%m') = '"
.
sprintf
(
'%02d'
,
$month
)
.
"'"
;
}
}
else
if
(
$year
>
0
)
{
$start
=
dol_mktime
(
0
,
0
,
0
,
1
,
1
,
$year
);
$end
=
dol_time_plus_duree
(
$start
,
1
,
'y'
)
-
1
;
$sql
.
=
" AND "
.
$date
P
rint
.
" BETWEEN '"
.
$db
->
idate
(
$start
)
.
"' AND '"
.
$db
->
idate
(
$end
)
.
"'"
;
$sql
.
=
" AND "
.
$date
p
rint
.
" BETWEEN '"
.
$db
->
idate
(
$start
)
.
"' AND '"
.
$db
->
idate
(
$end
)
.
"'"
;
}
if
(
$sref
)
$sql
.
=
" AND "
.
$doc_number
.
" LIKE '%"
.
$sref
.
"%'"
;
if
(
$sprod_fulldescr
)
$sql
.
=
" AND (d.description LIKE '%"
.
$sprod_fulldescr
.
"%' OR p.label LIKE '%"
.
$sprod_fulldescr
.
"%')"
;
...
...
@@ -259,7 +259,7 @@ print '<table class="liste" width="100%">'."\n";
// Titles with sort buttons
print
'<tr class="liste_titre">'
;
print_liste_field_titre
(
$langs
->
trans
(
'Ref'
),
$_SERVER
[
'PHP_SELF'
],
'doc_number'
,
''
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
'Date'
),
$_SERVER
[
'PHP_SELF'
],
'date
P
rint'
,
''
,
$param
,
'align="center" width="150"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
'Date'
),
$_SERVER
[
'PHP_SELF'
],
'date
p
rint'
,
''
,
$param
,
'align="center" width="150"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
'Product'
),
$_SERVER
[
'PHP_SELF'
],
''
,
''
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
'Quantity'
),
$_SERVER
[
'PHP_SELF'
],
'prod_qty'
,
''
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
// Filters
...
...
@@ -295,7 +295,7 @@ if ($sql_select)
$documentstatic
->
type
=
$objp
->
type
;
print
$documentstatic
->
getNomUrl
(
1
);
print
'</td>'
;
print
'<td align="center" width="80">'
.
dol_print_date
(
$db
->
jdate
(
$objp
->
date
P
rint
),
'day'
)
.
'</td>'
;
print
'<td align="center" width="80">'
.
dol_print_date
(
$db
->
jdate
(
$objp
->
date
p
rint
),
'day'
)
.
'</td>'
;
print
'<td>'
;
...
...
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