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
cd9a893b
Commit
cd9a893b
authored
15 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: disable warehouse
parent
211b47f4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/cashdesk/facturation_dhtml.php
+39
-39
39 additions, 39 deletions
htdocs/cashdesk/facturation_dhtml.php
htdocs/cashdesk/facturation_verif.php
+73
-75
73 additions, 75 deletions
htdocs/cashdesk/facturation_verif.php
with
112 additions
and
114 deletions
htdocs/cashdesk/facturation_dhtml.php
+
39
−
39
View file @
cd9a893b
...
@@ -29,24 +29,26 @@ $langs->load("@cashdesk");
...
@@ -29,24 +29,26 @@ $langs->load("@cashdesk");
// Verification
// Verification
if
(
strlen
(
$_GET
[
"code"
])
>=
0
)
// If at least one key
if
(
strlen
(
$_GET
[
"code"
])
>=
0
)
// If at least one key
{
{
$request
=
"SELECT p.rowid, p.ref, p.label, p.tva_tx
$sql
=
"SELECT p.rowid, p.ref, p.label, p.tva_tx"
;
FROM "
.
MAIN_DB_PREFIX
.
"product as p
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"product as p"
;
LEFT JOIN "
.
MAIN_DB_PREFIX
.
"product_stock as ps ON p.rowid = ps.fk_product
if
(
$conf
->
stock
->
enabled
&&
!
empty
(
$conf_fkentrepot
))
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"product_stock as ps ON p.rowid = ps.fk_product"
;
WHERE p.envente = 1
$sql
.
=
" WHERE p.envente = 1"
;
AND p.fk_product_type = 0"
;
$sql
.
=
" AND p.fk_product_type = 0"
;
if
(
$conf
->
stock
->
enabled
)
$request
.
=
" AND ps.fk_entrepot = '"
.
$conf_fkentrepot
.
"'"
;
if
(
$conf
->
stock
->
enabled
&&
!
empty
(
$conf_fkentrepot
))
$sql
.
=
" AND ps.fk_entrepot = '"
.
$conf_fkentrepot
.
"'"
;
$request
.
=
" AND (p.ref LIKE '%"
.
$_GET
[
'code'
]
.
"%'
$sql
.
=
" AND (p.ref LIKE '%"
.
$_GET
[
'code'
]
.
"%' OR p.label LIKE '%"
.
$_GET
[
'code'
]
.
"%')"
;
OR p.label LIKE '%"
.
$_GET
[
'code'
]
.
"%')
$sql
.
=
" ORDER BY label"
;
ORDER BY label"
;
dol_syslog
(
$request
);
$res
=
$db
->
query
(
$request
);
if
(
$nbr
=
$db
->
num_rows
(
$res
)
)
{
dol_syslog
(
$sql
);
$result
=
$db
->
query
(
$sql
);
if
(
$result
)
{
if
(
$nbr
=
$db
->
num_rows
(
$result
)
)
{
$resultat
=
'<ul class="dhtml_bloc">'
;
$resultat
=
'<ul class="dhtml_bloc">'
;
$ret
=
array
();
$i
=
0
;
$ret
=
array
();
$i
=
0
;
while
(
$tab
=
$db
->
fetch_array
(
$res
)
)
while
(
$tab
=
$db
->
fetch_array
(
$res
ult
)
)
{
{
foreach
(
$tab
as
$cle
=>
$valeur
)
foreach
(
$tab
as
$cle
=>
$valeur
)
{
{
...
@@ -56,28 +58,26 @@ if ( strlen ($_GET["code"]) >= 0 ) // If at least one key
...
@@ -56,28 +58,26 @@ if ( strlen ($_GET["code"]) >= 0 ) // If at least one key
}
}
$tab
=
$ret
;
$tab
=
$ret
;
for
(
$i
=
0
;
$i
<
count
(
$tab
);
$i
++
)
{
for
(
$i
=
0
;
$i
<
count
(
$tab
);
$i
++
)
{
$resultat
.
=
'
$resultat
.
=
'
<li class="dhtml_defaut" title="'
.
$tab
[
$i
][
'ref'
]
.
'"
<li class="dhtml_defaut" title="'
.
$tab
[
$i
][
'ref'
]
.
'"
onMouseOver="javascript: this.className = \'dhtml_selection\';"
onMouseOver="javascript: this.className = \'dhtml_selection\';"
onMouseOut="javascript: this.className = \'dhtml_defaut\';"
onMouseOut="javascript: this.className = \'dhtml_defaut\';"
">'
.
htmlentities
(
$tab
[
$i
][
'ref'
]
.
' - '
.
$tab
[
$i
][
'label'
])
.
'</li>
">'
.
htmlentities
(
$tab
[
$i
][
'ref'
]
.
' - '
.
$tab
[
$i
][
'label'
])
.
'</li>
'
;
'
;
}
}
$resultat
.
=
'</ul>'
;
$resultat
.
=
'</ul>'
;
echo
$resultat
;
print
$resultat
;
}
}
else
{
else
echo
(
'
{
<ul class="dhtml_bloc">
print
'<ul class="dhtml_bloc">'
;
<li class="dhtml_defaut">'
.
$langs
->
trans
(
"NoResults"
)
.
'</li>
print
'<li class="dhtml_defaut">'
.
$langs
->
trans
(
"NoResults"
)
.
'</li>'
;
</ul>
print
'</ul>'
;
'
);
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/cashdesk/facturation_verif.php
+
73
−
75
View file @
cd9a893b
...
@@ -25,88 +25,86 @@ $obj_facturation = unserialize ($_SESSION['serObjFacturation']);
...
@@ -25,88 +25,86 @@ $obj_facturation = unserialize ($_SESSION['serObjFacturation']);
unset
(
$_SESSION
[
'serObjFacturation'
]);
unset
(
$_SESSION
[
'serObjFacturation'
]);
switch
(
$_GET
[
'action'
]
)
{
switch
(
$_GET
[
'action'
]
)
{
default
:
default
:
if
(
$_POST
[
'hdnSource'
]
!=
'NULL'
)
{
if
(
$_POST
[
'hdnSource'
]
!=
'NULL'
)
{
// Recuperation des donnees en fonction de la source (liste d�roulante ou champ texte) ...
$sql
=
"SELECT p.rowid, p.ref, p.price, p.tva_tx"
;
if
(
$_POST
[
'hdnSource'
]
==
'LISTE'
)
{
if
(
$conf
->
stock
->
enabled
&&
!
empty
(
$conf_fkentrepot
))
$sql
.
=
", ps.reel"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"product as p"
;
$res
=
$db
->
query
(
'SELECT fk_product, ref, price, reel, tva_tx
if
(
$conf
->
stock
->
enabled
&&
!
empty
(
$conf_fkentrepot
))
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"product_stock as ps ON p.rowid = ps.fk_product"
;
FROM '
.
MAIN_DB_PREFIX
.
'product
LEFT JOIN '
.
MAIN_DB_PREFIX
.
'product_stock ON '
.
MAIN_DB_PREFIX
.
'product.rowid = '
.
MAIN_DB_PREFIX
.
'product_stock.fk_product
WHERE fk_product = '
.
$_POST
[
'selProduit'
]
.
'
;'
);
}
else
if
(
$_POST
[
'hdnSource'
]
==
'REF'
)
{
$res
=
$db
->
query
(
'SELECT fk_product, ref, price, reel, tva_tx
FROM '
.
MAIN_DB_PREFIX
.
'product
LEFT JOIN '
.
MAIN_DB_PREFIX
.
'product_stock ON '
.
MAIN_DB_PREFIX
.
'product.rowid = '
.
MAIN_DB_PREFIX
.
'product_stock.fk_product
WHERE ref = \''
.
$_POST
[
'txtRef'
]
.
'\'
;'
);
// Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ...
if
(
$_POST
[
'hdnSource'
]
==
'LISTE'
)
{
$sql
.
=
" WHERE p.rowid = "
.
$_POST
[
'selProduit'
];
}
}
else
if
(
$_POST
[
'hdnSource'
]
==
'REF'
)
{
$sql
.
=
" WHERE p.ref = '"
.
$_POST
[
'txtRef'
]
.
"'"
;
}
if
(
$conf
->
stock
->
enabled
&&
!
empty
(
$conf_fkentrepot
))
$sql
.
=
" AND ps.fk_entrepot = "
.
$conf_fkentrepot
;
$result
=
$db
->
query
(
$sql
);
if
(
$result
)
{
// ... et enregistrement dans l'objet
// ... et enregistrement dans l'objet
if
(
$db
->
num_rows
(
$res
)
)
{
if
(
$db
->
num_rows
(
$res
ult
)
)
{
$ret
=
array
();
$ret
=
array
();
$tab
=
$db
->
fetch_array
(
$res
);
$tab
=
$db
->
fetch_array
(
$res
ult
);
foreach
(
$tab
as
$
cle
=>
$vale
ur
)
foreach
(
$tab
as
$
key
=>
$val
u
e
)
{
{
$ret
[
$
cle
]
=
$vale
ur
;
$ret
[
$
key
]
=
$val
u
e
;
}
}
$tab
=
$ret
;
$obj_facturation
->
id
(
$
tab
[
'fk_product
'
]
);
$obj_facturation
->
id
(
$
ret
[
'rowid
'
]
);
$obj_facturation
->
ref
(
$
tab
[
'ref'
]
);
$obj_facturation
->
ref
(
$
ret
[
'ref'
]
);
$obj_facturation
->
stock
(
$
tab
[
'reel'
]);
$obj_facturation
->
stock
(
$
ret
[
'reel'
]
);
$obj_facturation
->
prix
(
$
tab
[
'price'
]
);
$obj_facturation
->
prix
(
$
ret
[
'price'
]
);
$obj_facturation
->
tva
(
$
tab
[
'tva_tx'
]
);
$obj_facturation
->
tva
(
$
ret
[
'tva_tx'
]
);
// Definition du filtre pour n'afficher que le produit concerne
// Definition du filtre pour n'afficher que le produit concerne
if
(
$_POST
[
'hdnSource'
]
==
'LISTE'
)
{
if
(
$_POST
[
'hdnSource'
]
==
'LISTE'
)
{
$filtre
=
$tab
[
'ref'
];
$filtre
=
$ret
[
'ref'
];
}
}
else
if
(
$_POST
[
'hdnSource'
]
==
'REF'
)
{
else
if
(
$_POST
[
'hdnSource'
]
==
'REF'
)
{
$filtre
=
$_POST
[
'txtRef'
];;
$filtre
=
$_POST
[
'txtRef'
];
}
}
$redirection
=
DOL_URL_ROOT
.
'/cashdesk/affIndex.php?menu=facturation&filtre='
.
$filtre
;
$redirection
=
DOL_URL_ROOT
.
'/cashdesk/affIndex.php?menu=facturation&filtre='
.
$filtre
;
}
}
else
{
else
{
$obj_facturation
->
raz
();
$obj_facturation
->
raz
();
if
(
$_POST
[
'hdnSource'
]
==
'REF'
)
{
if
(
$_POST
[
'hdnSource'
]
==
'REF'
)
{
$redirection
=
DOL_URL_ROOT
.
'/cashdesk/affIndex.php?menu=facturation&filtre='
.
$_POST
[
'txtRef'
];
$redirection
=
DOL_URL_ROOT
.
'/cashdesk/affIndex.php?menu=facturation&filtre='
.
$_POST
[
'txtRef'
];
}
}
else
{
else
{
$redirection
=
DOL_URL_ROOT
.
'/cashdesk/affIndex.php?menu=facturation'
;
$redirection
=
DOL_URL_ROOT
.
'/cashdesk/affIndex.php?menu=facturation'
;
}
}
}
}
}
}
else
{
else
{
dol_print_error
(
$db
);
}
}
else
{
$redirection
=
DOL_URL_ROOT
.
'/cashdesk/affIndex.php?menu=facturation'
;
$redirection
=
DOL_URL_ROOT
.
'/cashdesk/affIndex.php?menu=facturation'
;
}
}
break
;
break
;
case
'ajout_article'
;
case
'ajout_article'
:
$obj_facturation
->
qte
(
$_POST
[
'txtQte'
]);
$obj_facturation
->
qte
(
$_POST
[
'txtQte'
]);
$obj_facturation
->
tva
(
$_POST
[
'selTva'
]);
$obj_facturation
->
tva
(
$_POST
[
'selTva'
]);
$obj_facturation
->
remise_percent
(
$_POST
[
'txtRemise'
]);
$obj_facturation
->
remise_percent
(
$_POST
[
'txtRemise'
]);
...
...
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