Passed
Branch master (b77c0f)
by John
04:56
created
admin/subtotal_about.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 // Dolibarr environment
26 26
 $res = @include("../../main.inc.php"); // From htdocs directory
27 27
 if (! $res) {
28
-    $res = @include("../../../main.inc.php"); // From "custom" directory
28
+	$res = @include("../../../main.inc.php"); // From "custom" directory
29 29
 }
30 30
 
31 31
 // Libraries
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 // Access control
39 39
 if (! $user->admin) {
40
-    accessforbidden();
40
+	accessforbidden();
41 41
 }
42 42
 
43 43
 /*
@@ -48,17 +48,17 @@  discard block
 block discarded – undo
48 48
 
49 49
 // Subheader
50 50
 $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">'
51
-    . $langs->trans("BackToModuleList") . '</a>';
51
+	. $langs->trans("BackToModuleList") . '</a>';
52 52
 print_fiche_titre($langs->trans($page_name), $linkback);
53 53
 
54 54
 // Configuration header
55 55
 $head = subtotalAdminPrepareHead();
56 56
 dol_fiche_head(
57
-    $head,
58
-    'about',
59
-    $langs->trans("Module104777Name"),
60
-    0,
61
-    'subtotal@subtotal'
57
+	$head,
58
+	'about',
59
+	$langs->trans("Module104777Name"),
60
+	0,
61
+	'subtotal@subtotal'
62 62
 );
63 63
 
64 64
 // About page goes here
Please login to merge, or discard this patch.
script/import-from-milestone.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -56,33 +56,33 @@
 block discarded – undo
56 56
 	}
57 57
 
58 58
 
59
-        $res = $db->query("SELECT DISTINCT(fk_facture) as fk_facture FROM ".MAIN_DB_PREFIX."facturedet WHERE special_code=104777");
60
-        while($obj = $db->fetch_object($res)) {
61
-                $resLine = $db->query("SELECT rowid FROM  ".MAIN_DB_PREFIX."facturedet WHERE fk_facture=".$obj->fk_propal." ORDER BY rang ");
62
-                $k = 1;
63
-                while($objLine = $db->fetch_object($resLine)) {
59
+		$res = $db->query("SELECT DISTINCT(fk_facture) as fk_facture FROM ".MAIN_DB_PREFIX."facturedet WHERE special_code=104777");
60
+		while($obj = $db->fetch_object($res)) {
61
+				$resLine = $db->query("SELECT rowid FROM  ".MAIN_DB_PREFIX."facturedet WHERE fk_facture=".$obj->fk_propal." ORDER BY rang ");
62
+				$k = 1;
63
+				while($objLine = $db->fetch_object($resLine)) {
64 64
 
65
-                        $sql="UPDATE ".MAIN_DB_PREFIX."facturedet SET rang=".$k.",fk_parent_line=NULL WHERE rowid=".$objLine->rowid;
65
+						$sql="UPDATE ".MAIN_DB_PREFIX."facturedet SET rang=".$k.",fk_parent_line=NULL WHERE rowid=".$objLine->rowid;
66 66
 
67
-                         print $sql.";<br />";
68
-                        $k++;
69
-                }
67
+						 print $sql.";<br />";
68
+						$k++;
69
+				}
70 70
 
71
-        }
71
+		}
72 72
 
73
-        $res = $db->query("SELECT DISTINCT(fk_commande) as fk_commande FROM ".MAIN_DB_PREFIX."commandedet WHERE special_code=104777");
74
-        while($obj = $db->fetch_object($res)) {
75
-                $resLine = $db->query("SELECT rowid FROM  ".MAIN_DB_PREFIX."commandedet WHERE fk_commande=".$obj->fk_propal." ORDER BY rang ");
76
-                $k = 1;
77
-                while($objLine = $db->fetch_object($resLine)) {
73
+		$res = $db->query("SELECT DISTINCT(fk_commande) as fk_commande FROM ".MAIN_DB_PREFIX."commandedet WHERE special_code=104777");
74
+		while($obj = $db->fetch_object($res)) {
75
+				$resLine = $db->query("SELECT rowid FROM  ".MAIN_DB_PREFIX."commandedet WHERE fk_commande=".$obj->fk_propal." ORDER BY rang ");
76
+				$k = 1;
77
+				while($objLine = $db->fetch_object($resLine)) {
78 78
 
79
-                        $sql="UPDATE ".MAIN_DB_PREFIX."commandedet SET rang=".$k.",fk_parent_line=NULL WHERE rowid=".$objLine->rowid;
79
+						$sql="UPDATE ".MAIN_DB_PREFIX."commandedet SET rang=".$k.",fk_parent_line=NULL WHERE rowid=".$objLine->rowid;
80 80
 
81
-                         print $sql.";<br />";
82
-                        $k++;
83
-                }
81
+						 print $sql.";<br />";
82
+						$k++;
83
+				}
84 84
 
85
-        }
85
+		}
86 86
 
87 87
 
88 88
 	 print $sql.";<br />";
Please login to merge, or discard this patch.
htdocs_38/core/lib/pdf.lib.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
127 127
 	else require_once FPDF_PATH.'fpdf.php';
128 128
 
129 129
 	// We need to instantiate tcpdi or fpdi object (instead of tcpdf) to use merging features. But we can disable it (this will break all merge features).
130
-    if (empty($conf->global->MAIN_DISABLE_TCPDI)) require_once TCPDI_PATH.'tcpdi.php';
130
+	if (empty($conf->global->MAIN_DISABLE_TCPDI)) require_once TCPDI_PATH.'tcpdi.php';
131 131
 	else if (empty($conf->global->MAIN_DISABLE_FPDI)) require_once FPDI_PATH.'fpdi.php';
132 132
 
133 133
 	//$arrayformat=pdf_getFormat();
Please login to merge, or discard this patch.
core/modules/propale/doc/pdf_azur_subtotal.modules.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
 	}
129 129
 
130 130
 	/**
131
-     *  Function to build pdf onto disk
132
-     *
133
-     *  @param		Object		$object				Object to generate
134
-     *  @param		Translate	$outputlangs		Lang output object
135
-     *  @param		string		$srctemplatepath	Full path of source filename for generator using a template file
136
-     *  @param		int			$hidedetails		Do not show line details
137
-     *  @param		int			$hidedesc			Do not show desc
138
-     *  @param		int			$hideref			Do not show ref
139
-     *  @return     int             				1=OK, 0=KO
131
+	 *  Function to build pdf onto disk
132
+	 *
133
+	 *  @param		Object		$object				Object to generate
134
+	 *  @param		Translate	$outputlangs		Lang output object
135
+	 *  @param		string		$srctemplatepath	Full path of source filename for generator using a template file
136
+	 *  @param		int			$hidedetails		Do not show line details
137
+	 *  @param		int			$hidedesc			Do not show desc
138
+	 *  @param		int			$hideref			Do not show ref
139
+	 *  @return     int             				1=OK, 0=KO
140 140
 	 */
141 141
 	function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
142 142
 	{
@@ -259,25 +259,25 @@  discard block
 block discarded – undo
259 259
 				$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action);    // Note that $action and $object may have been modified by some hooks
260 260
 
261 261
 				// Create pdf instance
262
-                $pdf=pdf_getInstance($this->format);
263
-                $default_font_size = pdf_getPDFFontSize($outputlangs);	// Must be after pdf_getInstance
264
-                $heightforinfotot = 50;	// Height reserved to output the info and total part
265
-		        $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5);	// Height reserved to output the free text on last page
266
-	            $heightforfooter = $this->marge_basse + 8;	// Height reserved to output the footer (value include bottom margin)
267
-                $pdf->SetAutoPageBreak(1,0);
268
-
269
-                if (class_exists('TCPDF'))
270
-                {
271
-                    $pdf->setPrintHeader(false);
272
-                    $pdf->setPrintFooter(false);
273
-                }
274
-                $pdf->SetFont(pdf_getPDFFont($outputlangs));
275
-                // Set path to the background PDF File
276
-                if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
277
-                {
278
-                    $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
279
-                    $tplidx = $pdf->importPage(1);
280
-                }
262
+				$pdf=pdf_getInstance($this->format);
263
+				$default_font_size = pdf_getPDFFontSize($outputlangs);	// Must be after pdf_getInstance
264
+				$heightforinfotot = 50;	// Height reserved to output the info and total part
265
+				$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5);	// Height reserved to output the free text on last page
266
+				$heightforfooter = $this->marge_basse + 8;	// Height reserved to output the footer (value include bottom margin)
267
+				$pdf->SetAutoPageBreak(1,0);
268
+
269
+				if (class_exists('TCPDF'))
270
+				{
271
+					$pdf->setPrintHeader(false);
272
+					$pdf->setPrintFooter(false);
273
+				}
274
+				$pdf->SetFont(pdf_getPDFFont($outputlangs));
275
+				// Set path to the background PDF File
276
+				if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
277
+				{
278
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
279
+					$tplidx = $pdf->importPage(1);
280
+				}
281 281
 
282 282
 				$pdf->Open();
283 283
 				$pagenb=0;
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 						$localtax2_type = $localtaxtmp_array[2];
613 613
 					}
614 614
 
615
-				    // retrieve global local tax
615
+					// retrieve global local tax
616 616
 					if ($localtax1_type && $localtax1ligne != 0)
617 617
 						$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
618 618
 					if ($localtax2_type && $localtax2ligne != 0)
@@ -750,11 +750,11 @@  discard block
 block discarded – undo
750 750
 	/**
751 751
 	 *  Show payments table
752 752
 	 *
753
-     *  @param	PDF			$pdf           Object PDF
754
-     *  @param  Object		$object         Object proposal
755
-     *  @param  int			$posy           Position y in PDF
756
-     *  @param  Translate	$outputlangs    Object langs for output
757
-     *  @return int             			<0 if KO, >0 if OK
753
+	 *  @param	PDF			$pdf           Object PDF
754
+	 *  @param  Object		$object         Object proposal
755
+	 *  @param  int			$posy           Position y in PDF
756
+	 *  @param  Translate	$outputlangs    Object langs for output
757
+	 *  @return int             			<0 if KO, >0 if OK
758 758
 	 */
759 759
 	function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
760 760
 	{
@@ -790,10 +790,10 @@  discard block
 block discarded – undo
790 790
 
791 791
 		$posxval=52;
792 792
 
793
-        // Show shipping date
794
-        if (! empty($object->date_livraison))
793
+		// Show shipping date
794
+		if (! empty($object->date_livraison))
795 795
 		{
796
-            $outputlangs->load("sendings");
796
+			$outputlangs->load("sendings");
797 797
 			$pdf->SetFont('','B', $default_font_size - 2);
798 798
 			$pdf->SetXY($this->marge_gauche, $posy);
799 799
 			$titre = $outputlangs->transnoentities("DateDeliveryPlanned").':';
@@ -803,9 +803,9 @@  discard block
 block discarded – undo
803 803
 			$dlp=dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true);
804 804
 			$pdf->MultiCell(80, 4, $dlp, 0, 'L');
805 805
 
806
-            $posy=$pdf->GetY()+1;
806
+			$posy=$pdf->GetY()+1;
807 807
 		}
808
-        elseif ($object->availability_code || $object->availability)    // Show availability conditions
808
+		elseif ($object->availability_code || $object->availability)    // Show availability conditions
809 809
 		{
810 810
 			$pdf->SetFont('','B', $default_font_size - 2);
811 811
 			$pdf->SetXY($this->marge_gauche, $posy);
@@ -891,13 +891,13 @@  discard block
 block discarded – undo
891 891
 						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0);
892 892
 						$posy=$pdf->GetY()+1;
893 893
 
894
-			            if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
895
-			            {
894
+						if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
895
+						{
896 896
 							$pdf->SetXY($this->marge_gauche, $posy);
897 897
 							$pdf->SetFont('','', $default_font_size - $diffsizetitle);
898 898
 							$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0);
899 899
 							$posy=$pdf->GetY()+2;
900
-			            }
900
+						}
901 901
 					}
902 902
 					if ($conf->global->FACTURE_CHQ_NUMBER == -1)
903 903
 					{
@@ -906,13 +906,13 @@  discard block
 block discarded – undo
906 906
 						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0);
907 907
 						$posy=$pdf->GetY()+1;
908 908
 
909
-			            if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
910
-			            {
909
+						if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
910
+						{
911 911
 							$pdf->SetXY($this->marge_gauche, $posy);
912 912
 							$pdf->SetFont('','', $default_font_size - $diffsizetitle);
913 913
 							$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
914 914
 							$posy=$pdf->GetY()+2;
915
-			            }
915
+						}
916 916
 					}
917 917
 				}
918 918
 			}
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 							}
1023 1023
 						}
1024 1024
 					}
1025
-	      		//}
1025
+		  		//}
1026 1026
 				//Local tax 2 before VAT
1027 1027
 				//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
1028 1028
 				//{
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
 							}
1115 1115
 						}
1116 1116
 					}
1117
-	      		//}
1117
+		  		//}
1118 1118
 				//Local tax 2 after VAT
1119 1119
 				//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
1120 1120
 				//{
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
 
1125 1125
 						foreach( $localtax_rate as $tvakey => $tvaval )
1126 1126
 						{
1127
-						    // retrieve global local tax
1127
+							// retrieve global local tax
1128 1128
 							if ($tvakey != 0)    // On affiche pas taux 0
1129 1129
 							{
1130 1130
 								//$this->atleastoneratenotnull++;
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 		//  Show Draft Watermark
1342 1342
 		if($object->statut==0 && (! empty($conf->global->PROPALE_DRAFT_WATERMARK)) )
1343 1343
 		{
1344
-            pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->PROPALE_DRAFT_WATERMARK);
1344
+			pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->PROPALE_DRAFT_WATERMARK);
1345 1345
 		}
1346 1346
 
1347 1347
 		$pdf->SetTextColor(0,0,60);
@@ -1358,8 +1358,8 @@  discard block
 block discarded – undo
1358 1358
 		{
1359 1359
 			if (is_readable($logo))
1360 1360
 			{
1361
-			    $height=pdf_getHeightForLogo($logo);
1362
-			    $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);	// width=0 (auto)
1361
+				$height=pdf_getHeightForLogo($logo);
1362
+				$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);	// width=0 (auto)
1363 1363
 			}
1364 1364
 			else
1365 1365
 			{
@@ -1517,7 +1517,7 @@  discard block
 block discarded – undo
1517 1517
 
1518 1518
 	/**
1519 1519
 	 *   	Show footer of page. Need this->emetteur object
1520
-     *
1520
+	 *
1521 1521
 	 *   	@param	PDF			$pdf     			PDF
1522 1522
 	 * 		@param	Object		$object				Object to show
1523 1523
 	 *      @param	Translate	$outputlangs		Object lang for output
Please login to merge, or discard this patch.
script/migrate_titles_to_7.0.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -6,73 +6,73 @@
 block discarded – undo
6 6
 
7 7
 if((float)DOL_VERSION >= 7)
8 8
 {
9
-    print "Début de conversion des lignes de propale<br>";
10
-    $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."propaldet WHERE special_code = 104777 AND qty != 50 AND product_type = 9 AND (label = '' OR label IS NULL)";
11
-    $res = $db->query($sql);
12
-    if($res)
13
-    {
14
-        print $db->num_rows($res)." lignes à convertir<br>";
15
-        $i = 0;
16
-        while ($obj = $db->fetch_object($res))
17
-        {
18
-            $prop = new PropaleLigne($db);
19
-            $prop->fetch($obj->rowid);
20
-            $prop->fetch_optionals();
21
-            if (empty($prop->label)){
22
-                $prop->label = strip_tags($prop->desc);
23
-                $prop->desc = '';
24
-            }
25
-            $ret = $prop->update(1);
26
-            if($ret>0) $i++;
27
-        }
28
-        print $i." lignes converties<br>";
29
-    }
9
+	print "Début de conversion des lignes de propale<br>";
10
+	$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."propaldet WHERE special_code = 104777 AND qty != 50 AND product_type = 9 AND (label = '' OR label IS NULL)";
11
+	$res = $db->query($sql);
12
+	if($res)
13
+	{
14
+		print $db->num_rows($res)." lignes à convertir<br>";
15
+		$i = 0;
16
+		while ($obj = $db->fetch_object($res))
17
+		{
18
+			$prop = new PropaleLigne($db);
19
+			$prop->fetch($obj->rowid);
20
+			$prop->fetch_optionals();
21
+			if (empty($prop->label)){
22
+				$prop->label = strip_tags($prop->desc);
23
+				$prop->desc = '';
24
+			}
25
+			$ret = $prop->update(1);
26
+			if($ret>0) $i++;
27
+		}
28
+		print $i." lignes converties<br>";
29
+	}
30 30
     
31
-    print "Début de conversion des lignes de commande<br>";
32
-    $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commandedet WHERE special_code = 104777 AND qty != 50 AND product_type = 9 AND (label = '' OR label IS NULL)";
33
-    $res = $db->query($sql);
34
-    if($res)
35
-    {
36
-        print $db->num_rows($res)." lignes à convertir<br>";
37
-        $i = 0;
38
-        while ($obj = $db->fetch_object($res))
39
-        {
40
-            $cdeline = new OrderLine($db);
41
-            $cdeline->fetch($obj->rowid);
42
-            $cdeline->fetch_optionals($obj->rowid);
43
-            if (empty($cdeline->label)){
44
-                $cdeline->label = strip_tags($cdeline->desc);
45
-                $cdeline->desc = '';
46
-            }
47
-            $ret = $cdeline->update($user, 1);
48
-            if($ret>0) $i++;
49
-        }
31
+	print "Début de conversion des lignes de commande<br>";
32
+	$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commandedet WHERE special_code = 104777 AND qty != 50 AND product_type = 9 AND (label = '' OR label IS NULL)";
33
+	$res = $db->query($sql);
34
+	if($res)
35
+	{
36
+		print $db->num_rows($res)." lignes à convertir<br>";
37
+		$i = 0;
38
+		while ($obj = $db->fetch_object($res))
39
+		{
40
+			$cdeline = new OrderLine($db);
41
+			$cdeline->fetch($obj->rowid);
42
+			$cdeline->fetch_optionals($obj->rowid);
43
+			if (empty($cdeline->label)){
44
+				$cdeline->label = strip_tags($cdeline->desc);
45
+				$cdeline->desc = '';
46
+			}
47
+			$ret = $cdeline->update($user, 1);
48
+			if($ret>0) $i++;
49
+		}
50 50
         
51
-        print $i." lignes converties<br>";
52
-    }
51
+		print $i." lignes converties<br>";
52
+	}
53 53
     
54
-    print "Début de conversion des lignes de facture<br>";
55
-    $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facturedet WHERE special_code = 104777 AND qty != 50 AND product_type = 9 AND (label = '' OR label IS NULL)";
54
+	print "Début de conversion des lignes de facture<br>";
55
+	$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facturedet WHERE special_code = 104777 AND qty != 50 AND product_type = 9 AND (label = '' OR label IS NULL)";
56 56
     
57
-    $res = $db->query($sql);
58
-    if($res)
59
-    {
60
-        print $db->num_rows($res)." lignes à convertir<br>";
61
-        $i = 0;
62
-        while ($obj = $db->fetch_object($res))
63
-        {
64
-            $facline = new FactureLigne($db);
65
-            $facline->fetch($obj->rowid);
66
-            $facline->fetch_optionals($obj->rowid);
67
-            if (empty($facline->label)){
68
-                $facline->label = strip_tags($facline->desc);
69
-                $facline->desc = '';
70
-            }
71
-            $ret = $facline->update($user, 1);
72
-            if($ret>0) $i++;
73
-        }
57
+	$res = $db->query($sql);
58
+	if($res)
59
+	{
60
+		print $db->num_rows($res)." lignes à convertir<br>";
61
+		$i = 0;
62
+		while ($obj = $db->fetch_object($res))
63
+		{
64
+			$facline = new FactureLigne($db);
65
+			$facline->fetch($obj->rowid);
66
+			$facline->fetch_optionals($obj->rowid);
67
+			if (empty($facline->label)){
68
+				$facline->label = strip_tags($facline->desc);
69
+				$facline->desc = '';
70
+			}
71
+			$ret = $facline->update($user, 1);
72
+			if($ret>0) $i++;
73
+		}
74 74
         
75
-        print $i." lignes converties<br>";
76
-    }
75
+		print $i." lignes converties<br>";
76
+	}
77 77
     
78 78
 }
79 79
\ No newline at end of file
Please login to merge, or discard this patch.
core/modules/facture/doc/pdf_crabe_subtotal.modules.php 1 patch
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -38,17 +38,17 @@  discard block
 block discarded – undo
38 38
  */
39 39
 class pdf_crabe_subtotal extends ModelePDFFactures
40 40
 {
41
-    var $db;
42
-    var $name;
43
-    var $description;
44
-    var $type;
41
+	var $db;
42
+	var $name;
43
+	var $description;
44
+	var $type;
45 45
 
46
-    var $phpmin = array(4,3,0); // Minimum version of PHP required by module
47
-    var $version = 'dolibarr';
46
+	var $phpmin = array(4,3,0); // Minimum version of PHP required by module
47
+	var $version = 'dolibarr';
48 48
 
49
-    var $page_largeur;
50
-    var $page_hauteur;
51
-    var $format;
49
+	var $page_largeur;
50
+	var $page_hauteur;
51
+	var $format;
52 52
 	var $marge_gauche;
53 53
 	var	$marge_droite;
54 54
 	var	$marge_haute;
@@ -130,15 +130,15 @@  discard block
 block discarded – undo
130 130
 
131 131
 
132 132
 	/**
133
-     *  Function to build pdf onto disk
134
-     *
135
-     *  @param		Object		$object				Object to generate
136
-     *  @param		Translate	$outputlangs		Lang output object
137
-     *  @param		string		$srctemplatepath	Full path of source filename for generator using a template file
138
-     *  @param		int			$hidedetails		Do not show line details
139
-     *  @param		int			$hidedesc			Do not show desc
140
-     *  @param		int			$hideref			Do not show ref
141
-     *  @return     int         	    			1=OK, 0=KO
133
+	 *  Function to build pdf onto disk
134
+	 *
135
+	 *  @param		Object		$object				Object to generate
136
+	 *  @param		Translate	$outputlangs		Lang output object
137
+	 *  @param		string		$srctemplatepath	Full path of source filename for generator using a template file
138
+	 *  @param		int			$hidedetails		Do not show line details
139
+	 *  @param		int			$hidedesc			Do not show desc
140
+	 *  @param		int			$hideref			Do not show ref
141
+	 *  @return     int         	    			1=OK, 0=KO
142 142
 	 */
143 143
 	function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
144 144
 	{
@@ -230,25 +230,25 @@  discard block
 block discarded – undo
230 230
 
231 231
 				// Create pdf instance
232 232
 				$pdf=pdf_getInstance($this->format);
233
-                $default_font_size = pdf_getPDFFontSize($outputlangs);	// Must be after pdf_getInstance
233
+				$default_font_size = pdf_getPDFFontSize($outputlangs);	// Must be after pdf_getInstance
234 234
 				$heightforinfotot = 50;	// Height reserved to output the info and total part
235
-		        $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5);	// Height reserved to output the free text on last page
236
-	            $heightforfooter = $this->marge_basse + 8;	// Height reserved to output the footer (value include bottom margin)
237
-                $pdf->SetAutoPageBreak(1,0);
238
-
239
-                if (class_exists('TCPDF'))
240
-                {
241
-                    $pdf->setPrintHeader(false);
242
-                    $pdf->setPrintFooter(false);
243
-                }
244
-                $pdf->SetFont(pdf_getPDFFont($outputlangs));
245
-
246
-                // Set path to the background PDF File
247
-                if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
248
-                {
249
-				    $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
250
-				    $tplidx = $pdf->importPage(1);
251
-                }
235
+				$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5);	// Height reserved to output the free text on last page
236
+				$heightforfooter = $this->marge_basse + 8;	// Height reserved to output the footer (value include bottom margin)
237
+				$pdf->SetAutoPageBreak(1,0);
238
+
239
+				if (class_exists('TCPDF'))
240
+				{
241
+					$pdf->setPrintHeader(false);
242
+					$pdf->setPrintFooter(false);
243
+				}
244
+				$pdf->SetFont(pdf_getPDFFont($outputlangs));
245
+
246
+				// Set path to the background PDF File
247
+				if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
248
+				{
249
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
250
+					$tplidx = $pdf->importPage(1);
251
+				}
252 252
 
253 253
 				$pdf->Open();
254 254
 				$pagenb=0;
@@ -538,8 +538,8 @@  discard block
 block discarded – undo
538 538
 					// Discount on line
539 539
 					if ($object->lines[$i]->remise_percent)
540 540
 					{
541
-                        $pdf->SetXY($this->posxdiscount-2, $curY);
542
-					    $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
541
+						$pdf->SetXY($this->posxdiscount-2, $curY);
542
+						$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
543 543
 						$pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
544 544
 					}
545 545
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 						$localtax2_type = $localtaxtmp_array[2];
578 578
 					}
579 579
 
580
-				    // retrieve global local tax
580
+					// retrieve global local tax
581 581
 					if ($localtax1_type && $localtax1ligne != 0)
582 582
 						$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
583 583
 					if ($localtax2_type && $localtax2ligne != 0)
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 					}
596 596
 					else {
597 597
 						// standard
598
-                        if(!empty($tvaligne)) $this->tva[$vatrate] += $tvaligne;
598
+						if(!empty($tvaligne)) $this->tva[$vatrate] += $tvaligne;
599 599
 					}
600 600
 
601 601
 					if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
@@ -713,20 +713,20 @@  discard block
 block discarded – undo
713 713
 	/**
714 714
 	 *  Show payments table
715 715
 	 *
716
-     *  @param	PDF			$pdf           Object PDF
717
-     *  @param  Object		$object         Object invoice
718
-     *  @param  int			$posy           Position y in PDF
719
-     *  @param  Translate	$outputlangs    Object langs for output
720
-     *  @return int             			<0 if KO, >0 if OK
716
+	 *  @param	PDF			$pdf           Object PDF
717
+	 *  @param  Object		$object         Object invoice
718
+	 *  @param  int			$posy           Position y in PDF
719
+	 *  @param  Translate	$outputlangs    Object langs for output
720
+	 *  @return int             			<0 if KO, >0 if OK
721 721
 	 */
722 722
 	function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
723 723
 	{
724 724
 		global $conf;
725 725
 
726
-        $sign=1;
727
-        if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
726
+		$sign=1;
727
+		if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
728 728
 
729
-        $tab3_posx = 120;
729
+		$tab3_posx = 120;
730 730
 		$tab3_top = $posy + 8;
731 731
 		$tab3_width = 80;
732 732
 		$tab3_height = 4;
@@ -953,13 +953,13 @@  discard block
 block discarded – undo
953 953
 						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0);
954 954
 						$posy=$pdf->GetY()+1;
955 955
 
956
-			            if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
957
-			            {
956
+						if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
957
+						{
958 958
 							$pdf->SetXY($this->marge_gauche, $posy);
959 959
 							$pdf->SetFont('','', $default_font_size - $diffsizetitle);
960 960
 							$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0);
961 961
 							$posy=$pdf->GetY()+2;
962
-			            }
962
+						}
963 963
 					}
964 964
 					if ($conf->global->FACTURE_CHQ_NUMBER == -1)
965 965
 					{
@@ -968,13 +968,13 @@  discard block
 block discarded – undo
968 968
 						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0);
969 969
 						$posy=$pdf->GetY()+1;
970 970
 
971
-			            if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
972
-			            {
971
+						if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
972
+						{
973 973
 							$pdf->SetXY($this->marge_gauche, $posy);
974 974
 							$pdf->SetFont('','', $default_font_size - $diffsizetitle);
975 975
 							$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
976 976
 							$posy=$pdf->GetY()+2;
977
-			            }
977
+						}
978 978
 					}
979 979
 				}
980 980
 			}
@@ -1016,10 +1016,10 @@  discard block
 block discarded – undo
1016 1016
 	{
1017 1017
 		global $conf,$mysoc;
1018 1018
 
1019
-        $sign=1;
1020
-        if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
1019
+		$sign=1;
1020
+		if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
1021 1021
 
1022
-        $default_font_size = pdf_getPDFFontSize($outputlangs);
1022
+		$default_font_size = pdf_getPDFFontSize($outputlangs);
1023 1023
 
1024 1024
 		$tab2_top = $posy;
1025 1025
 		$tab2_hl = 4;
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
 							}
1089 1089
 						}
1090 1090
 					}
1091
-	      		//}
1091
+		  		//}
1092 1092
 				//Local tax 2 before VAT
1093 1093
 				//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
1094 1094
 				//{
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 							}
1181 1181
 						}
1182 1182
 					}
1183
-	      		//}
1183
+		  		//}
1184 1184
 				//Local tax 2 after VAT
1185 1185
 				//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
1186 1186
 				//{
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
 
1191 1191
 						foreach( $localtax_rate as $tvakey => $tvaval )
1192 1192
 						{
1193
-						    // retrieve global local tax
1193
+							// retrieve global local tax
1194 1194
 							if ($tvakey != 0)    // On affiche pas taux 0
1195 1195
 							{
1196 1196
 								//$this->atleastoneratenotnull++;
@@ -1424,15 +1424,15 @@  discard block
 block discarded – undo
1424 1424
 
1425 1425
 		// Show Draft Watermark
1426 1426
 		if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) )
1427
-        {
1428
-		      pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FACTURE_DRAFT_WATERMARK);
1429
-        }
1427
+		{
1428
+			  pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FACTURE_DRAFT_WATERMARK);
1429
+		}
1430 1430
 
1431 1431
 		$pdf->SetTextColor(0,0,60);
1432 1432
 		$pdf->SetFont('','B', $default_font_size + 3);
1433 1433
 
1434 1434
 		$posy=$this->marge_haute;
1435
-        $posx=$this->page_largeur-$this->marge_droite-100;
1435
+		$posx=$this->page_largeur-$this->marge_droite-100;
1436 1436
 
1437 1437
 		$pdf->SetXY($this->marge_gauche,$posy);
1438 1438
 
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
 		{
1443 1443
 			if (is_readable($logo))
1444 1444
 			{
1445
-			    $height=pdf_getHeightForLogo($logo);
1445
+				$height=pdf_getHeightForLogo($logo);
1446 1446
 				$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);	// width=0 (auto)
1447 1447
 			}
1448 1448
 			else
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
 
1634 1634
 	/**
1635 1635
 	 *   	Show footer of page. Need this->emetteur object
1636
-     *
1636
+	 *
1637 1637
 	 *   	@param	PDF			$pdf     			PDF
1638 1638
 	 * 		@param	Object		$object				Object to show
1639 1639
 	 *      @param	Translate	$outputlangs		Object lang for output
Please login to merge, or discard this patch.
core/modules/commande/doc/pdf_einstein_subtotal.modules.php 1 patch
Indentation   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -38,23 +38,23 @@  discard block
 block discarded – undo
38 38
  */
39 39
 class pdf_einstein_subtotal extends ModelePDFCommandes
40 40
 {
41
-    var $db;
42
-    var $name;
43
-    var $description;
44
-    var $type;
41
+	var $db;
42
+	var $name;
43
+	var $description;
44
+	var $type;
45 45
 
46
-    var $phpmin = array(4,3,0); // Minimum version of PHP required by module
47
-    var $version = 'dolibarr';
46
+	var $phpmin = array(4,3,0); // Minimum version of PHP required by module
47
+	var $version = 'dolibarr';
48 48
 
49
-    var $page_largeur;
50
-    var $page_hauteur;
51
-    var $format;
49
+	var $page_largeur;
50
+	var $page_hauteur;
51
+	var $format;
52 52
 	var $marge_gauche;
53 53
 	var	$marge_droite;
54 54
 	var	$marge_haute;
55 55
 	var	$marge_basse;
56 56
 
57
-    var $emetteur;	// Objet societe qui emet
57
+	var $emetteur;	// Objet societe qui emet
58 58
 
59 59
 
60 60
 	/**
@@ -129,15 +129,15 @@  discard block
 block discarded – undo
129 129
 	}
130 130
 
131 131
 	/**
132
-     *  Function to build pdf onto disk
133
-     *
134
-     *  @param		Object		$object				Object to generate
135
-     *  @param		Translate	$outputlangs		Lang output object
136
-     *  @param		string		$srctemplatepath	Full path of source filename for generator using a template file
137
-     *  @param		int			$hidedetails		Do not show line details
138
-     *  @param		int			$hidedesc			Do not show desc
139
-     *  @param		int			$hideref			Do not show ref
140
-     *  @return     int             			1=OK, 0=KO
132
+	 *  Function to build pdf onto disk
133
+	 *
134
+	 *  @param		Object		$object				Object to generate
135
+	 *  @param		Translate	$outputlangs		Lang output object
136
+	 *  @param		string		$srctemplatepath	Full path of source filename for generator using a template file
137
+	 *  @param		int			$hidedetails		Do not show line details
138
+	 *  @param		int			$hidedesc			Do not show desc
139
+	 *  @param		int			$hideref			Do not show ref
140
+	 *  @return     int             			1=OK, 0=KO
141 141
 	 */
142 142
 	function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
143 143
 	{
@@ -159,13 +159,13 @@  discard block
 block discarded – undo
159 159
 
160 160
 		if ($conf->commande->dir_output)
161 161
 		{
162
-            $object->fetch_thirdparty();
162
+			$object->fetch_thirdparty();
163 163
 			if(!empty($object->client) ){
164 164
 				$object->thirdparty = $object->client;
165 165
 			}
166
-            $deja_regle = "";
166
+			$deja_regle = "";
167 167
 
168
-            // Definition of $dir and $file
168
+			// Definition of $dir and $file
169 169
 			if ($object->specimen)
170 170
 			{
171 171
 				$dir = $conf->commande->dir_output;
@@ -204,22 +204,22 @@  discard block
 block discarded – undo
204 204
 				$pdf=pdf_getInstance($this->format);
205 205
 				$default_font_size = pdf_getPDFFontSize($outputlangs);	// Must be after pdf_getInstance
206 206
 				$heightforinfotot = 50;	// Height reserved to output the info and total part
207
-		        $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5);	// Height reserved to output the free text on last page
208
-	            $heightforfooter = $this->marge_basse + 8;	// Height reserved to output the footer (value include bottom margin)
209
-                $pdf->SetAutoPageBreak(1,0);
210
-
211
-                if (class_exists('TCPDF'))
212
-                {
213
-                    $pdf->setPrintHeader(false);
214
-                    $pdf->setPrintFooter(false);
215
-                }
216
-                $pdf->SetFont(pdf_getPDFFont($outputlangs));
217
-                // Set path to the background PDF File
218
-                if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
219
-                {
220
-                    $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
221
-                    $tplidx = $pdf->importPage(1);
222
-                }
207
+				$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5);	// Height reserved to output the free text on last page
208
+				$heightforfooter = $this->marge_basse + 8;	// Height reserved to output the footer (value include bottom margin)
209
+				$pdf->SetAutoPageBreak(1,0);
210
+
211
+				if (class_exists('TCPDF'))
212
+				{
213
+					$pdf->setPrintHeader(false);
214
+					$pdf->setPrintFooter(false);
215
+				}
216
+				$pdf->SetFont(pdf_getPDFFont($outputlangs));
217
+				// Set path to the background PDF File
218
+				if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
219
+				{
220
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
221
+					$tplidx = $pdf->importPage(1);
222
+				}
223 223
 
224 224
 				$pdf->Open();
225 225
 				$pagenb=0;
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 						$localtax2_type = $localtaxtmp_array[2];
524 524
 					}
525 525
 
526
-				    // retrieve global local tax
526
+					// retrieve global local tax
527 527
 					if ($localtax1_type && $localtax1ligne != 0)
528 528
 						$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
529 529
 					if ($localtax2_type && $localtax2ligne != 0)
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 					}
542 542
 					else {
543 543
 						// standard
544
-                        if(!empty($tvaligne)) $this->tva[$vatrate] += $tvaligne;
544
+						if(!empty($tvaligne)) $this->tva[$vatrate] += $tvaligne;
545 545
 					}
546 546
 
547 547
 					// Add line
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 
656 656
 	/**
657 657
 	 *  Show payments table
658
-     *
658
+	 *
659 659
 	 *  @param	PDF			$pdf     		Object PDF
660 660
 	 *  @param  Object		$object			Object order
661 661
 	 *	@param	int			$posy			Position y in PDF
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 
685 685
 		$pdf->SetFont('','', $default_font_size - 1);
686 686
 
687
-        // If France, show VAT mention if not applicable
687
+		// If France, show VAT mention if not applicable
688 688
 		if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
689 689
 		{
690 690
 			$pdf->SetFont('','B', $default_font_size - 2);
@@ -713,8 +713,8 @@  discard block
 block discarded – undo
713 713
 			$posy=$pdf->GetY()+3;
714 714
 		}
715 715
 
716
-        // Check a payment mode is defined
717
-        /* Not used with orders
716
+		// Check a payment mode is defined
717
+		/* Not used with orders
718 718
 		if (empty($object->mode_reglement_code)
719 719
         	&& ! $conf->global->FACTURE_CHQ_NUMBER
720 720
         	&& ! $conf->global->FACTURE_RIB_NUMBER)
@@ -740,10 +740,10 @@  discard block
 block discarded – undo
740 740
             $posy=$pdf->GetY()+1;
741 741
 		}*/
742 742
 
743
-	    // Show planed date of delivery
744
-        if (! empty($object->date_livraison))
743
+		// Show planed date of delivery
744
+		if (! empty($object->date_livraison))
745 745
 		{
746
-            $outputlangs->load("sendings");
746
+			$outputlangs->load("sendings");
747 747
 			$pdf->SetFont('','B', $default_font_size - 2);
748 748
 			$pdf->SetXY($this->marge_gauche, $posy);
749 749
 			$titre = $outputlangs->transnoentities("DateDeliveryPlanned").':';
@@ -753,9 +753,9 @@  discard block
 block discarded – undo
753 753
 			$dlp=dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true);
754 754
 			$pdf->MultiCell(80, 4, $dlp, 0, 'L');
755 755
 
756
-            $posy=$pdf->GetY()+1;
756
+			$posy=$pdf->GetY()+1;
757 757
 		}
758
-        elseif ($object->availability_code || $object->availability)    // Show availability conditions
758
+		elseif ($object->availability_code || $object->availability)    // Show availability conditions
759 759
 		{
760 760
 			$pdf->SetFont('','B', $default_font_size - 2);
761 761
 			$pdf->SetXY($this->marge_gauche, $posy);
@@ -771,70 +771,70 @@  discard block
 block discarded – undo
771 771
 			$posy=$pdf->GetY()+1;
772 772
 		}
773 773
 
774
-      	// Show payment mode
775
-        if ($object->mode_reglement_code
776
-        	 && $object->mode_reglement_code != 'CHQ'
777
-           	 && $object->mode_reglement_code != 'VIR')
778
-           	 {
779
-	            $pdf->SetFont('','B', $default_font_size - 2);
780
-	            $pdf->SetXY($this->marge_gauche, $posy);
781
-	            $titre = $outputlangs->transnoentities("PaymentMode").':';
782
-	            $pdf->MultiCell(80, 5, $titre, 0, 'L');
774
+	  	// Show payment mode
775
+		if ($object->mode_reglement_code
776
+			 && $object->mode_reglement_code != 'CHQ'
777
+		   	 && $object->mode_reglement_code != 'VIR')
778
+		   	 {
779
+				$pdf->SetFont('','B', $default_font_size - 2);
780
+				$pdf->SetXY($this->marge_gauche, $posy);
781
+				$titre = $outputlangs->transnoentities("PaymentMode").':';
782
+				$pdf->MultiCell(80, 5, $titre, 0, 'L');
783 783
 
784 784
 				$pdf->SetFont('','', $default_font_size - 2);
785
-	            $pdf->SetXY($posxval, $posy);
786
-	            $lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
787
-	            $pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
785
+				$pdf->SetXY($posxval, $posy);
786
+				$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
787
+				$pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
788 788
 
789
-	            $posy=$pdf->GetY()+2;
790
-           	 }
789
+				$posy=$pdf->GetY()+2;
790
+		   	 }
791 791
 
792 792
 		// Show payment mode CHQ
793
-        if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
794
-        {
795
-        	// Si mode reglement non force ou si force a CHQ
796
-	        if (! empty($conf->global->FACTURE_CHQ_NUMBER))
797
-	        {
798
-	            if ($conf->global->FACTURE_CHQ_NUMBER > 0)
799
-	            {
800
-	                $account = new Account($this->db);
801
-	                $account->fetch($conf->global->FACTURE_CHQ_NUMBER);
802
-
803
-	                $pdf->SetXY($this->marge_gauche, $posy);
804
-	                $pdf->SetFont('','B', $default_font_size - 3);
805
-	                $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0);
806
-		            $posy=$pdf->GetY()+1;
807
-
808
-		            if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
809
-		            {
810
-		                $pdf->SetXY($this->marge_gauche, $posy);
811
-		                $pdf->SetFont('','', $default_font_size - 3);
812
-		                $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0);
813
-			            $posy=$pdf->GetY()+2;
814
-		            }
815
-	            }
816
-	            if ($conf->global->FACTURE_CHQ_NUMBER == -1)
817
-	            {
818
-	                $pdf->SetXY($this->marge_gauche, $posy);
819
-	                $pdf->SetFont('','B', $default_font_size - 3);
820
-	                $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0);
821
-		            $posy=$pdf->GetY()+1;
822
-
823
-		            if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
824
-		            {
825
-			            $pdf->SetXY($this->marge_gauche, $posy);
826
-		                $pdf->SetFont('','', $default_font_size - 3);
827
-		                $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
828
-			            $posy=$pdf->GetY()+2;
829
-		            }
830
-	            }
831
-	        }
793
+		if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
794
+		{
795
+			// Si mode reglement non force ou si force a CHQ
796
+			if (! empty($conf->global->FACTURE_CHQ_NUMBER))
797
+			{
798
+				if ($conf->global->FACTURE_CHQ_NUMBER > 0)
799
+				{
800
+					$account = new Account($this->db);
801
+					$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
802
+
803
+					$pdf->SetXY($this->marge_gauche, $posy);
804
+					$pdf->SetFont('','B', $default_font_size - 3);
805
+					$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0);
806
+					$posy=$pdf->GetY()+1;
807
+
808
+					if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
809
+					{
810
+						$pdf->SetXY($this->marge_gauche, $posy);
811
+						$pdf->SetFont('','', $default_font_size - 3);
812
+						$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0);
813
+						$posy=$pdf->GetY()+2;
814
+					}
815
+				}
816
+				if ($conf->global->FACTURE_CHQ_NUMBER == -1)
817
+				{
818
+					$pdf->SetXY($this->marge_gauche, $posy);
819
+					$pdf->SetFont('','B', $default_font_size - 3);
820
+					$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0);
821
+					$posy=$pdf->GetY()+1;
822
+
823
+					if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
824
+					{
825
+						$pdf->SetXY($this->marge_gauche, $posy);
826
+						$pdf->SetFont('','', $default_font_size - 3);
827
+						$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
828
+						$posy=$pdf->GetY()+2;
829
+					}
830
+				}
831
+			}
832 832
 		}
833 833
 
834
-        // If payment mode not forced or forced to VIR, show payment with BAN
835
-        if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
836
-        {
837
-        	if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER))
834
+		// If payment mode not forced or forced to VIR, show payment with BAN
835
+		if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
836
+		{
837
+			if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER))
838 838
 			{
839 839
 				$bankid=(empty($object->fk_bank)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_bank);
840 840
 				$account = new Account($this->db);
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 
848 848
 				$posy+=2;
849 849
 			}
850
-        }
850
+		}
851 851
 
852 852
 		return $posy;
853 853
 	}
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 	 */
866 866
 	function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
867 867
 	{
868
-	    global $conf,$mysoc;
868
+		global $conf,$mysoc;
869 869
 
870 870
 		$default_font_size = pdf_getPDFFontSize($outputlangs);
871 871
 
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 		$pdf->SetFont('','', $default_font_size - 1);
875 875
 
876 876
 		// Tableau total
877
-        $col1x = 120; $col2x = 170;
877
+		$col1x = 120; $col2x = 170;
878 878
 		if ($this->page_largeur < 210) // To work with US executive format
879 879
 		{
880 880
 			$col2x-=20;
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 							}
936 936
 						}
937 937
 					}
938
-	      		//}
938
+		  		//}
939 939
 				//Local tax 2 before VAT
940 940
 				//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
941 941
 				//{
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 							}
1027 1027
 						}
1028 1028
 					}
1029
-	      		//}
1029
+		  		//}
1030 1030
 				//Local tax 2 after VAT
1031 1031
 				//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
1032 1032
 				//{
@@ -1075,8 +1075,8 @@  discard block
 block discarded – undo
1075 1075
 
1076 1076
 		$pdf->SetTextColor(0,0,0);
1077 1077
 
1078
-        $creditnoteamount=0;
1079
-        $depositsamount=0;
1078
+		$creditnoteamount=0;
1079
+		$depositsamount=0;
1080 1080
 		//$creditnoteamount=$object->getSumCreditNotesUsed();
1081 1081
 		//$depositsamount=$object->getSumDepositsUsed();
1082 1082
 		//print "x".$creditnoteamount."-".$depositsamount;exit;
@@ -1230,7 +1230,7 @@  discard block
 block discarded – undo
1230 1230
 		// Show Draft Watermark
1231 1231
 		if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) )
1232 1232
 		{
1233
-            pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK);
1233
+			pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK);
1234 1234
 		}
1235 1235
 
1236 1236
 		$pdf->SetTextColor(0,0,60);
@@ -1247,8 +1247,8 @@  discard block
 block discarded – undo
1247 1247
 		{
1248 1248
 			if (is_readable($logo))
1249 1249
 			{
1250
-			    $height=pdf_getHeightForLogo($logo);
1251
-			    $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);	// width=0 (auto)
1250
+				$height=pdf_getHeightForLogo($logo);
1251
+				$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);	// width=0 (auto)
1252 1252
 			}
1253 1253
 			else
1254 1254
 			{
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
 
1387 1387
 	/**
1388 1388
 	 *   	Show footer of page. Need this->emetteur object
1389
-     *
1389
+	 *
1390 1390
 	 *   	@param	PDF			$pdf     			PDF
1391 1391
 	 * 		@param	Object		$object				Object to show
1392 1392
 	 *      @param	Translate	$outputlangs		Object lang for output
Please login to merge, or discard this patch.
admin/subtotal_setup.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 // Dolibarr environment
29 29
 $res = @include("../../main.inc.php"); // From htdocs directory
30 30
 if (! $res) {
31
-    $res = @include("../../../main.inc.php"); // From "custom" directory
31
+	$res = @include("../../../main.inc.php"); // From "custom" directory
32 32
 }
33 33
 
34 34
 // Libraries
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 // Access control
41 41
 if (! $user->admin) {
42
-    accessforbidden();
42
+	accessforbidden();
43 43
 }
44 44
 
45 45
 // Parameters
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 // Configuration header
97 97
 $head = subtotalAdminPrepareHead();
98 98
 dol_fiche_head(
99
-    $head,
100
-    'settings',
101
-    $langs->trans("Module104777Name"),
102
-    -1,
103
-    "subtotal@subtotal"
99
+	$head,
100
+	'settings',
101
+	$langs->trans("Module104777Name"),
102
+	-1,
103
+	"subtotal@subtotal"
104 104
 );
105 105
 
106 106
 showParameters();
@@ -169,13 +169,13 @@  discard block
 block discarded – undo
169 169
 	print ajax_constantonoff('SUBTOTAL_ALLOW_DUPLICATE_BLOCK');
170 170
 	print '</td></tr>';
171 171
 
172
-    $var=!$var;
173
-    print '<tr '.$bc[$var].'>';
174
-    print '<td>'.$langs->trans("SUBTOTAL_ALLOW_DUPLICATE_LINE").'</td>';
175
-    print '<td align="center" width="20">&nbsp;</td>';
176
-    print '<td align="center" width="300">';
177
-    print ajax_constantonoff('SUBTOTAL_ALLOW_DUPLICATE_LINE');
178
-    print '</td></tr>';
172
+	$var=!$var;
173
+	print '<tr '.$bc[$var].'>';
174
+	print '<td>'.$langs->trans("SUBTOTAL_ALLOW_DUPLICATE_LINE").'</td>';
175
+	print '<td align="center" width="20">&nbsp;</td>';
176
+	print '<td align="center" width="300">';
177
+	print ajax_constantonoff('SUBTOTAL_ALLOW_DUPLICATE_LINE');
178
+	print '</td></tr>';
179 179
 	
180 180
 	$var=!$var;
181 181
 	print '<tr '.$bc[$var].'>';
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
 		print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
273 273
 		print '<input type="hidden" name="action" value="set_SUBTOTAL_TFIELD_TO_KEEP_WITH_NC">';
274 274
 		$TField = array(
275
-		    'pdf_getlineqty' => $langs->trans('Qty'), 
276
-		    'pdf_getlinevatrate' => $langs->trans('VAT'), 
277
-		    'pdf_getlineupexcltax' => $langs->trans('PriceUHT'), 
278
-		    'pdf_getlinetotalexcltax' => $langs->trans('TotalHT'), 
279
-		    'pdf_getlineunit' => $langs->trans('Unit'),
280
-		    'pdf_getlineremisepercent' => $langs->trans('Discount')
275
+			'pdf_getlineqty' => $langs->trans('Qty'), 
276
+			'pdf_getlinevatrate' => $langs->trans('VAT'), 
277
+			'pdf_getlineupexcltax' => $langs->trans('PriceUHT'), 
278
+			'pdf_getlinetotalexcltax' => $langs->trans('TotalHT'), 
279
+			'pdf_getlineunit' => $langs->trans('Unit'),
280
+			'pdf_getlineremisepercent' => $langs->trans('Discount')
281 281
 		);
282 282
 		print $html->multiselectarray('SUBTOTAL_TFIELD_TO_KEEP_WITH_NC', $TField, explode(',', $conf->global->SUBTOTAL_TFIELD_TO_KEEP_WITH_NC), 0, 0, '', 0, 0, 'style="min-width:100px"');
283 283
 		print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
Please login to merge, or discard this patch.
core/triggers/interface_90_modSubtotal_subtotaltrigger.class.php 1 patch
Indentation   +603 added lines, -603 removed lines patch added patch discarded remove patch
@@ -35,64 +35,64 @@  discard block
 block discarded – undo
35 35
  */
36 36
 class Interfacesubtotaltrigger extends DolibarrTriggers
37 37
 {
38
-    /**
39
-     * Constructor
40
-     *
41
-     * 	@param		DoliDB		$db		Database handler
42
-     */
43
-    public function __construct($db)
44
-    {
45
-        $this->db = $db;
46
-
47
-        $this->name = preg_replace('/^Interface/i', '', get_class($this));
48
-        $this->family = "demo";
49
-        $this->description = "Triggers of this module are subtotal functions.";
50
-        // 'development', 'experimental', 'dolibarr' or version
51
-        $this->version = 'development';
52
-        $this->picto = 'subtotal@subtotal';
53
-    }
54
-
55
-    /**
56
-     * Trigger name
57
-     *
58
-     * 	@return		string	Name of trigger file
59
-     */
60
-    public function getName()
61
-    {
62
-        return $this->name;
63
-    }
64
-
65
-    /**
66
-     * Trigger description
67
-     *
68
-     * 	@return		string	Description of trigger file
69
-     */
70
-    public function getDesc()
71
-    {
72
-        return $this->description;
73
-    }
74
-
75
-    /**
76
-     * Trigger version
77
-     *
78
-     * 	@return		string	Version of trigger file
79
-     */
80
-    public function getVersion()
81
-    {
82
-        global $langs;
83
-        $langs->load("admin");
84
-
85
-        if ($this->version == 'development') {
86
-            return $langs->trans("Development");
87
-        } elseif ($this->version == 'experimental')
88
-
89
-                return $langs->trans("Experimental");
90
-        elseif ($this->version == 'dolibarr') return DOL_VERSION;
91
-        elseif ($this->version) return $this->version;
92
-        else {
93
-            return $langs->trans("Unknown");
94
-        }
95
-    }
38
+	/**
39
+	 * Constructor
40
+	 *
41
+	 * 	@param		DoliDB		$db		Database handler
42
+	 */
43
+	public function __construct($db)
44
+	{
45
+		$this->db = $db;
46
+
47
+		$this->name = preg_replace('/^Interface/i', '', get_class($this));
48
+		$this->family = "demo";
49
+		$this->description = "Triggers of this module are subtotal functions.";
50
+		// 'development', 'experimental', 'dolibarr' or version
51
+		$this->version = 'development';
52
+		$this->picto = 'subtotal@subtotal';
53
+	}
54
+
55
+	/**
56
+	 * Trigger name
57
+	 *
58
+	 * 	@return		string	Name of trigger file
59
+	 */
60
+	public function getName()
61
+	{
62
+		return $this->name;
63
+	}
64
+
65
+	/**
66
+	 * Trigger description
67
+	 *
68
+	 * 	@return		string	Description of trigger file
69
+	 */
70
+	public function getDesc()
71
+	{
72
+		return $this->description;
73
+	}
74
+
75
+	/**
76
+	 * Trigger version
77
+	 *
78
+	 * 	@return		string	Version of trigger file
79
+	 */
80
+	public function getVersion()
81
+	{
82
+		global $langs;
83
+		$langs->load("admin");
84
+
85
+		if ($this->version == 'development') {
86
+			return $langs->trans("Development");
87
+		} elseif ($this->version == 'experimental')
88
+
89
+				return $langs->trans("Experimental");
90
+		elseif ($this->version == 'dolibarr') return DOL_VERSION;
91
+		elseif ($this->version) return $this->version;
92
+		else {
93
+			return $langs->trans("Unknown");
94
+		}
95
+	}
96 96
 
97 97
 	public function addToBegin(&$parent, &$object, $rang)
98 98
 	{
@@ -142,27 +142,27 @@  discard block
 block discarded – undo
142 142
 		}
143 143
 	}
144 144
 
145
-    /**
146
-     * Function called when a Dolibarrr business event is done.
147
-     * All functions "runTrigger" are triggered if file
148
-     * is inside directory core/triggers
149
-     *
150
-     * 	@param		string		$action		Event action code
151
-     * 	@param		Object		$object		Object
152
-     * 	@param		User		$user		Object user
153
-     * 	@param		Translate	$langs		Object langs
154
-     * 	@param		conf		$conf		Object conf
155
-     * 	@return		int						<0 if KO, 0 if no triggered ran, >0 if OK
156
-     */
157
-    public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
158
-    {
159
-        // Put here code you want to execute when a Dolibarr business events occurs.
160
-        // Data and type of action are stored into $object and $action
161
-        // Users
162
-        dol_include_once('/subtotal/class/subtotal.class.php');
163
-        $langs->load('subtotal@subtotal');
164
-
165
-        if (!empty($conf->global->SUBTOTAL_ALLOW_ADD_LINE_UNDER_TITLE) && in_array($action, array('LINEPROPAL_INSERT', 'LINEORDER_INSERT', 'LINEBILL_INSERT')))
145
+	/**
146
+	 * Function called when a Dolibarrr business event is done.
147
+	 * All functions "runTrigger" are triggered if file
148
+	 * is inside directory core/triggers
149
+	 *
150
+	 * 	@param		string		$action		Event action code
151
+	 * 	@param		Object		$object		Object
152
+	 * 	@param		User		$user		Object user
153
+	 * 	@param		Translate	$langs		Object langs
154
+	 * 	@param		conf		$conf		Object conf
155
+	 * 	@return		int						<0 if KO, 0 if no triggered ran, >0 if OK
156
+	 */
157
+	public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
158
+	{
159
+		// Put here code you want to execute when a Dolibarr business events occurs.
160
+		// Data and type of action are stored into $object and $action
161
+		// Users
162
+		dol_include_once('/subtotal/class/subtotal.class.php');
163
+		$langs->load('subtotal@subtotal');
164
+
165
+		if (!empty($conf->global->SUBTOTAL_ALLOW_ADD_LINE_UNDER_TITLE) && in_array($action, array('LINEPROPAL_INSERT', 'LINEORDER_INSERT', 'LINEBILL_INSERT')))
166 166
 		{
167 167
 			$rang = GETPOST('under_title', 'int'); // Rang du titre
168 168
 			if ($rang > 0)
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
 						$parent = new Facture($this->db);
181 181
 						$parent->fetch($object->fk_facture);
182 182
 						break;
183
-                    case 'LINEBILL_SUPPLIER_CREATE':
184
-                        $parent = new FactureFournisseur($this->db);
185
-                        $parent->fetch($object->fk_facture_fourn);
183
+					case 'LINEBILL_SUPPLIER_CREATE':
184
+						$parent = new FactureFournisseur($this->db);
185
+						$parent->fetch($object->fk_facture_fourn);
186 186
 					default:
187 187
 						$parent = $object;
188 188
 						break;
@@ -196,77 +196,77 @@  discard block
 block discarded – undo
196 196
 		}
197 197
 
198 198
 
199
-        if ($action == 'LINEBILL_INSERT' || $action == 'LINEBILL_SUPPLIER_CREATE')
199
+		if ($action == 'LINEBILL_INSERT' || $action == 'LINEBILL_SUPPLIER_CREATE')
200 200
 		{
201
-		    $is_supplier = $action == 'LINEBILL_SUPPLIER_CREATE' ? true : false;
202
-            /** @var bool $subtotal_skip Permet d'éviter de faire du traitement en double sur les titres est sous-totaux car ils ont automatiquement le bon rang, il ne faut donc pas faire un addline pour en suite update le rang ici */
203
-		    global $subtotal_skip;
204
-
205
-		    if ($subtotal_skip)
206
-            {
207
-                $subtotal_skip = false;
208
-            }
209
-		    else
210
-            {
211
-			    $subtotal_add_title_bloc_from_orderstoinvoice = GETPOST('subtotal_add_title_bloc_from_orderstoinvoice', 'none');
212
-			    if (!empty($subtotal_add_title_bloc_from_orderstoinvoice))
213
-			    {
214
-				    global $subtotal_current_rang, $subtotal_bloc_previous_fk_commande, $subtotal_bloc_already_add_title, $subtotal_bloc_already_add_st;
215
-
216
-				    $current_fk_commande = TSubtotal::getOrderIdFromLineId($this->db, $object->origin_id, $is_supplier);
217
-				    $last_fk_commandedet = TSubtotal::getLastLineOrderId($this->db, $current_fk_commande, $is_supplier);
218
-
219
-				    if (!$is_supplier){
220
-				        $facture = new Facture($this->db);
221
-				        $ret = $facture->fetch($object->fk_facture);
222
-                    }
223
-				    else
224
-                    {
225
-				        $facture = new FactureFournisseur($this->db);
226
-				        $ret = $facture->fetch($object->fk_facture_fourn);
227
-                    }
228
-
229
-				    if ($ret > 0 && !$subtotal_bloc_already_add_st)
230
-				    {
231
-					    $rang = !empty($subtotal_current_rang) ? $subtotal_current_rang : $object->rang;
232
-					    // Si le fk_commande courrant est différent alors on change de commande => ajout d'un titre
233
-					    if ($current_fk_commande != $subtotal_bloc_previous_fk_commande ) {
234
-                            if (!$is_supplier) $commande = new Commande($this->db);
235
-                            else $commande = new CommandeFournisseur($this->db);
236
-                            $commande->fetch($current_fk_commande);
237
-
238
-                            $label = $conf->global->SUBTOTAL_TEXT_FOR_TITLE_ORDETSTOINVOICE;
239
-                            if (empty($label)) {
240
-                                $label = 'Commande [__REFORDER__]';
241
-                                if (!$is_supplier) $label .= ' - Référence client : [__REFCUSTOMER__]';
242
-                            }
243
-                            $label = str_replace(array('__REFORDER__', '__REFCUSTOMER__'), array($commande->ref, $commande->ref_client), $label);
244
-
245
-                            if(!empty($current_fk_commande)) {
246
-                                $subtotal_skip = true;
247
-                                TSubtotal::addTitle($facture, $label, 1, $rang);
248
-                                $rang++;
249
-                            }
250
-                        }
251
-
252
-                        $object->rang = $rang;
253
-					    $facture->updateRangOfLine($object->id, $rang);
254
-					    $rang++;
255
-					    // Est-ce qu'il s'agit de la dernière ligne de la commande d'origine ? Si oui alors on ajout un sous-total
256
-                            if ($last_fk_commandedet === (int) $object->origin_id && !empty($current_fk_commande))
257
-					    {
258
-                            $subtotal_skip = true;
259
-                            $subtotal_bloc_already_add_st = 1;
260
-                            TSubtotal::addTotal($facture, $langs->trans('SubTotal'), 1, $rang);
261
-                            $subtotal_bloc_already_add_st = 0;
262
-                            $rang++;
263
-					    }
264
-				    }
265
-
266
-				    $subtotal_bloc_previous_fk_commande = $current_fk_commande;
267
-				    $subtotal_current_rang = $rang;
268
-			    }
269
-		    }
201
+			$is_supplier = $action == 'LINEBILL_SUPPLIER_CREATE' ? true : false;
202
+			/** @var bool $subtotal_skip Permet d'éviter de faire du traitement en double sur les titres est sous-totaux car ils ont automatiquement le bon rang, il ne faut donc pas faire un addline pour en suite update le rang ici */
203
+			global $subtotal_skip;
204
+
205
+			if ($subtotal_skip)
206
+			{
207
+				$subtotal_skip = false;
208
+			}
209
+			else
210
+			{
211
+				$subtotal_add_title_bloc_from_orderstoinvoice = GETPOST('subtotal_add_title_bloc_from_orderstoinvoice', 'none');
212
+				if (!empty($subtotal_add_title_bloc_from_orderstoinvoice))
213
+				{
214
+					global $subtotal_current_rang, $subtotal_bloc_previous_fk_commande, $subtotal_bloc_already_add_title, $subtotal_bloc_already_add_st;
215
+
216
+					$current_fk_commande = TSubtotal::getOrderIdFromLineId($this->db, $object->origin_id, $is_supplier);
217
+					$last_fk_commandedet = TSubtotal::getLastLineOrderId($this->db, $current_fk_commande, $is_supplier);
218
+
219
+					if (!$is_supplier){
220
+						$facture = new Facture($this->db);
221
+						$ret = $facture->fetch($object->fk_facture);
222
+					}
223
+					else
224
+					{
225
+						$facture = new FactureFournisseur($this->db);
226
+						$ret = $facture->fetch($object->fk_facture_fourn);
227
+					}
228
+
229
+					if ($ret > 0 && !$subtotal_bloc_already_add_st)
230
+					{
231
+						$rang = !empty($subtotal_current_rang) ? $subtotal_current_rang : $object->rang;
232
+						// Si le fk_commande courrant est différent alors on change de commande => ajout d'un titre
233
+						if ($current_fk_commande != $subtotal_bloc_previous_fk_commande ) {
234
+							if (!$is_supplier) $commande = new Commande($this->db);
235
+							else $commande = new CommandeFournisseur($this->db);
236
+							$commande->fetch($current_fk_commande);
237
+
238
+							$label = $conf->global->SUBTOTAL_TEXT_FOR_TITLE_ORDETSTOINVOICE;
239
+							if (empty($label)) {
240
+								$label = 'Commande [__REFORDER__]';
241
+								if (!$is_supplier) $label .= ' - Référence client : [__REFCUSTOMER__]';
242
+							}
243
+							$label = str_replace(array('__REFORDER__', '__REFCUSTOMER__'), array($commande->ref, $commande->ref_client), $label);
244
+
245
+							if(!empty($current_fk_commande)) {
246
+								$subtotal_skip = true;
247
+								TSubtotal::addTitle($facture, $label, 1, $rang);
248
+								$rang++;
249
+							}
250
+						}
251
+
252
+						$object->rang = $rang;
253
+						$facture->updateRangOfLine($object->id, $rang);
254
+						$rang++;
255
+						// Est-ce qu'il s'agit de la dernière ligne de la commande d'origine ? Si oui alors on ajout un sous-total
256
+							if ($last_fk_commandedet === (int) $object->origin_id && !empty($current_fk_commande))
257
+						{
258
+							$subtotal_skip = true;
259
+							$subtotal_bloc_already_add_st = 1;
260
+							TSubtotal::addTotal($facture, $langs->trans('SubTotal'), 1, $rang);
261
+							$subtotal_bloc_already_add_st = 0;
262
+							$rang++;
263
+						}
264
+					}
265
+
266
+					$subtotal_bloc_previous_fk_commande = $current_fk_commande;
267
+					$subtotal_current_rang = $rang;
268
+				}
269
+			}
270 270
 
271 271
 		}
272 272
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 
282 282
 		if (!empty($conf->global->SUBTOTAL_MANAGE_COMPRIS_NONCOMPRIS) && in_array($action, array('LINEPROPAL_INSERT', 'LINEPROPAL_UPDATE', 'LINEORDER_INSERT', 'LINEORDER_UPDATE', 'LINEBILL_INSERT', 'LINEBILL_UPDATE', 'LINEBILL_SUPPLIER_CREATE', 'LINEBILL_SUPPLIER_UPDATE')))
283 283
 		{
284
-            if(! function_exists('_updateLineNC')) dol_include_once('/subtotal/lib/subtotal.lib.php');
284
+			if(! function_exists('_updateLineNC')) dol_include_once('/subtotal/lib/subtotal.lib.php');
285 285
 
286 286
 			$doli_action = GETPOST('action', 'none');
287 287
 			$set = GETPOST('set', 'none');
@@ -383,166 +383,166 @@  discard block
 block discarded – undo
383 383
 			//exit;
384 384
 		}
385 385
 
386
-        if ($action == 'USER_LOGIN') {
387
-            dol_syslog(
388
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
389
-            );
390
-        } elseif ($action == 'USER_UPDATE_SESSION') {
391
-            // Warning: To increase performances, this action is triggered only if
392
-            // constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
393
-            dol_syslog(
394
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
395
-            );
396
-        } elseif ($action == 'USER_CREATE') {
397
-            dol_syslog(
398
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
399
-            );
400
-        } elseif ($action == 'USER_CREATE_FROM_CONTACT') {
401
-            dol_syslog(
402
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
403
-            );
404
-        } elseif ($action == 'USER_MODIFY') {
405
-            dol_syslog(
406
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
407
-            );
408
-        } elseif ($action == 'USER_NEW_PASSWORD') {
409
-            dol_syslog(
410
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
411
-            );
412
-        } elseif ($action == 'USER_ENABLEDISABLE') {
413
-            dol_syslog(
414
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
415
-            );
416
-        } elseif ($action == 'USER_DELETE') {
417
-            dol_syslog(
418
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
419
-            );
420
-        } elseif ($action == 'USER_LOGOUT') {
421
-            dol_syslog(
422
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
423
-            );
424
-        } elseif ($action == 'USER_SETINGROUP') {
425
-            dol_syslog(
426
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
427
-            );
428
-        } elseif ($action == 'USER_REMOVEFROMGROUP') {
429
-            dol_syslog(
430
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
431
-            );
432
-        }
433
-
434
-        // Groups
435
-        elseif ($action == 'GROUP_CREATE') {
436
-            dol_syslog(
437
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
438
-            );
439
-        } elseif ($action == 'GROUP_MODIFY') {
440
-            dol_syslog(
441
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
442
-            );
443
-        } elseif ($action == 'GROUP_DELETE') {
444
-            dol_syslog(
445
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
446
-            );
447
-        }
448
-
449
-        // Companies
450
-        elseif ($action == 'COMPANY_CREATE') {
451
-            dol_syslog(
452
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
453
-            );
454
-        } elseif ($action == 'COMPANY_MODIFY') {
455
-            dol_syslog(
456
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
457
-            );
458
-        } elseif ($action == 'COMPANY_DELETE') {
459
-            dol_syslog(
460
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
461
-            );
462
-        }
463
-
464
-        // Contacts
465
-        elseif ($action == 'CONTACT_CREATE') {
466
-            dol_syslog(
467
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
468
-            );
469
-        } elseif ($action == 'CONTACT_MODIFY') {
470
-            dol_syslog(
471
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
472
-            );
473
-        } elseif ($action == 'CONTACT_DELETE') {
474
-            dol_syslog(
475
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
476
-            );
477
-        }
478
-
479
-        // Products
480
-        elseif ($action == 'PRODUCT_CREATE') {
481
-            dol_syslog(
482
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
483
-            );
484
-        } elseif ($action == 'PRODUCT_MODIFY') {
485
-            dol_syslog(
486
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
487
-            );
488
-        } elseif ($action == 'PRODUCT_DELETE') {
489
-            dol_syslog(
490
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
491
-            );
492
-        }
493
-
494
-        // Customer orders
495
-        elseif ($action == 'ORDER_VALIDATE') {
496
-            dol_syslog(
497
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
498
-            );
499
-        } elseif ($action == 'ORDER_DELETE') {
500
-            dol_syslog(
501
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
502
-            );
503
-        } elseif ($action == 'ORDER_BUILDDOC') {
504
-            dol_syslog(
505
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
506
-            );
507
-        } elseif ($action == 'ORDER_SENTBYMAIL') {
508
-            dol_syslog(
509
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
510
-            );
511
-        } elseif ($action == 'LINEORDER_INSERT') {
512
-            dol_syslog(
513
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
514
-            );
515
-        } elseif ($action == 'LINEORDER_DELETE') {
516
-            dol_syslog(
517
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
518
-            );
519
-        }
520
-
521
-        // Supplier orders
522
-        elseif ($action == 'ORDER_SUPPLIER_CREATE') {
523
-            dol_syslog(
524
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
525
-            );
526
-        } elseif ($action == 'ORDER_SUPPLIER_VALIDATE') {
527
-            dol_syslog(
528
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
529
-            );
530
-        } elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') {
531
-            dol_syslog(
532
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
533
-            );
534
-        } elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') {
535
-            dol_syslog(
536
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
537
-            );
538
-        }
539
-
540
-        // Proposals
541
-        elseif ((floatval(DOL_VERSION) <= 7.0 && in_array($action, array('PROPAL_CLONE', 'ORDER_CLONE', 'BILL_CLONE'))) ||
542
-                (floatval(DOL_VERSION) >= 8.0 && ! empty($object->context) && in_array('createfromclone', $object->context) && in_array($action, array('PROPAL_CREATE', 'ORDER_CREATE', 'BILL_CREATE')))) {
543
-            dol_syslog(
544
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
545
-            );
386
+		if ($action == 'USER_LOGIN') {
387
+			dol_syslog(
388
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
389
+			);
390
+		} elseif ($action == 'USER_UPDATE_SESSION') {
391
+			// Warning: To increase performances, this action is triggered only if
392
+			// constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
393
+			dol_syslog(
394
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
395
+			);
396
+		} elseif ($action == 'USER_CREATE') {
397
+			dol_syslog(
398
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
399
+			);
400
+		} elseif ($action == 'USER_CREATE_FROM_CONTACT') {
401
+			dol_syslog(
402
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
403
+			);
404
+		} elseif ($action == 'USER_MODIFY') {
405
+			dol_syslog(
406
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
407
+			);
408
+		} elseif ($action == 'USER_NEW_PASSWORD') {
409
+			dol_syslog(
410
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
411
+			);
412
+		} elseif ($action == 'USER_ENABLEDISABLE') {
413
+			dol_syslog(
414
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
415
+			);
416
+		} elseif ($action == 'USER_DELETE') {
417
+			dol_syslog(
418
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
419
+			);
420
+		} elseif ($action == 'USER_LOGOUT') {
421
+			dol_syslog(
422
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
423
+			);
424
+		} elseif ($action == 'USER_SETINGROUP') {
425
+			dol_syslog(
426
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
427
+			);
428
+		} elseif ($action == 'USER_REMOVEFROMGROUP') {
429
+			dol_syslog(
430
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
431
+			);
432
+		}
433
+
434
+		// Groups
435
+		elseif ($action == 'GROUP_CREATE') {
436
+			dol_syslog(
437
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
438
+			);
439
+		} elseif ($action == 'GROUP_MODIFY') {
440
+			dol_syslog(
441
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
442
+			);
443
+		} elseif ($action == 'GROUP_DELETE') {
444
+			dol_syslog(
445
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
446
+			);
447
+		}
448
+
449
+		// Companies
450
+		elseif ($action == 'COMPANY_CREATE') {
451
+			dol_syslog(
452
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
453
+			);
454
+		} elseif ($action == 'COMPANY_MODIFY') {
455
+			dol_syslog(
456
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
457
+			);
458
+		} elseif ($action == 'COMPANY_DELETE') {
459
+			dol_syslog(
460
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
461
+			);
462
+		}
463
+
464
+		// Contacts
465
+		elseif ($action == 'CONTACT_CREATE') {
466
+			dol_syslog(
467
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
468
+			);
469
+		} elseif ($action == 'CONTACT_MODIFY') {
470
+			dol_syslog(
471
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
472
+			);
473
+		} elseif ($action == 'CONTACT_DELETE') {
474
+			dol_syslog(
475
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
476
+			);
477
+		}
478
+
479
+		// Products
480
+		elseif ($action == 'PRODUCT_CREATE') {
481
+			dol_syslog(
482
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
483
+			);
484
+		} elseif ($action == 'PRODUCT_MODIFY') {
485
+			dol_syslog(
486
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
487
+			);
488
+		} elseif ($action == 'PRODUCT_DELETE') {
489
+			dol_syslog(
490
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
491
+			);
492
+		}
493
+
494
+		// Customer orders
495
+		elseif ($action == 'ORDER_VALIDATE') {
496
+			dol_syslog(
497
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
498
+			);
499
+		} elseif ($action == 'ORDER_DELETE') {
500
+			dol_syslog(
501
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
502
+			);
503
+		} elseif ($action == 'ORDER_BUILDDOC') {
504
+			dol_syslog(
505
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
506
+			);
507
+		} elseif ($action == 'ORDER_SENTBYMAIL') {
508
+			dol_syslog(
509
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
510
+			);
511
+		} elseif ($action == 'LINEORDER_INSERT') {
512
+			dol_syslog(
513
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
514
+			);
515
+		} elseif ($action == 'LINEORDER_DELETE') {
516
+			dol_syslog(
517
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
518
+			);
519
+		}
520
+
521
+		// Supplier orders
522
+		elseif ($action == 'ORDER_SUPPLIER_CREATE') {
523
+			dol_syslog(
524
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
525
+			);
526
+		} elseif ($action == 'ORDER_SUPPLIER_VALIDATE') {
527
+			dol_syslog(
528
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
529
+			);
530
+		} elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') {
531
+			dol_syslog(
532
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
533
+			);
534
+		} elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') {
535
+			dol_syslog(
536
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
537
+			);
538
+		}
539
+
540
+		// Proposals
541
+		elseif ((floatval(DOL_VERSION) <= 7.0 && in_array($action, array('PROPAL_CLONE', 'ORDER_CLONE', 'BILL_CLONE'))) ||
542
+				(floatval(DOL_VERSION) >= 8.0 && ! empty($object->context) && in_array('createfromclone', $object->context) && in_array($action, array('PROPAL_CREATE', 'ORDER_CREATE', 'BILL_CREATE')))) {
543
+			dol_syslog(
544
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
545
+			);
546 546
 
547 547
 			$doli_action = GETPOST('action', 'none');
548 548
 
@@ -575,296 +575,296 @@  discard block
 block discarded – undo
575 575
 				if (!empty($line)) $object->update_price(1);
576 576
 			}
