summaryrefslogtreecommitdiff
path: root/src/Latex.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Latex.php')
-rw-r--r--src/Latex.php35
1 files changed, 31 insertions, 4 deletions
diff --git a/src/Latex.php b/src/Latex.php
index 9ae9435..a766fd6 100644
--- a/src/Latex.php
+++ b/src/Latex.php
@@ -9,6 +9,30 @@ abstract class Latex
9 protected $latexPath = ''; 9 protected $latexPath = '';
10 protected $pdfPath = ''; 10 protected $pdfPath = '';
11 11
12 static function makeLatexSubClass(string $type): Object
13 {
14 switch($type)
15 {
16 // documents pour les clients
17 case 'devis':
18 return new DevisLatex();
19 case 'facture':
20 return new FactireLatex();
21 case 'location':
22 return new LocationLatex();
23 case 'enveloppe_recto':
24 return new EnveloppeRectoLatex();
25 case 'enveloppe_verso':
26 return new EnveloppeVersoLatex();
27
28 // documents pour la compta
29
30 // erreur
31 default:
32 echo 'erreur, la sous-classe latex à initialiser n\'existe pas';
33 }
34 }
35
12 protected function createFile(string $latex, string $fileName, string $latexPath) 36 protected function createFile(string $latex, string $fileName, string $latexPath)
13 { 37 {
14 // nom du fichier créé = nom.tex 38 // nom du fichier créé = nom.tex
@@ -24,6 +48,7 @@ abstract class Latex
24} 48}
25 49
26 50
51
27abstract class PrestaLatex extends Latex 52abstract class PrestaLatex extends Latex
28{ 53{
29 public function __construct(string $quoi, string $codePresta) 54 public function __construct(string $quoi, string $codePresta)
@@ -38,21 +63,23 @@ abstract class PrestaLatex extends Latex
38 } 63 }
39} 64}
40 65
66//~ class PrestaClassFactory extends PrestaLatex
67//~ {}
68
41class DevisLatex extends PrestaLatex 69class DevisLatex extends PrestaLatex
42{} 70{}
43
44class FactureLatex extends PrestaLatex 71class FactureLatex extends PrestaLatex
45{} 72{}
46
47class LocationLatex extends PrestaLatex 73class LocationLatex extends PrestaLatex
48{} 74{}
49 75
50class EnveloppeRectoLatex extends PrestaLatex 76class EnveloppeRectoLatex// extends PrestaLatex
51{} 77{}
52class EnveloppeVersoLatex extends PrestaLatex 78class EnveloppeVersoLatex// extends PrestaLatex
53{} 79{}
54 80
55 81
82
56abstract class ComptaLatex extends Latex 83abstract class ComptaLatex extends Latex
57{ 84{
58 public function __construct(string $quoi, string $annee, int $numeroMois = 0) 85 public function __construct(string $quoi, string $annee, int $numeroMois = 0)