@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | $object->fields = dol_sort_array($object->fields, 'position'); |
| 317 | 317 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
| 318 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 318 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 319 | 319 | |
| 320 | 320 | // Security check |
| 321 | 321 | if ($search_type == '0') { |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | if (isModEnabled('category') && $user->hasRight($rightskey, 'creer')) { |
| 864 | 864 | $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"') . $langs->trans("AffectTag"); |
| 865 | 865 | } |
| 866 | -if (in_array($massaction, array('presend', 'predelete','preaffecttag', 'edit_extrafields', 'preupdateprice'))) { |
|
| 866 | +if (in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'edit_extrafields', 'preupdateprice'))) { |
|
| 867 | 867 | $arrayofmassactions = array(); |
| 868 | 868 | } |
| 869 | 869 | if ($user->hasRight($rightskey, 'supprimer')) { |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
| 979 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
| 979 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
| 980 | 980 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
| 981 | 981 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 982 | 982 | |
@@ -1948,10 +1948,10 @@ discard block |
||
| 1948 | 1948 | |
| 1949 | 1949 | // Multiprices |
| 1950 | 1950 | if (getDolGlobalString('PRODUIT_MULTIPRICES')) { |
| 1951 | - if (! isset($productpricescache)) { |
|
| 1951 | + if (!isset($productpricescache)) { |
|
| 1952 | 1952 | $productpricescache = array(); |
| 1953 | 1953 | } |
| 1954 | - if (! isset($productpricescache[$obj->rowid])) { |
|
| 1954 | + if (!isset($productpricescache[$obj->rowid])) { |
|
| 1955 | 1955 | $productpricescache[$obj->rowid] = array(); |
| 1956 | 1956 | } |
| 1957 | 1957 | |
@@ -1055,7 +1055,7 @@ discard block |
||
| 1055 | 1055 | return $result; |
| 1056 | 1056 | } |
| 1057 | 1057 | |
| 1058 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1058 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1059 | 1059 | /** |
| 1060 | 1060 | * Check barcode |
| 1061 | 1061 | * |
@@ -1068,7 +1068,7 @@ discard block |
||
| 1068 | 1068 | */ |
| 1069 | 1069 | public function check_barcode($valuetotest, $typefortest) |
| 1070 | 1070 | { |
| 1071 | - // phpcs:enable |
|
| 1071 | + // phpcs:enable |
|
| 1072 | 1072 | global $conf; |
| 1073 | 1073 | if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { |
| 1074 | 1074 | $module = strtolower(getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')); |
@@ -1984,7 +1984,7 @@ discard block |
||
| 1984 | 1984 | } |
| 1985 | 1985 | |
| 1986 | 1986 | |
| 1987 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1987 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1988 | 1988 | /** |
| 1989 | 1989 | * Insert a track that we changed a customer price |
| 1990 | 1990 | * |
@@ -1994,7 +1994,7 @@ discard block |
||
| 1994 | 1994 | */ |
| 1995 | 1995 | private function _log_price($user, $level = 0) |
| 1996 | 1996 | { |
| 1997 | - // phpcs:enable |
|
| 1997 | + // phpcs:enable |
|
| 1998 | 1998 | global $conf; |
| 1999 | 1999 | |
| 2000 | 2000 | $now = dol_now(); |
@@ -2023,7 +2023,7 @@ discard block |
||
| 2023 | 2023 | } |
| 2024 | 2024 | |
| 2025 | 2025 | |
| 2026 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2026 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2027 | 2027 | /** |
| 2028 | 2028 | * Delete a price line |
| 2029 | 2029 | * |
@@ -2033,7 +2033,7 @@ discard block |
||
| 2033 | 2033 | */ |
| 2034 | 2034 | public function log_price_delete($user, $rowid) |
| 2035 | 2035 | { |
| 2036 | - // phpcs:enable |
|
| 2036 | + // phpcs:enable |
|
| 2037 | 2037 | $sql = "DELETE FROM " . $this->db->prefix() . "product_price_by_qty"; |
| 2038 | 2038 | $sql .= " WHERE fk_product_price = " . ((int) $rowid); |
| 2039 | 2039 | $resql = $this->db->query($sql); |
@@ -2168,7 +2168,7 @@ discard block |
||
| 2168 | 2168 | return array('pu_ht' => $pu_ht, 'pu_ttc' => $pu_ttc, 'price_min' => $price_min, 'price_base_type' => $price_base_type, 'tva_tx' => $tva_tx, 'tva_npr' => $tva_npr); |
| 2169 | 2169 | } |
| 2170 | 2170 | |
| 2171 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2171 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2172 | 2172 | /** |
| 2173 | 2173 | * Read price used by a provider. |
| 2174 | 2174 | * We enter as input couple prodfournprice/qty or triplet qty/product_id/fourn_ref. |
@@ -2184,7 +2184,7 @@ discard block |
||
| 2184 | 2184 | */ |
| 2185 | 2185 | public function get_buyprice($prodfournprice, $qty, $product_id = 0, $fourn_ref = '', $fk_soc = 0) |
| 2186 | 2186 | { |
| 2187 | - // phpcs:enable |
|
| 2187 | + // phpcs:enable |
|
| 2188 | 2188 | global $action, $hookmanager; |
| 2189 | 2189 | |
| 2190 | 2190 | // Call hook if any |
@@ -2988,7 +2988,7 @@ discard block |
||
| 2988 | 2988 | } |
| 2989 | 2989 | } |
| 2990 | 2990 | |
| 2991 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2991 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2992 | 2992 | /** |
| 2993 | 2993 | * Charge tableau des stats OF pour le produit/service |
| 2994 | 2994 | * |
@@ -2997,7 +2997,7 @@ discard block |
||
| 2997 | 2997 | */ |
| 2998 | 2998 | public function load_stats_mo($socid = 0) |
| 2999 | 2999 | { |
| 3000 | - // phpcs:enable |
|
| 3000 | + // phpcs:enable |
|
| 3001 | 3001 | global $user, $hookmanager, $action; |
| 3002 | 3002 | |
| 3003 | 3003 | $error = 0; |
@@ -3048,7 +3048,7 @@ discard block |
||
| 3048 | 3048 | return 1; |
| 3049 | 3049 | } |
| 3050 | 3050 | |
| 3051 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3051 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3052 | 3052 | /** |
| 3053 | 3053 | * Charge tableau des stats OF pour le produit/service |
| 3054 | 3054 | * |
@@ -3057,7 +3057,7 @@ discard block |
||
| 3057 | 3057 | */ |
| 3058 | 3058 | public function load_stats_bom($socid = 0) |
| 3059 | 3059 | { |
| 3060 | - // phpcs:enable |
|
| 3060 | + // phpcs:enable |
|
| 3061 | 3061 | global $user, $hookmanager, $action; |
| 3062 | 3062 | |
| 3063 | 3063 | $error = 0; |
@@ -3117,7 +3117,7 @@ discard block |
||
| 3117 | 3117 | return 1; |
| 3118 | 3118 | } |
| 3119 | 3119 | |
| 3120 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3120 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3121 | 3121 | /** |
| 3122 | 3122 | * Charge tableau des stats propale pour le produit/service |
| 3123 | 3123 | * |
@@ -3126,7 +3126,7 @@ discard block |
||
| 3126 | 3126 | */ |
| 3127 | 3127 | public function load_stats_propale($socid = 0) |
| 3128 | 3128 | { |
| 3129 | - // phpcs:enable |
|
| 3129 | + // phpcs:enable |
|
| 3130 | 3130 | global $conf, $user, $hookmanager, $action; |
| 3131 | 3131 | |
| 3132 | 3132 | $sql = "SELECT COUNT(DISTINCT p.fk_soc) as nb_customers, COUNT(DISTINCT p.rowid) as nb,"; |
@@ -3192,7 +3192,7 @@ discard block |
||
| 3192 | 3192 | } |
| 3193 | 3193 | |
| 3194 | 3194 | |
| 3195 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3195 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3196 | 3196 | /** |
| 3197 | 3197 | * Charge tableau des stats propale pour le produit/service |
| 3198 | 3198 | * |
@@ -3201,7 +3201,7 @@ discard block |
||
| 3201 | 3201 | */ |
| 3202 | 3202 | public function load_stats_proposal_supplier($socid = 0) |
| 3203 | 3203 | { |
| 3204 | - // phpcs:enable |
|
| 3204 | + // phpcs:enable |
|
| 3205 | 3205 | global $conf, $user, $hookmanager, $action; |
| 3206 | 3206 | |
| 3207 | 3207 | $sql = "SELECT COUNT(DISTINCT p.fk_soc) as nb_suppliers, COUNT(DISTINCT p.rowid) as nb,"; |
@@ -3246,7 +3246,7 @@ discard block |
||
| 3246 | 3246 | } |
| 3247 | 3247 | |
| 3248 | 3248 | |
| 3249 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3249 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3250 | 3250 | /** |
| 3251 | 3251 | * Charge tableau des stats commande client pour le produit/service |
| 3252 | 3252 | * |
@@ -3257,7 +3257,7 @@ discard block |
||
| 3257 | 3257 | */ |
| 3258 | 3258 | public function load_stats_commande($socid = 0, $filtrestatut = '', $forVirtualStock = 0) |
| 3259 | 3259 | { |
| 3260 | - // phpcs:enable |
|
| 3260 | + // phpcs:enable |
|
| 3261 | 3261 | global $conf, $user, $hookmanager, $action; |
| 3262 | 3262 | |
| 3263 | 3263 | $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_customers, COUNT(DISTINCT c.rowid) as nb,"; |
@@ -3373,7 +3373,7 @@ discard block |
||
| 3373 | 3373 | } |
| 3374 | 3374 | } |
| 3375 | 3375 | |
| 3376 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3376 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3377 | 3377 | /** |
| 3378 | 3378 | * Charge tableau des stats commande fournisseur pour le produit/service |
| 3379 | 3379 | * |
@@ -3385,7 +3385,7 @@ discard block |
||
| 3385 | 3385 | */ |
| 3386 | 3386 | public function load_stats_commande_fournisseur($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $dateofvirtualstock = null) |
| 3387 | 3387 | { |
| 3388 | - // phpcs:enable |
|
| 3388 | + // phpcs:enable |
|
| 3389 | 3389 | global $conf, $user, $hookmanager, $action; |
| 3390 | 3390 | |
| 3391 | 3391 | $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_suppliers, COUNT(DISTINCT c.rowid) as nb,"; |
@@ -3434,7 +3434,7 @@ discard block |
||
| 3434 | 3434 | } |
| 3435 | 3435 | } |
| 3436 | 3436 | |
| 3437 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3437 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3438 | 3438 | /** |
| 3439 | 3439 | * Charge tableau des stats expedition client pour le produit/service |
| 3440 | 3440 | * |
@@ -3446,7 +3446,7 @@ discard block |
||
| 3446 | 3446 | */ |
| 3447 | 3447 | public function load_stats_sending($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $filterShipmentStatus = '') |
| 3448 | 3448 | { |
| 3449 | - // phpcs:enable |
|
| 3449 | + // phpcs:enable |
|
| 3450 | 3450 | global $conf, $user, $hookmanager, $action; |
| 3451 | 3451 | |
| 3452 | 3452 | $sql = "SELECT COUNT(DISTINCT e.fk_soc) as nb_customers, COUNT(DISTINCT e.rowid) as nb,"; |
@@ -3520,7 +3520,7 @@ discard block |
||
| 3520 | 3520 | } |
| 3521 | 3521 | } |
| 3522 | 3522 | |
| 3523 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3523 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3524 | 3524 | /** |
| 3525 | 3525 | * Charge tableau des stats réception fournisseur pour le produit/service |
| 3526 | 3526 | * |
@@ -3532,7 +3532,7 @@ discard block |
||
| 3532 | 3532 | */ |
| 3533 | 3533 | public function load_stats_reception($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $dateofvirtualstock = null) |
| 3534 | 3534 | { |
| 3535 | - // phpcs:enable |
|
| 3535 | + // phpcs:enable |
|
| 3536 | 3536 | global $conf, $user, $hookmanager, $action; |
| 3537 | 3537 | |
| 3538 | 3538 | $sql = "SELECT COUNT(DISTINCT cf.fk_soc) as nb_suppliers, COUNT(DISTINCT cf.rowid) as nb,"; |
@@ -3581,7 +3581,7 @@ discard block |
||
| 3581 | 3581 | } |
| 3582 | 3582 | } |
| 3583 | 3583 | |
| 3584 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3584 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3585 | 3585 | /** |
| 3586 | 3586 | * Charge tableau des stats production pour le produit/service |
| 3587 | 3587 | * |
@@ -3594,7 +3594,7 @@ discard block |
||
| 3594 | 3594 | */ |
| 3595 | 3595 | public function load_stats_inproduction($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $dateofvirtualstock = null, $warehouseid = 0) |
| 3596 | 3596 | { |
| 3597 | - // phpcs:enable |
|
| 3597 | + // phpcs:enable |
|
| 3598 | 3598 | global $user, $hookmanager, $action; |
| 3599 | 3599 | |
| 3600 | 3600 | $serviceStockIsEnabled = isModEnabled("service") && getDolGlobalString('STOCK_SUPPORTS_SERVICES'); |
@@ -3708,7 +3708,7 @@ discard block |
||
| 3708 | 3708 | } |
| 3709 | 3709 | } |
| 3710 | 3710 | |
| 3711 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3711 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3712 | 3712 | /** |
| 3713 | 3713 | * Charge tableau des stats contrat pour le produit/service |
| 3714 | 3714 | * |
@@ -3717,7 +3717,7 @@ discard block |
||
| 3717 | 3717 | */ |
| 3718 | 3718 | public function load_stats_contrat($socid = 0) |
| 3719 | 3719 | { |
| 3720 | - // phpcs:enable |
|
| 3720 | + // phpcs:enable |
|
| 3721 | 3721 | global $conf, $user, $hookmanager, $action; |
| 3722 | 3722 | |
| 3723 | 3723 | $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_customers, COUNT(DISTINCT c.rowid) as nb,"; |
@@ -3782,7 +3782,7 @@ discard block |
||
| 3782 | 3782 | } |
| 3783 | 3783 | } |
| 3784 | 3784 | |
| 3785 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3785 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3786 | 3786 | /** |
| 3787 | 3787 | * Charge tableau des stats facture pour le produit/service |
| 3788 | 3788 | * |
@@ -3791,7 +3791,7 @@ discard block |
||
| 3791 | 3791 | */ |
| 3792 | 3792 | public function load_stats_facture($socid = 0) |
| 3793 | 3793 | { |
| 3794 | - // phpcs:enable |
|
| 3794 | + // phpcs:enable |
|
| 3795 | 3795 | global $conf, $user, $hookmanager, $action; |
| 3796 | 3796 | |
| 3797 | 3797 | $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_customers, COUNT(DISTINCT f.rowid) as nb,"; |
@@ -3857,7 +3857,7 @@ discard block |
||
| 3857 | 3857 | } |
| 3858 | 3858 | |
| 3859 | 3859 | |
| 3860 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3860 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3861 | 3861 | /** |
| 3862 | 3862 | * Charge tableau des stats facture recurrentes pour le produit/service |
| 3863 | 3863 | * |
@@ -3866,7 +3866,7 @@ discard block |
||
| 3866 | 3866 | */ |
| 3867 | 3867 | public function load_stats_facturerec($socid = 0) |
| 3868 | 3868 | { |
| 3869 | - // phpcs:enable |
|
| 3869 | + // phpcs:enable |
|
| 3870 | 3870 | global $conf, $user, $hookmanager, $action; |
| 3871 | 3871 | |
| 3872 | 3872 | $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_customers, COUNT(DISTINCT f.rowid) as nb,"; |
@@ -3931,7 +3931,7 @@ discard block |
||
| 3931 | 3931 | } |
| 3932 | 3932 | } |
| 3933 | 3933 | |
| 3934 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3934 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3935 | 3935 | /** |
| 3936 | 3936 | * Charge tableau des stats facture pour le produit/service |
| 3937 | 3937 | * |
@@ -3940,7 +3940,7 @@ discard block |
||
| 3940 | 3940 | */ |
| 3941 | 3941 | public function load_stats_facture_fournisseur($socid = 0) |
| 3942 | 3942 | { |
| 3943 | - // phpcs:enable |
|
| 3943 | + // phpcs:enable |
|
| 3944 | 3944 | global $conf, $user, $hookmanager, $action; |
| 3945 | 3945 | |
| 3946 | 3946 | $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_suppliers, COUNT(DISTINCT f.rowid) as nb,"; |
@@ -3984,7 +3984,7 @@ discard block |
||
| 3984 | 3984 | } |
| 3985 | 3985 | } |
| 3986 | 3986 | |
| 3987 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3987 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3988 | 3988 | /** |
| 3989 | 3989 | * Return an array formatted for showing graphs |
| 3990 | 3990 | * |
@@ -3995,7 +3995,7 @@ discard block |
||
| 3995 | 3995 | */ |
| 3996 | 3996 | private function _get_stats($sql, $mode, $year = 0) |
| 3997 | 3997 | { |
| 3998 | - // phpcs:enable |
|
| 3998 | + // phpcs:enable |
|
| 3999 | 3999 | $tab = array(); |
| 4000 | 4000 | |
| 4001 | 4001 | $resql = $this->db->query($sql); |
@@ -4062,7 +4062,7 @@ discard block |
||
| 4062 | 4062 | } |
| 4063 | 4063 | |
| 4064 | 4064 | |
| 4065 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4065 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4066 | 4066 | /** |
| 4067 | 4067 | * Return nb of units or customers invoices in which product is included |
| 4068 | 4068 | * |
@@ -4075,7 +4075,7 @@ discard block |
||
| 4075 | 4075 | */ |
| 4076 | 4076 | public function get_nb_vente($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '') |
| 4077 | 4077 | { |
| 4078 | - // phpcs:enable |
|
| 4078 | + // phpcs:enable |
|
| 4079 | 4079 | global $conf; |
| 4080 | 4080 | global $user; |
| 4081 | 4081 | |
@@ -4116,7 +4116,7 @@ discard block |
||
| 4116 | 4116 | } |
| 4117 | 4117 | |
| 4118 | 4118 | |
| 4119 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4119 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4120 | 4120 | /** |
| 4121 | 4121 | * Return nb of units or supplier invoices in which product is included |
| 4122 | 4122 | * |
@@ -4129,7 +4129,7 @@ discard block |
||
| 4129 | 4129 | */ |
| 4130 | 4130 | public function get_nb_achat($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '') |
| 4131 | 4131 | { |
| 4132 | - // phpcs:enable |
|
| 4132 | + // phpcs:enable |
|
| 4133 | 4133 | global $conf; |
| 4134 | 4134 | global $user; |
| 4135 | 4135 | |
@@ -4169,7 +4169,7 @@ discard block |
||
| 4169 | 4169 | return $this->_get_stats($sql, $mode, $year); |
| 4170 | 4170 | } |
| 4171 | 4171 | |
| 4172 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4172 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4173 | 4173 | /** |
| 4174 | 4174 | * Return nb of units in proposals in which product is included |
| 4175 | 4175 | * |
@@ -4182,7 +4182,7 @@ discard block |
||
| 4182 | 4182 | */ |
| 4183 | 4183 | public function get_nb_propal($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '') |
| 4184 | 4184 | { |
| 4185 | - // phpcs:enable |
|
| 4185 | + // phpcs:enable |
|
| 4186 | 4186 | global $conf, $user; |
| 4187 | 4187 | |
| 4188 | 4188 | $sql = "SELECT sum(d.qty) as qty, date_format(p.datep, '%Y%m')"; |
@@ -4221,7 +4221,7 @@ discard block |
||
| 4221 | 4221 | return $this->_get_stats($sql, $mode, $year); |
| 4222 | 4222 | } |
| 4223 | 4223 | |
| 4224 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4224 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4225 | 4225 | /** |
| 4226 | 4226 | * Return nb of units in proposals in which product is included |
| 4227 | 4227 | * |
@@ -4234,7 +4234,7 @@ discard block |
||
| 4234 | 4234 | */ |
| 4235 | 4235 | public function get_nb_propalsupplier($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '') |
| 4236 | 4236 | { |
| 4237 | - // phpcs:enable |
|
| 4237 | + // phpcs:enable |
|
| 4238 | 4238 | global $conf; |
| 4239 | 4239 | global $user; |
| 4240 | 4240 | |
@@ -4274,7 +4274,7 @@ discard block |
||
| 4274 | 4274 | return $this->_get_stats($sql, $mode, $year); |
| 4275 | 4275 | } |
| 4276 | 4276 | |
| 4277 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4277 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4278 | 4278 | /** |
| 4279 | 4279 | * Return nb of units in orders in which product is included |
| 4280 | 4280 | * |
@@ -4287,7 +4287,7 @@ discard block |
||
| 4287 | 4287 | */ |
| 4288 | 4288 | public function get_nb_order($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '') |
| 4289 | 4289 | { |
| 4290 | - // phpcs:enable |
|
| 4290 | + // phpcs:enable |
|
| 4291 | 4291 | global $conf, $user; |
| 4292 | 4292 | |
| 4293 | 4293 | $sql = "SELECT sum(d.qty) as qty, date_format(c.date_commande, '%Y%m')"; |
@@ -4326,7 +4326,7 @@ discard block |
||
| 4326 | 4326 | return $this->_get_stats($sql, $mode, $year); |
| 4327 | 4327 | } |
| 4328 | 4328 | |
| 4329 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4329 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4330 | 4330 | /** |
| 4331 | 4331 | * Return nb of units in orders in which product is included |
| 4332 | 4332 | * |
@@ -4339,7 +4339,7 @@ discard block |
||
| 4339 | 4339 | */ |
| 4340 | 4340 | public function get_nb_ordersupplier($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '') |
| 4341 | 4341 | { |
| 4342 | - // phpcs:enable |
|
| 4342 | + // phpcs:enable |
|
| 4343 | 4343 | global $conf, $user; |
| 4344 | 4344 | |
| 4345 | 4345 | $sql = "SELECT sum(d.qty) as qty, date_format(c.date_commande, '%Y%m')"; |
@@ -4378,7 +4378,7 @@ discard block |
||
| 4378 | 4378 | return $this->_get_stats($sql, $mode, $year); |
| 4379 | 4379 | } |
| 4380 | 4380 | |
| 4381 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4381 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4382 | 4382 | /** |
| 4383 | 4383 | * Return nb of units in orders in which product is included |
| 4384 | 4384 | * |
@@ -4391,7 +4391,7 @@ discard block |
||
| 4391 | 4391 | */ |
| 4392 | 4392 | public function get_nb_contract($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '') |
| 4393 | 4393 | { |
| 4394 | - // phpcs:enable |
|
| 4394 | + // phpcs:enable |
|
| 4395 | 4395 | global $conf, $user; |
| 4396 | 4396 | |
| 4397 | 4397 | $sql = "SELECT sum(d.qty) as qty, date_format(c.date_contrat, '%Y%m')"; |
@@ -4432,7 +4432,7 @@ discard block |
||
| 4432 | 4432 | return $this->_get_stats($sql, $mode, $year); |
| 4433 | 4433 | } |
| 4434 | 4434 | |
| 4435 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4435 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4436 | 4436 | /** |
| 4437 | 4437 | * Return nb of units in orders in which product is included |
| 4438 | 4438 | * |
@@ -4445,7 +4445,7 @@ discard block |
||
| 4445 | 4445 | */ |
| 4446 | 4446 | public function get_nb_mos($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '') |
| 4447 | 4447 | { |
| 4448 | - // phpcs:enable |
|
| 4448 | + // phpcs:enable |
|
| 4449 | 4449 | global $conf, $user; |
| 4450 | 4450 | |
| 4451 | 4451 | $sql = "SELECT sum(d.qty), date_format(d.date_valid, '%Y%m')"; |
@@ -4485,7 +4485,7 @@ discard block |
||
| 4485 | 4485 | return $this->_get_stats($sql, $mode, $year); |
| 4486 | 4486 | } |
| 4487 | 4487 | |
| 4488 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4488 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4489 | 4489 | /** |
| 4490 | 4490 | * Link a product/service to a parent product/service |
| 4491 | 4491 | * |
@@ -4500,7 +4500,7 @@ discard block |
||
| 4500 | 4500 | { |
| 4501 | 4501 | global $user; |
| 4502 | 4502 | |
| 4503 | - // phpcs:enable |
|
| 4503 | + // phpcs:enable |
|
| 4504 | 4504 | // Clean parameters |
| 4505 | 4505 | if (!is_numeric($id_pere)) { |
| 4506 | 4506 | $id_pere = 0; |
@@ -4558,7 +4558,7 @@ discard block |
||
| 4558 | 4558 | } |
| 4559 | 4559 | } |
| 4560 | 4560 | |
| 4561 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4561 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4562 | 4562 | /** |
| 4563 | 4563 | * Modify composed product |
| 4564 | 4564 | * |
@@ -4573,7 +4573,7 @@ discard block |
||
| 4573 | 4573 | { |
| 4574 | 4574 | global $user; |
| 4575 | 4575 | |
| 4576 | - // phpcs:enable |
|
| 4576 | + // phpcs:enable |
|
| 4577 | 4577 | // Clean parameters |
| 4578 | 4578 | if (!is_numeric($id_pere)) { |
| 4579 | 4579 | $id_pere = 0; |
@@ -4612,7 +4612,7 @@ discard block |
||
| 4612 | 4612 | } |
| 4613 | 4613 | } |
| 4614 | 4614 | |
| 4615 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4615 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4616 | 4616 | /** |
| 4617 | 4617 | * Remove a link between a subproduct and a parent product/service |
| 4618 | 4618 | * |
@@ -4625,7 +4625,7 @@ discard block |
||
| 4625 | 4625 | { |
| 4626 | 4626 | global $user; |
| 4627 | 4627 | |
| 4628 | - // phpcs:enable |
|
| 4628 | + // phpcs:enable |
|
| 4629 | 4629 | if (!is_numeric($fk_parent)) { |
| 4630 | 4630 | $fk_parent = 0; |
| 4631 | 4631 | } |
@@ -4676,7 +4676,7 @@ discard block |
||
| 4676 | 4676 | return 1; |
| 4677 | 4677 | } |
| 4678 | 4678 | |
| 4679 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4679 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4680 | 4680 | /** |
| 4681 | 4681 | * Check if it is a sub-product into a kit |
| 4682 | 4682 | * |
@@ -4686,7 +4686,7 @@ discard block |
||
| 4686 | 4686 | */ |
| 4687 | 4687 | public function is_sousproduit($fk_parent, $fk_child) |
| 4688 | 4688 | { |
| 4689 | - // phpcs:enable |
|
| 4689 | + // phpcs:enable |
|
| 4690 | 4690 | $sql = "SELECT fk_product_pere, qty, incdec"; |
| 4691 | 4691 | $sql .= " FROM " . $this->db->prefix() . "product_association"; |
| 4692 | 4692 | $sql .= " WHERE fk_product_pere = " . ((int) $fk_parent); |
@@ -4713,7 +4713,7 @@ discard block |
||
| 4713 | 4713 | } |
| 4714 | 4714 | |
| 4715 | 4715 | |
| 4716 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4716 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4717 | 4717 | /** |
| 4718 | 4718 | * Add a supplier price for the product. |
| 4719 | 4719 | * Note: Duplicate ref is accepted for different quantity only, or for different companies. |
@@ -4726,7 +4726,7 @@ discard block |
||
| 4726 | 4726 | */ |
| 4727 | 4727 | public function add_fournisseur($user, $id_fourn, $ref_fourn, $quantity) |
| 4728 | 4728 | { |
| 4729 | - // phpcs:enable |
|
| 4729 | + // phpcs:enable |
|
| 4730 | 4730 | global $conf; |
| 4731 | 4731 | |
| 4732 | 4732 | $now = dol_now(); |
@@ -4814,7 +4814,7 @@ discard block |
||
| 4814 | 4814 | } |
| 4815 | 4815 | |
| 4816 | 4816 | |
| 4817 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4817 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4818 | 4818 | /** |
| 4819 | 4819 | * Return list of suppliers providing the product or service |
| 4820 | 4820 | * |
@@ -4822,7 +4822,7 @@ discard block |
||
| 4822 | 4822 | */ |
| 4823 | 4823 | public function list_suppliers() |
| 4824 | 4824 | { |
| 4825 | - // phpcs:enable |
|
| 4825 | + // phpcs:enable |
|
| 4826 | 4826 | global $conf; |
| 4827 | 4827 | |
| 4828 | 4828 | $list = array(); |
@@ -4846,7 +4846,7 @@ discard block |
||
| 4846 | 4846 | return $list; |
| 4847 | 4847 | } |
| 4848 | 4848 | |
| 4849 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4849 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4850 | 4850 | /** |
| 4851 | 4851 | * Recopie les prix d'un produit/service sur un autre |
| 4852 | 4852 | * |
@@ -4934,7 +4934,7 @@ discard block |
||
| 4934 | 4934 | return 1; |
| 4935 | 4935 | } |
| 4936 | 4936 | |
| 4937 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4937 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4938 | 4938 | /** |
| 4939 | 4939 | * Clone links between products |
| 4940 | 4940 | * |
@@ -4944,7 +4944,7 @@ discard block |
||
| 4944 | 4944 | */ |
| 4945 | 4945 | public function clone_associations($fromId, $toId) |
| 4946 | 4946 | { |
| 4947 | - // phpcs:enable |
|
| 4947 | + // phpcs:enable |
|
| 4948 | 4948 | $this->db->begin(); |
| 4949 | 4949 | |
| 4950 | 4950 | $sql = 'INSERT INTO ' . $this->db->prefix() . 'product_association (fk_product_pere, fk_product_fils, qty, incdec)'; |
@@ -4961,7 +4961,7 @@ discard block |
||
| 4961 | 4961 | return 1; |
| 4962 | 4962 | } |
| 4963 | 4963 | |
| 4964 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4964 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 4965 | 4965 | /** |
| 4966 | 4966 | * Recopie les fournisseurs et prix fournisseurs d'un produit/service sur un autre |
| 4967 | 4967 | * |
@@ -4971,7 +4971,7 @@ discard block |
||
| 4971 | 4971 | */ |
| 4972 | 4972 | public function clone_fournisseurs($fromId, $toId) |
| 4973 | 4973 | { |
| 4974 | - // phpcs:enable |
|
| 4974 | + // phpcs:enable |
|
| 4975 | 4975 | $this->db->begin(); |
| 4976 | 4976 | |
| 4977 | 4977 | $now = dol_now(); |
@@ -5007,7 +5007,7 @@ discard block |
||
| 5007 | 5007 | } |
| 5008 | 5008 | } |
| 5009 | 5009 | |
| 5010 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5010 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5011 | 5011 | /** |
| 5012 | 5012 | * Function recursive, used only by get_arbo_each_prod(), to build tree of subproducts into ->res |
| 5013 | 5013 | * Define value of this->res |
@@ -5022,7 +5022,7 @@ discard block |
||
| 5022 | 5022 | */ |
| 5023 | 5023 | public function fetch_prod_arbo($prod, $compl_path = '', $multiply = 1, $level = 1, $id_parent = 0, $ignore_stock_load = 0) |
| 5024 | 5024 | { |
| 5025 | - // phpcs:enable |
|
| 5025 | + // phpcs:enable |
|
| 5026 | 5026 | global $conf, $langs; |
| 5027 | 5027 | |
| 5028 | 5028 | $tmpproduct = null; |
@@ -5075,7 +5075,7 @@ discard block |
||
| 5075 | 5075 | } |
| 5076 | 5076 | } |
| 5077 | 5077 | |
| 5078 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5078 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5079 | 5079 | /** |
| 5080 | 5080 | * Build the tree of subproducts and return it. |
| 5081 | 5081 | * this->sousprods must have been loaded by this->get_sousproduits_arbo() |
@@ -5086,7 +5086,7 @@ discard block |
||
| 5086 | 5086 | */ |
| 5087 | 5087 | public function get_arbo_each_prod($multiply = 1, $ignore_stock_load = 0) |
| 5088 | 5088 | { |
| 5089 | - // phpcs:enable |
|
| 5089 | + // phpcs:enable |
|
| 5090 | 5090 | $this->res = array(); |
| 5091 | 5091 | if (isset($this->sousprods) && is_array($this->sousprods)) { |
| 5092 | 5092 | foreach ($this->sousprods as $prod_name => $desc_product) { |
@@ -5297,7 +5297,7 @@ discard block |
||
| 5297 | 5297 | } |
| 5298 | 5298 | } |
| 5299 | 5299 | |
| 5300 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5300 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5301 | 5301 | /** |
| 5302 | 5302 | * Return tree of all subproducts for product. Tree contains array of array(0=prodid, 1=>qty, 2=>product type, 3=>label, 4=>incdec, 5=>product ref) |
| 5303 | 5303 | * Set this->sousprods |
@@ -5306,7 +5306,7 @@ discard block |
||
| 5306 | 5306 | */ |
| 5307 | 5307 | public function get_sousproduits_arbo() |
| 5308 | 5308 | { |
| 5309 | - // phpcs:enable |
|
| 5309 | + // phpcs:enable |
|
| 5310 | 5310 | $parent = array(); |
| 5311 | 5311 | |
| 5312 | 5312 | foreach ($this->getChildsArbo($this->id) as $keyChild => $valueChild) { // Warning. getChildsArbo can call getChildsArbo recursively. Starting point is $value[0]=id of product |
@@ -5602,7 +5602,7 @@ discard block |
||
| 5602 | 5602 | } |
| 5603 | 5603 | } |
| 5604 | 5604 | |
| 5605 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5605 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5606 | 5606 | /** |
| 5607 | 5607 | * Return label of a given status |
| 5608 | 5608 | * |
@@ -5613,7 +5613,7 @@ discard block |
||
| 5613 | 5613 | */ |
| 5614 | 5614 | public function LibStatut($status, $mode = 0, $type = 0) |
| 5615 | 5615 | { |
| 5616 | - // phpcs:enable |
|
| 5616 | + // phpcs:enable |
|
| 5617 | 5617 | global $conf, $langs; |
| 5618 | 5618 | |
| 5619 | 5619 | $labelStatus = $labelStatusShort = ''; |
@@ -5711,7 +5711,7 @@ discard block |
||
| 5711 | 5711 | } |
| 5712 | 5712 | |
| 5713 | 5713 | |
| 5714 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5714 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5715 | 5715 | /** |
| 5716 | 5716 | * Adjust stock in a warehouse for product |
| 5717 | 5717 | * |
@@ -5730,7 +5730,7 @@ discard block |
||
| 5730 | 5730 | */ |
| 5731 | 5731 | public function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null) |
| 5732 | 5732 | { |
| 5733 | - // phpcs:enable |
|
| 5733 | + // phpcs:enable |
|
| 5734 | 5734 | if ($id_entrepot) { |
| 5735 | 5735 | $this->db->begin(); |
| 5736 | 5736 | |
@@ -5770,7 +5770,7 @@ discard block |
||
| 5770 | 5770 | return -1; |
| 5771 | 5771 | } |
| 5772 | 5772 | |
| 5773 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5773 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5774 | 5774 | /** |
| 5775 | 5775 | * Adjust stock in a warehouse for product with batch number |
| 5776 | 5776 | * |
@@ -5793,7 +5793,7 @@ discard block |
||
| 5793 | 5793 | */ |
| 5794 | 5794 | public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null, $force_update_batch = false) |
| 5795 | 5795 | { |
| 5796 | - // phpcs:enable |
|
| 5796 | + // phpcs:enable |
|
| 5797 | 5797 | if ($id_entrepot) { |
| 5798 | 5798 | $this->db->begin(); |
| 5799 | 5799 | |
@@ -5833,7 +5833,7 @@ discard block |
||
| 5833 | 5833 | return -1; |
| 5834 | 5834 | } |
| 5835 | 5835 | |
| 5836 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5836 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5837 | 5837 | /** |
| 5838 | 5838 | * Load information about stock of a product into ->stock_reel, ->stock_warehouse[] (including stock_warehouse[idwarehouse]->detail_batch for batch products) |
| 5839 | 5839 | * This function need a lot of load. If you use it on list, use a cache to execute it once for each product id. |
@@ -5848,7 +5848,7 @@ discard block |
||
| 5848 | 5848 | */ |
| 5849 | 5849 | public function load_stock($option = '', $includedraftpoforvirtual = null, $dateofvirtualstock = null) |
| 5850 | 5850 | { |
| 5851 | - // phpcs:enable |
|
| 5851 | + // phpcs:enable |
|
| 5852 | 5852 | global $conf; |
| 5853 | 5853 | |
| 5854 | 5854 | $this->stock_reel = 0; |
@@ -5915,7 +5915,7 @@ discard block |
||
| 5915 | 5915 | } |
| 5916 | 5916 | |
| 5917 | 5917 | |
| 5918 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5918 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 5919 | 5919 | /** |
| 5920 | 5920 | * Load value ->stock_theorique of a product. Property this->id must be defined. |
| 5921 | 5921 | * This function need a lot of load. If you use it on list, use a cache to execute it one for each product id. |
@@ -5927,7 +5927,7 @@ discard block |
||
| 5927 | 5927 | */ |
| 5928 | 5928 | public function load_virtual_stock($includedraftpoforvirtual = null, $dateofvirtualstock = null) |
| 5929 | 5929 | { |
| 5930 | - // phpcs:enable |
|
| 5930 | + // phpcs:enable |
|
| 5931 | 5931 | global $conf, $hookmanager, $action; |
| 5932 | 5932 | |
| 5933 | 5933 | $stock_commande_client = 0; |
@@ -6086,7 +6086,7 @@ discard block |
||
| 6086 | 6086 | } |
| 6087 | 6087 | } |
| 6088 | 6088 | |
| 6089 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6089 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6090 | 6090 | /** |
| 6091 | 6091 | * Move an uploaded file described into $file array into target directory $sdir. |
| 6092 | 6092 | * |
@@ -6096,7 +6096,7 @@ discard block |
||
| 6096 | 6096 | */ |
| 6097 | 6097 | public function add_photo($sdir, $file) |
| 6098 | 6098 | { |
| 6099 | - // phpcs:enable |
|
| 6099 | + // phpcs:enable |
|
| 6100 | 6100 | global $conf; |
| 6101 | 6101 | |
| 6102 | 6102 | include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
@@ -6133,7 +6133,7 @@ discard block |
||
| 6133 | 6133 | } |
| 6134 | 6134 | } |
| 6135 | 6135 | |
| 6136 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6136 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6137 | 6137 | /** |
| 6138 | 6138 | * Return if at least one photo is available |
| 6139 | 6139 | * |
@@ -6142,7 +6142,7 @@ discard block |
||
| 6142 | 6142 | */ |
| 6143 | 6143 | public function is_photo_available($sdir) |
| 6144 | 6144 | { |
| 6145 | - // phpcs:enable |
|
| 6145 | + // phpcs:enable |
|
| 6146 | 6146 | include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
| 6147 | 6147 | include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; |
| 6148 | 6148 | |
@@ -6174,7 +6174,7 @@ discard block |
||
| 6174 | 6174 | return false; |
| 6175 | 6175 | } |
| 6176 | 6176 | |
| 6177 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6177 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6178 | 6178 | /** |
| 6179 | 6179 | * Return an array with all photos of product found on disk. There is no sorting criteria. |
| 6180 | 6180 | * |
@@ -6184,7 +6184,7 @@ discard block |
||
| 6184 | 6184 | */ |
| 6185 | 6185 | public function liste_photos($dir, $nbmax = 0) |
| 6186 | 6186 | { |
| 6187 | - // phpcs:enable |
|
| 6187 | + // phpcs:enable |
|
| 6188 | 6188 | include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
| 6189 | 6189 | include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; |
| 6190 | 6190 | |
@@ -6235,7 +6235,7 @@ discard block |
||
| 6235 | 6235 | return $tabobj; |
| 6236 | 6236 | } |
| 6237 | 6237 | |
| 6238 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6238 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6239 | 6239 | /** |
| 6240 | 6240 | * Delete a photo and its thumbs |
| 6241 | 6241 | * |
@@ -6244,7 +6244,7 @@ discard block |
||
| 6244 | 6244 | */ |
| 6245 | 6245 | public function delete_photo($file) |
| 6246 | 6246 | { |
| 6247 | - // phpcs:enable |
|
| 6247 | + // phpcs:enable |
|
| 6248 | 6248 | include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
| 6249 | 6249 | include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; |
| 6250 | 6250 | |
@@ -6269,7 +6269,7 @@ discard block |
||
| 6269 | 6269 | } |
| 6270 | 6270 | } |
| 6271 | 6271 | |
| 6272 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6272 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6273 | 6273 | /** |
| 6274 | 6274 | * Load size of image file |
| 6275 | 6275 | * |
@@ -6278,7 +6278,7 @@ discard block |
||
| 6278 | 6278 | */ |
| 6279 | 6279 | public function get_image_size($file) |
| 6280 | 6280 | { |
| 6281 | - // phpcs:enable |
|
| 6281 | + // phpcs:enable |
|
| 6282 | 6282 | $file_osencoded = dol_osencode($file); |
| 6283 | 6283 | $infoImg = getimagesize($file_osencoded); // Get information on image |
| 6284 | 6284 | $this->imgWidth = $infoImg[0]; // Largeur de l'image |
@@ -6376,7 +6376,7 @@ discard block |
||
| 6376 | 6376 | } |
| 6377 | 6377 | |
| 6378 | 6378 | |
| 6379 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6379 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6380 | 6380 | /** |
| 6381 | 6381 | * Get a barcode from the module to generate barcode values. |
| 6382 | 6382 | * Return value is stored into this->barcode |
@@ -6387,7 +6387,7 @@ discard block |
||
| 6387 | 6387 | */ |
| 6388 | 6388 | public function get_barcode($object, $type = '') |
| 6389 | 6389 | { |
| 6390 | - // phpcs:enable |
|
| 6390 | + // phpcs:enable |
|
| 6391 | 6391 | global $conf; |
| 6392 | 6392 | |
| 6393 | 6393 | $result = ''; |
@@ -6494,7 +6494,7 @@ discard block |
||
| 6494 | 6494 | return $label; |
| 6495 | 6495 | } |
| 6496 | 6496 | |
| 6497 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6497 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 6498 | 6498 | /** |
| 6499 | 6499 | * Return minimum product recommended price |
| 6500 | 6500 | * |
@@ -6502,7 +6502,7 @@ discard block |
||
| 6502 | 6502 | */ |
| 6503 | 6503 | public function min_recommended_price() |
| 6504 | 6504 | { |
| 6505 | - // phpcs:enable |
|
| 6505 | + // phpcs:enable |
|
| 6506 | 6506 | global $conf; |
| 6507 | 6507 | |
| 6508 | 6508 | $maxpricesupplier = 0; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | public $price; |
| 148 | 148 | |
| 149 | - public $price_formated; // used by takepos/ajax/ajax.php |
|
| 149 | + public $price_formated; // used by takepos/ajax/ajax.php |
|
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | 152 | * Selling price with tax |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | public $price_ttc; |
| 157 | 157 | |
| 158 | - public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
| 158 | + public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | 161 | * Minimum price net |
@@ -408,20 +408,20 @@ discard block |
||
| 408 | 408 | |
| 409 | 409 | //! Metric of products |
| 410 | 410 | public $weight; |
| 411 | - public $weight_units; // scale -3, 0, 3, 6 |
|
| 411 | + public $weight_units; // scale -3, 0, 3, 6 |
|
| 412 | 412 | public $length; |
| 413 | - public $length_units; // scale -3, 0, 3, 6 |
|
| 413 | + public $length_units; // scale -3, 0, 3, 6 |
|
| 414 | 414 | public $width; |
| 415 | - public $width_units; // scale -3, 0, 3, 6 |
|
| 415 | + public $width_units; // scale -3, 0, 3, 6 |
|
| 416 | 416 | public $height; |
| 417 | - public $height_units; // scale -3, 0, 3, 6 |
|
| 417 | + public $height_units; // scale -3, 0, 3, 6 |
|
| 418 | 418 | public $surface; |
| 419 | - public $surface_units; // scale -3, 0, 3, 6 |
|
| 419 | + public $surface_units; // scale -3, 0, 3, 6 |
|
| 420 | 420 | public $volume; |
| 421 | - public $volume_units; // scale -3, 0, 3, 6 |
|
| 421 | + public $volume_units; // scale -3, 0, 3, 6 |
|
| 422 | 422 | |
| 423 | 423 | public $net_measure; |
| 424 | - public $net_measure_units; // scale -3, 0, 3, 6 |
|
| 424 | + public $net_measure_units; // scale -3, 0, 3, 6 |
|
| 425 | 425 | |
| 426 | 426 | public $accountancy_code_sell; |
| 427 | 427 | public $accountancy_code_sell_intra; |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000), |
| 634 | 634 | //'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
| 635 | 635 | //'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
| 636 | - 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
| 636 | + 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
| 637 | 637 | ); |
| 638 | 638 | |
| 639 | 639 | /** |
@@ -1957,7 +1957,7 @@ discard block |
||
| 1957 | 1957 | */ |
| 1958 | 1958 | private function getArrayForPriceCompare($level = 0) |
| 1959 | 1959 | { |
| 1960 | - $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); |
|
| 1960 | + $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly'); |
|
| 1961 | 1961 | |
| 1962 | 1962 | foreach ($testExit as $field) { |
| 1963 | 1963 | if (!isset($this->$field)) { |
@@ -2601,8 +2601,8 @@ discard block |
||
| 2601 | 2601 | |
| 2602 | 2602 | //For MultiCompany |
| 2603 | 2603 | //PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity |
| 2604 | - $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
| 2605 | - $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
| 2604 | + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
| 2605 | + $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
| 2606 | 2606 | $visibleWarehousesEntities = $conf->entity; |
| 2607 | 2607 | if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { |
| 2608 | 2608 | if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) { |
@@ -2795,15 +2795,15 @@ discard block |
||
| 2795 | 2795 | $sql .= " WHERE entity IN (" . getEntity('productprice') . ")"; |
| 2796 | 2796 | $sql .= " AND price_level=" . ((int) $i); |
| 2797 | 2797 | $sql .= " AND fk_product = " . ((int) $this->id); |
| 2798 | - $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
| 2799 | - $sql .= " LIMIT 1"; // Only the first one |
|
| 2798 | + $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
| 2799 | + $sql .= " LIMIT 1"; // Only the first one |
|
| 2800 | 2800 | $resql = $this->db->query($sql); |
| 2801 | 2801 | if ($resql) { |
| 2802 | 2802 | $result = $this->db->fetch_array($resql); |
| 2803 | 2803 | |
| 2804 | 2804 | $this->multiprices[$i] = $result ? $result["price"] : null; |
| 2805 | 2805 | $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null; |
| 2806 | - $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
| 2806 | + $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
| 2807 | 2807 | $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null; |
| 2808 | 2808 | $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null; |
| 2809 | 2809 | // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on |
@@ -3028,7 +3028,7 @@ discard block |
||
| 3028 | 3028 | $obj = $this->db->fetch_object($result); |
| 3029 | 3029 | $this->stats_mo['customers_' . $role] = $obj->nb_customers ? $obj->nb_customers : 0; |
| 3030 | 3030 | $this->stats_mo['nb_' . $role] = $obj->nb ? $obj->nb : 0; |
| 3031 | - $this->stats_mo['qty_' . $role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
| 3031 | + $this->stats_mo['qty_' . $role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
| 3032 | 3032 | } else { |
| 3033 | 3033 | $this->error = $this->db->error(); |
| 3034 | 3034 | $error++; |
@@ -4534,7 +4534,7 @@ discard block |
||
| 4534 | 4534 | //Addition of a product with the highest rank +1 |
| 4535 | 4535 | $sql = "INSERT INTO " . $this->db->prefix() . "product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)"; |
| 4536 | 4536 | $sql .= " VALUES (" . ((int) $id_pere) . ", " . ((int) $id_fils) . ", " . price2num($qty, 'MS') . ", " . ((int) $incdec) . ", " . ((int) $rank) . ")"; |
| 4537 | - if (! $this->db->query($sql)) { |
|
| 4537 | + if (!$this->db->query($sql)) { |
|
| 4538 | 4538 | dol_print_error($this->db); |
| 4539 | 4539 | return -1; |
| 4540 | 4540 | } else { |
@@ -4655,7 +4655,7 @@ discard block |
||
| 4655 | 4655 | $sql = "UPDATE " . $this->db->prefix() . "product_association"; |
| 4656 | 4656 | $sql .= " SET rang = " . ((int) $cpt); |
| 4657 | 4657 | $sql .= " WHERE rowid = " . ((int) $objrank->rowid); |
| 4658 | - if (! $this->db->query($sql)) { |
|
| 4658 | + if (!$this->db->query($sql)) { |
|
| 4659 | 4659 | dol_print_error($this->db); |
| 4660 | 4660 | return -1; |
| 4661 | 4661 | } |
@@ -6722,7 +6722,7 @@ discard block |
||
| 6722 | 6722 | */ |
| 6723 | 6723 | public function getKanbanView($option = '', $arraydata = null) |
| 6724 | 6724 | { |
| 6725 | - global $langs,$conf; |
|
| 6725 | + global $langs, $conf; |
|
| 6726 | 6726 | |
| 6727 | 6727 | $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); |
| 6728 | 6728 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 236 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 237 | 237 | /** |
| 238 | 238 | * Return full path to current warehouse in $tab (recursive function) |
| 239 | 239 | * |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | */ |
| 244 | 244 | private function get_parent_path($tab, $final_label = '') |
| 245 | 245 | { |
| 246 | - //phpcs:enable |
|
| 246 | + //phpcs:enable |
|
| 247 | 247 | if (empty($final_label)) { |
| 248 | 248 | $final_label = $tab['label']; |
| 249 | 249 | } |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 527 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 528 | 528 | /** |
| 529 | 529 | * Output a combo box with list of units |
| 530 | 530 | * Currently the units are not define in the DB |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | */ |
| 540 | 540 | public function select_measuring_units($name = 'measuring_units', $measuring_style = '', $selected = '0', $adddefault = 0, $mode = 0) |
| 541 | 541 | { |
| 542 | - //phpcs:enable |
|
| 542 | + //phpcs:enable |
|
| 543 | 543 | print $this->selectMeasuringUnits($name, $measuring_style, $selected, $adddefault, $mode); |
| 544 | 544 | } |
| 545 | 545 | |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | return $this->LibStatut($this->status, $mode); |
| 726 | 726 | } |
| 727 | 727 | |
| 728 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 728 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 729 | 729 | /** |
| 730 | 730 | * Return the status |
| 731 | 731 | * |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | */ |
| 736 | 736 | public function LibStatut($status, $mode = 0) |
| 737 | 737 | { |
| 738 | - // phpcs:enable |
|
| 738 | + // phpcs:enable |
|
| 739 | 739 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
| 740 | 740 | global $langs; |
| 741 | 741 | //$langs->load("buypricehistory@buypricehistory"); |
@@ -58,18 +58,18 @@ discard block |
||
| 58 | 58 | public $fk_product; |
| 59 | 59 | |
| 60 | 60 | // Properties of the lot |
| 61 | - public $lotid; // ID in table of the details of properties of each lots |
|
| 61 | + public $lotid; // ID in table of the details of properties of each lots |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * @var int|string |
| 65 | 65 | * @deprecated |
| 66 | 66 | */ |
| 67 | - public $sellby = ''; // dlc |
|
| 67 | + public $sellby = ''; // dlc |
|
| 68 | 68 | /** |
| 69 | 69 | * @var int|string |
| 70 | 70 | * @deprecated |
| 71 | 71 | */ |
| 72 | - public $eatby = ''; // dmd/dluo |
|
| 72 | + public $eatby = ''; // dmd/dluo |
|
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -103,15 +103,15 @@ discard block |
||
| 103 | 103 | // Insert request |
| 104 | 104 | $sql = "INSERT INTO " . $this->db->prefix() . "product_batch ("; |
| 105 | 105 | $sql .= "fk_product_stock,"; |
| 106 | - $sql .= "sellby,"; // no more used |
|
| 107 | - $sql .= "eatby,"; // no more used |
|
| 106 | + $sql .= "sellby,"; // no more used |
|
| 107 | + $sql .= "eatby,"; // no more used |
|
| 108 | 108 | $sql .= "batch,"; |
| 109 | 109 | $sql .= "qty,"; |
| 110 | 110 | $sql .= "import_key"; |
| 111 | 111 | $sql .= ") VALUES ("; |
| 112 | 112 | $sql .= " " . (!isset($this->fk_product_stock) ? 'NULL' : $this->fk_product_stock) . ","; |
| 113 | - $sql .= " " . (!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'" . $this->db->idate($this->sellby) . "'") . ","; // no more used |
|
| 114 | - $sql .= " " . (!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'" . $this->db->idate($this->eatby) . "'") . ","; // no more used |
|
| 113 | + $sql .= " " . (!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'" . $this->db->idate($this->sellby) . "'") . ","; // no more used |
|
| 114 | + $sql .= " " . (!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'" . $this->db->idate($this->eatby) . "'") . ","; // no more used |
|
| 115 | 115 | $sql .= " " . (!isset($this->batch) ? 'NULL' : "'" . $this->db->escape($this->batch) . "'") . ","; |
| 116 | 116 | $sql .= " " . (!isset($this->qty) ? 'NULL' : $this->qty) . ","; |
| 117 | 117 | $sql .= " " . (!isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'"); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $sql .= " pl.eatby,"; |
| 163 | 163 | $sql .= " pl.sellby"; |
| 164 | 164 | $sql .= " FROM " . $this->db->prefix() . "product_batch as t"; |
| 165 | - $sql .= " INNER JOIN " . $this->db->prefix() . "product_stock w on t.fk_product_stock = w.rowid"; // llx_product_stock is a parent table so this link does NOT generate duplicate record |
|
| 165 | + $sql .= " INNER JOIN " . $this->db->prefix() . "product_stock w on t.fk_product_stock = w.rowid"; // llx_product_stock is a parent table so this link does NOT generate duplicate record |
|
| 166 | 166 | $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lot as pl on pl.fk_product = w.fk_product and pl.batch = t.batch"; |
| 167 | 167 | $sql .= " WHERE t.rowid = " . ((int) $id); |
| 168 | 168 | |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | $this->tms = $this->db->jdate($obj->tms); |
| 432 | 432 | $this->fk_product_stock = $obj->fk_product_stock; |
| 433 | 433 | $this->sellby = $this->db->jdate($obj->sellby); // deprecated. do no tuse this data. |
| 434 | - $this->eatby = $this->db->jdate($obj->eatby); // deprecated. do not use this data. |
|
| 434 | + $this->eatby = $this->db->jdate($obj->eatby); // deprecated. do not use this data. |
|
| 435 | 435 | $this->batch = $obj->batch; |
| 436 | 436 | $this->qty = $obj->qty; |
| 437 | 437 | $this->import_key = $obj->import_key; |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | |
| 530 | 530 | if ($fk_product > 0) { |
| 531 | 531 | // Some properties of the lot |
| 532 | - $tmp->lotid = $obj->lotid; // ID in table of the details of properties of each lots |
|
| 532 | + $tmp->lotid = $obj->lotid; // ID in table of the details of properties of each lots |
|
| 533 | 533 | $tmp->sellby = $dbs->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby); |
| 534 | 534 | $tmp->eatby = $dbs->jdate($obj->eatby ? $obj->eatby : $obj->oldeatby); |
| 535 | 535 | } |
@@ -256,7 +256,7 @@ |
||
| 256 | 256 | $sql .= " " . (empty($this->localtax2_type) ? "'0'" : "'" . $this->db->escape($this->localtax2_type) . "'") . ","; |
| 257 | 257 | $sql .= " " . (!isset($this->localtax2_tx) ? 'NULL' : (empty($this->localtax2_tx) ? 0 : $this->localtax2_tx)) . ","; |
| 258 | 258 | $sql .= " " . ((int) $user->id) . ","; |
| 259 | - $sql .= " " . (!isset($this->price_label) ? 'NULL' : "'" . $this->db->escape($this->price_label) . "'") . ","; |
|
| 259 | + $sql .= " " . (!isset($this->price_label) ? 'NULL' : "'" . $this->db->escape($this->price_label) . "'") . ","; |
|
| 260 | 260 | $sql .= " " . (!isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'"); |
| 261 | 261 | $sql .= ")"; |
| 262 | 262 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 229 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 230 | 230 | /** |
| 231 | 231 | * Load object in memory from the database |
| 232 | 232 | * |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public function fetch_by_product($product_id, $lang = '') |
| 238 | 238 | { |
| 239 | - // phpcs:enable |
|
| 239 | + // phpcs:enable |
|
| 240 | 240 | global $langs, $conf; |
| 241 | 241 | |
| 242 | 242 | $sql = "SELECT"; |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 407 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 408 | 408 | /** |
| 409 | 409 | * Delete object in database |
| 410 | 410 | * |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | */ |
| 417 | 417 | public function delete_by_product($user, $product_id, $lang_id = '', $notrigger = 0) |
| 418 | 418 | { |
| 419 | - // phpcs:enable |
|
| 419 | + // phpcs:enable |
|
| 420 | 420 | global $conf, $langs; |
| 421 | 421 | $error = 0; |
| 422 | 422 | |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | } |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 455 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 456 | 456 | /** |
| 457 | 457 | * Delete object in database |
| 458 | 458 | * |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | */ |
| 462 | 462 | public function delete_by_file($user) |
| 463 | 463 | { |
| 464 | - // phpcs:enable |
|
| 464 | + // phpcs:enable |
|
| 465 | 465 | global $conf, $langs; |
| 466 | 466 | $error = 0; |
| 467 | 467 | |
@@ -1942,7 +1942,7 @@ discard block |
||
| 1942 | 1942 | return array('stock_warehouses' => $stockData); |
| 1943 | 1943 | } |
| 1944 | 1944 | |
| 1945 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
| 1945 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
| 1946 | 1946 | /** |
| 1947 | 1947 | * Clean sensible object datas |
| 1948 | 1948 | * |
@@ -1951,7 +1951,7 @@ discard block |
||
| 1951 | 1951 | */ |
| 1952 | 1952 | protected function _cleanObjectDatas($object) |
| 1953 | 1953 | { |
| 1954 | - // phpcs:enable |
|
| 1954 | + // phpcs:enable |
|
| 1955 | 1955 | $object = parent::_cleanObjectDatas($object); |
| 1956 | 1956 | |
| 1957 | 1957 | unset($object->statut); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | //this query will return total products with the filters given |
| 235 | - $sqlTotals = str_replace('SELECT t.rowid, t.ref, t.ref_ext', 'SELECT count(t.rowid) as total', $sql); |
|
| 235 | + $sqlTotals = str_replace('SELECT t.rowid, t.ref, t.ref_ext', 'SELECT count(t.rowid) as total', $sql); |
|
| 236 | 236 | |
| 237 | 237 | $sql .= $this->db->order($sortfield, $sortorder); |
| 238 | 238 | if ($limit) { |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | if (getDolGlobalString('PRODUIT_MULTIPRICES')) { |
| 331 | 331 | $key_max = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); |
| 332 | - for ($key = 1; $key <= $key_max ; $key++) { |
|
| 332 | + for ($key = 1; $key <= $key_max; $key++) { |
|
| 333 | 333 | $newvat = $this->product->multiprices_tva_tx[$key]; |
| 334 | 334 | $newnpr = 0; |
| 335 | 335 | $newvatsrccode = $this->product->default_vat_code; |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | if ($result > 0 && getDolGlobalString('PRODUIT_MULTIPRICES')) { |
| 464 | 464 | $key_max = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); |
| 465 | - for ($key = 1; $key <= $key_max ; $key++) { |
|
| 465 | + for ($key = 1; $key <= $key_max; $key++) { |
|
| 466 | 466 | $pricemodified = false; |
| 467 | 467 | if ($this->product->multiprices_base_type[$key] != $oldproduct->multiprices_base_type[$key]) { |
| 468 | 468 | $pricemodified = true; |
@@ -467,13 +467,23 @@ |
||
| 467 | 467 | if ($this->product->multiprices_base_type[$key] != $oldproduct->multiprices_base_type[$key]) { |
| 468 | 468 | $pricemodified = true; |
| 469 | 469 | } else { |
| 470 | - if ($this->product->multiprices_tva_tx[$key] != $oldproduct->multiprices_tva_tx[$key]) $pricemodified = true; |
|
| 470 | + if ($this->product->multiprices_tva_tx[$key] != $oldproduct->multiprices_tva_tx[$key]) { |
|
| 471 | + $pricemodified = true; |
|
| 472 | + } |
|
| 471 | 473 | if ($this->product->multiprices_base_type[$key] == 'TTC') { |
| 472 | - if ($this->product->multiprices_ttc[$key] != $oldproduct->multiprices_ttc[$key]) $pricemodified = true; |
|
| 473 | - if ($this->product->multiprices_min_ttc[$key] != $oldproduct->multiprices_min_ttc[$key]) $pricemodified = true; |
|
| 474 | + if ($this->product->multiprices_ttc[$key] != $oldproduct->multiprices_ttc[$key]) { |
|
| 475 | + $pricemodified = true; |
|
| 476 | + } |
|
| 477 | + if ($this->product->multiprices_min_ttc[$key] != $oldproduct->multiprices_min_ttc[$key]) { |
|
| 478 | + $pricemodified = true; |
|
| 479 | + } |
|
| 474 | 480 | } else { |
| 475 | - if ($this->product->multiprices[$key] != $oldproduct->multiprices[$key]) $pricemodified = true; |
|
| 476 | - if ($this->product->multiprices_min[$key] != $oldproduct->multiprices[$key]) $pricemodified = true; |
|
| 481 | + if ($this->product->multiprices[$key] != $oldproduct->multiprices[$key]) { |
|
| 482 | + $pricemodified = true; |
|
| 483 | + } |
|
| 484 | + if ($this->product->multiprices_min[$key] != $oldproduct->multiprices[$key]) { |
|
| 485 | + $pricemodified = true; |
|
| 486 | + } |
|
| 477 | 487 | } |
| 478 | 488 | } |
| 479 | 489 | if ($pricemodified && $result > 0) { |
@@ -444,7 +444,7 @@ |
||
| 444 | 444 | |
| 445 | 445 | $unitline = price2num(($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise), 'MU'); |
| 446 | 446 | $totalline = price2num($value['nb'] * ($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise), 'MT'); |
| 447 | - $total += $totalline; |
|
| 447 | + $total += $totalline; |
|
| 448 | 448 | |
| 449 | 449 | print '<td class="right nowraponall">'; |
| 450 | 450 | print($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'] . 'x ' : '') . '<span class="amount">' . price($unitline, 0, '', 0, 0, -1, $conf->currency)) . '</span>'; |