577 577
 
578
-        } elseif ($action == 'PROPAL_MODIFY') {
579
-            dol_syslog(
580
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
581
-            );
582
-        } elseif ($action == 'PROPAL_VALIDATE') {
583
-            dol_syslog(
584
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
585
-            );
586
-        } elseif ($action == 'PROPAL_BUILDDOC') {
587
-            dol_syslog(
588
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
589
-            );
590
-        } elseif ($action == 'PROPAL_SENTBYMAIL') {
591
-            dol_syslog(
592
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
593
-            );
594
-        } elseif ($action == 'PROPAL_CLOSE_SIGNED') {
595
-            dol_syslog(
596
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
597
-            );
598
-        } elseif ($action == 'PROPAL_CLOSE_REFUSED') {
599
-            dol_syslog(
600
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
601
-            );
602
-        } elseif ($action == 'PROPAL_DELETE') {
603
-            dol_syslog(
604
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
605
-            );
606
-        } elseif ($action == 'LINEPROPAL_INSERT') {
607
-            dol_syslog(
608
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
609
-            );
610
-        } elseif ($action == 'LINEPROPAL_MODIFY') {
611
-            dol_syslog(
612
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
613
-            );
614
-        } elseif ($action == 'LINEPROPAL_DELETE') {
615
-            dol_syslog(
616
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
617
-            );
618
-        }
619
-
620
-        // Contracts
621
-        elseif ($action == 'CONTRACT_CREATE') {
622
-            dol_syslog(
623
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
624
-            );
625
-        } elseif ($action == 'CONTRACT_MODIFY') {
626
-            dol_syslog(
627
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
628
-            );
629
-        } elseif ($action == 'CONTRACT_ACTIVATE') {
630
-            dol_syslog(
631
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
632
-            );
633
-        } elseif ($action == 'CONTRACT_CANCEL') {
634
-            dol_syslog(
635
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
636
-            );
637
-        } elseif ($action == 'CONTRACT_CLOSE') {
638
-            dol_syslog(
639
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
640
-            );
641
-        } elseif ($action == 'CONTRACT_DELETE') {
642
-            dol_syslog(
643
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
644
-            );
645
-        }
578
+		} elseif ($action == 'PROPAL_MODIFY') {
579
+			dol_syslog(
580
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
581
+			);
582
+		} elseif ($action == 'PROPAL_VALIDATE') {
583
+			dol_syslog(
584
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
585
+			);
586
+		} elseif ($action == 'PROPAL_BUILDDOC') {
587
+			dol_syslog(
588
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
589
+			);
590
+		} elseif ($action == 'PROPAL_SENTBYMAIL') {
591
+			dol_syslog(
592
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
593
+			);
594
+		} elseif ($action == 'PROPAL_CLOSE_SIGNED') {
595
+			dol_syslog(
596
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
597
+			);
598
+		} elseif ($action == 'PROPAL_CLOSE_REFUSED') {
599
+			dol_syslog(
600
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
601
+			);
602
+		} elseif ($action == 'PROPAL_DELETE') {
603
+			dol_syslog(
604
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
605
+			);
606
+		} elseif ($action == 'LINEPROPAL_INSERT') {
607
+			dol_syslog(
608
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
609
+			);
610
+		} elseif ($action == 'LINEPROPAL_MODIFY') {
611
+			dol_syslog(
612
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
613
+			);
614
+		} elseif ($action == 'LINEPROPAL_DELETE') {
615
+			dol_syslog(
616
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
617
+			);
618
+		}
619
+
620
+		// Contracts
621
+		elseif ($action == 'CONTRACT_CREATE') {
622
+			dol_syslog(
623
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
624
+			);
625
+		} elseif ($action == 'CONTRACT_MODIFY') {
626
+			dol_syslog(
627
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
628
+			);
629
+		} elseif ($action == 'CONTRACT_ACTIVATE') {
630
+			dol_syslog(
631
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
632
+			);
633
+		} elseif ($action == 'CONTRACT_CANCEL') {
634
+			dol_syslog(
635
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
636
+			);
637
+		} elseif ($action == 'CONTRACT_CLOSE') {
638
+			dol_syslog(
639
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
640
+			);
641
+		} elseif ($action == 'CONTRACT_DELETE') {
642
+			dol_syslog(
643
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
644
+			);
645
+		}
646 646
 
