File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 157157 . ucfirst ($PROJECT )
158158 . " .class.php"
159159 );
160- $custom = 0 ;
160+ $custom = 1 ;
161161 if ( !$result ) {
162162 $result = open (
163163 $IN ,
180180 }
181181 }
182182 else {
183- $custom = 1 ;
183+ $custom = 0 ;
184184 }
185185 while (<$IN >) {
186186 if ( $_ =~ / this->version\s *=\s *'([\d\. ]+)'/ ) {
Original file line number Diff line number Diff line change 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 ];
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 .' ' .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> ' ;
You can’t perform that action at this time.
0 commit comments