Skip to content

Commit 4f40a50

Browse files
committed
Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 23.0
2 parents ff9b2dd + 446559b commit 4f40a50

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

dev/build/makepack-dolibarrmodule.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
. ucfirst($PROJECT)
158158
. ".class.php"
159159
);
160-
$custom = 0;
160+
$custom = 1;
161161
if ( !$result ) {
162162
$result = open(
163163
$IN,
@@ -180,7 +180,7 @@
180180
}
181181
}
182182
else {
183-
$custom = 1;
183+
$custom = 0;
184184
}
185185
while (<$IN>) {
186186
if ( $_ =~ /this->version\s*=\s*'([\d\.]+)'/ ) {

htdocs/commande/list.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3003,6 +3003,8 @@
30033003
$generic_commande->getLinesArray(); // Load array ->lines
30043004
$generic_commande->loadExpeditions(); // Load array ->expeditions
30053005

3006+
$stock = [];
3007+
30063008
$numlines = count($generic_commande->lines); // Loop on each line of order
30073009
for ($lig = 0; $lig < $numlines; $lig++) {
30083010
$orderLine = $generic_commande->lines[$lig];
@@ -3027,9 +3029,15 @@
30273029
$generic_product->stock_theorique = $productstat_cachevirtual[$orderLine->fk_product]['stock_reel'];
30283030
}
30293031

3030-
if ($reliquat > $generic_product->stock_reel) {
3032+
if (!array_key_exists($orderLine->fk_product, $stock)) {
3033+
$stock[$orderLine->fk_product] = $generic_product->stock_reel;
3034+
}
3035+
3036+
if ($reliquat > $stock[$orderLine->fk_product]) {
30313037
$notshippable++;
30323038
}
3039+
3040+
$stock[$orderLine->fk_product] = $stock[$orderLine->fk_product] - $reliquat;
30333041
if (!getDolGlobalString('SHIPPABLE_ORDER_ICON_IN_LIST')) { // Default code. Default should be this case.
30343042
$text_info .= $reliquat.' x '.$orderLine->product_ref.'&nbsp;'.dol_trunc($orderLine->product_label, 20);
30353043
$text_info .= ' - '.$langs->trans("Stock").': <span class="'.($generic_product->stock_reel > 0 ? 'ok' : 'error').'">'.$generic_product->stock_reel.'</span>';

0 commit comments

Comments
 (0)