Passed
Push — CHECK_API ( 78ffdd...fa4f39 )
by Rafael
41:29
created
Dolibarr/Code/Societe/Classes/Societe.php 1 patch
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
     }
1105 1105
 
1106 1106
 
1107
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1107
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1108 1108
     /**
1109 1109
      * Create a contact/address from thirdparty
1110 1110
      *
@@ -2254,7 +2254,7 @@  discard block
 block discarded – undo
2254 2254
         return 0;
2255 2255
     }
2256 2256
 
2257
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2257
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2258 2258
     /**
2259 2259
      *  Define third party as a customer
2260 2260
      *
@@ -2265,7 +2265,7 @@  discard block
 block discarded – undo
2265 2265
     public function set_as_client()
2266 2266
     {
2267 2267
         global $conf;
2268
-		// phpcs:enable
2268
+        // phpcs:enable
2269 2269
         dol_syslog(get_class($this) . "::set_as_client is deprecated use setAsCustomer instead", LOG_NOTICE);
2270 2270
         return $this->setAsCustomer();
2271 2271
     }
@@ -2298,7 +2298,7 @@  discard block
 block discarded – undo
2298 2298
         return 0;
2299 2299
     }
2300 2300
 
2301
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2301
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2302 2302
     /**
2303 2303
      *  Defines the company as a customer
2304 2304
      *
@@ -2309,7 +2309,7 @@  discard block
 block discarded – undo
2309 2309
      */
2310 2310
     public function set_remise_client($remise, $note, User $user)
2311 2311
     {
2312
-		// phpcs:enable
2312
+        // phpcs:enable
2313 2313
         global $conf, $langs;
2314 2314
 
2315 2315
         // Parameter cleaning
@@ -2359,7 +2359,7 @@  discard block
 block discarded – undo
2359 2359
         return -1;
2360 2360
     }
2361 2361
 
2362
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2362
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2363 2363
     /**
2364 2364
      *  Defines the company as a customer
2365 2365
      *
@@ -2370,7 +2370,7 @@  discard block
 block discarded – undo
2370 2370
      */
2371 2371
     public function set_remise_supplier($remise, $note, User $user)
2372 2372
     {
2373
-		// phpcs:enable
2373
+        // phpcs:enable
2374 2374
         global $conf, $langs;
2375 2375
 
2376 2376
         // Parameter cleaning
@@ -2420,7 +2420,7 @@  discard block
 block discarded – undo
2420 2420
         return -1;
2421 2421
     }
2422 2422
 
2423
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2423
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2424 2424
     /**
2425 2425
      *      Add a discount for third party
2426 2426
      *
@@ -2434,7 +2434,7 @@  discard block
 block discarded – undo
2434 2434
      */
2435 2435
     public function set_remise_except($remise, User $user, $desc, $vatrate = '', $discount_type = 0, $price_base_type = 'HT')
2436 2436
     {
2437
-		// phpcs:enable
2437
+        // phpcs:enable
2438 2438
         global $langs;
2439 2439
 
2440 2440
         // Clean parameters
@@ -2620,7 +2620,7 @@  discard block
 block discarded – undo
2620 2620
         return -1;
2621 2621
     }
2622 2622
 
2623
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2623
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2624 2624
     /**
2625 2625
      *  Add link to sales representative
2626 2626
      *
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
      */
2631 2631
     public function add_commercial(User $user, $commid)
2632 2632
     {
2633
-		// phpcs:enable
2633
+        // phpcs:enable
2634 2634
         $error = 0;
2635 2635
 
2636 2636
         if ($this->id > 0 && $commid > 0) {
@@ -2680,7 +2680,7 @@  discard block
 block discarded – undo
2680 2680
         return 0;
2681 2681
     }
2682 2682
 
2683
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2683
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2684 2684
     /**
2685 2685
      *  Add link to sales representative
2686 2686
      *
@@ -2690,7 +2690,7 @@  discard block
 block discarded – undo
2690 2690
      */
2691 2691
     public function del_commercial(User $user, $commid)
2692 2692
     {
2693
-		// phpcs:enable
2693
+        // phpcs:enable
2694 2694
         $error = 0;
2695 2695
         $this->context = array('commercial_modified' => $commid);
2696 2696
 
@@ -3075,7 +3075,7 @@  discard block
 block discarded – undo
3075 3075
         return $this->LibStatut($this->status, $mode);
3076 3076
     }
3077 3077
 
3078
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3078
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3079 3079
     /**
3080 3080
      *  Return the label of a given status
3081 3081
      *
@@ -3085,7 +3085,7 @@  discard block
 block discarded – undo
3085 3085
      */
3086 3086
     public function LibStatut($status, $mode = 0)
3087 3087
     {
3088
-		// phpcs:enable
3088
+        // phpcs:enable
3089 3089
         global $langs;
3090 3090
         $langs->load('companies');
3091 3091
 
@@ -3104,7 +3104,7 @@  discard block
 block discarded – undo
3104 3104
         return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
3105 3105
     }
3106 3106
 
3107
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3107
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3108 3108
     /**
3109 3109
      *    Return list of contacts emails existing for third party
3110 3110
      *
@@ -3113,7 +3113,7 @@  discard block
 block discarded – undo
3113 3113
      */
3114 3114
     public function thirdparty_and_contact_email_array($addthirdparty = 0)
3115 3115
     {
3116
-		// phpcs:enable
3116
+        // phpcs:enable
3117 3117
         global $langs;
3118 3118
 
3119 3119
         $contact_emails = $this->contact_property_array('email', 1);
@@ -3129,7 +3129,7 @@  discard block
 block discarded – undo
3129 3129
         return $contact_emails;
3130 3130
     }
3131 3131
 
3132
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3132
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3133 3133
     /**
3134 3134
      *    Return list of contacts mobile phone existing for third party
3135 3135
      *
@@ -3137,7 +3137,7 @@  discard block
 block discarded – undo
3137 3137
      */
3138 3138
     public function thirdparty_and_contact_phone_array()
3139 3139
     {
3140
-		// phpcs:enable
3140
+        // phpcs:enable
3141 3141
         global $langs;
3142 3142
 
3143 3143
         $contact_phone = $this->contact_property_array('mobile');
@@ -3152,7 +3152,7 @@  discard block
 block discarded – undo
3152 3152
         return $contact_phone;
3153 3153
     }
3154 3154
 
3155
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3155
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3156 3156
     /**
3157 3157
      *  Return list of contacts emails or mobile existing for third party
3158 3158
      *
@@ -3162,7 +3162,7 @@  discard block
 block discarded – undo
3162 3162
      */
3163 3163
     public function contact_property_array($mode = 'email', $hidedisabled = 0)
3164 3164
     {
3165
-		// phpcs:enable
3165
+        // phpcs:enable
3166 3166
         global $langs;
3167 3167
 
3168 3168
         $contact_property = array();
@@ -3222,7 +3222,7 @@  discard block
 block discarded – undo
3222 3222
     }
3223 3223
 
3224 3224
 
3225
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3225
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3226 3226
     /**
3227 3227
      *    Returns the contact list of this company
3228 3228
      *
@@ -3230,7 +3230,7 @@  discard block
 block discarded – undo
3230 3230
      */
3231 3231
     public function contact_array()
3232 3232
     {
3233
-		// phpcs:enable
3233
+        // phpcs:enable
3234 3234
         $contacts = array();
3235 3235
 
3236 3236
         $sql = "SELECT rowid, lastname, firstname FROM " . MAIN_DB_PREFIX . "socpeople WHERE fk_soc = " . ((int) $this->id);
@@ -3251,7 +3251,7 @@  discard block
 block discarded – undo
3251 3251
         return $contacts;
3252 3252
     }
3253 3253
 
3254
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3254
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3255 3255
     /**
3256 3256
      *    Returns the contact list of this company
3257 3257
      *
@@ -3281,7 +3281,7 @@  discard block
 block discarded – undo
3281 3281
         return $contacts;
3282 3282
     }
3283 3283
 
3284
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3284
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3285 3285
     /**
3286 3286
      *  Return property of contact from its id
3287 3287
      *
@@ -3291,7 +3291,7 @@  discard block
 block discarded – undo
3291 3291
      */
3292 3292
     public function contact_get_property($rowid, $mode)
3293 3293
     {
3294
-		// phpcs:enable
3294
+        // phpcs:enable
3295 3295
         $contact_property = '';
3296 3296
 
3297 3297
         if (empty($rowid)) {
@@ -3324,7 +3324,7 @@  discard block
 block discarded – undo
3324 3324
     }
3325 3325
 
3326 3326
 
3327
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3327
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3328 3328
     /**
3329 3329
      *  Return bank number property of thirdparty (label or rum)
3330 3330
      *
@@ -3333,7 +3333,7 @@  discard block
 block discarded – undo
3333 3333
      */
3334 3334
     public function display_rib($mode = 'label')
3335 3335
     {
3336
-		// phpcs:enable
3336
+        // phpcs:enable
3337 3337
 
3338 3338
         $bac = new CompanyBankAccount($this->db);
3339 3339
         // @phan-suppress-next-line PhanPluginSuspiciousParamPosition
@@ -3360,7 +3360,7 @@  discard block
 block discarded – undo
3360 3360
         }
3361 3361
     }
3362 3362
 
3363
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3363
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3364 3364
     /**
3365 3365
      * Return Array of RIB
3366 3366
      *
@@ -3368,7 +3368,7 @@  discard block
 block discarded – undo
3368 3368
      */
3369 3369
     public function get_all_rib()
3370 3370
     {
3371
-		// phpcs:enable
3371
+        // phpcs:enable
3372 3372
         $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "societe_rib WHERE type='ban' AND fk_soc = " . ((int) $this->id);
3373 3373
         $result = $this->db->query($sql);
3374 3374
         if (!$result) {
@@ -3389,7 +3389,7 @@  discard block
 block discarded – undo
3389 3389
         }
3390 3390
     }
3391 3391
 
3392
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3392
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3393 3393
     /**
3394 3394
      *  Assigns a customer code from the code control module.
3395 3395
      *  Return value is stored into this->code_client
@@ -3400,7 +3400,7 @@  discard block
 block discarded – undo
3400 3400
      */
3401 3401
     public function get_codeclient($objsoc = null, $type = 0)
3402 3402
     {
3403
-		// phpcs:enable
3403
+        // phpcs:enable
3404 3404
         global $conf;
3405 3405
         if (getDolGlobalString('SOCIETE_CODECLIENT_ADDON')) {
3406 3406
             $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON');
@@ -3422,7 +3422,7 @@  discard block
 block discarded – undo
3422 3422
         }
3423 3423
     }
3424 3424
 
3425
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3425
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3426 3426
     /**
3427 3427
      *  Assigns a vendor code from the code control module.
3428 3428
      *  Return value is stored into this->code_fournisseur
@@ -3433,7 +3433,7 @@  discard block
 block discarded – undo
3433 3433
      */
3434 3434
     public function get_codefournisseur($objsoc = null, $type = 1)
3435 3435
     {
3436
-		// phpcs:enable
3436
+        // phpcs:enable
3437 3437
         global $conf;
3438 3438
         if (getDolGlobalString('SOCIETE_CODECLIENT_ADDON')) {
3439 3439
             $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON');
@@ -3454,7 +3454,7 @@  discard block
 block discarded – undo
3454 3454
         }
3455 3455
     }
3456 3456
 
3457
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3457
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3458 3458
     /**
3459 3459
      *    Check if a client code is editable based on the parameters of the
3460 3460
      *    code control module.
@@ -3463,7 +3463,7 @@  discard block
 block discarded – undo
3463 3463
      */
3464 3464
     public function codeclient_modifiable()
3465 3465
     {
3466
-		// phpcs:enable
3466
+        // phpcs:enable
3467 3467
         global $conf;
3468 3468
         if (getDolGlobalString('SOCIETE_CODECLIENT_ADDON')) {
3469 3469
             $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON');
@@ -3495,7 +3495,7 @@  discard block
 block discarded – undo
3495 3495
     }
3496 3496
 
3497 3497
 
3498
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3498
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3499 3499
     /**
3500 3500
      *    Check if a vendor code is editable in the code control module configuration
3501 3501
      *
@@ -3503,7 +3503,7 @@  discard block
 block discarded – undo
3503 3503
      */
3504 3504
     public function codefournisseur_modifiable()
3505 3505
     {
3506
-		// phpcs:enable
3506
+        // phpcs:enable
3507 3507
         global $conf;
3508 3508
         if (getDolGlobalString('SOCIETE_CODECLIENT_ADDON')) {
3509 3509
             $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON');
@@ -3535,7 +3535,7 @@  discard block
 block discarded – undo
3535 3535
     }
3536 3536
 
3537 3537
 
3538
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3538
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3539 3539
     /**
3540 3540
      *  Check customer code
3541 3541
      *
@@ -3549,7 +3549,7 @@  discard block
 block discarded – undo
3549 3549
      */
3550 3550
     public function check_codeclient()
3551 3551
     {
3552
-		// phpcs:enable
3552
+        // phpcs:enable
3553 3553
         global $conf;
3554 3554
         if (getDolGlobalString('SOCIETE_CODECLIENT_ADDON')) {
3555 3555
             $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON');
@@ -3576,7 +3576,7 @@  discard block
 block discarded – undo
3576 3576
         }
3577 3577
     }
3578 3578
 
3579
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3579
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3580 3580
     /**
3581 3581
      *    Check supplier code
3582 3582
      *
@@ -3590,7 +3590,7 @@  discard block
 block discarded – undo
3590 3590
      */
3591 3591
     public function check_codefournisseur()
3592 3592
     {
3593
-		// phpcs:enable
3593
+        // phpcs:enable
3594 3594
         global $conf;
3595 3595
         if (getDolGlobalString('SOCIETE_CODECLIENT_ADDON')) {
3596 3596
             $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON');
@@ -3617,7 +3617,7 @@  discard block
 block discarded – undo
3617 3617
         }
3618 3618
     }
3619 3619
 
3620
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3620
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3621 3621
     /**
3622 3622
      *      Assigns a accounting code from the accounting code module.
3623 3623
      *      Computed value is stored into this->code_compta or this->code_compta_fournisseur according to $type.
@@ -3628,7 +3628,7 @@  discard block
 block discarded – undo
3628 3628
      */
3629 3629
     public function get_codecompta($type)
3630 3630
     {
3631
-		// phpcs:enable
3631
+        // phpcs:enable
3632 3632
         global $conf;
3633 3633
 
3634 3634
         if (getDolGlobalString('SOCIETE_CODECOMPTA_ADDON')) {
@@ -3776,7 +3776,7 @@  discard block
 block discarded – undo
3776 3776
         return array();
3777 3777
     }
3778 3778
 
3779
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3779
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3780 3780
     /**
3781 3781
      *  Returns if a profid should be verified to be unique
3782 3782
      *
@@ -3785,7 +3785,7 @@  discard block
 block discarded – undo
3785 3785
      */
3786 3786
     public function id_prof_verifiable($idprof)
3787 3787
     {
3788
-		// phpcs:enable
3788
+        // phpcs:enable
3789 3789
         global $conf;
3790 3790
 
3791 3791
         switch ($idprof) {
@@ -3814,7 +3814,7 @@  discard block
 block discarded – undo
3814 3814
         return $ret;
3815 3815
     }
3816 3816
 
3817
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3817
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3818 3818
     /**
3819 3819
      *    Verify if a profid exists into database for others thirds
3820 3820
      *
@@ -3825,7 +3825,7 @@  discard block
 block discarded – undo
3825 3825
      */
3826 3826
     public function id_prof_exists($idprof, $value, $socid = 0)
3827 3827
     {
3828
-		// phpcs:enable
3828
+        // phpcs:enable
3829 3829
         $field = $idprof;
3830 3830
 
3831 3831
         switch ($idprof) {  // For backward compatibility
@@ -3875,7 +3875,7 @@  discard block
 block discarded – undo
3875 3875
         }
3876 3876
     }
3877 3877
 
3878
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3878
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3879 3879
     /**
3880 3880
      *  Check the validity of a professional identifier according to the country of the company (siren, siret, ...)
3881 3881
      *
@@ -3886,7 +3886,7 @@  discard block
 block discarded – undo
3886 3886
      */
3887 3887
     public function id_prof_check($idprof, $soc)
3888 3888
     {
3889
-		// phpcs:enable
3889
+        // phpcs:enable
3890 3890
         global $conf;
3891 3891
 
3892 3892
         // load the library necessary to check the professional identifiers
@@ -3931,7 +3931,7 @@  discard block
 block discarded – undo
3931 3931
         return $ok;
3932 3932
     }
3933 3933
 
3934
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3934
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3935 3935
     /**
3936 3936
      *   Return an url to check online a professional id or empty string
3937 3937
      *
@@ -3942,7 +3942,7 @@  discard block
 block discarded – undo
3942 3942
      */
3943 3943
     public function id_prof_url($idprof, $thirdparty)
3944 3944
     {
3945
-		// phpcs:enable
3945
+        // phpcs:enable
3946 3946
         global $conf, $langs, $hookmanager;
3947 3947
 
3948 3948
         $url = '';
@@ -3987,7 +3987,7 @@  discard block
 block discarded – undo
3987 3987
         return '';
3988 3988
     }
3989 3989
 
3990
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3990
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3991 3991
     /**
3992 3992
      *   Indicates if the company has projects
3993 3993
      *
@@ -3995,7 +3995,7 @@  discard block
 block discarded – undo
3995 3995
      */
3996 3996
     public function has_projects()
3997 3997
     {
3998
-		// phpcs:enable
3998
+        // phpcs:enable
3999 3999
         $sql = "SELECT COUNT(*) as numproj FROM " . MAIN_DB_PREFIX . "projet WHERE fk_soc = " . ((int) $this->id);
4000 4000
         $resql = $this->db->query($sql);
4001 4001
         if ($resql) {
@@ -4086,7 +4086,7 @@  discard block
 block discarded – undo
4086 4086
         return isInEEC($this);
4087 4087
     }
4088 4088
 
4089
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4089
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4090 4090
     /**
4091 4091
      *  Load the list of provider categories
4092 4092
      *
@@ -4094,7 +4094,7 @@  discard block
 block discarded – undo
4094 4094
      */
4095 4095
     public function LoadSupplierCateg()
4096 4096
     {
4097
-		// phpcs:enable
4097
+        // phpcs:enable
4098 4098
         $this->SupplierCategories = array();
4099 4099
         $sql = "SELECT rowid, label";
4100 4100
         $sql .= " FROM " . MAIN_DB_PREFIX . "categorie";
@@ -4111,7 +4111,7 @@  discard block
 block discarded – undo
4111 4111
         }
4112 4112
     }
4113 4113
 
4114
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4114
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4115 4115
     /**
4116 4116
      *  Insert link supplier - category
4117 4117
      *
@@ -4120,7 +4120,7 @@  discard block
 block discarded – undo
4120 4120
      */
4121 4121
     public function AddFournisseurInCategory($categorie_id)
4122 4122
     {
4123
-		// phpcs:enable
4123
+        // phpcs:enable
4124 4124
         if ($categorie_id > 0 && $this->id > 0) {
4125 4125
             $sql = "INSERT INTO " . MAIN_DB_PREFIX . "categorie_fournisseur (fk_categorie, fk_soc) ";
4126 4126
             $sql .= " VALUES (" . ((int) $categorie_id) . ", " . ((int) $this->id) . ")";
@@ -4240,7 +4240,7 @@  discard block
 block discarded – undo
4240 4240
         return 0;
4241 4241
     }
4242 4242
 
4243
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4243
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4244 4244
     /**
4245 4245
      *  Create a third party into database from a member object
4246 4246
      *
@@ -4252,7 +4252,7 @@  discard block
 block discarded – undo
4252 4252
      */
4253 4253
     public function create_from_member(Adherent $member, $socname = '', $socalias = '', $customercode = '')
4254 4254
     {
4255
-		// phpcs:enable
4255
+        // phpcs:enable
4256 4256
         global $conf, $user, $langs;
4257 4257
 
4258 4258
         dol_syslog(get_class($this) . "::create_from_member", LOG_DEBUG);
@@ -4619,7 +4619,7 @@  discard block
 block discarded – undo
4619 4619
         return $this->LibProspLevel($this->fk_prospectlevel);
4620 4620
     }
4621 4621
 
4622
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4622
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4623 4623
     /**
4624 4624
      *  Return label of prospect level
4625 4625
      *
@@ -4628,7 +4628,7 @@  discard block
 block discarded – undo
4628 4628
      */
4629 4629
     public function LibProspLevel($fk_prospectlevel)
4630 4630
     {
4631
-		// phpcs:enable
4631
+        // phpcs:enable
4632 4632
         global $langs;
4633 4633
 
4634 4634
         $label = '';
@@ -4655,7 +4655,7 @@  discard block
 block discarded – undo
4655 4655
         return $this->LibProspCommStatut($this->stcomm_id, $mode, $label, $this->stcomm_picto);
4656 4656
     }
4657 4657
 
4658
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4658
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4659 4659
     /**
4660 4660
      *  Return label of a given status
4661 4661
      *
@@ -4671,7 +4671,7 @@  discard block
 block discarded – undo
4671 4671
      */
4672 4672
     public function LibProspCommStatut($status, $mode = 0, $label = '', $picto = '')
4673 4673
     {
4674
-		// phpcs:enable
4674
+        // phpcs:enable
4675 4675
         global $langs;
4676 4676
 
4677 4677
         $langs->load('customers');
@@ -4914,7 +4914,7 @@  discard block
 block discarded – undo
4914 4914
         return $this->LibCustProspStatut($this->client);
4915 4915
     }
4916 4916
 
4917
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4917
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4918 4918
     /**
4919 4919
      *  Return the label of the customer/prospect status
4920 4920
      *
@@ -4923,7 +4923,7 @@  discard block
 block discarded – undo
4923 4923
      */
4924 4924
     public function LibCustProspStatut($status)
4925 4925
     {
4926
-		// phpcs:enable
4926
+        // phpcs:enable
4927 4927
         global $langs;
4928 4928
         $langs->load('companies');
4929 4929
 
Please login to merge, or discard this patch.
Dolibarr/Code/Projet/Api/Tasks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             if ($search_sale == -2) {
105 105
                 $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
106 106
             } elseif ($search_sale > 0) {
107
-                $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")";
107
+                $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")";
108 108
             }
109 109
         }
110 110
         // Add sql filters
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
             }
499 499
             if ($field == 'array_options' && is_array($value)) {
500 500
                 foreach ($value as $index => $val) {
501
-                    $this->task->array_options[$index] = $this->_checkValForAPI($field, $val, $this->task);;
501
+                    $this->task->array_options[$index] = $this->_checkValForAPI($field, $val, $this->task); ;
502 502
                 }
503 503
                 continue;
504 504
             }
Please login to merge, or discard this patch.
Dolibarr/Code/Product/Api/Products.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
         // Select products of given category
341 341
         if ($category > 0) {
342
-            $sql .= " AND c.fk_categorie = " . ((int)$category);
342
+            $sql .= " AND c.fk_categorie = " . ((int) $category);
343 343
             $sql .= " AND c.fk_product = t.rowid";
344 344
         }
345 345
         if ($mode == 1) {
@@ -418,9 +418,9 @@  discard block
 block discarded – undo
418 418
 
419 419
             $obj_ret['data'] = $tmp;
420 420
             $obj_ret['pagination'] = array(
421
-                'total' => (int)$total,
421
+                'total' => (int) $total,
422 422
                 'page' => $page, //count starts from 0
423
-                'page_count' => ceil((int)$total / $limit),
423
+                'page_count' => ceil((int) $total / $limit),
424 424
                 'limit' => $limit
425 425
             );
426 426
         }
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
         if ($result <= 0) {
1000 1000
             throw new RestException(500, "Error updating buy price : " . $this->db->lasterror());
1001 1001
         }
1002
-        return (int)$this->productsupplier->product_fourn_price_id;
1002
+        return (int) $this->productsupplier->product_fourn_price_id;
1003 1003
     }
1004 1004
 
1005 1005
     /**
@@ -1082,15 +1082,15 @@  discard block
 block discarded – undo
1082 1082
         $sql .= ' WHERE t.entity IN (' . getEntity('product') . ')';
1083 1083
 
1084 1084
         if ($supplier > 0) {
1085
-            $sql .= " AND s.fk_soc = " . ((int)$supplier);
1085
+            $sql .= " AND s.fk_soc = " . ((int) $supplier);
1086 1086
         }
1087 1087
         if ($socid > 0) {   // if external user
1088
-            $sql .= " AND s.fk_soc = " . ((int)$socid);
1088
+            $sql .= " AND s.fk_soc = " . ((int) $socid);
1089 1089
         }
1090 1090
         $sql .= " AND s.fk_product = t.rowid";
1091 1091
         // Select products of given category
1092 1092
         if ($category > 0) {
1093
-            $sql .= " AND c.fk_categorie = " . ((int)$category);
1093
+            $sql .= " AND c.fk_categorie = " . ((int) $category);
1094 1094
             $sql .= " AND c.fk_product = t.rowid";
1095 1095
         }
1096 1096
         if ($mode == 1) {
@@ -1285,7 +1285,7 @@  discard block
 block discarded – undo
1285 1285
         }
1286 1286
 
1287 1287
         $prodattr = new ProductAttribute($this->db);
1288
-        $result = $prodattr->fetch((int)$id);
1288
+        $result = $prodattr->fetch((int) $id);
1289 1289
 
1290 1290
         if ($result < 0) {
1291 1291
             throw new RestException(404, "Product attribute not found");
@@ -1301,11 +1301,11 @@  discard block
 block discarded – undo
1301 1301
 
1302 1302
         $sql = "SELECT COUNT(*) as nb FROM " . $this->db->prefix() . "product_attribute_combination2val as pac2v";
1303 1303
         $sql .= " JOIN " . $this->db->prefix() . "product_attribute_combination as pac ON pac2v.fk_prod_combination = pac.rowid";
1304
-        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int)$prodattr->id) . " AND pac.entity IN (" . getEntity('product') . ")";
1304
+        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int) $prodattr->id) . " AND pac.entity IN (" . getEntity('product') . ")";
1305 1305
 
1306 1306
         $resql = $this->db->query($sql);
1307 1307
         $obj = $this->db->fetch_object($resql);
1308
-        $prodattr->is_used_by_products = (int)$obj->nb;
1308
+        $prodattr->is_used_by_products = (int) $obj->nb;
1309 1309
 
1310 1310
         return $this->_cleanObjectDatas($prodattr);
1311 1311
     }
@@ -1350,12 +1350,12 @@  discard block
 block discarded – undo
1350 1350
 
1351 1351
         $sql = "SELECT COUNT(*) as nb FROM " . $this->db->prefix() . "product_attribute_combination2val as pac2v";
1352 1352
         $sql .= " JOIN " . $this->db->prefix() . "product_attribute_combination as pac ON pac2v.fk_prod_combination = pac.rowid";
1353
-        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int)$result->rowid) . " AND pac.entity IN (" . getEntity('product') . ")";
1353
+        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int) $result->rowid) . " AND pac.entity IN (" . getEntity('product') . ")";
1354 1354
 
1355 1355
         $resql = $this->db->query($sql);
1356 1356
         $obj = $this->db->fetch_object($resql);
1357 1357
 
1358
-        $attr["is_used_by_products"] = (int)$obj->nb;
1358
+        $attr["is_used_by_products"] = (int) $obj->nb;
1359 1359
 
1360 1360
         return $attr;
1361 1361
     }
@@ -1400,12 +1400,12 @@  discard block
 block discarded – undo
1400 1400
 
1401 1401
         $sql = "SELECT COUNT(*) as nb FROM " . $this->db->prefix() . "product_attribute_combination2val as pac2v";
1402 1402
         $sql .= " JOIN " . $this->db->prefix() . "product_attribute_combination as pac ON pac2v.fk_prod_combination = pac.rowid";
1403
-        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int)$result->rowid) . " AND pac.entity IN (" . getEntity('product') . ")";
1403
+        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int) $result->rowid) . " AND pac.entity IN (" . getEntity('product') . ")";
1404 1404
 
1405 1405
         $resql = $this->db->query($sql);
1406 1406
         $obj = $this->db->fetch_object($resql);
1407 1407
 
1408
-        $attr["is_used_by_products"] = (int)$obj->nb;
1408
+        $attr["is_used_by_products"] = (int) $obj->nb;
1409 1409
 
1410 1410
         return $attr;
1411 1411
     }
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
 
1464 1464
         $prodattr = new ProductAttribute($this->db);
1465 1465
 
1466
-        $result = $prodattr->fetch((int)$id);
1466
+        $result = $prodattr->fetch((int) $id);
1467 1467
         if ($result == 0) {
1468 1468
             throw new RestException(404, 'Attribute not found');
1469 1469
         } elseif ($result < 0) {
@@ -1484,7 +1484,7 @@  discard block
 block discarded – undo
1484 1484
         }
1485 1485
 
1486 1486
         if ($prodattr->update(DolibarrApiAccess::$user) > 0) {
1487
-            $result = $prodattr->fetch((int)$id);
1487
+            $result = $prodattr->fetch((int) $id);
1488 1488
             if ($result == 0) {
1489 1489
                 throw new RestException(404, 'Attribute not found');
1490 1490
             } elseif ($result < 0) {
@@ -1514,7 +1514,7 @@  discard block
 block discarded – undo
1514 1514
         }
1515 1515
 
1516 1516
         $prodattr = new ProductAttribute($this->db);
1517
-        $prodattr->id = (int)$id;
1517
+        $prodattr->id = (int) $id;
1518 1518
         $result = $prodattr->delete(DolibarrApiAccess::$user);
1519 1519
 
1520 1520
         if ($result <= 0) {
@@ -1580,7 +1580,7 @@  discard block
 block discarded – undo
1580 1580
             throw new RestException(403);
1581 1581
         }
1582 1582
 
1583
-        $sql = "SELECT rowid, fk_product_attribute, ref, value FROM " . $this->db->prefix() . "product_attribute_value WHERE rowid = " . (int)$id . " AND entity IN (" . getEntity('product') . ")";
1583
+        $sql = "SELECT rowid, fk_product_attribute, ref, value FROM " . $this->db->prefix() . "product_attribute_value WHERE rowid = " . (int) $id . " AND entity IN (" . getEntity('product') . ")";
1584 1584
 
1585 1585
         $query = $this->db->query($sql);
1586 1586
 
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
         $ref = trim($ref);
1625 1625
 
1626 1626
         $sql = "SELECT rowid, fk_product_attribute, ref, value FROM " . $this->db->prefix() . "product_attribute_value";
1627
-        $sql .= " WHERE ref LIKE '" . $this->db->escape($ref) . "' AND fk_product_attribute = " . ((int)$id) . " AND entity IN (" . getEntity('product') . ")";
1627
+        $sql .= " WHERE ref LIKE '" . $this->db->escape($ref) . "' AND fk_product_attribute = " . ((int) $id) . " AND entity IN (" . getEntity('product') . ")";
1628 1628
 
1629 1629
         $query = $this->db->query($sql);
1630 1630
 
@@ -1667,7 +1667,7 @@  discard block
 block discarded – undo
1667 1667
         $ref = trim($ref);
1668 1668
 
1669 1669
         $sql = "SELECT rowid FROM " . $this->db->prefix() . "product_attribute_value";
1670
-        $sql .= " WHERE ref LIKE '" . $this->db->escape($ref) . "' AND fk_product_attribute = " . ((int)$id) . " AND entity IN (" . getEntity('product') . ")";
1670
+        $sql .= " WHERE ref LIKE '" . $this->db->escape($ref) . "' AND fk_product_attribute = " . ((int) $id) . " AND entity IN (" . getEntity('product') . ")";
1671 1671
         $query = $this->db->query($sql);
1672 1672
 
1673 1673
         if (!$query) {
@@ -1709,7 +1709,7 @@  discard block
 block discarded – undo
1709 1709
 
1710 1710
         $objectval = new ProductAttributeValue($this->db);
1711 1711
 
1712
-        $return = $objectval->fetchAllByProductAttribute((int)$id);
1712
+        $return = $objectval->fetchAllByProductAttribute((int) $id);
1713 1713
 
1714 1714
         if (count($return) == 0) {
1715 1715
             throw new RestException(404, 'Attribute values not found');
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
         }
1786 1786
 
1787 1787
         $objectval = new ProductAttributeValue($this->db);
1788
-        $objectval->fk_product_attribute = ((int)$id);
1788
+        $objectval->fk_product_attribute = ((int) $id);
1789 1789
         $objectval->ref = $ref;
1790 1790
         $objectval->value = $value;
1791 1791
 
@@ -1814,7 +1814,7 @@  discard block
 block discarded – undo
1814 1814
         }
1815 1815
 
1816 1816
         $objectval = new ProductAttributeValue($this->db);
1817
-        $result = $objectval->fetch((int)$id);
1817
+        $result = $objectval->fetch((int) $id);
1818 1818
 
1819 1819
         if ($result == 0) {
1820 1820
             throw new RestException(404, 'Attribute value not found');
@@ -1836,7 +1836,7 @@  discard block
 block discarded – undo
1836 1836
         }
1837 1837
 
1838 1838
         if ($objectval->update(DolibarrApiAccess::$user) > 0) {
1839
-            $result = $objectval->fetch((int)$id);
1839
+            $result = $objectval->fetch((int) $id);
1840 1840
             if ($result == 0) {
1841 1841
                 throw new RestException(404, 'Attribute not found');
1842 1842
             } elseif ($result < 0) {
@@ -1866,7 +1866,7 @@  discard block
 block discarded – undo
1866 1866
         }
1867 1867
 
1868 1868
         $objectval = new ProductAttributeValue($this->db);
1869
-        $objectval->id = (int)$id;
1869
+        $objectval->id = (int) $id;
1870 1870
 
1871 1871
         if ($objectval->delete(DolibarrApiAccess::$user) > 0) {
1872 1872
             return 1;
@@ -1893,16 +1893,16 @@  discard block
 block discarded – undo
1893 1893
         }
1894 1894
 
1895 1895
         $prodcomb = new ProductCombination($this->db);
1896
-        $combinations = $prodcomb->fetchAllByFkProductParent((int)$id);
1896
+        $combinations = $prodcomb->fetchAllByFkProductParent((int) $id);
1897 1897
 
1898 1898
         foreach ($combinations as $key => $combination) {
1899 1899
             $prodc2vp = new ProductCombination2ValuePair($this->db);
1900
-            $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int)$combination->id);
1900
+            $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id);
1901 1901
             $combinations[$key] = $this->_cleanObjectDatas($combinations[$key]);
1902 1902
 
1903 1903
             if (!empty($includestock) && DolibarrApiAccess::$user->hasRight('stock', 'lire')) {
1904 1904
                 $productModel = new Product($this->db);
1905
-                $productModel->fetch((int)$combination->fk_product_child);
1905
+                $productModel->fetch((int) $combination->fk_product_child);
1906 1906
                 $productModel->load_stock($includestock);
1907 1907
                 $combinations[$key]->stock_warehouse = $this->_cleanObjectDatas($productModel)->stock_warehouse;
1908 1908
             }
@@ -1934,11 +1934,11 @@  discard block
 block discarded – undo
1934 1934
         }
1935 1935
 
1936 1936
         $prodcomb = new ProductCombination($this->db);
1937
-        $combinations = $prodcomb->fetchAllByFkProductParent((int)$this->product->id);
1937
+        $combinations = $prodcomb->fetchAllByFkProductParent((int) $this->product->id);
1938 1938
 
1939 1939
         foreach ($combinations as $key => $combination) {
1940 1940
             $prodc2vp = new ProductCombination2ValuePair($this->db);
1941
-            $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int)$combination->id);
1941
+            $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id);
1942 1942
             $combinations[$key] = $this->_cleanObjectDatas($combinations[$key]);
1943 1943
         }
1944 1944
 
@@ -1985,15 +1985,15 @@  discard block
 block discarded – undo
1985 1985
         $prodattr = new ProductAttribute($this->db);
1986 1986
         $prodattr_val = new ProductAttributeValue($this->db);
1987 1987
         foreach ($features as $id_attr => $id_value) {
1988
-            if ($prodattr->fetch((int)$id_attr) < 0) {
1988
+            if ($prodattr->fetch((int) $id_attr) < 0) {
1989 1989
                 throw new RestException(400, 'Invalid attribute ID: ' . $id_attr);
1990 1990
             }
1991
-            if ($prodattr_val->fetch((int)$id_value) < 0) {
1991
+            if ($prodattr_val->fetch((int) $id_value) < 0) {
1992 1992
                 throw new RestException(400, 'Invalid attribute value ID: ' . $id_value);
1993 1993
             }
1994 1994
         }
1995 1995
 
1996
-        $result = $this->product->fetch((int)$id);
1996
+        $result = $this->product->fetch((int) $id);
1997 1997
         if (!$result) {
1998 1998
             throw new RestException(404, 'Product not found');
1999 1999
         }
@@ -2042,10 +2042,10 @@  discard block
 block discarded – undo
2042 2042
         $prodattr = new ProductAttribute($this->db);
2043 2043
         $prodattr_val = new ProductAttributeValue($this->db);
2044 2044
         foreach ($features as $id_attr => $id_value) {
2045
-            if ($prodattr->fetch((int)$id_attr) < 0) {
2045
+            if ($prodattr->fetch((int) $id_attr) < 0) {
2046 2046
                 throw new RestException(404);
2047 2047
             }
2048
-            if ($prodattr_val->fetch((int)$id_value) < 0) {
2048
+            if ($prodattr_val->fetch((int) $id_value) < 0) {
2049 2049
                 throw new RestException(404);
2050 2050
             }
2051 2051
         }
@@ -2089,7 +2089,7 @@  discard block
 block discarded – undo
2089 2089
         }
2090 2090
 
2091 2091
         $prodcomb = new ProductCombination($this->db);
2092
-        $prodcomb->fetch((int)$id);
2092
+        $prodcomb->fetch((int) $id);
2093 2093
 
2094 2094
         foreach ($request_data as $field => $value) {
2095 2095
             if ($field == 'rowid') {
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
         }
2130 2130
 
2131 2131
         $prodcomb = new ProductCombination($this->db);
2132
-        $prodcomb->id = (int)$id;
2132
+        $prodcomb->id = (int) $id;
2133 2133
         $result = $prodcomb->delete(DolibarrApiAccess::$user);
2134 2134
         if ($result <= 0) {
2135 2135
             throw new RestException(500, "Error deleting variant");
Please login to merge, or discard this patch.
Dolibarr/Code/Core/Classes/CommonInvoice.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public $revenuestamp;
101 101
 
102
-    public $totalpaid;          // duplicate with sumpayed
103
-    public $totaldeposits;      // duplicate with sumdeposit
104
-    public $totalcreditnotes;   // duplicate with sumcreditnote
102
+    public $totalpaid; // duplicate with sumpayed
103
+    public $totaldeposits; // duplicate with sumdeposit
104
+    public $totalcreditnotes; // duplicate with sumcreditnote
105 105
 
106 106
     public $sumpayed;
107 107
     public $sumpayed_multicurrency;
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
 
1142 1142
         if ($this->status > self::STATUS_DRAFT && $this->paye == 0) {
1143 1143
             // Get the default payment mode for BAN payment of the third party
1144
-            $bac = new CompanyBankAccount($this->db);   // Table societe_rib
1144
+            $bac = new CompanyBankAccount($this->db); // Table societe_rib
1145 1145
             $result = $bac->fetch(0, '', $this->socid, 1, 'ban');
1146 1146
             if ($result <= 0 || empty($bac->id)) {
1147 1147
                 $this->error = $langs->trans("ThirdpartyHasNoDefaultBanAccount");
@@ -1155,16 +1155,16 @@  discard block
 block discarded – undo
1155 1155
             $sql .= " FROM " . $this->db->prefix() . "prelevement_demande";
1156 1156
             $sql .= " WHERE rowid = " . ((int) $did);
1157 1157
             if ($type != 'bank-transfer' && $type != 'credit-transfer') {
1158
-                $sql .= " AND fk_facture = " . ((int) $this->id);             // Add a protection to not pay another invoice than current one
1158
+                $sql .= " AND fk_facture = " . ((int) $this->id); // Add a protection to not pay another invoice than current one
1159 1159
             }
1160 1160
             if ($type != 'direct-debit') {
1161 1161
                 if ($sourcetype == 'salary') {
1162
-                    $sql .= " AND fk_salary = " . ((int) $this->id);          // Add a protection to not pay another salary than current one
1162
+                    $sql .= " AND fk_salary = " . ((int) $this->id); // Add a protection to not pay another salary than current one
1163 1163
                 } else {
1164
-                    $sql .= " AND fk_facture_fourn = " . ((int) $this->id);   // Add a protection to not pay another invoice than current one
1164
+                    $sql .= " AND fk_facture_fourn = " . ((int) $this->id); // Add a protection to not pay another invoice than current one
1165 1165
                 }
1166 1166
             }
1167
-            $sql .= " AND traite = 0";  // To not process payment request that were already converted into a direct debit or credit transfer order (Note: fk_prelevement_bons is also empty when traite = 0)
1167
+            $sql .= " AND traite = 0"; // To not process payment request that were already converted into a direct debit or credit transfer order (Note: fk_prelevement_bons is also empty when traite = 0)
1168 1168
 
1169 1169
             dol_syslog(get_class($this) . "::makeStripeSepaRequest load requests to process", LOG_DEBUG);
1170 1170
             $resql = $this->db->query($sql);
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 
1181 1181
                 if (is_numeric($amount) && $amount != 0) {
1182 1182
                     require_once constant('DOL_DOCUMENT_ROOT') . '/societe/class/companypaymentmode.class.php';
1183
-                    $companypaymentmode = new CompanyPaymentMode($this->db);    // table societe_rib
1183
+                    $companypaymentmode = new CompanyPaymentMode($this->db); // table societe_rib
1184 1184
                     $companypaymentmode->fetch($bac->id);
1185 1185
 
1186 1186
                     $this->stripechargedone = 0;
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
 
1191 1191
                     $currency = $conf->currency;
1192 1192
 
1193
-                    $errorforinvoice = 0;     // We reset the $errorforinvoice at each invoice loop
1193
+                    $errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop
1194 1194
 
1195 1195
                     $this->fetch_thirdparty();
1196 1196
 
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
                         $amountstripe = $amountstripe * 100;
1210 1210
                     }
1211 1211
 
1212
-                    $fk_bank_account = getDolGlobalInt('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');     // Bank account used for SEPA direct debit or credit transfer. Must be the Stripe account in Dolibarr.
1212
+                    $fk_bank_account = getDolGlobalInt('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'); // Bank account used for SEPA direct debit or credit transfer. Must be the Stripe account in Dolibarr.
1213 1213
                     if (!($fk_bank_account > 0)) {
1214 1214
                         $error++;
1215 1215
                         $errorforinvoice++;
@@ -1270,7 +1270,7 @@  discard block
 block discarded – undo
1270 1270
                                 $thirdparty = new Societe($this->db);
1271 1271
                                 $resultthirdparty = $thirdparty->fetch($this->socid);
1272 1272
 
1273
-                                include_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php';        // This include the include of htdocs/stripe/config.php
1273
+                                include_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php
1274 1274
                                 // So it inits or erases the $stripearrayofkeysbyenv
1275 1275
                                 $stripe = new Stripe($this->db);
1276 1276
 
@@ -1283,26 +1283,26 @@  discard block
 block discarded – undo
1283 1283
                                 $foundalternativestripeaccount = '';
1284 1284
 
1285 1285
                                 // Force stripe to another value (by default this value is empty)
1286
-                                if (! empty($forcestripe)) {
1286
+                                if (!empty($forcestripe)) {
1287 1287
                                     dol_syslog("makeStripeSepaRequest A dedicated stripe account was forced, so we switch to it.");
1288 1288
 
1289 1289
                                     $tmparray = explode('@', $forcestripe);
1290
-                                    if (! empty($tmparray[1])) {
1290
+                                    if (!empty($tmparray[1])) {
1291 1291
                                         $tmparray2 = explode(':', $tmparray[1]);
1292
-                                        if (! empty($tmparray2[1])) {
1292
+                                        if (!empty($tmparray2[1])) {
1293 1293
                                             $stripearrayofkeysbyenv[$servicestatus]["publishable_key"] = $tmparray2[0];
1294 1294
                                             $stripearrayofkeysbyenv[$servicestatus]["secret_key"] = $tmparray2[1];
1295 1295
 
1296 1296
                                             $stripearrayofkeys = $stripearrayofkeysbyenv[$servicestatus];
1297 1297
                                             \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']);
1298 1298
 
1299
-                                            $foundalternativestripeaccount = $tmparray[0];    // Store the customer id
1299
+                                            $foundalternativestripeaccount = $tmparray[0]; // Store the customer id
1300 1300
 
1301 1301
                                             dol_syslog("makeStripeSepaRequest We use now customer=" . $foundalternativestripeaccount . " publishable_key=" . $stripearrayofkeys['publishable_key'], LOG_DEBUG);
1302 1302
                                         }
1303 1303
                                     }
1304 1304
 
1305
-                                    if (! $foundalternativestripeaccount) {
1305
+                                    if (!$foundalternativestripeaccount) {
1306 1306
                                         $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv;
1307 1307
 
1308 1308
                                         $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus];
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
                                     dol_syslog("makeStripeSepaRequest No dedicated Stripe Account requested, so we use global one, so " . $stripearrayofkeys['publishable_key'], LOG_DEBUG);
1318 1318
                                 }
1319 1319
 
1320
-                                $stripeacc = $stripe->getStripeAccount($service, $this->socid);                             // Get Stripe OAuth connect account if it exists (no network access here)
1320
+                                $stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here)
1321 1321
 
1322 1322
                                 if ($foundalternativestripeaccount) {
1323 1323
                                     if (empty($stripeacc)) {                // If the Stripe connect account not set, we use common API usage
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
                                     }
1328 1328
                                 } else {
1329 1329
                                     $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0);
1330
-                                    if (empty($customer) && ! empty($stripe->error)) {
1330
+                                    if (empty($customer) && !empty($stripe->error)) {
1331 1331
                                         $this->errors[] = $stripe->error;
1332 1332
                                     }
1333 1333
                                     /*if (!empty($customer) && empty($customer->sources)) {
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
                                                 $charge->failure_message = $stripe->error;
1384 1384
                                                 $charge->failure_declinecode = $stripe->declinecode;
1385 1385
                                                 $stripefailurecode = $stripe->code;
1386
-                                                $stripefailuremessage = 'Action required. Contact the support at ';// . $conf->global->SELLYOURSAAS_MAIN_EMAIL;
1386
+                                                $stripefailuremessage = 'Action required. Contact the support at '; // . $conf->global->SELLYOURSAAS_MAIN_EMAIL;
1387 1387
                                                 $stripefailuredeclinecode = $stripe->declinecode;
1388 1388
                                             } else {
1389 1389
                                                 dol_syslog(var_export($paymentintent, true), LOG_DEBUG);
@@ -1523,18 +1523,18 @@  discard block
 block discarded – undo
1523 1523
                                     // Insert record of payment (success or error)
1524 1524
                                     $actioncomm = new ActionComm($this->db);
1525 1525
 
1526
-                                    $actioncomm->type_code = 'AC_OTH_AUTO';     // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
1526
+                                    $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
1527 1527
                                     $actioncomm->code = 'AC_' . $actioncode;
1528 1528
                                     $actioncomm->label = $description;
1529 1529
                                     $actioncomm->note_private = implode(",\n", $postactionmessages);
1530 1530
                                     $actioncomm->fk_project = $this->fk_project;
1531 1531
                                     $actioncomm->datep = $now;
1532 1532
                                     $actioncomm->datef = $now;
1533
-                                    $actioncomm->percentage = -1;   // Not applicable
1533
+                                    $actioncomm->percentage = -1; // Not applicable
1534 1534
                                     $actioncomm->socid = $thirdparty->id;
1535 1535
                                     $actioncomm->contactid = 0;
1536
-                                    $actioncomm->authorid = $user->id;   // User saving action
1537
-                                    $actioncomm->userownerid = $user->id;   // Owner of action
1536
+                                    $actioncomm->authorid = $user->id; // User saving action
1537
+                                    $actioncomm->userownerid = $user->id; // Owner of action
1538 1538
                                     // Fields when action is a real email (content is already into note)
1539 1539
                                     /*$actioncomm->email_msgid = $object->email_msgid;
1540 1540
                                      $actioncomm->email_from  = $object->email_from;
@@ -1670,10 +1670,10 @@  discard block
 block discarded – undo
1670 1670
 
1671 1671
         // Add the standard elements to the QR code
1672 1672
         $lines = [
1673
-            'BCD',  // Service Tag (optional)
1674
-            '002',  // Version (optional)
1675
-            '1',    // Character set (optional)
1676
-            'SCT',  // Identification (optional)
1673
+            'BCD', // Service Tag (optional)
1674
+            '002', // Version (optional)
1675
+            '1', // Character set (optional)
1676
+            'SCT', // Identification (optional)
1677 1677
         ];
1678 1678
 
1679 1679
         // Add the bank account information
@@ -1746,10 +1746,10 @@  discard block
 block discarded – undo
1746 1746
         $s .= pack('C1', 3) . pack('C1', strlen($datestring)) . $datestring;
1747 1747
         $s .= pack('C1', 4) . pack('C1', strlen($pricewithtaxstring)) . $pricewithtaxstring;
1748 1748
         $s .= pack('C1', 5) . pack('C1', strlen($pricetaxstring)) . $pricetaxstring;
1749
-        $s .= '';                   // Hash of xml invoice
1750
-        $s .= '';                   // ecda signature
1751
-        $s .= '';                   // ecda public key
1752
-        $s .= '';                   // ecda signature of public key stamp
1749
+        $s .= ''; // Hash of xml invoice
1750
+        $s .= ''; // ecda signature
1751
+        $s .= ''; // ecda public key
1752
+        $s .= ''; // ecda signature of public key stamp
1753 1753
 
1754 1754
         $s = base64_encode($s);
1755 1755
 
@@ -1816,8 +1816,8 @@  discard block
 block discarded – undo
1816 1816
             $s .= "S\n";
1817 1817
             $s .= dol_trunc($bankaccount->proprio, 70, 'right', 'UTF-8', 1) . "\n";
1818 1818
             $addresslinearray = explode("\n", $bankaccount->owner_address);
1819
-            $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1) . "\n";     // address line 1
1820
-            $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1) . "\n";     // address line 2
1819
+            $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1) . "\n"; // address line 1
1820
+            $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1) . "\n"; // address line 2
1821 1821
             /*$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n";
1822 1822
             $s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n";
1823 1823
             $s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";*/
@@ -1825,8 +1825,8 @@  discard block
 block discarded – undo
1825 1825
             $s .= "S\n";
1826 1826
             $s .= dol_trunc($mysoc->name, 70, 'right', 'UTF-8', 1) . "\n";
1827 1827
             $addresslinearray = explode("\n", $mysoc->address);
1828
-            $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1) . "\n";     // address line 1
1829
-            $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1) . "\n";     // address line 2
1828
+            $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1) . "\n"; // address line 1
1829
+            $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1) . "\n"; // address line 2
1830 1830
             $s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1) . "\n";
1831 1831
             $s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1) . "\n";
1832 1832
             $s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1) . "\n";
@@ -1846,14 +1846,14 @@  discard block
 block discarded – undo
1846 1846
         $s .= "S\n";
1847 1847
         $s .= dol_trunc($this->thirdparty->name, 70, 'right', 'UTF-8', 1) . "\n";
1848 1848
         $addresslinearray = explode("\n", $this->thirdparty->address);
1849
-        $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1) . "\n";     // address line 1
1850
-        $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1) . "\n";     // address line 2
1849
+        $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1) . "\n"; // address line 1
1850
+        $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1) . "\n"; // address line 2
1851 1851
         $s .= dol_trunc($this->thirdparty->zip, 16, 'right', 'UTF-8', 1) . "\n";
1852 1852
         $s .= dol_trunc($this->thirdparty->town, 35, 'right', 'UTF-8', 1) . "\n";
1853 1853
         $s .= dol_trunc($this->thirdparty->country_code, 2, 'right', 'UTF-8', 1) . "\n";
1854 1854
         // ID of payment
1855
-        $s .= "NON\n";          // NON or QRR
1856
-        $s .= "\n";             // QR Code reference if previous field is QRR
1855
+        $s .= "NON\n"; // NON or QRR
1856
+        $s .= "\n"; // QR Code reference if previous field is QRR
1857 1857
         // Free text
1858 1858
         if ($complementaryinfo) {
1859 1859
             $s .= $complementaryinfo . "\n";
Please login to merge, or discard this patch.
Dolibarr/Core/Base/DolibarrApi.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -240,8 +240,9 @@
 block discarded – undo
240 240
     public static function getModule($moduleName, $className)
241 241
     {
242 242
         $namespace = static::getModuleNamespace($moduleName, $className);
243
-        if (!is_dir)
244
-            dump(['namespace' => $namespace]);
243
+        if (!is_dir) {
244
+                    dump(['namespace' => $namespace]);
245
+        }
245 246
 
246 247
         return new $namespace();
247 248
     }
Please login to merge, or discard this patch.