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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
622f5dff
Commit
622f5dff
authored
12 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: use order entity instead customer entity
parent
84089f3e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/commande/orderstoinvoice.php
+31
-30
31 additions, 30 deletions
htdocs/commande/orderstoinvoice.php
with
31 additions
and
30 deletions
htdocs/commande/orderstoinvoice.php
+
31
−
30
View file @
622f5dff
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-201
1
Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-201
2
Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
...
@@ -39,15 +39,19 @@ if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/p
...
@@ -39,15 +39,19 @@ if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/p
$langs
->
load
(
'orders'
);
$langs
->
load
(
'orders'
);
$langs
->
load
(
'deliveries'
);
$langs
->
load
(
'deliveries'
);
$langs
->
load
(
'companies'
);
$langs
->
load
(
'companies'
);
$langs
->
load
(
'orderstoinvoice@orderstoinvoice'
);
if
(
!
$user
->
rights
->
facture
->
creer
)
accessforbidden
();
$id
=
(
GETPOST
(
'id'
)
?
GETPOST
(
"id"
)
:
GETPOST
(
"facid"
));
// For backward compatibility
$ref
=
GETPOST
(
'ref'
,
'alpha'
);
$action
=
GETPOST
(
'action'
,
'alpha'
);
$confirm
=
GETPOST
(
'confirm'
,
'alpha'
);
$sref
=
GETPOST
(
'sref'
);
$sref
=
GETPOST
(
'sref'
);
$sref_client
=
GETPOST
(
'sref_client'
);
$sref_client
=
GETPOST
(
'sref_client'
);
$sall
=
GETPOST
(
'sall'
);
$sall
=
GETPOST
(
'sall'
);
$socid
=
GETPOST
(
'socid'
,
'int'
);
$socid
=
GETPOST
(
'socid'
,
'int'
);
if
(
!
$user
->
rights
->
facture
->
creer
)
accessforbidden
();
$sortfield
=
GETPOST
(
"sortfield"
,
'alpha'
);
$sortfield
=
GETPOST
(
"sortfield"
,
'alpha'
);
$sortorder
=
GETPOST
(
"sortorder"
,
'alpha'
);
$sortorder
=
GETPOST
(
"sortorder"
,
'alpha'
);
...
@@ -120,19 +124,14 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
...
@@ -120,19 +124,14 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$_POST
[
'originid'
]
=
$orders_id
[
0
];
$_POST
[
'originid'
]
=
$orders_id
[
0
];
}
}
$sall
=
isset
(
$_GET
[
'sall'
])
?
trim
(
$_GET
[
'sall'
])
:
trim
(
$_POST
[
'sall'
]);
$projectid
=
isset
(
$_GET
[
'projectid'
])
?
$_GET
[
'projectid'
]
:
0
;
$projectid
=
GETPOST
(
'projectid'
,
'int'
)
?
GETPOST
(
'projectid'
,
'int'
)
:
0
;
$id
=
(
GETPOST
(
'id'
)
?
GETPOST
(
"id"
)
:
GETPOST
(
"facid"
));
// For backward compatibility
$lineid
=
GETPOST
(
'lineid'
,
'int'
);
$ref
=
GETPOST
(
'ref'
);
$userid
=
GETPOST
(
'userid'
,
'int'
);
$socid
=
GETPOST
(
'socid'
);
$action
=
GETPOST
(
'action'
);
$confirm
=
GETPOST
(
'confirm'
);
$lineid
=
GETPOST
(
'lineid'
);
$userid
=
GETPOST
(
'userid'
);
$search_ref
=
GETPOST
(
'sf_ref'
)
?
GETPOST
(
'sf_ref'
)
:
GETPOST
(
'search_ref'
);
$search_ref
=
GETPOST
(
'sf_ref'
)
?
GETPOST
(
'sf_ref'
)
:
GETPOST
(
'search_ref'
);
// Security check
// Security check
$fieldid
=
isset
(
$_GET
[
"ref"
]
)
?
'facnumber'
:
'rowid'
;
$fieldid
=
GETPOST
(
'ref'
,
'alpha'
)
?
'facnumber'
:
'rowid'
;
if
(
$user
->
societe_id
)
$socid
=
$user
->
societe_id
;
if
(
$user
->
societe_id
)
$socid
=
$user
->
societe_id
;
$result
=
restrictedArea
(
$user
,
'facture'
,
$id
,
''
,
''
,
'fk_soc'
,
$fieldid
);
$result
=
restrictedArea
(
$user
,
'facture'
,
$id
,
''
,
''
,
'fk_soc'
,
$fieldid
);
...
@@ -502,7 +501,8 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
...
@@ -502,7 +501,8 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
$sql
.
=
' FROM '
.
MAIN_DB_PREFIX
.
'societe as s'
;
$sql
.
=
' FROM '
.
MAIN_DB_PREFIX
.
'societe as s'
;
$sql
.
=
', '
.
MAIN_DB_PREFIX
.
'commande as c'
;
$sql
.
=
', '
.
MAIN_DB_PREFIX
.
'commande as c'
;
if
(
!
$user
->
rights
->
societe
->
client
->
voir
&&
!
$socid
)
$sql
.
=
", "
.
MAIN_DB_PREFIX
.
"societe_commerciaux as sc"
;
if
(
!
$user
->
rights
->
societe
->
client
->
voir
&&
!
$socid
)
$sql
.
=
", "
.
MAIN_DB_PREFIX
.
"societe_commerciaux as sc"
;
$sql
.
=
' WHERE c.fk_soc = s.rowid'
;
$sql
.
=
' WHERE c.entity = '
.
$conf
->
entity
;
$sql
.
=
' AND c.fk_soc = s.rowid'
;
/*
/*
if ($viewstatut <> '')
if ($viewstatut <> '')
...
@@ -530,7 +530,6 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
...
@@ -530,7 +530,6 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
// Which invoice to show
// Which invoice to show
$sql
.
=
" AND c.fk_statut in (1, 2) AND c.facture = 0"
;
$sql
.
=
" AND c.fk_statut in (1, 2) AND c.facture = 0"
;
$sql
.
=
' AND s.entity = '
.
$conf
->
entity
;
if
(
$socid
)
$sql
.
=
' AND s.rowid = '
.
$socid
;
if
(
$socid
)
$sql
.
=
' AND s.rowid = '
.
$socid
;
if
(
!
$user
->
rights
->
societe
->
client
->
voir
&&
!
$socid
)
$sql
.
=
" AND s.rowid = sc.fk_soc AND sc.fk_user = "
.
$user
->
id
;
if
(
!
$user
->
rights
->
societe
->
client
->
voir
&&
!
$socid
)
$sql
.
=
" AND s.rowid = sc.fk_soc AND sc.fk_user = "
.
$user
->
id
;
if
(
$sref
)
if
(
$sref
)
...
@@ -571,13 +570,15 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
...
@@ -571,13 +570,15 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
$i
=
0
;
$i
=
0
;
$period
=
$html
->
select_date
(
$date_start
,
'date_start'
,
0
,
0
,
1
,
''
,
1
,
0
,
1
)
.
' - '
.
$html
->
select_date
(
$date_end
,
'date_end'
,
0
,
0
,
1
,
''
,
1
,
0
,
1
);
$period
=
$html
->
select_date
(
$date_start
,
'date_start'
,
0
,
0
,
1
,
''
,
1
,
0
,
1
)
.
' - '
.
$html
->
select_date
(
$date_end
,
'date_end'
,
0
,
0
,
1
,
''
,
1
,
0
,
1
);
$periodely
=
$html
->
select_date
(
$date_starty
,
'date_start_dely'
,
0
,
0
,
1
,
''
,
1
,
0
,
1
)
.
' - '
.
$html
->
select_date
(
$date_endy
,
'date_end_dely'
,
0
,
0
,
1
,
''
,
1
,
0
,
1
);
$periodely
=
$html
->
select_date
(
$date_starty
,
'date_start_dely'
,
0
,
0
,
1
,
''
,
1
,
0
,
1
)
.
' - '
.
$html
->
select_date
(
$date_endy
,
'date_end_dely'
,
0
,
0
,
1
,
''
,
1
,
0
,
1
);
if
(
!
empty
(
$socid
))
{
// Company
// Company
print
'<h3>'
;
$companystatic
->
id
=
$socid
;
$companystatic
->
id
=
$socid
;
$companystatic
->
nom
=
$soc
->
nom
;
$companystatic
->
nom
=
$soc
->
nom
;
print
'<h3>'
.
$companystatic
->
getNomUrl
(
1
,
'customer'
)
.
'</h3>'
;
}
print
$companystatic
->
getNomUrl
(
1
,
'customer'
);
print
'</h3>'
;
print
'<table class="noborder" width="100%">'
;
print
'<table class="noborder" width="100%">'
;
print
'<tr class="liste_titre">'
;
print
'<tr class="liste_titre">'
;
print_liste_field_titre
(
$langs
->
trans
(
'Ref'
),
'orderstoinvoice.php'
,
'c.ref'
,
''
,
'&socid='
.
$socid
,
''
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
'Ref'
),
'orderstoinvoice.php'
,
'c.ref'
,
''
,
'&socid='
.
$socid
,
''
,
$sortfield
,
$sortorder
);
...
...
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