@@ -274,12 +274,12 @@ discard block |
||
274 | 274 | /* |
275 | 275 | * No signature |
276 | 276 | */ |
277 | - const STATUS_NO_SIGNATURE = 0; |
|
277 | + const STATUS_NO_SIGNATURE = 0; |
|
278 | 278 | |
279 | 279 | /* |
280 | 280 | * Signed by sender |
281 | 281 | */ |
282 | - const STATUS_SIGNED_SENDER = 1; |
|
282 | + const STATUS_SIGNED_SENDER = 1; |
|
283 | 283 | |
284 | 284 | /* |
285 | 285 | * Signed by receiver |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | /* |
290 | 290 | * Signed by all |
291 | 291 | */ |
292 | - const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract) |
|
292 | + const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract) |
|
293 | 293 | |
294 | 294 | |
295 | 295 | /** |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | if (getDolGlobalString('CONTRACT_ADDON')) { |
320 | 320 | $mybool = false; |
321 | 321 | |
322 | - $file = getDolGlobalString('CONTRACT_ADDON') . ".php"; |
|
322 | + $file = getDolGlobalString('CONTRACT_ADDON').".php"; |
|
323 | 323 | $classname = getDolGlobalString('CONTRACT_ADDON'); |
324 | 324 | |
325 | 325 | // Include file with class |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | if ($contratline->statut != ContratLigne::STATUS_OPEN) { |
430 | 430 | $contratline->context = $this->context; |
431 | 431 | |
432 | - $result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE |
|
432 | + $result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE |
|
433 | 433 | if ($result < 0) { |
434 | 434 | $error++; |
435 | 435 | $this->error = $contratline->error; |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | // Close lines not already closed |
480 | 480 | if ($contratline->statut != ContratLigne::STATUS_CLOSED) { |
481 | 481 | $contratline->date_end_real = $now; |
482 | - $contratline->date_cloture = $now; // For backward compatibility |
|
482 | + $contratline->date_cloture = $now; // For backward compatibility |
|
483 | 483 | $contratline->user_closing_id = $user->id; |
484 | 484 | $contratline->statut = ContratLigne::STATUS_CLOSED; |
485 | 485 | $result = $contratline->close_line($user, $now, $comment, $notrigger); |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | if (!$error) { |
619 | 619 | $this->ref = $num; |
620 | 620 | $this->status = self::STATUS_VALIDATED; |
621 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
621 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
622 | 622 | $this->date_validation = $now; |
623 | 623 | } |
624 | 624 | } else { |
@@ -888,10 +888,10 @@ discard block |
||
888 | 888 | $line->localtax2_tx = $objp->localtax2_tx; |
889 | 889 | $line->localtax1_type = $objp->localtax1_type; |
890 | 890 | $line->localtax2_type = $objp->localtax2_type; |
891 | - $line->subprice = $objp->subprice; |
|
891 | + $line->subprice = $objp->subprice; |
|
892 | 892 | $line->statut = $objp->status; |
893 | 893 | $line->status = $objp->status; |
894 | - $line->remise_percent = $objp->remise_percent; |
|
894 | + $line->remise_percent = $objp->remise_percent; |
|
895 | 895 | $line->price_ht = $objp->price_ht; |
896 | 896 | $line->price = $objp->price_ht; // For backward compatibility |
897 | 897 | $line->total_ht = $objp->total_ht; |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | //$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite); |
935 | 935 | //$line->date_fin_reel = $this->db->jdate($objp->date_cloture); |
936 | 936 | |
937 | - $line->rang = $objp->rang; |
|
937 | + $line->rang = $objp->rang; |
|
938 | 938 | |
939 | 939 | // Retrieve all extrafields for contract line |
940 | 940 | // fetch optionals attributes and labels |
@@ -1447,7 +1447,7 @@ discard block |
||
1447 | 1447 | } |
1448 | 1448 | |
1449 | 1449 | if (!$error) { |
1450 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
1450 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
1451 | 1451 | if ($result < 0) { |
1452 | 1452 | $error++; |
1453 | 1453 | } |
@@ -2083,7 +2083,7 @@ discard block |
||
2083 | 2083 | } |
2084 | 2084 | $datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1); |
2085 | 2085 | } |
2086 | - $datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer; |
|
2086 | + $datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer; |
|
2087 | 2087 | if (!$nofetch) { |
2088 | 2088 | $langs->load('project'); |
2089 | 2089 | if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) { |
@@ -2551,7 +2551,7 @@ discard block |
||
2551 | 2551 | global $user; |
2552 | 2552 | |
2553 | 2553 | $ticket = new Ticket($this->db); |
2554 | - $nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id)); |
|
2554 | + $nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id)); |
|
2555 | 2555 | |
2556 | 2556 | return ($nbTicket < 0 ? $nbTicket : $ticket->lines); |
2557 | 2557 | } |
@@ -2573,7 +2573,7 @@ discard block |
||
2573 | 2573 | global $conf, $langs; |
2574 | 2574 | |
2575 | 2575 | if (!dol_strlen($modele)) { |
2576 | - $modele = ''; // No doc template/generation by default |
|
2576 | + $modele = ''; // No doc template/generation by default |
|
2577 | 2577 | |
2578 | 2578 | if (!empty($this->model_pdf)) { |
2579 | 2579 | $modele = $this->model_pdf; |
@@ -2670,14 +2670,14 @@ discard block |
||
2670 | 2670 | } |
2671 | 2671 | } |
2672 | 2672 | |
2673 | - if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').".php")) { |
|
2673 | + if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').".php")) { |
|
2674 | 2674 | $this->error = 'ErrorSetupNotComplete'; |
2675 | 2675 | dol_syslog($this->error); |
2676 | 2676 | return -1; |
2677 | 2677 | } |
2678 | 2678 | |
2679 | 2679 | // Set ref |
2680 | - require_once DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').'.php'; |
|
2680 | + require_once DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').'.php'; |
|
2681 | 2681 | $obj = getDolGlobalString('CONTRACT_ADDON'); |
2682 | 2682 | $modContract = new $obj(); |
2683 | 2683 | '@phan-var-force CommonNumRefGenerator $modContrat'; |
@@ -2800,7 +2800,7 @@ discard block |
||
2800 | 2800 | |
2801 | 2801 | // Load contract |
2802 | 2802 | $object = new Contrat($this->db); |
2803 | - $object->fetch($obj->rowid); // fetch also lines |
|
2803 | + $object->fetch($obj->rowid); // fetch also lines |
|
2804 | 2804 | //$object->fetch_thirdparty(); |
2805 | 2805 | |
2806 | 2806 | if ($object->id <= 0) { |
@@ -2847,7 +2847,7 @@ discard block |
||
2847 | 2847 | if ($expirationdate && $expirationdate < $enddatetoscan) { |
2848 | 2848 | dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate); |
2849 | 2849 | $newdate = $expirationdate; |
2850 | - $protecti = 0; //$protecti is to avoid infinite loop |
|
2850 | + $protecti = 0; //$protecti is to avoid infinite loop |
|
2851 | 2851 | while ($newdate < $enddatetoscan && $protecti < 1000) { |
2852 | 2852 | $newdate = dol_time_plus_duree($newdate, $duration_value, $duration_unit); |
2853 | 2853 | $protecti++; |
@@ -2875,20 +2875,20 @@ discard block |
||
2875 | 2875 | |
2876 | 2876 | // Create an event |
2877 | 2877 | $actioncomm = new ActionComm($this->db); |
2878 | - $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
2878 | + $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
2879 | 2879 | $actioncomm->code = 'AC_'.$actioncode; |
2880 | 2880 | $actioncomm->label = $label; |
2881 | 2881 | $actioncomm->datep = $now; |
2882 | 2882 | $actioncomm->datef = $now; |
2883 | - $actioncomm->percentage = -1; // Not applicable |
|
2883 | + $actioncomm->percentage = -1; // Not applicable |
|
2884 | 2884 | $actioncomm->socid = $object->socid; |
2885 | - $actioncomm->authorid = $user->id; // User saving action |
|
2886 | - $actioncomm->userownerid = $user->id; // Owner of action |
|
2885 | + $actioncomm->authorid = $user->id; // User saving action |
|
2886 | + $actioncomm->userownerid = $user->id; // Owner of action |
|
2887 | 2887 | $actioncomm->fk_element = $object->id; |
2888 | 2888 | $actioncomm->elementtype = 'contract'; |
2889 | 2889 | $actioncomm->note_private = $comment; |
2890 | 2890 | |
2891 | - $ret = $actioncomm->create($user); // User creating action |
|
2891 | + $ret = $actioncomm->create($user); // User creating action |
|
2892 | 2892 | } else { |
2893 | 2893 | $contracterror[$object->id] = $object->ref; |
2894 | 2894 | |
@@ -2897,7 +2897,7 @@ discard block |
||
2897 | 2897 | $this->error = $this->db->lasterror(); |
2898 | 2898 | } |
2899 | 2899 | |
2900 | - if (! $errorforlocaltransaction) { |
|
2900 | + if (!$errorforlocaltransaction) { |
|
2901 | 2901 | $this->db->commit(); |
2902 | 2902 | } else { |
2903 | 2903 | $this->db->rollback(); |