IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Symfony PHP Discussion :

HTML2PDF avec Symfony 4.2


Sujet :

Symfony PHP

  1. #1
    Membre régulier
    Femme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2010
    Messages
    414
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Seine Maritime (Haute Normandie)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Octobre 2010
    Messages : 414
    Points : 111
    Points
    111
    Par défaut HTML2PDF avec Symfony 4.2
    Bonjour,
    Voila je rencontre un petit problème avec mon code. Merci de m'aider !


    Ce que je veux

    J'aimerais générer les factures au format PDF.
    Ce que j'obtiens

    Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
    Fatal error: Unknown: Failed opening required 'C:\xampp\htdocs\devis_facture\vendor\symfony\web-server-bundle/Resources/router.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0
    Ce que je fais

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    <?php
     
     
    namespace App\Controller;
     
     
    use App\Entity\Facture;
    use App\Form\FactureType;
    use App\Service\HTML2PDF;
    use App\Repository\FactureRepository;
    use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
    use Symfony\Component\HttpFoundation\Request;
    use Symfony\Component\HttpFoundation\Response;
    use Symfony\Component\Routing\Annotation\Route;
     
     
    /**
     * @Route("/facture")
     */
    class FactureController extends AbstractController
    {
        //.........
     
     
        /**
         * @Route("facture_pdf/{id}", name="facture_pdf", methods={"GET"})
         */
        public function showPdf(Facture $facture): Response
        {
            $template = $this->render('facture/pdf.html.twig', [
                'facture' => $facture,
            ]);
     
     
          $html2pdf->create('P', 'A4', 'fr', true, 'UTF-8', array(10, 15, 10, 15));
     
     
          return $html2pdf->generatePdf($template, "facture");
        }
    }
    Et la class Html2pdf:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    <?php
    /**
    *génération des factures au format pdf
    */
    namespace App\Service;
     
     
    class HTML2PDF
    {
     private $pdf;
     
     
    public function create($orientation=null, $format=null, $lang=null, $unicode=null, $encoding=null, $margin=null)
    {
      $this->pdf = new \Html2Pdf(
        $orientation ? $orientation : $this->orientation,
        $format ? $format : $this->format,
        $lang ? $lang : $this->lang,
        $unicode ? $unicode : $this->unicode,
        $encoding ? $encoding : $this->encoding,
        $margin ? $margin : $this->margin,
      );
    }
     
     
    public function generatePdf($template, $name)
    {
      $this->pdf->writeHTML($template);
      return $this->pdf->Output($name.'.pdf');
    }
     
     
    }
     
     
    // Fin génération des factures au format pdf
    Le template twig :
    Code Twig : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    <page backtop="0mm" backright="10mm" backbottom="20mm" backleft="10mm">
    	<style type="text/css">
                    <!--  table
                    {
                            width: 100%;
                            border-collapse:collapse;
                    font-size:16px}
     
     
                    .header td
                    {
                            width: 50%;
                    vertical-align: top}
     
     
                    .text-left
                    {
                    text-align: left}
     
     
                    .text-right
                    {
                    text-align: right}
     
     
                    .text-center
                    {
                    text-align: center}
     
     
                    .separator
                    {
                            height: 20px;
                    width: 100%}
     
     
                    .content td
                    {
                            border:solid 1px #CFD1D2;
                            padding: 5px;
                    }
     
     
                    .content th
                    {
                            border:solid 1px #000000;
                            padding: 5px;
                            background-color: #000000;
                    color: #FFFFFF}
     
     
                    .ligne1Content
                    {
                    background-color:#57B223}
     
     
                    .couleurgris
                    {
                            background-color:#DDDDDD;
                            height:auto;
                    }
     
     
                    .tht, .taxe, .ttc
                    {
                            font-size: 1.2em;
                    }
     
     
                    .ttc
                    {
                            color:#57B223;
                            font-weight:bold;
                    }
     
     
                    .couleurverte
                    {
                    background-color: #57B223}
     
     
                    .couleurmoinsgris
                    {
                            background: #EEEEEE;
                    }
     
     
                    .taille1
                    {
                            width:40%;
                    }
     
     
                    .taille2
                    {
                            width:15%;
                    }
     
     
                    .taille3
                    {
                            width:15%;
                    }
     
     
                    .taille4
                    {
                            width:20%;
                    }
     
     
                    .taille5
                    {
                            width:10%;
                    }
     
     
                    .header1
                    {
                    width:50%}
     
     
                    .header2
                    {
                    width:50%}
     
     
                    .tailleligne
                    {
                            height:auto;
                    }
     
     
                    .taille1, taille2, taille3, taille4, taille5
                    {
                            height:auto;
                    }
     
     
                    span
                    {
                            font-size:14px;
                            font-weight:bold;
                            color:#57B223;
                    }
     
     
                    h1, h2, h3
                    {
                            color:#57B223;
                    }
     
     
                    .colorwhite
                    {
                    color:white}
            </style>
    	<table class="header">
    		<tr>
    			<td class="text-lef">
    				<h1>Facture</h1>
    				<br>
    			</td>
    		</tr>
    		<tr>
    			<td class="text-left">
    				<span>DE</span>
    				<br/>
    				<br/>
    				{{ facture.vosinfos }}
    				<br>
    			</td>
    			<td class="text-right">
    				<span>FACTURE N°:</span>
    				 {{ facture.numfacture }}
    				<br/>
    				<br/>
    				<span>DATE: </span>
    				{{ facture.datefacture ? facture.datefacture|date('Y-m-d H:i:s') : '' }}
    				<br/>
    				<br/>
    				<span>N° TVA:</span>
    				{{ facture.numtva }}
    			</td>
    		</tr>
    		<tr>
    			<td class="text-left">
    				<br/>
    				<br/>
    				<br/>
    				<br/>
    				<br/>
    				<br/>
    				<br/>
    				<span>FACTURÉ À</span>
    				<br/>
    				<br/>
    				{{ facture.infosclient }}
    				<br>
    			</td>
    			<td class="text-right"></td>
    		</tr>
    	</table>
    	<table class="content">
    		<thead>
    			<tr class="ligne1Content">
    				<td class="text-left couleurgris taille1">
    					<b>DESIGNATION</b>
    				</td>
    				<td class="text-center couleurmoinsgris taille2">
    					<b>QUANTITE</b>
    				</td>
    				<td class="text-center couleurgris taille3">
    					<b>PRIX HT</b>
    				</td>
    				<td class="text-center couleurgris taille5">
    					<b>TAXE</b>
    				</td>
    				<td class="text-center couleurverte taille4 colorwhite">
    					<b>TOTAL HT</b>
    				</td>
    			</tr>
    		</thead>
    		<tbody>
    			<tr class="couleurgris">
    				<td class="text-left couleurgris taille1">
    					{{ facture.designation1 }}
    				</td>
    				<td class="text-center couleurmoinsgris taille2">
    					{{ facture.quantite1 }}
    				</td>
    				<td class="text-center taille3">
    					{{ facture.prixht1 }}
    				</td>
    				<td class="text-center taille5">
    					{{ facture.taxe1 }}
    				</td>
    				<td class="text-center couleurverte taille4 colorwhite">
                         {{ facture.quantite1 }} * {{ facture.prixht1 }}
    				</td>
    			</tr>
     
     
    <tr class="couleurgris">
    				<td class="text-left couleurgris taille1">
    					{{ facture.designation2 }}
    				</td>
    				<td class="text-center couleurmoinsgris taille2">
    					{{ facture.quantite2 }}
    				</td>
    				<td class="text-center taille3">
    					{{ facture.prixht2 }}
    				</td>
    				<td class="text-center taille5">
    					{{ facture.taxe2 }}
    				</td>
    				<td class="text-center couleurverte taille4 colorwhite">
                         {{ facture.quantite2 }} * {{ facture.prixht2 }}
    				</td>
    			</tr>
    <tr class="couleurgris">
    				<td class="text-left couleurgris taille1">
    					{{ facture.designation3 }}
    				</td>
    				<td class="text-center couleurmoinsgris taille2">
    					{{ facture.quantite3 }}
    				</td>
    				<td class="text-center taille3">
    					{{ facture.prixht3 }}
    				</td>
    				<td class="text-center taille5">
    					{{ facture.taxe3 }}
    				</td>
    				<td class="text-center couleurverte taille4 colorwhite">
                         {{ facture.quantite3 }} * {{ facture.prixht3 }}
    				</td>
    			</tr>
     
     
    		</tbody>
    		<tfoot>
    			<tr>
    				<td colspan="4" class="text-right tht">
    					TOTAL HT
    				</td>
    				<td class="tht text-center">
    					{{ facture.quantite1 }} * {{ facture.prixht1 }} + {{ facture.quantite2 }} * {{ facture.prixht2 }} + {{ facture.quantite3 }} * {{ facture.prixht3 }}
    				</td>
    			</tr>
    			<tr>
    				<td colspan="4" class="text-right tht">
    					TAXE à {{ facture.taxe1 }}
    				</td>
    				<td class="text-center">
    					{{ facture.taxe2 }}
    				</td>
    			</tr>
    			<tr>
    				<td colspan="4" class="text-right">
    					<h3>TOTAL TTC À PAYER</h3>
    				</td>
    				<td class="text-center">
    					<h3></h3>
    				</td>
    			</tr>
    			<tr>
    				<td colspan="5">
    					<span>CONDITIONS ET MOYENS DE PAIEMENT:</span>
    					<br/>
    					{{ facture.conditions }}
    				</td>
    			</tr>
    		</tfoot>
    	</table>
    </page>

    Formatrice - Web développeuse - WebMarketing - Recrutement
    Site O'ClockWeb : http://oclockweb.cvflashjob.com/
    Mon Facebook : https://www.facebook.com/minkoueobame

  2. #2
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2011
    Messages
    351
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Ain (Rhône Alpes)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2011
    Messages : 351
    Points : 582
    Points
    582
    Par défaut
    Salut,

    Est-ce que le fichier router.php existe bien à l'endroit indiqué dans le message d'erreur ? (C:\xampp\htdocs\devis_facture\vendor\symfony\web-server-bundle/Resources/)

  3. #3
    Membre régulier
    Femme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2010
    Messages
    414
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Seine Maritime (Haute Normandie)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Octobre 2010
    Messages : 414
    Points : 111
    Points
    111
    Par défaut
    Justement le fichier router.php n'existe pas, j'ai oublié de le mentionner.
    Formatrice - Web développeuse - WebMarketing - Recrutement
    Site O'ClockWeb : http://oclockweb.cvflashjob.com/
    Mon Facebook : https://www.facebook.com/minkoueobame

  4. #4
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2011
    Messages
    351
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Ain (Rhône Alpes)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2011
    Messages : 351
    Points : 582
    Points
    582
    Par défaut
    Dans ce cas je pense que le plus simple est de ré-installer le "web-server-bundler" avec Composer (supprimer tous le dossier et son contenu, puis composer install pour le ré-installer).

  5. #5
    Membre régulier
    Femme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2010
    Messages
    414
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Seine Maritime (Haute Normandie)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Octobre 2010
    Messages : 414
    Points : 111
    Points
    111
    Par défaut
    ça marche !
    effectivement il fallait que je re-installe web-server-bundler et ensuite j'ai modifié les fichiers comme ceci si ça peut aider à l'avenir :

    Le controller:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    <?php
     
     
    namespace App\Controller;
     
     
    use App\Entity\Facture;
    use App\Form\FactureType;
    use Spipu\Html2Pdf\Html2Pdf;
    use App\Service\T_HTML2PDF;
    use App\Repository\FactureRepository;
    use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
    use Symfony\Component\HttpFoundation\Request;
    use Symfony\Component\HttpFoundation\Response;
    use Symfony\Component\Routing\Annotation\Route;
     
     
    /**
     * @Route("/facture")
     */
    class FactureController extends AbstractController
    {
     
    //......
     
     
        /**
       * @Route("facture_pdf/{id}", name="facture_pdf", methods={"GET"})
         */
        public function showPdf(Facture $facture): Response
        {
            $template = $this->render('facture/pdf.html.twig', [
                'facture' => $facture,
            ]);
     
     
          $html2pdf = new T_Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', array(10, 15, 10, 15));
          $html2pdf->create('P', 'A4', 'fr', true, 'UTF-8', array(10, 15, 10, 15));
     
     
          return $html2pdf->generatePdf($template, "facture");
        }
    }
    La classe T_HTML2PDF :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    <?php
    /**
    *génération des factures et devis au format pdf
    */
    namespace App\Service;
     
     
    //use App\Service\HTML2PDF;
     
     
    use Spipu\Html2Pdf\Html2Pdf;
     
     
    class T_HTML2PDF
    {
     private $pdf;
     
     
    public function create(
      $orientation=null,
      $format=null,
      $lang=null,
      $unicode=null,
      $encoding=null,
      $margin=null
      ):void{
    $this->pdf = new \Spipu\Html2Pdf\Html2Pdf(
        $orientation ? $orientation : $this->orientation,
        $format ? $format : $this->format,
        $lang ? $lang : $this->lang,
        $unicode ? $unicode : $this->unicode,
        $encoding ? $encoding : $this->encoding,
        $margin ? $margin : $this->margin,
      );
    }
     
     
    public function generatePdf($template, $name)
    {
      $this->pdf->writeHTML($template);
      return $this->pdf->Output($name.'.pdf');
    }
     
     
    }
     
     
    // Fin génération des factures et devis au format pdf
    Le template twig :
    Code Twig : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    <page backtop="0mm" backright="10mm" backbottom="20mm" backleft="10mm">
        <style type="text/css">
            <!--  table
            {
                width: 100%;
                border-collapse:collapse;
            font-size:16px}
     
     
            .header td
            {
                width: 50%;
            vertical-align: top}
     
     
            .text-left
            {
            text-align: left}
     
     
            .text-right
            {
            text-align: right}
     
     
            .text-center
            {
            text-align: center}
     
     
            .separator
            {
                height: 20px;
            width: 100%}
     
     
            .content td
            {
                border:solid 1px #CFD1D2;
                padding: 5px;
            }
     
     
            .content th
            {
                border:solid 1px #000000;
                padding: 5px;
                background-color: #000000;
            color: #FFFFFF}
     
     
            .ligne1Content
            {
            background-color:#57B223}
     
     
            .couleurgris
            {
                background-color:#DDDDDD;
                height:auto;
            }
     
     
            .tht, .taxe, .ttc
            {
                font-size: 1.2em;
            }
     
     
            .ttc
            {
                color:#57B223;
                font-weight:bold;
            }
     
     
            .couleurverte
            {
            background-color: #57B223}
     
     
            .couleurmoinsgris
            {
                background: #EEEEEE;
            }
     
     
            .taille1
            {
                width:40%;
            }
     
     
            .taille2
            {
                width:15%;
            }
     
     
            .taille3
            {
                width:15%;
            }
     
     
            .taille4
            {
                width:20%;
            }
     
     
            .taille5
            {
                width:10%;
            }
     
     
            .header1
            {
            width:50%}
     
     
            .header2
            {
            width:50%}
     
     
            .tailleligne
            {
                height:auto;
            }
     
     
            .taille1, taille2, taille3, taille4, taille5
            {
                height:auto;
            }
     
     
            span
            {
                font-size:14px;
                font-weight:bold;
                color:#57B223;
            }
     
     
            h1, h2, h3
            {
                color:#57B223;
            }
     
     
            .colorwhite
            {
            color:white}
        </style>
        <table class="header">
            <tr>
                <td class="text-lef">
                    <h1>Facture</h1>
                    <br>
                </td>
            </tr>
            <tr>
                <td class="text-left">
                    <span>DE</span>
                    <br/>
                    <br/>
                    {{ facture.vosinfos }}
                    <br>
                </td>
                <td class="text-right">
                    <span>FACTURE N°:</span>
                     {{ facture.numfacture }}
                    <br/>
                    <br/>
                    <span>DATE: </span>
                    {{ facture.datefacture ? facture.datefacture|date('d-m-Y') : '' }}
                    <br/>
                    <br/>
                    <span>N° TVA:</span>
                    {{ facture.numtva }}
                </td>
            </tr>
            <tr>
                <td class="text-left">
                    <br/>
                    <br/>
                    <br/>
                    <br/>
                    <br/>
                    <br/>
                    <br/>
                    <span>FACTURÉ À</span>
                    <br/>
                    <br/>
                    {{ facture.infosclient }}
                    <br>
                </td>
                <td class="text-right"></td>
            </tr>
        </table>
        <table class="content">
            <thead>
                <tr class="ligne1Content">
                    <td class="text-left couleurgris taille1">
                        <b>PRESTATION</b>
                    </td>
                    <td class="text-center couleurmoinsgris taille2">
                        <b>QUANTITÉ</b>
                    </td>
                    <td class="text-center couleurgris taille3">
                        <b>PRIX HT</b>
                    </td>
                    <td class="text-center couleurgris taille5">
                        <b>TAXE</b>
                    </td>
                    <td class="text-center couleurverte taille4 colorwhite">
                        <b>TOTAL HT</b>
                    </td>
                </tr>
            </thead>
            <tbody>
                <tr class="couleurgris">
                    <td class="text-left couleurgris taille1">
                        {{ facture.designation1 }}
                    </td>
                    <td class="text-center couleurmoinsgris taille2">
                        {{ facture.quantite1 }}
                    </td>
                    <td class="text-center taille3">
                        {{ facture.prixht1 }}</td>
                    <td class="text-center taille5">
                        {{ facture.taxe1 }}%
                    </td>
                    <td class="text-center couleurverte taille4 colorwhite">
                         {{ facture.quantite1 * facture.prixht1 }}</td>
                </tr>
     
     
    <tr class="couleurgris">
                    <td class="text-left couleurgris taille1">
                        {{ facture.designation2 }}
                    </td>
                    <td class="text-center couleurmoinsgris taille2">
                        {{ facture.quantite2 }}
                    </td>
                    <td class="text-center taille3">
                        {{ facture.prixht2 }}</td>
                    <td class="text-center taille5">
                        {{ facture.taxe2 }}%
                    </td>
                    <td class="text-center couleurverte taille4 colorwhite">
                         {{ facture.quantite2 * facture.prixht2 }}</td>
                </tr>
    <tr class="couleurgris">
                    <td class="text-left couleurgris taille1">
                        {{ facture.designation3 }}
                    </td>
                    <td class="text-center couleurmoinsgris taille2">
                        {{ facture.quantite3 }}
                    </td>
                    <td class="text-center taille3">
                        {{ facture.prixht3 }}</td>
                    <td class="text-center taille5">
                        {{ facture.taxe3 }}%
                    </td>
                    <td class="text-center couleurverte taille4 colorwhite">
                         {{ facture.quantite3 * facture.prixht3 }}</td>
                </tr>
     
     
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="4" class="text-right tht">
                        TOTAL HT
                    </td>
                    <td class="tht text-center">
                        {{ facture.quantite1 * facture.prixht1 + facture.quantite2 * facture.prixht2 + facture.quantite3 * facture.prixht3 }}</td>
                </tr>
                <tr>
                    <td colspan="4" class="text-right tht">
                        TAXE à {{ facture.taxe1 }}%
                    </td>
                    <td class="text-center">
                        {{ facture.prixht1 * (1+(facture.taxe1/100)) }}</td>
                </tr>
     
     
                <tr>
                    <td colspan="4" class="text-right tht">
                        TAXE à {{ facture.taxe2 }}%
                    </td>
                    <td class="text-center">
                        {{ facture.prixht2 * (1+(facture.taxe2/100)) }}</td>
                </tr>
     
     
                <tr>
                    <td colspan="4" class="text-right tht">
                        TAXE à {{ facture.taxe3 }}%
                    </td>
                    <td class="text-center">
                        {{ facture.prixht3 * (1+(facture.taxe3/100)) }}</td>
                </tr>
                <tr>
                    <td colspan="4" class="text-right">
                        <h3>TOTAL TTC À PAYER</h3>
                    </td>
                    <td class="text-center">
                        <h3> {{ (facture.quantite1 * facture.prixht1 + facture.quantite2 * facture.prixht2 + facture.quantite3 * facture.prixht3) + (facture.prixht1 * (1+(facture.taxe1/100)))+(facture.prixht2 * (1+(facture.taxe2/100)))+(facture.prixht3 * (1+(facture.taxe3/100))) }}</h3>
                    </td>
                </tr>
                <tr>
                    <td colspan="5">
                        <span>CONDITIONS ET MOYENS DE PAIEMENT:</span>
                        <br/>
                        {{ facture.conditions }}
                    </td>
                </tr>
     
     
                <tr>
                    <td colspan="5">
                        <span>NOTES OU REMARQUES PARTICULIÈRES:</span>
                        <br/>
                        {{ facture.consignes }}
                    </td>
                </tr>
            </tfoot>
        </table>
    </page>
    Formatrice - Web développeuse - WebMarketing - Recrutement
    Site O'ClockWeb : http://oclockweb.cvflashjob.com/
    Mon Facebook : https://www.facebook.com/minkoueobame

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [1.x] Validation conditionnelle avec Symfony
    Par MacReiben dans le forum Symfony
    Réponses: 1
    Dernier message: 17/07/2008, 13h25
  2. [1.x] Problème de génération de model propel avec symfony 1.1
    Par youknowriad dans le forum Symfony
    Réponses: 2
    Dernier message: 04/07/2008, 16h13
  3. [1.x] Message d'erreur avec symfony propel-build-model
    Par thewind1 dans le forum Symfony
    Réponses: 6
    Dernier message: 03/04/2008, 18h09
  4. [1.x] Retours d'expérience avec Symfony
    Par ygrim dans le forum Symfony
    Réponses: 6
    Dernier message: 05/09/2007, 15h13

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo