Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shippingscanner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dolibarr extension
shippingscanner
Commits
d4bd5ba8
Commit
d4bd5ba8
authored
1 year ago
by
Thomas Negre
Browse files
Options
Downloads
Patches
Plain Diff
Manage DLC/DLUOs
parent
0388585d
No related branches found
No related tags found
2 merge requests
!2
Preprod -> master
,
!1
Preprod manage lots
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
langs/fr_FR/shippingscanner.lang
+5
-1
5 additions, 1 deletion
langs/fr_FR/shippingscanner.lang
substitutions/fourn/commande/dispatch.php
+33
-1
33 additions, 1 deletion
substitutions/fourn/commande/dispatch.php
with
38 additions
and
2 deletions
langs/fr_FR/shippingscanner.lang
+
5
−
1
View file @
d4bd5ba8
...
...
@@ -25,4 +25,8 @@ ShippingScannerProductNotFoundOnExpedition2 = n'a pas été trouvé
ShippingScannerDispatchLinesDontHaveWarehouse = Sur certaines lignes, l'enterpôt n'est pas configuré. Veuillez le configurer.
ShippingScannerDispatchLinesLastLineNegative = La dernière ligne a une quantité négative. N'avez-vous pas scanné trop de produits ?
\ No newline at end of file
ShippingScannerDispatchLinesLastLineNegative = La dernière ligne a une quantité négative. N'avez-vous pas scanné trop de produits ?
ShippingScannerDlcMandatory = Une DLC n'est pas renseignée sur ce produit. Elle est obligatoire
ShippingScannerDuoMandatory = Une DMD/DLUO n'est pas renseignée sur ce produit. Elle est obligatoire
ShippingScannerDlcAndDluoMandatory = Une DLC ou DMD/DLUO n'est pas renseignée sur ce produit. Elles sont obligatoires.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
substitutions/fourn/commande/dispatch.php
+
33
−
1
View file @
d4bd5ba8
...
...
@@ -1007,6 +1007,7 @@ if ($id > 0 || !empty($ref)) {
// For serial number (batch status = 2) and lot (batch status = 1)
$canSearchSerial
=
(
in_array
(
$tmpproduct
->
status_batch
,
[
1
,
2
])
&&
$splitAsciiCode
>
0
);
$dlc_dluo_mandatory
=
!
empty
(
$tmpproduct
->
sell_or_eat_by_mandatory
);
if
(
$canSearchSerial
===
true
)
{
$serialInput
=
dol_escape_js
(
'lot_number'
.
$suffix
);
...
...
@@ -1034,6 +1035,32 @@ if ($id > 0 || !empty($ref)) {
jQuery("input[name=\"dispatch\"]").focus();
}
function checkDlcDluo(element) {
'
;
if
(
$dlc_dluo_mandatory
)
{
switch
(
$tmpproduct
->
sell_or_eat_by_mandatory
)
{
case
Product
::
SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY
:
$checkDlcDluoCond
=
'Boolean(element.parent().parent().find("input[id^=dlc_]).val())'
;
$alert_msg
=
'ShippingScannerDlcMandatory'
;
break
;
case
Product
::
SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY
:
$checkDlcDluoCond
=
'Boolean(element.parent().parent().find("input[id^=dluo_]).val())'
;
$alert_msg
=
'ShippingScannerDuoMandatory'
;
break
;
case
Product
::
SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT
:
$checkDlcDluoCond
=
'Boolean(element.parent().parent().find("input[id^=dlc_]).val()) && Boolean(element.parent().parent().find("input[id^=dluo_]).val())'
;
$alert_msg
=
'ShippingScannerDlcAndDluoMandatory'
;
break
;
}
$jsLine
.
=
'
if (! '
.
$checkDlcDluoCond
.
') {
alert("'
.
$langs
->
transnoentities
(
$alert_msg
)
.
'")
}
'
;
}
// else empty function
$jsLine
.
=
'
}
jQuery("#'
.
$serialInput
.
'").keypress(function(event){
var splitAsciiCode = "'
.
dol_escape_js
(
$splitAsciiCode
)
.
'";
var i = '
.
dol_escape_js
(
$i
)
.
';
...
...
@@ -1043,11 +1070,11 @@ if ($id > 0 || !empty($ref)) {
if (event.which == splitAsciiCode) {
if (jQuery("#qty_"+(qtyToDispatch-1)+"_"+i).length <= 0) { // max input lines to dispatch not reached
let searchInput = $("#'
.
$serialInput
.
'").val()
'
;
if
(
$tmpproduct
->
status_batch
==
1
)
{
$jsLine
.
=
'
// if we find a line with same lot number, increment qty
let searchInput = $("#'
.
$serialInput
.
'").val()
let same_lot_number = $("#'
.
$serialInput
.
'").parent().parent().parent().find("input[id^=\'lot_number_\']").filter((n, elt) => { return elt.value === searchInput })
if (same_lot_number.length > 1) { // There is already a line
...
...
@@ -1060,6 +1087,7 @@ if ($id > 0 || !empty($ref)) {
let cur_qty = cur_qty_input.val();
cur_qty_input.val(cur_qty-1)
if (cur_qty-1 <= 0) {
checkDlcDluo(same_lot_number)
endReception()
}
...
...
@@ -1073,16 +1101,19 @@ if ($id > 0 || !empty($ref)) {
let cur_qty_input = $(event.target).parent().parent().find("input[id^=qty_]");
let cur_qty = cur_qty_input.val();
if (cur_qty-1 <= 0) {
checkDlcDluo(searchInput)
endReception()
} else {
cur_qty_input.val(1)
addDispatchLine(i, type);
checkDlcDluo(searchInput)
}
}
'
;
}
elseif
(
$tmpproduct
->
status_batch
==
2
)
{
$jsLine
.
=
'
addDispatchLine(i, type);
checkDlcDluo(searchInput)
'
;
}
$jsLine
.
=
'
...
...
@@ -1091,6 +1122,7 @@ if ($id > 0 || !empty($ref)) {
if (serialInputNext.length > 0) { // found a next serial input
serialInputNext.focus();
} else { // no next serial input : so go to create button
checkDlcDluo(searchInput)
endReception()
}
}
...
...
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