647 647
 		elseif ($action == 'BILL_MODIFY') {
648
-            dol_syslog(
649
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
650
-            );
651
-
652
-
653
-            global $conf;
654
-
655
-            if (!empty($conf->global->INVOICE_USE_SITUATION) && $object->element == 'facture' && $object->type == Facture::TYPE_SITUATION)
656
-            {
657
-                $object->situation_final = 1;
658
-                foreach($object->lines as $i => $line) {
659
-                    if(!TSubtotal::isModSubtotalLine($line) && $line->situation_percent != 100){
660
-                        $object->situation_final = 0;
661
-                        break;
662
-                    }
663
-                }
664
-                // ne pas utiliser $object->setFinal ne peut pas marcher
665
-                $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture SET situation_final = ' . $object->situation_final . ' where rowid = ' . $object->id;
666
-                $resql=$object->db->query($sql);
667
-            }
668
-
669
-
670
-        } elseif ($action == 'BILL_VALIDATE') {
671
-            dol_syslog(
672
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
673
-            );
674
-        } elseif ($action == 'BILL_BUILDDOC') {
675
-            dol_syslog(
676
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
677
-            );
678
-        } elseif ($action == 'BILL_SENTBYMAIL') {
679
-            dol_syslog(
680
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
681
-            );
682
-        } elseif ($action == 'BILL_CANCEL') {
683
-            dol_syslog(
684
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
685
-            );
686
-        } elseif ($action == 'BILL_DELETE') {
687
-            dol_syslog(
688
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
689
-            );
690
-        } elseif ($action == 'LINEBILL_INSERT') {
691
-
692
-        	dol_syslog(
693
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
694
-            );
695
-        } elseif ($action == 'LINEBILL_DELETE') {
696
-            dol_syslog(
697
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
698
-            );
699
-        }
700
-
701
-        // Payments
702
-        elseif ($action == 'PAYMENT_CUSTOMER_CREATE') {
703
-            dol_syslog(
704
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
705
-            );
706
-        } elseif ($action == 'PAYMENT_SUPPLIER_CREATE') {
707
-            dol_syslog(
708
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
709
-            );
710
-        } elseif ($action == 'PAYMENT_ADD_TO_BANK') {
711
-            dol_syslog(
712
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
713
-            );
714
-        } elseif ($action == 'PAYMENT_DELETE') {
715
-            dol_syslog(
716
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
717
-            );
718
-        }
719
-
720
-        // Interventions
721
-        elseif ($action == 'FICHEINTER_CREATE') {
722
-            dol_syslog(
723
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
724
-            );
725
-        } elseif ($action == 'FICHEINTER_MODIFY') {
726
-            dol_syslog(
727
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
728
-            );
729
-        } elseif ($action == 'FICHEINTER_VALIDATE') {
730
-            dol_syslog(
731
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
732
-            );
733
-        } elseif ($action == 'FICHEINTER_DELETE') {
734
-            dol_syslog(
735
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
736
-            );
737
-        }
738
-
739
-        // Members
740
-        elseif ($action == 'MEMBER_CREATE') {
741
-            dol_syslog(
742
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
743
-            );
744
-        } elseif ($action == 'MEMBER_VALIDATE') {
745
-            dol_syslog(
746
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
747
-            );
748
-        } elseif ($action == 'MEMBER_SUBSCRIPTION') {
749
-            dol_syslog(
750
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
751
-            );
752
-        } elseif ($action == 'MEMBER_MODIFY') {
753
-            dol_syslog(
754
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
755
-            );
756
-        } elseif ($action == 'MEMBER_NEW_PASSWORD') {
757
-            dol_syslog(
758
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
759
-            );
760
-        } elseif ($action == 'MEMBER_RESILIATE') {
761
-            dol_syslog(
762
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
763
-            );
764
-        } elseif ($action == 'MEMBER_DELETE') {
765
-            dol_syslog(
766
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
767
-            );
768
-        }
769
-
770
-        // Categories
771
-        elseif ($action == 'CATEGORY_CREATE') {
772
-            dol_syslog(
773
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
774
-            );
775
-        } elseif ($action == 'CATEGORY_MODIFY') {
776
-            dol_syslog(
777
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
778
-            );
779
-        } elseif ($action == 'CATEGORY_DELETE') {
780
-            dol_syslog(
781
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
782
-            );
783
-        }
784
-
785
-        // Projects
786
-        elseif ($action == 'PROJECT_CREATE') {
787
-            dol_syslog(
788
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
789
-            );
790
-        } elseif ($action == 'PROJECT_MODIFY') {
791
-            dol_syslog(
792
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
793
-            );
794
-        } elseif ($action == 'PROJECT_DELETE') {
795
-            dol_syslog(
796
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
797
-            );
798
-        }
799
-
800
-        // Project tasks
801
-        elseif ($action == 'TASK_CREATE') {
802
-            dol_syslog(
803
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
804
-            );
805
-        } elseif ($action == 'TASK_MODIFY') {
806
-            dol_syslog(
807
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
808
-            );
809
-        } elseif ($action == 'TASK_DELETE') {
810
-            dol_syslog(
811
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
812
-            );
813
-        }
814
-
815
-        // Task time spent
816
-        elseif ($action == 'TASK_TIMESPENT_CREATE') {
817
-            dol_syslog(
818
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
819
-            );
820
-        } elseif ($action == 'TASK_TIMESPENT_MODIFY') {
821
-            dol_syslog(
822
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
823
-            );
824
-        } elseif ($action == 'TASK_TIMESPENT_DELETE') {
825
-            dol_syslog(
826
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
827
-            );
828
-        }
829
-
830
-        // Shipping
831
-        elseif ($action == 'SHIPPING_CREATE') {
832
-            dol_syslog(
833
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
834
-            );
835
-        } elseif ($action == 'SHIPPING_MODIFY') {
836
-            dol_syslog(
837
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
838
-            );
839
-        } elseif ($action == 'SHIPPING_VALIDATE') {
840
-            dol_syslog(
841
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
842
-            );
843
-        } elseif ($action == 'SHIPPING_SENTBYMAIL') {
844
-            dol_syslog(
845
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
846
-            );
847
-        } elseif ($action == 'SHIPPING_DELETE') {
848
-            dol_syslog(
849
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
850
-            );
851
-        } elseif ($action == 'SHIPPING_BUILDDOC') {
852
-            dol_syslog(
853
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
854
-            );
855
-        }
856
-
857
-        // File
858
-        elseif ($action == 'FILE_UPLOAD') {
859
-            dol_syslog(
860
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
861
-            );
862
-        } elseif ($action == 'FILE_DELETE') {
863
-            dol_syslog(
864
-                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
865
-            );
866
-        }
867
-
868
-        return 0;
869
-    }
648
+			dol_syslog(
649
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
650
+			);
651
+
652
+
653
+			global $conf;
654
+
655
+			if (!empty($conf->global->INVOICE_USE_SITUATION) && $object->element == 'facture' && $object->type == Facture::TYPE_SITUATION)
656
+			{
657
+				$object->situation_final = 1;
658
+				foreach($object->lines as $i => $line) {
659
+					if(!TSubtotal::isModSubtotalLine($line) && $line->situation_percent != 100){
660
+						$object->situation_final = 0;
661
+						break;
662
+					}
663
+				}
664
+				// ne pas utiliser $object->setFinal ne peut pas marcher
665
+				$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture SET situation_final = ' . $object->situation_final . ' where rowid = ' . $object->id;
666
+				$resql=$object->db->query($sql);
667
+			}
668
+
669
+
670
+		} elseif ($action == 'BILL_VALIDATE') {
671
+			dol_syslog(
672
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
673
+			);
674
+		} elseif ($action == 'BILL_BUILDDOC') {
675
+			dol_syslog(
676
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
677
+			);
678
+		} elseif ($action == 'BILL_SENTBYMAIL') {
679
+			dol_syslog(
680
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
681
+			);
682
+		} elseif ($action == 'BILL_CANCEL') {
683
+			dol_syslog(
684
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
685
+			);
686
+		} elseif ($action == 'BILL_DELETE') {
687
+			dol_syslog(
688
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
689
+			);
690
+		} elseif ($action == 'LINEBILL_INSERT') {
691
+
692
+			dol_syslog(
693
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
694
+			);
695
+		} elseif ($action == 'LINEBILL_DELETE') {
696
+			dol_syslog(
697
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
698
+			);
699
+		}
700
+
701
+		// Payments
702
+		elseif ($action == 'PAYMENT_CUSTOMER_CREATE') {
703
+			dol_syslog(
704
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
705
+			);
706
+		} elseif ($action == 'PAYMENT_SUPPLIER_CREATE') {
707
+			dol_syslog(
708
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
709
+			);
710
+		} elseif ($action == 'PAYMENT_ADD_TO_BANK') {
711
+			dol_syslog(
712
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
713
+			);
714
+		} elseif ($action == 'PAYMENT_DELETE') {
715
+			dol_syslog(
716
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
717
+			);
718
+		}
719
+
720
+		// Interventions
721
+		elseif ($action == 'FICHEINTER_CREATE') {
722
+			dol_syslog(
723
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
724
+			);
725
+		} elseif ($action == 'FICHEINTER_MODIFY') {
726
+			dol_syslog(
727
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
728
+			);
729
+		} elseif ($action == 'FICHEINTER_VALIDATE') {
730
+			dol_syslog(
731
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
732
+			);
733
+		} elseif ($action == 'FICHEINTER_DELETE') {
734
+			dol_syslog(
735
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
736
+			);
737
+		}
738
+
739
+		// Members
740
+		elseif ($action == 'MEMBER_CREATE') {
741
+			dol_syslog(
742
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
743
+			);
744
+		} elseif ($action == 'MEMBER_VALIDATE') {
745
+			dol_syslog(
746
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
747
+			);
748
+		} elseif ($action == 'MEMBER_SUBSCRIPTION') {
749
+			dol_syslog(
750
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
751
+			);
752
+		} elseif ($action == 'MEMBER_MODIFY') {
753
+			dol_syslog(
754
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
755
+			);
756
+		} elseif ($action == 'MEMBER_NEW_PASSWORD') {
757
+			dol_syslog(
758
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
759
+			);
760
+		} elseif ($action == 'MEMBER_RESILIATE') {
761
+			dol_syslog(
762
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
763
+			);
764
+		} elseif ($action == 'MEMBER_DELETE') {
765
+			dol_syslog(
766
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
767
+			);
768
+		}
769
+
770
+		// Categories
771
+		elseif ($action == 'CATEGORY_CREATE') {
772
+			dol_syslog(
773
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
774
+			);
775
+		} elseif ($action == 'CATEGORY_MODIFY') {
776
+			dol_syslog(
777
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
778
+			);
779
+		} elseif ($action == 'CATEGORY_DELETE') {
780
+			dol_syslog(
781
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
782
+			);
783
+		}
784
+
785
+		// Projects
786
+		elseif ($action == 'PROJECT_CREATE') {
787
+			dol_syslog(
788
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
789
+			);
790
+		} elseif ($action == 'PROJECT_MODIFY') {
791
+			dol_syslog(
792
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
793
+			);
794
+		} elseif ($action == 'PROJECT_DELETE') {
795
+			dol_syslog(
796
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
797
+			);
798
+		}
799
+
800
+		// Project tasks
801
+		elseif ($action == 'TASK_CREATE') {
802
+			dol_syslog(
803
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
804
+			);
805
+		} elseif ($action == 'TASK_MODIFY') {
806
+			dol_syslog(
807
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
808
+			);
809
+		} elseif ($action == 'TASK_DELETE') {
810
+			dol_syslog(
811
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
812
+			);
813
+		}
814
+
815
+		// Task time spent
816
+		elseif ($action == 'TASK_TIMESPENT_CREATE') {
817
+			dol_syslog(
818
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
819
+			);
820
+		} elseif ($action == 'TASK_TIMESPENT_MODIFY') {
821
+			dol_syslog(
822
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
823
+			);
824
+		} elseif ($action == 'TASK_TIMESPENT_DELETE') {
825
+			dol_syslog(
826
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
827
+			);
828
+		}
829
+
830
+		// Shipping
831
+		elseif ($action == 'SHIPPING_CREATE') {
832
+			dol_syslog(
833
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
834
+			);
835
+		} elseif ($action == 'SHIPPING_MODIFY') {
836
+			dol_syslog(
837
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
838
+			);
839
+		} elseif ($action == 'SHIPPING_VALIDATE') {
840
+			dol_syslog(
841
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
842
+			);
843
+		} elseif ($action == 'SHIPPING_SENTBYMAIL') {
844
+			dol_syslog(
845
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
846
+			);
847
+		} elseif ($action == 'SHIPPING_DELETE') {
848
+			dol_syslog(
849
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
850
+			);
851
+		} elseif ($action == 'SHIPPING_BUILDDOC') {
852
+			dol_syslog(
853
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
854
+			);
855
+		}
856
+
857
+		// File
858
+		elseif ($action == 'FILE_UPLOAD') {
859
+			dol_syslog(
860
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
861
+			);
862
+		} elseif ($action == 'FILE_DELETE') {
863
+			dol_syslog(
864
+				"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
865
+			);
866
+		}
867
+
868
+		return 0;
869
+	}
870 870
 }
Please login to merge, or discard this patch.