Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Antoine
ae2
Commits
c072b111
Commit
c072b111
authored
May 23, 2014
by
Bate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Peut-etre qu'il faudrait empecher de declicker des ecocup qu'on a pas achete
parent
060c4306
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
comptoir/include/produit.inc.php
comptoir/include/produit.inc.php
+19
-0
No files found.
comptoir/include/produit.inc.php
View file @
c072b111
...
@@ -597,6 +597,25 @@ class produit extends stdentity
...
@@ -597,6 +597,25 @@ class produit extends stdentity
return
$val
;
return
$val
;
}
}
// Les putains d'Ecocup
if
(
$this
->
id_produit
==
1151
)
{
$req
=
new
requete
(
$this
->
db
,
"SELECT SUM(cpt_produits.prix_vente_prod)/100 nb_consigne FROM cpt_vendu
INNER JOIN cpt_produits ON cpt_vendu.id_produit = cpt_produits.id_produit
INNER JOIN cpt_debitfacture ON cpt_debitfacture.id_facture = cpt_vendu.id_facture
WHERE cpt_debitfacture.id_utilisateur_client = '"
.
intval
(
$user
->
id
)
.
"'
AND (cpt_produits.id_produit = 1152 OR cpt_produits.id_produit = 1151)"
);
$row
=
$req
->
get_row
();
// Le nombre renvoyé doit être >= 0 !
$val
=
max
(
0
,
$this
->
limite_utilisateur
-
$row
[
"nb_achetes"
]);
return
$val
;
}
return
-
1
;
return
-
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment