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 :

symfony2 popup avec iframe fonctionne selon le contexte


Sujet :

Symfony PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2016
    Messages
    17
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2016
    Messages : 17
    Par défaut symfony2 popup avec iframe fonctionne selon le contexte
    Bonjour, j'essaie d'ouvrir une popup dans un projet symfony2
    j'y arrive en ajoutant ce code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <a href="javascript:void(0);" class="po-invoice" data-original-title="Facture" data-content='
                            <iframe src="{{ path('admin_stock_article_list') }}" width="700" height="500"></iframe>
                        '><i class="icon-search"></i></a>
    dans cette page

    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
    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
    {% extends 'SonataAdminBundle:CRUD:list.html.twig' %}
    {% set DISPLAY_NONE = constant('tahiti\\BillingBundle\\Entity\\Invoice::DISPLAY_NONE') %}
    {% set DISPLAY_CHAPTER = constant('tahiti\\BillingBundle\\Entity\\Invoice::DISPLAY_CHAPTER') %}
    {% set DISPLAY_DETAIL = constant('tahiti\\BillingBundle\\Entity\\Invoice::DISPLAY_DETAIL') %}
     
    {% block javascripts %}
        {{ parent() }}
        <script>
        $(function(){
            $('.po').popover({ html: true, placement: 'right' });
            $('.tt').tooltip({ html: true, placement: 'top' });
     
            $('.po-invoice').popover({ html: true, placement: 'bottom' }).on("click", function(){
                $('.popover').addClass('po-invoice-custom'); //Add class .dynamic-class to <div>
            });
     
            $('.paymentModeBtn').on('click', function(event) {
                event.preventDefault();
                elt = $(this);
                $.post(elt.attr('href'), function(data) {
                    elt.closest('.btn-group').find('.label-update').html(data);
                });
            });
     
            $('.displayBtn').on('click', function(event) {
                event.preventDefault();
                elt = $(this);
                $.post(elt.attr('href'), function(data) {
                    elt.closest('.btn-group').find('.label-update').html(data);
                });
            });
     
            $('.validateBtn').on('click', function(event) {
                event.preventDefault();
                elt = $(this);
                var td = elt.parent();
                var tr = elt.closest('tr');
                var creationDate = td.find('.date').val();
     
                if (window.confirm(this.title ||
                    'Etes vous sûr de vouloir valider la facture ?\n'+
                    'Le numéro de facture va être généré et la facture sera validée à la date saisie'
                )) {
                    $.post(elt.attr('href'), {creationDate: creationDate}, function(data) {
                    tr.find('.badge').attr('style', 'background: #0086cc;');
                    tr.find('.badge').html(data.status);
                    tr.find('.ref').html(data.ref);
                    td.html('<a href="'+elt.attr('rel')+'" class="btn btn-info">Modifier</a>');
                }, 'json');
                }
     
            });
     
            $('.chargedBtn').on('click', function(event) {
                event.preventDefault();
                elt = $(this);
                var td = elt.parent();
                var tr = elt.closest('tr');
     
                if (window.confirm(this.title ||
                    'Etes vous sûr de vouloir passer la facture en état PAYÉ ?\n'+
                    'Si oui, merci de confirmer'
                )) {
                    $.post(elt.attr('href'), function(data) {
                        tr.find('.badge').attr('style', 'background: #a800cc;');
                        tr.find('.badge').html(data.status);
                        td.html('<i class="icon-ok"></i>');
                    }, 'json');
                }
            });
        });
        </script>
    {% endblock %}
     
    {% block table_header %}
        <thead>
            <tr>
                <th></th>
     
                <th class="txtC">Créé le</th>
                {% if status.code != 'INVOICE_INPROCESS' %}
                    <th class="txtC">Références</th>
                {% endif %}
                <th class="txtC">Aperçu</th>
                <th class="txtC">Commande</th>
                <th class="txtC">Devis</th>
                <th>Client/Station</th>
                <th class="txtC">Chapitres/Lignes</th>
                <th class="txtR">Montant</th>
                {#<th>Status</th>#}
     
                <th>Action</th>
            </tr>
        </thead>
    {% endblock %}
     
    {% block table_body %}
        <tbody class="invoice-table">
            {% for object in admin.datagrid.results %}
                <tr>
                    <td><input type="checkbox" name="idx[]" value="{{ object.id }}"/></td>
                    <td class="txtC">
                        <span>{{ object.createdAt|date('d/m/Y') }}</span><br/>
                        {{ object.createdBy.fullname }}
                    </td>
                    {% if status.code != 'INVOICE_INPROCESS' %}
                        <td class="txtC">
                            <span>{{ object.ref }}</span>
                        </td>
                    {% endif %}
                    <td class="txtC">
                        <a href="javascript:void();" class="po-invoice" data-original-title="Facture" data-content='
                            <iframe src="{{ path('admin_billing_invoice_print', {id : object.id}) }}" width="700" height="500"></iframe>
                        '><i class="icon-search"></i></a>
     
     
     
     
                                            <a href="javascript:void(0);" class="po-invoice" data-original-title="Facture" data-content='
                            <iframe src="{{ path('admin_stock_article_list') }}" width="700" height="500"></iframe>
                        '><i class="icon-search"></i></a>
     
     
     
     
                    </td>
                    <td class="txtC">
                        {% for quotation in object.quotations if quotation.orderRef is not empty %}
                            <span>{{ quotation.orderRef }}</span><br/>
                        {% endfor %}
                    </td>
                    <td class="txtC">
                        <strong>{{ object.quotations|length }}</strong><br/>
                        {% if object.quotations|length > 0 %}
                            {% for quotation in object.quotations %}
                                <a href="{{ path('admin_billing_quotation_show', { id: quotation.id }) }}"><small>{{ quotation.ref }}</small></a><br/>
                            {% endfor %}
                            <br/>
                        {% endif %}
                    </td>
                    <td>
                        <a href="javascript:void();" class="po link" data-original-title="Client et Destinataire" data-content='
                        <strong>Client : {{ object.client }}</strong><br/>
                        <i class="icon-home"></i> {{ object.client.address }} - {{ object.client.postcode }} {{ object.client.city }}<br/>
                        <i class="icon-phone"></i>{{ object.client.tel }}<br/>
                        <i class="icon-print"></i>{{ object.client.fax }}<br/>
                        <i class="icon-envelope"></i>{{ object.client.email }}<br/>
                        <br/>
                        <strong>Destinataire : {{ object.contact }}</strong><br/>
                        <i class="icon-home"></i> {{ object.contact.address }} - {{ object.contact.postcode }} {{ object.contact.city }}<br/>
                        <i class="icon-phone"></i>{{ object.contact.tel }}<br/>
                        <i class="icon-print"></i>{{ object.contact.fax }}<br/>
                        <i class="icon-envelope"></i>{{ object.contact.email }}<br/>
                        '>{{ object.client }} <i class="icon-info-sign soft"></i></a><br/>
                        <em class="med">{{ object.station }}</em>
                    </td>
                    <td class="txtC">
                        <strong>{{ object.chapterCount }}</strong>
                        <span class="med">{{ object.lineCount }}</span>
                    </td>
                    <td class="txtR"><strong>{{ object.totalExcVat|number_format(2,',', ' ') }} €</strong></td>
     
                    {#<td><span class="badge" style="background: #{{ object.status.color }};">{{ object.status }}</span></td>
                    <td>
                        <div class="btn-group">
                            <button class="btn btn-mini btn-info label-update">{{ object.paymentMode }}</button>
                            <button class="btn btn-mini btn-info dropdown-toggle" data-toggle="dropdown">
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu">
                                {% for p in paymentModes %}
                                    <li><a href="{{ path('admin_billing_invoice_paymentMode', { id: object.id, mode: p.id, ajax: true }) }}" class="paymentModeBtn">{{ p }}</a></li>
                                {% endfor %}
                            </ul>
                        </div>
                        <div class="btn-group" style="margin-left: 0; margin-top: 3px;">
                            <button class="btn btn-mini btn-info label-update">
                                {{ (object.display == DISPLAY_NONE) ? 'Aucun détail' }}
                                {{ (object.display == DISPLAY_CHAPTER) ? 'Chapitres' }}
                                {{ (object.display == DISPLAY_DETAIL) ? 'Détaillé' }}
                            </button>
                            <button class="btn btn-mini btn-info dropdown-toggle" data-toggle="dropdown">
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu">
                                <li><a href="{{ path('admin_billing_invoice_displayMode', { id: object.id, mode: DISPLAY_NONE , ajax: true }) }}" class="displayBtn">Aucun détail</a></li>
                                {% if object.hasChapter %}
                                    <li><a href="{{ path('admin_billing_invoice_displayMode', { id: object.id, mode: DISPLAY_CHAPTER, ajax: true }) }}" class="displayBtn">Chapitre</a></li>
                                {% endif %}
                                <li><a href="{{ path('admin_billing_invoice_displayMode', { id: object.id, mode: DISPLAY_DETAIL, ajax: true }) }}" class="displayBtn">Détaillé</a></li>
                            </ul>
                        </div>
                    </td>
                    #}
                    <td>
                        {# if object.creationDate is empty %}
                            <input name="date" type="text" class="tt date" style="width: 80px;" title="<strong>Date souhaitée :</strong><br/>{{ object.preferedDate|date('d/m/Y') }}<br/><strong>Commentaire :</strong><br/> {{ object.info }}" value="{{ object.preferedDate|date('d/m/Y') }}" />
                            <a href="{{ path('admin_billing_invoice_validate', { id: object.id }) }}" class="btn btn-success validateBtn" rel="{{ path('admin_billing_invoice_show', { id: object.id }) }}">Valider</a>
                        {% else %}
                            <a href="{{ path('admin_billing_invoice_show', { id: object.id }) }}" class="btn btn-info">Modifier</a>
                        {% endif #}
                        {% if object.status.code == 'INVOICE_INPROCESS' %}
                            <a href="{{ path('admin_billing_invoice_show', { id: object.id }) }}" class="btn btn-success">Voir</a>
                        {% else %}
                            <a href="{{ path('admin_billing_invoice_show', { id: object.id }) }}" class="btn btn-info">Modifier</a>
                        {% endif %}
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    {% endblock %}
     
    {% block list_filters %}
        {% if admin.datagrid.filters %}
            <form class="sonata-filter-form form-stacked {{ admin.isChild and 1 == admin.datagrid.filters|length ? 'hide' : '' }}" action="{{ admin.generateUrl('list') }}" method="GET">
                <fieldset class="filter_legend">
                    <legend class="filter_legend {{ admin.datagrid.hasActiveFilters ? 'active' : 'inactive' }}">{% trans from 'SonataAdminBundle' %}label_filters{% endtrans %}</legend>
                    <div class="filter_container inactive" style="display: none;">
                        <table class="table table-bordered">
                            {% for filter in admin.datagrid.filters %}
                            <tr id="filter_{{ filter.name }}_row" class="filter {{ filter.isActive ? 'active' : 'inactive' }}">
                                    <td class="filter-title">{{ admin.trans(filter.label) }}</td>
                                    <td class="filter-type">{{ form_widget(form.getChild(filter.formName).getChild('type')) }}</td>
                                    <td class="filter-value">{{ form_widget(form.getChild(filter.formName).getChild('value')) }}</td>
                                </tr>
                            {% endfor %}
                        </table>
                        <input type="hidden" name="filter[_page]" id="filter__page" value="1" />
                        {% set foo = form.getChild('_page').setRendered() %}
                        {{ form_rest(form) }}
                        <input type="submit" class="btn primary" value="{% trans from 'SonataAdminBundle' %}btn_filter{% endtrans %}" />
                        <a class="btn" href="{{ admin.generateUrl('list') }}">{% trans from 'SonataAdminBundle' %}link_reset_filter{% endtrans %}</a>
                    </div>
                </fieldset>
            </form>
        {% endif %}
        <ul class="nav nav-pills">
            <li class="{{ (status.code == 'INVOICE_INPROCESS') ? 'active' }}"><a href="{{ path('admin_billing_invoice_filter') }}?status=INVOICE_INPROCESS">Devis à traiter</a></li>
            <li class="{{ (status.code == 'INVOICED') ? 'active' }}"><a href="{{ path('admin_billing_invoice_filter') }}?status=INVOICED">Factures à comptabiliser</a></li>
            <li class="{{ (status.code == 'INVOICE_ACCOUNTED') ? 'active' }}"><a href="{{ path('admin_billing_invoice_filter') }}?status=INVOICE_ACCOUNTED">Factures comptabilisées</a></li>
            <li class="{{ (status.code == 'INVOICE_PAYED') ? 'active' }}"><a href="{{ path('admin_billing_invoice_filter') }}?status=INVOICE_PAYED">Factures payées</a></li>
        </ul>
    {% endblock %}
    par contre cela ne fonctionne pas en mettant le même code dans cette autre page
    je ne comprend pas d'autant plus que je n'ai pas d'erreur JS sur la console ni d'erreurs PHP coté serveur

    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
    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
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    {% extends 'SonataAdminBundle:CRUD:edit.html.twig' %}
     
    {% block form %}
     
    {% if action == 'create' %}
        {% set url = path('admin_billing_order_create') %}
    {% else %}
        {% set url = path('admin_billing_order_edit', { 'id': object.id }) %}
    {% endif %}
     
    <form class="order-form" action="{{ url }}" method="post">
        {{ form_widget(form._token) }}
        <fieldset>
            <legend>Affectation {{ form_errors(form) }}</legend>
            <div class="row-fluid" style="padding-top: 10px">
                <div class="span3">
                    <div class="control-group">
                        <label class="control-label">Stock</label>
                        <div class="controls">
                            {{ form_widget(form.stock) }}
                        </div>
                    </div>
                </div>
                <div class="span1">
                    <span style="font-size: 30px; display: block; padding-top: 20px; text-align: center;">Ou</span>
                </div>
                <div class="span3">
                    <div class="control-group">
                        <label class="control-label">Intervention</label>
                        <div class="controls">
                            {{ form_widget(form.interventionSearch) }}
                        </div>
                    </div>
                </div>
        </fieldset>
        <div class="row-fluid">
            <div class="span4">
                <fieldset>
                    <legend>General</legend>
                    <div class="control-group">
                        <label class="control-label">Ref devis fournisseur</label>
                        <div class="controls">
                            {{ form_widget(form.supplierRef) }}
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Nature *</label>
                        <div class="controls">
                            {{ form_widget(form.nature) }}
                            <div class="errors">
                            {{ form_errors(form.nature) }}
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Corps d'état *</label>
                        <div class="controls">
                            {{ form_widget(form.job) }}
                            <div class="errors">
                            {{ form_errors(form.job) }}
                            </div>
                        </div>
                    </div>
                </fieldset>
            </div>
     
            <div class="span4">
                <fieldset>
                    <legend>Fournisseur</legend>
                    <div class="control-group">
                        <label class="control-label">Fournisseur *</label>
                        <div class="controls">
                            {{ form_widget(form.companySearch) }}
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Magasin *</label>
                        <div class="controls">
                            {{ form_widget(form.supplierSearch) }}
                            <a href="#modal" role="button" class="btn addSupplier" data-toggle="modal" style="{{ (object.supplier is empty) ? "display: none;" }}"><i class="icon-plus-sign"></i></a>
                        </div>
                    </div>
                </fieldset>
            </div>
     
            <div class="span4">
                <fieldset>
                    <legend>Livraison</legend>
                    <div class="control-group delivery-container">
                        <label class="control-label">Livraison *</label>
                        <div class="controls">
                            {{ form_errors(form.deliveryType) }}
                            {{ form_widget(form.deliveryType) }}
                        </div>
                    </div>
                    <div class="control-group retreivedBy" {% if object.retrievedBy is empty %}style="display:none;"{% endif %}>
                        <label class="control-label">Enlevé par *</label>
                        <div class="controls">
                            {{ form_widget(form.userSearch) }}
                        </div>
                    </div>
     
                    <div class="control-group">
                        <label class="control-label">Souhaitée le *</label>
                        <div class="controls">
                            {{ form_widget(form.deliveryDesiredDate) }}
                            <div class="errors">
                            {{ form_errors(form.deliveryDesiredDate) }}
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Adresse *</label>
                        <div class="controls">
                            {{ form_widget(form.address) }}
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Code postal *</label>
                        <div class="controls">
                            {{ form_widget(form.postcode) }}
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Ville *</label>
                        <div class="controls">
                            {{ form_widget(form.city) }}
                        </div>
                    </div>
                </fieldset>
            </div>
        </div>
     
    {% if action == 'edit' %}
        <fieldset>
            <legend>Commentaire</legend>
            <div class="control-group">
                <div class="controls">
                    {{ form_widget(form.comment) }}
                </div>
            </div>
        </fieldset>
        <fieldset style="margin: 30px 0">
            <table class="lines table table-striped">
                <thead>
                    <tr>
                        <th>Article</th>
                        <th>Unité</th>
                        <th>Prix Unitaire</th>
                        <th>Eco-contrib.</th>
                        <th>Quantité</th>
                        <th>Réduction</th>
                        <th>Montant</th>
                        <th>&nbsp;</th>
                        <th>Commentaire</th>
                        <th>&nbsp;</th>
                    </tr>
                </thead>
                <tbody>
                    {% for key,line in object.lines %}
                        <tr>
                            <td>
                                <input type="hidden" name="id" value="{{ line.id }}" class="line-id" />
                                {% if line.article is not empty %}
                                    <input id="article{{key}}" type="hidden" name="article_id" class="articleSearch" value="{{ line.article.label }}">
                                {% endif %}
                            </td>
                            <td><input type="text" name="unit" class="unit required callSave" value="{{ line.unit }}" placeholder="U"></td>
                            <td>
                                <div class="input-prepend">
                                    <span class="add-on">&euro;</span>
                                    <input type="text" name="price" class="price required callSave tt number" value="{{ line.price }}"
                                    {% if line.article is not empty %}
                                    title="Prix commandé<br>moyen {{line.article.price }} &euro;<br>min {{ line.article.priceMin }} &euro;<br>max {{ line.article.priceMax }} &euro;
                                    {% endif %}
                                    ">
                                </div>
                            </td>
                            <td>
                                <div class="input-prepend">
                                    <span class="add-on">&euro;</span>
                                    <input type="text" name="eco" class="eco required callSave tt number" value="{{ line.eco }}">
                                </div>
                            </td>
                            <td><input type="text" name="quantity" class="quantity required callSave number" value="{{ line.quantity }}"></td>
                            <td>
                                <div class="input-append">
                                    <input type="text" name="discount" class="discount callSave number" value="{{ line.discount }}">
                                    <span class="add-on">%</span>
                                </div>
                            </td>
                            <td class="total"></td>
                            <td>
                                <select name="vat" class="callSave" style="width: 65px">
                                    {% for vat in vats %}
                                        <option value="{{ vat.id }}" {% if line.vat is not empty and line.vat.id == vat.id %}selected="selected"{% endif %}>{{ vat }}</option>
                                    {% endfor %}
                                </select>
                            </td>
                            <td>
                                <input type="text" name="comment" class="comment callSave" value="{{ line.comment }}">
                            </td>
                            <td><a href="#" class="btn btn-danger remove"><i class="icon-remove"></i></a></td>
                        </tr>
                    {% endfor %}
                    <tr>
                        <td>
                            <input type="hidden" name="id" value="" class="line-id" />
                            <input type="hidden" name="article_id" class="articleSearch">
                            <a href="#" class="btn btn-danger out" title="Hors base article"><i class="icon-signout"></i></a>
     
     
     
     
     
     
     
                                            <a href="javascript:alert('1');void(0);alert('2');" class="po-invoice" data-original-title="Facture" data-content='
                            <iframe src="{{ path('admin_stock_article_list') }}" width="700" height="500"></iframe>
                        '><i class="icon-search"></i></a>
     
     
     
     
     
     
                        </td>
                        <td><input type="text" name="unit" class="unit required callSave" placeholder="U"></td>
                        <td>
                            <div class="input-prepend">
                                <span class="add-on">&euro;</span>
                                <input type="text" name="price" class="price required callSave tt number">
                            </div>
                        </td>
                        <td>
                            <div class="input-prepend">
                                <span class="add-on">&euro;</span>
                                <input type="text" name="eco" class="eco required callSave tt number" value="0">
                            </div>
                        </td>
                        <td><input type="text" name="quantity" class="quantity required callSave number" value="1"></td>
     
                        <td>
                            <div class="input-append">
                                <input type="text" name="discount" class="discount callSave number" value="0">
                                <span class="add-on">%</span>
                            </div>
                        </td>
                        <td class="total"></td>
                        <td>
                            <select name="vat" class="callSave" style="width: 65px">
                                {% for vat in vats %}
                                    <option value="{{ vat.id }}">{{ vat }}</option>
                                {% endfor %}
                            </select>
                        </td>
                        <td>
                            <input type="text" name="comment" class="comment callSave" value="">
                        </td>
                        <td><a href="#" class="btn btn-danger remove"><i class="icon-remove"></i></a></td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td>Nombre d'article : <span class="counter">XXX</span></td>
                        <td colspan="6" style="text-align: right">Total : <span class="total">XXX</span></td>
                        <td colspan="2"></td>
                    </tr>
                </tfoot>
            </table>
        </fieldset>
    {% endif %}
     
        <div class="well form-actions">
            <a href="{{ path('admin_billing_order_list') }}" class="btn">Annuler</a>
            <input type="submit" class="btn btn-primary save" name="btn_update_and_edit" value="Enregistrer">
        </div>
     
    </form>
     
    <table style="display: none;">
        <tr class="clone">
            <td>
                <input type="hidden" name="id" value="" class="line-id" />
                <input type="hidden" name="article_id" class="articleSearchTemp">
                <a href="#" class="btn btn-danger out" title="Hors base article"><i class="icon-signout"></i></a>
            </td>
            <td><input type="text" name="unit" class="unit required callSave" placeholder="U"></td>
            <td>
                <div class="input-prepend">
                    <span class="add-on">&euro;</span>
                    <input type="text" name="price" class="price required callSave tt number">
                </div>
            </td>
            <td>
                <div class="input-prepend">
                    <span class="add-on">&euro;</span>
                    <input type="text" name="eco" class="eco required callSave tt number" value="0">
                </div>
            </td>
            <td><input type="text" name="quantity" class="quantity required callSave number" value="1"></td>
     
            <td>
                <div class="input-append">
                    <input type="text" name="discount" class="discount callSave number" value="0">
                    <span class="add-on">%</span>
                </div>
            </td>
            <td class="total"></td>
            <td>
                <select name="vat" class="callSave" style="width: 65px">
                    {% for vat in vats %}
                        <option value="{{ vat.id }}"@>{{ vat }}</option>
                    {% endfor %}
                </select>
            </td>
            <td><a href="#" class="btn btn-danger remove"><i class="icon-remove"></i></a></td>
        </tr>
    </table>
     
    <div id="modal" class="modal hide fade">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="#modal" aria-hidden="true">&times;</button>
            <h3>Ajouter un magasin</h3>
        </div>
        <div class="modal-body">
            <form class="supplierForm" method="post" action="{{ path('supplier_create') }}">
                <input type="hidden" name="company" value="{{ (object.supplier is not empty) ? object.supplier.company.id }}"/>
                {{ form_widget(form_supplier) }}
            </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn closeModal">Annuler</a>
            <a href="#" class="btn btn-primary modalSave">Enregistrer</a>
        </div>
    </div>
     
    <script>
    $(function(){
        $('.tt').tooltip({'html': true});
     
        // Prevent saving form on enter key
        $('.order-form').bind("keypress", function(e) {
            if (e.keyCode == 13) {
                e.preventDefault();
                return false;
            }
        });
     
        $('.number').keypress(function(event) {
          if ((event.which != 46 || $(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) {
            event.preventDefault();
          }
        });
     
        $( ".save" ).click(function(e) {
            e.preventDefault();
            if ($('.interventionSearch').select2("val") != '') {
                if ($('.deliveryType').val() == 1) {
                    if ($('.userSearch').select2("val") != '') {
                        $( ".order-form" ).submit();
                    } else {
                        alert('Pour un enlèvement comptoire vous devez choisir un technicien');
                    }
                } else {
                    $( ".order-form" ).submit();    
                }
            } else {
                if ($('.stock').val() != '') {
                    $( ".order-form" ).submit();    
                } else {
                    alert('Veuillez choisir un stock ou une intervention');
                }
            }
        });
     
        var opts0 =
        {
            placeholder: "Choisir un fournisseur",
            minimumInputLength: 0,
            allowClear: true,
            ajax: {
                url: "{{path('billing_company_search')}}",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        q: term,
                        page_limit: 10
                    };
                },
                results: function (data, page) {
                    return {results: data.results};
                }
            },
            formatResult: companyFormatResult,
            formatSelection: companyFormatSelection,
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) { return m; }
        };
     
        $(".companySearch").select2( opts0 );
     
        {% if object.supplier is not empty %}
            $(".companySearch").select2("data", {id: {{ object.supplier.company.id }}, name: '{{ object.supplier.company.name }}'});
        {% endif %}
     
        $('.companySearch').on("change", function(e) {
            $(".supplierSearch").select2('data', null);
            $('.supplierForm input[name=company]').val($(".companySearch").select2("val"));
            $('.addSupplier').show();
        });
     
        // Configure intervention select2
        var opts3 =
        {
            placeholder: "Choisir un magasin",
            minimumInputLength: 0,
            allowClear: true,
            ajax: {
                url: "{{path('billing_supplier_search')}}",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        q: term,
                        page_limit: 10,
                        company: $(".companySearch").select2("val")
                    };
                },
                results: function (data, page) {
                    return {results: data.results};
                }
            },
            formatResult: supplierFormatResult,
            formatSelection: supplierFormatSelection,
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) { return m; }
        };
     
        $(".supplierSearch").select2( opts3 );
     
        {% if object.supplier is not empty %}
            $(".supplierSearch").select2("data", {id: {{ object.supplier.id }}, name: '{{ object.supplier.name }}'});
        {% endif %}
     
     
     
        $('.supplierSearch').on("change", function(e) {
            var data = $(".supplierSearch").select2("data");
            $(".companySearch").select2("data", {id: data.company_id, name: data.company_name});
        });
     
        // Configure intervention select2
        var opts1 =
        {
            placeholder: "Choisir une intervention",
            minimumInputLength: 2,
            allowClear: true,
            ajax: {
                url: "{{path('billing_intervention_search')}}",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        q: term,
                        page_limit: 10
                    };
                },
                results: function (data, page) {
                    return {results: data.results};
                }
            },
            formatResult: interventionFormatResult,
            formatSelection: interventionFormatSelection,
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) { return m; }
        };
     
        $(".interventionSearch").select2( opts1 );
     
        {% if object.intervention is not empty %}
            $(".interventionSearch").select2("data", {id: {{ object.intervention.id }}, ref: '{{ object.intervention.ref }}'});
        {% endif %}
     
        $('.interventionSearch').on("change", function(e) {
            $('.stock').val('');
            $('.deliveryType').val('');
            $('.deliveryType').addClass('error');
            $('.delivery-container').show();
        });
     
        $('.stock').on("click", function(e) {
            $('.interventionSearch').select2("data", null);
        });
     
        $('.stock').on("change", function(e) {
            $('.deliveryType').val('3');
            $('.deliveryType').change();
            $('.delivery-container').hide();
        });
     
        // Configure article select2
        var opts2 =
        {
            placeholder: "Ajouter un article",
            minimumInputLength: 0,
            ajax: {
                url: "{{path('billing_article_search')}}",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        q: term,
                        page_limit: 10,
                        company: $(".companySearch").select2("val")
                    };
                },
                results: function (data, page) {
                    return {results: data.results};
                }
            },
            formatResult: articleFormatResult,
            formatSelection: articleFormatSelection,
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) { return m; }
        };
     
        $(".articleSearch").select2( opts2 );
     
        {% for key,line in object.lines if line.article is not empty %}
            $("#article{{key}}").select2("data", {id: {{ line.article.id }}, ref: '{{ line.article }}'});
        {% endfor %}
     
        var opts4 =
        {
            placeholder: "Choisir un technicien",
            minimumInputLength: 0,
            allowClear: true,
            ajax: {
                url: "{{path('billing_user_search')}}",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        q: term,
                        page_limit: 10
                    };
                },
                results: function (data, page) {
                    return {results: data.results};
                }
            },
            formatResult: userFormatResult,
            formatSelection: userFormatSelection,
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) { return m; }
        };
     
        $(".userSearch").select2( opts4 );
     
        {% if object.retrievedBy is not empty %}
            $(".userSearch").select2("data", {id: {{ object.retrievedBy.id }}, ref: '{{ object.retrievedBy.fullname }}'});
        {% endif %}
     
        $('.deliveryType').on("change", function(e) {
            $(this).removeClass('error');
            var type = $(this).val();
            var supplier = $(".supplierSearch").select2("val");
            var intervention = $(".interventionSearch").select2("val");
            var stock = $(".stock").val();
     
            if (type==1) {
                $('.retreivedBy').show();
            } else {
                $('.retreivedBy').hide();
            }
     
            $.post("{{ path('billing_address_search') }}", {
                'type': type,
                'supplier': supplier,
                'intervention': intervention,
                'stock': stock
            }, function(data) {
                if (data.error) {
                    $('.deliveryType').val('');
                    $('.address').val('');
                    $('.city').val('');
                    $('.postcode').val('');
                    alert("Un problème est survenu\nVous devez\n- saisir un magasin pour un enlèvement comptoir\n- saisir un intervention pour une livraison chantier");
                } else {
                    $('.address').val(data.address);
                    $('.city').val(data.city);
                    $('.postcode').val(data.postcode);
                }
            }, 'json');
        }).change();
     
     
        // On article select2 change : save line and create a new one if necessary
        $(document).on("change", '.articleSearch', function(e) {
            articleChange($(this));
        });
     
        function articleChange(elt) {
            var line = elt.parent().parent();
            var id = line.find('.line-id');
            var price = line.find('.price');
            var unit = line.find('.unit');
            var eco = line.find('.eco');
     
            //console.log('allo');
            //console.log($(this).select2('data'));
     
            var data = elt.select2('data');
            price.val(data.price);
            price.attr('title', 'Prix commandé<br>moyen '+ data.price +'&euro;<br>min '+ data.priceMin +' &euro;<br>max '+ data.priceMax +' &euro;');
            price.tooltip({'html': true});
            unit.val(data.unit);
            eco.val(data.eco);
     
            $.post("{{ path('orderline_save', { order: object.id }) }}", line.find(':input').serialize(), function(data) {
                if (id.val() == '') {
                    // Set price
                    //price.val(data.price);
                    //price.attr('title', 'Prix commandé<br>moyen '+ data.price +'&euro;<br>min '+ data.priceMin +' &euro;<br>max '+ data.priceMax +' &euro;');
                    //price.tooltip({'html': true});
     
                    //unit.val(data.unit);
                    //eco.val(data.eco);
     
                    // Keep line select2 data and destroy it
                    //var sdata = line.find('.articleSearch').select2("data")
                    //line.find('.articleSearch').select2("destroy");
     
                    // Add new line
                    var newline = $('.clone').clone(true);
                    newline.removeClass('clone');
                    newline.appendTo($('.lines'));
     
                    // Reinit its inputs
                    newline.find('.ref').val('');
                    newline.find('.llabel').val('');
                    newline.find('.unit').val('');
                    newline.find('.price').val('0');
                    newline.find('.quantity').val('1');
                    newline.find('.discount').val('0');
                    newline.find('.articleSearchTemp').removeClass('articleSearchTemp').addClass('articleSearch');
                    newline.find('.articleSearch').select2(opts2);
                    //newline.find('.articleSearch').select2("data", {id: '', ref: 'Ajouter un article'});
     
                    // Recreate line select2
                    //line.find('.articleSearch').select2(opts2);
                    //line.find('.articleSearch').select2("data", sdata);
     
                    //Set the previous line id
                    id.val(data.id);
                }
            }, 'json');
        }
     
        $(document).on("click", '.order-form .out', function(e) {
            e.preventDefault();
            $(this).prev().remove();
            $(this).prev().remove();
            $(this).parent().append('<input type="hidden" name="article_id"><input type="text" name="ref" class="ref callSave" placeholder="Référence" /><input type="text" name="label" class="llabel callSave" placeholder="Libéllé" /><a href="#" class="btn btn-info in" title="Dans base article"><i class="icon-signin"></i></a>');
            $(this).remove();
     
        });
     
        $(document).on("click", '.order-form .in', function(e) {
            e.preventDefault();
            $(this).prev().remove();
            $(this).prev().remove();
            $(this).parent().append('<input type="hidden" name="article_id" class="articleSearch"><a href="#" class="btn btn-danger out" title="Hors base article"><i class="icon-signout"></i></a>');
            $(this).parent().find('.articleSearch').select2(opts2);
            $(this).parent().find('.articleSearch').select2("data", {id: '', ref: 'Ajouter un article'});
            $(this).remove();
     
        });
     
        $(document).on("change", '.callSave', function(event){
            var elt = $(this);
     
     
            var line = elt.closest('tr');
            var id = line.find('.line-id');
            var article = line.find("input[name='article_id']");
            //alert(id);
     
     
     
            if (elt.hasClass('ref')) {
            //console.log('change1 '+elt);           
                {% if object.supplier is not empty %}
                $.post("{{ path('orderline_checkArticle', {'company': object.supplier.company.id }) }}", line.find(':input').serialize(), function(data) {
                    if (data.id > 0) {
                        article.val(data.id);
                        line.find('.in').click();
                        //console.log('1 '+data.id);
                        //console.log(data.ref);
                        line.find('.articleSearch').select2(opts2);
                        line.find(".articleSearch").select2("data", data);
                        articleChange(line.find(".articleSearch"));
                        //line.find(".articleSearch").change();
                    }
                });
                {% endif %}
     
            } else {
             //console.log('change2 '+elt);
     
     
                $.post("{{ path('orderline_save', { order: object.id }) }}", line.find(':input').serialize(), function(data) {
                    //console.log('2 '+data.id);
                    if (data.id != undefined && data.id > 0 && id.val() != data.id && !data.chapter) {
                        line.find('.articleSearch').select2("destroy");
     
                        // Add new line
                        var newline = line.clone(true);
                        newline.appendTo($('.lines'));
     
                        // Reinit its inputs
                        newline.find('.ref').val('');
                        newline.find('.llabel').val('');
                        newline.find('.price').val('0');
                        newline.find('.quantity').val('1');
                        newline.find('.discount').val('0');
                        newline.find('.articleSearch').select2(opts2);
                        newline.find('.articleSearch').select2("data", {id: '', ref: 'Ajouter un article'});
     
                        // Recreate line select2
                        line.find('.articleSearch').select2(opts2);
                    }
     
                    id.val(data.id);
                    article.val(data.article_id);
     
                    $('.callSave').prop('readonly', false);
                });
            }
     
            updateTotals();
        });
     
        $(document).on("click", '.remove', function(event){
            event.preventDefault();
            var line = $(this).parent().parent();
            var id = line.find('.line-id');
     
            $.post("{{ path('orderline_delete') }}", {id: id.val()}, function(data) {
                line.remove();
            });
        });
     
        $(document).on("click", '.addSupplier', function(event){
            $('#modal input[type=text]').val('');
        });    
     
        $(document).on("click", '.modalSave', function(event){
            event.preventDefault();
     
            $.post("{{ path('supplier_create') }}", $('.supplierForm').serialize(), function(data) {
                if (data != null) {
                    $(".supplierSearch").select2("data", {id: data.id, name: data.name});
                    $('#modal').modal('hide');
                }
            }, 'json');
        });
     
         $(document).on("click", '.closeModal', function(event){
            event.preventDefault();
            $('#modal').modal('hide');
        });
     
        updateTotals();
     
    });
     
    function updateTotals() {
        var total = 0;
        var counter = 0;
        var totalspan = $('span.total');
        var counterspan = $('span.counter');
     
        $('.lines tbody tr').each(function( index ) {
            var price = parseFloat($(this).find('.price').val());
            var quantity = parseFloat($(this).find('.quantity').val());
            var eco = parseFloat($(this).find('.eco').val());
            var discount = parseFloat($(this).find('.discount').val());
            var line_total = $(this).find('.total');
     
            tot = (price + eco) * quantity;
            if (discount > 0) {
                tot = tot * (1 - (discount/100));
            }
            if (!isNaN(tot)) {
                line_total.html(tot.toFixed(2));
                total = total + tot;
                counter++;
            }
     
        });
     
        totalspan.html(total.toFixed(2));
        counterspan.html(counter);
    }
    </script>
     
    {% endblock %}
     
     
    Comment faire?

  2. #2
    Membre confirmé
    Homme Profil pro
    Administrateur systèmes et réseaux
    Inscrit en
    Septembre 2013
    Messages
    71
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : France, Gers (Midi Pyrénées)

    Informations professionnelles :
    Activité : Administrateur systèmes et réseaux
    Secteur : Santé

    Informations forums :
    Inscription : Septembre 2013
    Messages : 71
    Par défaut
    Bonjour,

    Peux-tu nous mettre le code HTML rendu dans ton navigateur ?

  3. #3
    Membre averti
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2016
    Messages
    17
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2016
    Messages : 17
    Par défaut code HTML
    le popup est au tour de la ligne 606
    voici le code HTML de la page où le popup ne fonctionne pas (en tout cas sous chrome):
    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
    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
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    969
    970
    971
    972
    973
    974
    975
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
    996
    997
    998
    999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
    1024
    1025
    1026
    1027
    1028
    1029
    1030
    1031
    1032
    1033
    1034
    1035
    1036
    1037
    1038
    1039
    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    1048
    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    1057
    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    1085
    1086
    1087
    1088
    1089
    1090
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
    1101
    1102
    1103
    1104
    1105
    1106
    1107
    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    1128
    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    1168
    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    1187
    1188
    1189
    1190
    1191
    1192
    1193
    1194
    <!DOCTYPE html>
    <html class="no-js">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <link rel="shortcut icon" href="/favicon.png" />
     
                        <!-- jQuery code -->
                <link rel="stylesheet" href="/bundles/sonatajquery/themes/flick/jquery-ui-1.8.16.custom.css" type="text/css" media="all" />
     
                <link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css" media="all"  />
                <link rel="stylesheet" href="/css/bootstrap-responsive.min.css" type="text/css" media="all"  />
                <link rel="stylesheet" href="/css/font-awesome.min.css" type="text/css" media="all"  />
     
                <!-- base application asset -->
                <link rel="stylesheet" href="/bundles/sonataadmin/css/layout.css" type="text/css" media="all" />
                <link rel="stylesheet" href="/bundles/sonataadmin/css/colors.css" type="text/css" media="all" />
     
                <link type="text/css" href="/css/custom.css?v=11" rel="stylesheet" />
                <link type="text/css" href="/css/colorpicker.css" rel="stylesheet" />
                <link type="text/css" href="/css/select2.css" rel="stylesheet" />
                <link type="text/css" href="/css/daterangepicker.css" rel="stylesheet" />
     
     
                        <script src="/bundles/sonatajquery/jquery-1.8.0.js" type="text/javascript"></script>
                <script src="/bundles/sonatajquery/jquery-ui-1.8.23.js" type="text/javascript"></script>
                <script src="/bundles/sonatajquery/jquery-ui-i18n.js" type="text/javascript"></script>
     
                <script src="/bundles/sonataadmin/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
     
                <script src="/bundles/sonataadmin/qtip/jquery.qtip-1.0.0-rc3.min.js" type="text/javascript"></script>
                <script src="/bundles/sonataadmin/jquery/jquery.form.js" type="text/javascript"></script>
                <script src="/bundles/sonataadmin/base.js" type="text/javascript"></script>
     
                <script type="text/javascript" src="/js/jquery.ui.datepicker-fr.js"></script>
                <script type="text/javascript" src="/js/jquery-ui-timepicker.js"></script>
                <script type="text/javascript" src="/js/select2.min.js"></script>
                <script type="text/javascript" src="/js/select2_locale_fr.js"></script>
                <script type="text/javascript" src="/js/colorpicker.js"></script>
                <script type="text/javascript" src="/js/moment.min.js"></script>
                <script type="text/javascript" src="/js/daterangepicker.js"></script>
                <script type="text/javascript" src="/js/custom.js?v=9"></script>
     
     
            <title>
                CMS
     
                                            Éditer &quot;C160100011&quot;
     
                        </title>
        </head>
        <body class="sonata-bc sonata-ba-no-side-menu">
     
            <div class="navbar navbar-fixed-top">
                <div class="navbar-inner">
                    <div class="container-fluid">
                        <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                            <i class="icon-reorder"></i>
                        </a>
     
                                                <div class="navbar-text pull-right" style="margin-top: 6px;">
                                                                                                                                                                        <a href="http://cms.dev/app_dev.php/sonata/user/user/379/show" class="account" rel="popover"
                                            data-placement="bottom"
                                            data-original-title="Mon compte"
                                            data-content="Agence de Rouen<br/>Groupe Super Administrateur /Administrateur                                         ">
                                                <i class="icon-user icon-fixed-width"></i> j-m.gallais
                                            </a>
                                            <a href="http://cms.dev/app_dev.php/logout" title="Se deconnecter"><i class="icon-off"></i></a>
                                                                                                                            </div>
     
                                                        <a href="http://cms.dev/app_dev.php/" class="brand">
                                    <img src="/images/logo.png"  alt="CMS" />
                                </a>
     
                            <div class="nav-collapse">
                                <ul class="nav">
                                                                                                                                                                                             <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Activités <span class="caret"></span></a>
                                                    <ul class="dropdown-menu">
                                                                                                                                                                            <li><a href="/app_dev.php/tahiti/work/intervention/list">Interventions</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/work/task/list">Tâches</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/work/report/list">Rapports d'intervention</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/work/vprim/list">Vprims</a></li>
                                                                                                                                                                                                                                                                                        <li class="dropdown-submenu">
                                                                    <a href="#" tabindex="-1">Planning</a>
                                                                    <ul class="dropdown-menu">
                                                                        <li><a href="/app_dev.php/schedule/intervention">Interventions</a></li>
                                                                        <li><a href="/app_dev.php/schedule/team">Equipes</a></li>
                                                                        <li><a href="/app_dev.php/schedule/user">Techniciens</a></li>
                                                                        <li><a href="/app_dev.php/schedule/vehicle">Véhicules</a></li>
                                                                        <li><a href="/app_dev.php/schedule/map">Carte</a></li>
                                                                        <li><a href="/app_dev.php/schedule/timeoff">Absences</a></li>
                                                                    </ul>
                                                                </li>
                                                                <li class="dropdown-submenu">
                                                                    <a href="#" tabindex="-1">Géolocalisation</a>
                                                                    <ul class="dropdown-menu">
                                                                        <li><a href="/app_dev.php/tahiti/geo/vehicle/list">Véhicules</a></li>
                                                                        <li><a href="/app_dev.php/tahiti/geo/event/report">Rapports</a></li>
                                                                    </ul>
                                                                </li>
                                                                <li><a href="/app_dev.php/map/" target="_blank"><i class="icon-globe"></i> Map</a></li>
                                                                                                                                                                                                                                                                                </ul>
                                                </li>
                                                                                        <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Parc <span class="caret"></span></a>
                                                    <ul class="dropdown-menu">
                                                                                                                                                                            <li><a href="/app_dev.php/tahiti/client/station/list">Stations</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/equipment/equipment/list">Equipements</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/equipment/sticker/list">Vignettes</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/equipment/stickerpack/list">Lot de vignettes</a></li>
                                                                                                                                                                                                                                                                                                                                                <li><a href="/app_dev.php/equipment/flexible/monitoring">Suivi flexibles</a></li>
                                                                <li class="dropdown-submenu">
                                                                    <a href="#" tabindex="-1">Import Total</a>
                                                                    <ul class="dropdown-menu">
                                                                        <li><a href="/app_dev.php/tahiti/equipment/equipment/import">Equipements</a></li>
                                                                        <li><a href="/app_dev.php/tahiti/client/station/import">Stations</a></li>
                                                                    </ul>
                                                                </li>
                                                                                                                                                                                                                        </ul>
                                                </li>
                                                                                        <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Commandes <span class="caret"></span></a>
                                                    <ul class="dropdown-menu">
                                                                                                                                                                            <li><a href="/app_dev.php/tahiti/billing/order/list">Commandes</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/billing/delivery/list">Livraisons</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/stock/article/list">Articles</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/stock/tahitiarticle/list">Articles tahiti</a></li>
                                                                                                                                                                                                                                                                                                                                                                                                                                                </ul>
                                                </li>
                                                                                        <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Stock <span class="caret"></span></a>
                                                    <ul class="dropdown-menu">
                                                                                                                                                                            <li><a href="/app_dev.php/tahiti/stock/inventory/list">Stock</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/stock/movement/list">Mouvements</a></li>
                                                                                                                                                                                                                                                                                                                                                                                                                                                </ul>
                                                </li>
                                                                                        <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Devis <span class="caret"></span></a>
                                                    <ul class="dropdown-menu">
                                                                                                                                                                            <li><a href="/app_dev.php/tahiti/client/client/list">Clients</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/client/contact/list">Contacts</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/billing/quotationrequest/list">Demande de devis</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/billing/quotation/list">Devis</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/billing/quotationorder/list">Commandes</a></li>
                                                                                                                                                                                                                                                                                                                                                                                                                                                </ul>
                                                </li>
                                                                                        <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Facturation <span class="caret"></span></a>
                                                    <ul class="dropdown-menu">
                                                                                                                                                                            <li><a href="/app_dev.php/tahiti/billing/invoice/list">Factures Ventes</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/billing/situation/list">Factures Situation</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/billing/invoicesupplier/list">Factures Achats</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/stock/company/list">Fournisseur</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/stock/supplier/list">Magasin</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/billing/deposit/list">Accomptes</a></li>
                                                                                                                                                                                                                                                                                                                                                                                                                                                </ul>
                                                </li>
                                                                                        <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">RH <span class="caret"></span></a>
                                                    <ul class="dropdown-menu">
                                                                                                                                                                            <li><a href="/app_dev.php/tahiti/staff/team/list">Equipes</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/staff/payrise/list">Augmentation</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/staff/medicalvisit/list">Visites médicales</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/staff/absence/list">Absences</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/staff/contract/list">Contrats</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/staff/expensereceipt/list">Notes de frais</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/staff/training/list">Formations</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/staff/attachment/list">Pièces jointes</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/tahiti/staff/warning/list">Avertissements</a></li>
                                                                                                                                                                                                                                                                                                                                                                                                        <li><a href="/app_dev.php/staff/timesheet">Feuilles d'heures</a></li>
                                                                                                                                                                </ul>
                                                </li>
                                                                                        <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Utilisateurs <span class="caret"></span></a>
                                                    <ul class="dropdown-menu">
                                                                                                                                                                            <li><a href="/app_dev.php/sonata/user/user/list">Utilisateurs</a></li>
                                                                                                                                                                                                                                    <li><a href="/app_dev.php/sonata/user/group/list">Groupes</a></li>
                                                                                                                                                                                                                                                                                                                                                                                                                                                </ul>
                                                </li>
     
                                                                                                                                <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Statistiques <span class="caret"></span></a>
                                                    <ul class="dropdown-menu">
                                                        <li><a href="/app_dev.php/stat/stat/dashboard">Interventions</a></li>
                                                        <li><a href="/app_dev.php/stat/stat/analyse">Analyse des pannes</a></li>
                                                        <li><a href="/app_dev.php/stat/stat/campaign">Campagnes</a></li>
                                                        <li><a href="/app_dev.php/stat/stat/station">Stations</a></li>
                                                                                                                <li><a href="/app_dev.php/stat/stat/intervention">Résultat chantier</a></li>
                                                            <li><a href="/app_dev.php/stat/stat/billing">Facturation</a></li>
                                                                                                        </ul>
                                                </li>
     
                                                                                        <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Configuration <span class="caret"></span></a>
                                                    <ul class="dropdown-menu">
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Ressources Humaines</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/staff/medicalvisittype/list">Types visite médicale</a></li>
                                                                <li><a href="/app_dev.php/tahiti/staff/absencetype/list">Types d'absence</a></li>
                                                                <li><a href="/app_dev.php/tahiti/staff/worktime/list">Temps de travail</a></li>
                                                                <li><a href="/app_dev.php/tahiti/staff/attachmenttype/list">Types de pièces jointes</a></li>
                                                                <li><a href="/app_dev.php/tahiti/staff/trainingtype/list">Types de formations</a></li>
                                                                <li><a href="/app_dev.php/tahiti/staff/salary/list">Salaires</a></li>
                                                                <li><a href="/app_dev.php/tahiti/staff/expensetype/list">Types de Notes de frais</a></li>
                                                                <li><a href="/app_dev.php/tahiti/staff/licensetype/list">Types de permis</a></li>
                                                                <li><a href="/app_dev.php/tahiti/staff/contract/list">Types de contract</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Agences</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/client/agency/list">Agences tahiti</a></li>
                                                                <li><a href="/app_dev.php/tahiti/staff/service/list">Service tahiti</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Stations</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/client/company/list">Distributeurs</a></li>
                                                                <li><a href="/app_dev.php/tahiti/client/network/list">Réseaux des stations</a></li>
                                                            </ul>
                                                        </li>
     
                                                        <li class="divider"></li>
     
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Interventions</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/work/source/list">Source (SDM)</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/job/list">Corps d'états</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/agreement/list">Contrats</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/domaingroup/list">Groupes de domaines</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/domain/list">Domaines</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/nature/list">Natures</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/emergencylevel/list">Degrés d'urgence</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/interventionfailure/list">Analyse hors délais</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/taskfailure/list">Pannes des tâches</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/group/list">Groupes (Travaux)</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Rapport d'intervention</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/work/reporttype/list">Type Rapport d'intervention</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/reportcategory/list">IBE Catégorie</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/reportitem/list">IBE Lignes</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Campagne</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/work/campaigntype/list">Type de campagnes</a></li>
                                                                <li><a href="/app_dev.php/tahiti/work/family/list">Famille</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Géolocalisation</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/geo/worktype/list">Types de Travail</a></li>
                                                            </ul>
                                                        </li>
     
                                                        <li class="divider"></li>
     
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Equipements</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/equipment/model/list">Modèles Commerciaux</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/metrologicmodel/list">Modèles Métrologiques</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/supplier/list">Fournisseurs</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/manufacturer/list">Constructeurs</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/equipmenttype/list">Type d'equipement</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/equipmentattribute/list">Attributs</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/equipmentattributelist/list">Liste d'attributs</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Appareils distributeurs</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/equipment/product/list">Produits</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/connection/list">Raccords</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/diameter/list">Diamètres</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/flexlength/list">Longueurs flexibles</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/approvaldecision/list">Décision d'approbation</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/stickertype/list">Type de vignettes</a></li>
                                                                <li class="divider"></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/domain/list">Domaines</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/nature/list">Natures</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/effect/list">Effets</a></li>
                                                                <li><a href="/app_dev.php/tahiti/equipment/action/list">Actions</a></li>
                                                            </ul>
                                                        </li>
     
                                                        <li class="divider"></li>
     
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Commande</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/billing/nature/list">Nature des commandes</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/deliverytype/list">Type de livraison</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/statusorder/list">Etats</a></li>
                                                            </ul>
                                                        </li>
     
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Articles</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/stock/family/list">Famille</a></li>
                                                                <li><a href="/app_dev.php/tahiti/stock/brand/list">Marques</a></li>
                                                                <li><a href="/app_dev.php/tahiti/stock/company/list">Fournisseurs</a></li>
                                                                <li><a href="/app_dev.php/tahiti/stock/supplier/list">Magasins</a></li>
                                                                <li><a href="/app_dev.php/tahiti/stock/status/list">Status</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Stock</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/stock/stock/list">Stock</a></li>
                                                            </ul>
                                                        </li>
     
                                                        <li class="divider"></li>
     
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Devis/Facturation</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/billing/status/list">Etats</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/quotationlimit/list">Limite des devis</a></li>
     
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Bordereaux</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/billing/priceschedulegroup/list">Bordereau</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/priceschedulechapter/list">Chapitre</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/priceschedule/list">Ligne</a></li>
                                                            </ul>
                                                        </li>
     
                                                        <li class="divider"></li>
     
                                                        <li class="dropdown-submenu">
                                                            <a href="#" tabindex="-1">Comptabilité</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="/app_dev.php/tahiti/client/clientcode/list">Codes Client</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/vat/list">Taux de TVA</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/paymentmode/list">Modes de paiment</a></li>
                                                                <li><a href="/app_dev.php/tahiti/client/legalentity/list">Entités Juridiques</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/account/list">Comptes imputation Vente</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/accountorder/list">Comptes imputation Achat</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/tolerance/list">Tolérance</a></li>
                                                                <li><a href="/app_dev.php/tahiti/client/client/xport">Export Client</a></li>
                                                                <li><a href="/app_dev.php/tahiti/stock/company/xport">Export Fournisseur</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/invoice/xport">Export Facture Vente</a></li>
                                                                <li><a href="/app_dev.php/tahiti/billing/invoicesupplier/xport">Export Facture Achat</a></li>
                                                                <li><a href="/app_dev.php/billing/book">Export Journal Vente</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="divider"></li>
                                                                                                            <li>
                                                            <a href="/app_dev.php/trans/">Traduction Manager</a>
                                                        </li>
                                                    </ul>
                                                </li>
                                                                                                                                                                             </ul>
                            </div>
                                        </div>
                </div>
            </div>
     
            <div class="container-fluid">
                                <ul class="breadcrumb">
                                                                                                                                                <li><a href="/app_dev.php/">Tableau de bord</a><span class="divider">/</span></li>
                                                                                                                                    <li><a href="/app_dev.php/tahiti/billing/order/list">Order List</a><span class="divider">/</span></li>
                                                                                                                                    <li class="active">Order Edit</li>
                                                                                                                            </ul>
     
     
                <div style="float: right">
                        <div class="sonata-actions">
     
                <a class="btn sonata-action-element" href="/app_dev.php/tahiti/billing/order/create">
                <i class="icon-plus"></i>
                Ajouter</a>
                            <a class="btn sonata-action-element" href="/app_dev.php/tahiti/billing/order/list">
                    <i class="icon-list"></i>
                    Liste</a>
                </div>
                </div>
     
                                <div class="page-header">
                        <h1>
                                                                    Éditer &quot;C160100011&quot;
     
                                                </h1>
                    </div>
     
                <div class="row-fluid">
     
                    <div class="content span12">
     
     
     
     
                                                <div class="sonata-ba-form">
     
    <form class="order-form" action="/app_dev.php/tahiti/billing/order/1381/edit" method="post">
        <input type="hidden" id="tahiti_billingbundle_ordertype__token" name="tahiti_billingbundle_ordertype[_token]" value="2eb8074c2b042fde8648ca76fe60b26eeda48a08" />
        <fieldset>
            <legend>Affectation </legend>
            <div class="row-fluid" style="padding-top: 10px">
                <div class="span3">
                    <div class="control-group">
                        <label class="control-label">Stock</label>
                        <div class="controls">
                            <select id="tahiti_billingbundle_ordertype_stock" name="tahiti_billingbundle_ordertype[stock]"    class="stock"><option value=""></option><option value="1">STOCK ESS ROUEN</option><option value="2">STOCK tahiti ROUEN</option><option value="3">Stock DIA</option><option value="4">Stock ESTEVES</option><option value="5">Stock FEIND</option><option value="6">Stock GAUCHER</option><option value="7">Stock LECARPENTIER</option><option value="8">Stock LEFEVRE</option><option value="9">Stock LEGALL</option><option value="10">Stock LEJEUNE</option><option value="11">Stock PASQUIER</option><option value="12">Stock RAILLOT</option><option value="13">Stock VAN RANTERGHEM</option><option value="14">Stock IVRY</option><option value="15">Stock SCHNEIDER</option></select>
                        </div>
                    </div>
                </div>
                <div class="span1">
                    <span style="font-size: 30px; display: block; padding-top: 20px; text-align: center;">Ou</span>
                </div>
                <div class="span3">
                    <div class="control-group">
                        <label class="control-label">Intervention</label>
                        <div class="controls">
                            <input type="text" id="tahiti_billingbundle_ordertype_interventionSearch" name="tahiti_billingbundle_ordertype[interventionSearch]"    class="interventionSearch" />
                        </div>
                    </div>
                </div>
        </fieldset>
        <div class="row-fluid">
            <div class="span4">
                <fieldset>
                    <legend>General</legend>
                    <div class="control-group">
                        <label class="control-label">Ref devis fournisseur</label>
                        <div class="controls">
                            <input type="text" id="tahiti_billingbundle_ordertype_supplierRef" name="tahiti_billingbundle_ordertype[supplierRef]" maxlength="20" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Nature *</label>
                        <div class="controls">
                            <select id="tahiti_billingbundle_ordertype_nature" name="tahiti_billingbundle_ordertype[nature]" required="required"><option value="">- Choisir -</option><option value="1">Matériaux</option><option value="2" selected="selected">Matériel</option><option value="3">Location</option><option value="4">Sous-traitance</option><option value="5">Outillage</option><option value="6">Entretien</option><option value="7">Achat/Revente</option></select>
                            <div class="errors">
     
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Corps d'état *</label>
                        <div class="controls">
                            <select id="tahiti_billingbundle_ordertype_job" name="tahiti_billingbundle_ordertype[job]" required="required"><option value="">- Choisir -</option><option value="1">Maçonnerie</option><option value="2">Electricité</option><option value="3">Génie Civil</option><option value="4">Tuyauterie</option><option value="5">Serrurerie</option><option value="6" selected="selected">Appareils Distributeurs</option><option value="7">Bureau d'études</option><option value="8">Dispatch</option><option value="9">Encadrement</option><option value="10">Épreuve accoustique</option><option value="12">Dépannage téléphonique</option><option value="13">Vérificateur</option><option value="14">Chauffeur PL</option><option value="15">Plomberie</option><option value="16">Administratif</option><option value="17">Magasinier</option><option value="18">Couverture</option></select>
                            <div class="errors">
     
                            </div>
                        </div>
                    </div>
                </fieldset>
            </div>
     
            <div class="span4">
                <fieldset>
                    <legend>Fournisseur</legend>
                    <div class="control-group">
                        <label class="control-label">Fournisseur *</label>
                        <div class="controls">
                            <input type="text" id="tahiti_billingbundle_ordertype_companySearch" name="tahiti_billingbundle_ordertype[companySearch]"    class="companySearch" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Magasin *</label>
                        <div class="controls">
                            <input type="text" id="tahiti_billingbundle_ordertype_supplierSearch" name="tahiti_billingbundle_ordertype[supplierSearch]"    class="supplierSearch" />
                            <a href="#modal" role="button" class="btn addSupplier" data-toggle="modal" style=""><i class="icon-plus-sign"></i></a>
                        </div>
                    </div>
                </fieldset>
            </div>
     
            <div class="span4">
                <fieldset>
                    <legend>Livraison</legend>
                    <div class="control-group delivery-container">
                        <label class="control-label">Livraison *</label>
                        <div class="controls">
     
                            <select id="tahiti_billingbundle_ordertype_deliveryType" name="tahiti_billingbundle_ordertype[deliveryType]" required="required"    class="deliveryType"><option value="">- Choisir -</option><option value="1">Enlèvement comptoir</option><option value="2">Chantier</option><option value="3" selected="selected">Agence</option></select>
                        </div>
                    </div>
                    <div class="control-group retreivedBy" style="display:none;">
                        <label class="control-label">Enlevé par *</label>
                        <div class="controls">
                            <input type="text" id="tahiti_billingbundle_ordertype_userSearch" name="tahiti_billingbundle_ordertype[userSearch]"    class="userSearch" />
                        </div>
                    </div>
     
                    <div class="control-group">
                        <label class="control-label">Souhaitée le *</label>
                        <div class="controls">
                            <input type="text" id="tahiti_billingbundle_ordertype_deliveryDesiredDate" name="tahiti_billingbundle_ordertype[deliveryDesiredDate]" required="required"    class="date" value="06/01/2016" />
                            <div class="errors">
     
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Adresse *</label>
                        <div class="controls">
                            <input type="text" id="tahiti_billingbundle_ordertype_address" name="tahiti_billingbundle_ordertype[address]" maxlength="255"    class="address" value="2 rue jean hyacinthe vincent" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Code postal *</label>
                        <div class="controls">
                            <input type="text" id="tahiti_billingbundle_ordertype_postcode" name="tahiti_billingbundle_ordertype[postcode]" maxlength="10"    class="postcode" value="76300" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Ville *</label>
                        <div class="controls">
                            <input type="text" id="tahiti_billingbundle_ordertype_city" name="tahiti_billingbundle_ordertype[city]" maxlength="100"    class="city" value="Sotteville les Rouen" />
                        </div>
                    </div>
                </fieldset>
            </div>
        </div>
     
        <fieldset>
            <legend>Commentaire</legend>
            <div class="control-group">
                <div class="controls">
                    <textarea id="tahiti_billingbundle_ordertype_comment" name="tahiti_billingbundle_ordertype[comment]"    class="comment">Commande très Urgente, à nous livrer pour demain matin.</textarea>
                </div>
            </div>
        </fieldset>
        <fieldset style="margin: 30px 0">
            <table class="lines table table-striped">
                <thead>
                    <tr>
                        <th>Article</th>
                        <th>Unité</th>
                        <th>Prix Unitaire</th>
                        <th>Eco-contrib.</th>
                        <th>Quantité</th>
                        <th>Réduction</th>
                        <th>Montant</th>
                        <th>&nbsp;</th>
                        <th>Commentaire</th>
                        <th>&nbsp;</th>
                    </tr>
                </thead>
                <tbody>
                                        <tr>
                            <td>
                                <input type="hidden" name="id" value="4429" class="line-id" />
                                                                <input id="article0" type="hidden" name="article_id" class="articleSearch" value="Clavier polyesters pour automate ALX 803">
                                                        </td>
                            <td><input type="text" name="unit" class="unit required callSave" value="Unité" placeholder="U"></td>
                            <td>
                                <div class="input-prepend">
                                    <span class="add-on">&euro;</span>
                                    <input type="text" name="price" class="price required callSave tt number" value="3.00000"
                                                                    title="Prix commandé<br>moyen 52.00 &euro;<br>min  &euro;<br>max  &euro;
                                                                    ">
                                </div>
                            </td>
                            <td>
                                <div class="input-prepend">
                                    <span class="add-on">&euro;</span>
                                    <input type="text" name="eco" class="eco required callSave tt number" value="0.00">
                                </div>
                            </td>
                            <td><input type="text" name="quantity" class="quantity required callSave number" value="1.000"></td>
                            <td>
                                <div class="input-append">
                                    <input type="text" name="discount" class="discount callSave number" value="20">
                                    <span class="add-on">%</span>
                                </div>
                            </td>
                            <td class="total"></td>
                            <td>
                                <select name="vat" class="callSave" style="width: 65px">
                                                                        <option value="3" selected="selected">20%</option>
                                                                        <option value="1" >19,6%</option>
                                                                        <option value="2" >7%</option>
                                                                </select>
                            </td>
                            <td>
                                <input type="text" name="comment" class="comment callSave" value="">
                            </td>
                            <td><a href="#" class="btn btn-danger remove"><i class="icon-remove"></i></a></td>
                        </tr>
                                    <tr>
                        <td>
                            <input type="hidden" name="id" value="" class="line-id" />
                            <input type="hidden" name="article_id" class="articleSearch">
                            <a href="#" class="btn btn-danger out" title="Hors base article"><i class="icon-signout"></i></a>
     
                            <div id="article_list"></div>
     
      <a href="javascript:void(0);" class="po-invoice" data-original-title="Facture" data-content='
                            <iframe src="/app_dev.php/tahiti/stock/article/list" width="700" height="500"></iframe>
                        '><i class="icon-search"></i></a>
     
     
                        </td>
                        <td><input type="text" name="unit" class="unit required callSave" placeholder="U"></td>
                        <td>
                            <div class="input-prepend">
                                <span class="add-on">&euro;</span>
                                <input type="text" name="price" class="price required callSave tt number">
                            </div>
                        </td>
                        <td>
                            <div class="input-prepend">
                                <span class="add-on">&euro;</span>
                                <input type="text" name="eco" class="eco required callSave tt number" value="0">
                            </div>
                        </td>
                        <td><input type="text" name="quantity" class="quantity required callSave number" value="1"></td>
     
                        <td>
                            <div class="input-append">
                                <input type="text" name="discount" class="discount callSave number" value="0">
                                <span class="add-on">%</span>
                            </div>
                        </td>
                        <td class="total"></td>
                        <td>
                            <select name="vat" class="callSave" style="width: 65px">
                                                                <option value="3">20%</option>
                                                                <option value="1">19,6%</option>
                                                                <option value="2">7%</option>
                                                        </select>
                        </td>
                        <td>
                            <input type="text" name="comment" class="comment callSave" value="">
                        </td>
                        <td><a href="#" class="btn btn-danger remove"><i class="icon-remove"></i></a></td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td>Nombre d'article : <span class="counter">XXX</span></td>
                        <td colspan="6" style="text-align: right">Total : <span class="total">XXX</span></td>
                        <td colspan="2"></td>
                    </tr>
                </tfoot>
            </table>
        </fieldset>
     
        <div class="well form-actions">
            <a href="/app_dev.php/tahiti/billing/order/list" class="btn">Annuler</a>
            <input type="submit" class="btn btn-primary save" name="btn_update_and_edit" value="Enregistrer">
        </div>
     
    </form>
     
    <table style="display: none;">
        <tr class="clone">
            <td>
                <input type="hidden" name="id" value="" class="line-id" />
                <input type="hidden" name="article_id" class="articleSearchTemp">
                <a href="#" class="btn btn-danger out" title="Hors base article"><i class="icon-signout"></i></a>
            </td>
            <td><input type="text" name="unit" class="unit required callSave" placeholder="U"></td>
            <td>
                <div class="input-prepend">
                    <span class="add-on">&euro;</span>
                    <input type="text" name="price" class="price required callSave tt number">
                </div>
            </td>
            <td>
                <div class="input-prepend">
                    <span class="add-on">&euro;</span>
                    <input type="text" name="eco" class="eco required callSave tt number" value="0">
                </div>
            </td>
            <td><input type="text" name="quantity" class="quantity required callSave number" value="1"></td>
     
            <td>
                <div class="input-append">
                    <input type="text" name="discount" class="discount callSave number" value="0">
                    <span class="add-on">%</span>
                </div>
            </td>
            <td class="total"></td>
            <td>
                <select name="vat" class="callSave" style="width: 65px">
                                        <option value="3"@>20%</option>
                                        <option value="1"@>19,6%</option>
                                        <option value="2"@>7%</option>
                                </select>
            </td>
            <td><a href="#" class="btn btn-danger remove"><i class="icon-remove"></i></a></td>
        </tr>
    </table>
     
    <div id="modal" class="modal hide fade">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="#modal" aria-hidden="true">&times;</button>
            <h3>Ajouter un magasin</h3>
        </div>
        <div class="modal-body">
            <form class="supplierForm" method="post" action="/app_dev.php/stock/supplier/create">
                <input type="hidden" name="company" value="15"/>
                <div id="tahiti_stockbundle_suppliertype"><div><label for="tahiti_stockbundle_suppliertype_name" class="required">Nom *</label><input type="text" id="tahiti_stockbundle_suppliertype_name" name="tahiti_stockbundle_suppliertype[name]" required="required" maxlength="255" /></div><div><label for="tahiti_stockbundle_suppliertype_address" class="required">Adresse *</label><input type="text" id="tahiti_stockbundle_suppliertype_address" name="tahiti_stockbundle_suppliertype[address]" required="required" maxlength="255" /></div><div><label for="tahiti_stockbundle_suppliertype_postcode" class="required">Code postal *</label><input type="text" id="tahiti_stockbundle_suppliertype_postcode" name="tahiti_stockbundle_suppliertype[postcode]" required="required" maxlength="10" /></div><div><label for="tahiti_stockbundle_suppliertype_city" class="required">Ville *</label><input type="text" id="tahiti_stockbundle_suppliertype_city" name="tahiti_stockbundle_suppliertype[city]" required="required" maxlength="100" /></div><div><label for="tahiti_stockbundle_suppliertype_tel" class="required">Téléphone</label><input type="text" id="tahiti_stockbundle_suppliertype_tel" name="tahiti_stockbundle_suppliertype[tel]" required="required" maxlength="20" /></div><div><label for="tahiti_stockbundle_suppliertype_fax" class="required">Fax</label><input type="text" id="tahiti_stockbundle_suppliertype_fax" name="tahiti_stockbundle_suppliertype[fax]" required="required" maxlength="20" /></div><div><label for="tahiti_stockbundle_suppliertype_email" class="required">Email</label><input type="text" id="tahiti_stockbundle_suppliertype_email" name="tahiti_stockbundle_suppliertype[email]" required="required" maxlength="100" /></div><input type="hidden" id="tahiti_stockbundle_suppliertype__token" name="tahiti_stockbundle_suppliertype[_token]" value="2eb8074c2b042fde8648ca76fe60b26eeda48a08" /></div>
            </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn closeModal">Annuler</a>
            <a href="#" class="btn btn-primary modalSave">Enregistrer</a>
        </div>
    </div>
     
    <script>
    $(function(){
        $('.tt').tooltip({'html': true});
     
        // Prevent saving form on enter key
        $('.order-form').bind("keypress", function(e) {
            if (e.keyCode == 13) {
                e.preventDefault();
                return false;
            }
        });
     
        $('.number').keypress(function(event) {
          if ((event.which != 46 || $(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) {
            event.preventDefault();
          }
        });
     
        $( ".save" ).click(function(e) {
            e.preventDefault();
            if ($('.interventionSearch').select2("val") != '') {
                if ($('.deliveryType').val() == 1) {
                    if ($('.userSearch').select2("val") != '') {
                        $( ".order-form" ).submit();
                    } else {
                        alert('Pour un enlèvement comptoire vous devez choisir un technicien');
                    }
                } else {
                    $( ".order-form" ).submit();    
                }
            } else {
                if ($('.stock').val() != '') {
                    $( ".order-form" ).submit();    
                } else {
                    alert('Veuillez choisir un stock ou une intervention');
                }
            }
        });
     
        var opts0 =
        {
            placeholder: "Choisir un fournisseur",
            minimumInputLength: 0,
            allowClear: true,
            ajax: {
                url: "/app_dev.php/billing/order/company/search",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        q: term,
                        page_limit: 10
                    };
                },
                results: function (data, page) {
                    return {results: data.results};
                }
            },
            formatResult: companyFormatResult,
            formatSelection: companyFormatSelection,
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) { return m; }
        };
     
        $(".companySearch").select2( opts0 );
     
                $(".companySearch").select2("data", {id: 15, name: 'ALX'});
     
        $('.companySearch').on("change", function(e) {
            $(".supplierSearch").select2('data', null);
            $('.supplierForm input[name=company]').val($(".companySearch").select2("val"));
            $('.addSupplier').show();
        });
     
        // Configure intervention select2
        var opts3 =
        {
            placeholder: "Choisir un magasin",
            minimumInputLength: 0,
            allowClear: true,
            ajax: {
                url: "/app_dev.php/billing/order/supplier/search",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        q: term,
                        page_limit: 10,
                        company: $(".companySearch").select2("val")
                    };
                },
                results: function (data, page) {
                    return {results: data.results};
                }
            },
            formatResult: supplierFormatResult,
            formatSelection: supplierFormatSelection,
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) { return m; }
        };
     
        $(".supplierSearch").select2( opts3 );
     
                $(".supplierSearch").select2("data", {id: 116, name: 'ALX TECHNOLOGIES'});
     
     
     
        $('.supplierSearch').on("change", function(e) {
            var data = $(".supplierSearch").select2("data");
            $(".companySearch").select2("data", {id: data.company_id, name: data.company_name});
        });
     
        // Configure intervention select2
        var opts1 =
        {
            placeholder: "Choisir une intervention",
            minimumInputLength: 2,
            allowClear: true,
            ajax: {
                url: "/app_dev.php/billing/order/intervention/search",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        q: term,
                        page_limit: 10
                    };
                },
                results: function (data, page) {
                    return {results: data.results};
                }
            },
            formatResult: interventionFormatResult,
            formatSelection: interventionFormatSelection,
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) { return m; }
        };
     
        $(".interventionSearch").select2( opts1 );
     
                $(".interventionSearch").select2("data", {id: 88235, ref: 'I-F98F0E'});
     
        $('.interventionSearch').on("change", function(e) {
            $('.stock').val('');
            $('.deliveryType').val('');
            $('.deliveryType').addClass('error');
            $('.delivery-container').show();
        });
     
        $('.stock').on("click", function(e) {
            $('.interventionSearch').select2("data", null);
        });
     
        $('.stock').on("change", function(e) {
            $('.deliveryType').val('3');
            $('.deliveryType').change();
            $('.delivery-container').hide();
        });
     
        // Configure article select2
        var opts2 =
        {
            placeholder: "Ajouter un article",
            minimumInputLength: 0,
            ajax: {
                url: "/app_dev.php/billing/order/article/search",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        q: term,
                        page_limit: 10,
                        company: $(".companySearch").select2("val")
                    };
                },
                results: function (data, page) {
                    return {results: data.results};
                }
            },
            formatResult: articleFormatResult,
            formatSelection: articleFormatSelection,
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) { return m; }
        };
     
        $(".articleSearch").select2( opts2 );
     
                $("#article0").select2("data", {id: 668074, ref: 'K803PX - Clavier polyesters pour automate ALX 803'});
     
        var opts4 =
        {
            placeholder: "Choisir un technicien",
            minimumInputLength: 0,
            allowClear: true,
            ajax: {
                url: "/app_dev.php/billing/order/user/search",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        q: term,
                        page_limit: 10
                    };
                },
                results: function (data, page) {
                    return {results: data.results};
                }
            },
            formatResult: userFormatResult,
            formatSelection: userFormatSelection,
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) { return m; }
        };
     
        $(".userSearch").select2( opts4 );
     
     
        $('.deliveryType').on("change", function(e) {
            $(this).removeClass('error');
            var type = $(this).val();
            var supplier = $(".supplierSearch").select2("val");
            var intervention = $(".interventionSearch").select2("val");
            var stock = $(".stock").val();
     
            if (type==1) {
                $('.retreivedBy').show();
            } else {
                $('.retreivedBy').hide();
            }
     
            $.post("/app_dev.php/billing/order/address/search", {
                'type': type,
                'supplier': supplier,
                'intervention': intervention,
                'stock': stock
            }, function(data) {
                if (data.error) {
                    $('.deliveryType').val('');
                    $('.address').val('');
                    $('.city').val('');
                    $('.postcode').val('');
                    alert("Un problème est survenu\nVous devez\n- saisir un magasin pour un enlèvement comptoir\n- saisir un intervention pour une livraison chantier");
                } else {
                    $('.address').val(data.address);
                    $('.city').val(data.city);
                    $('.postcode').val(data.postcode);
                }
            }, 'json');
        }).change();
     
     
        // On article select2 change : save line and create a new one if necessary
        $(document).on("change", '.articleSearch', function(e) {
            articleChange($(this));
        });
     
        function articleChange(elt) {
            var line = elt.parent().parent();
            var id = line.find('.line-id');
            var price = line.find('.price');
            var unit = line.find('.unit');
            var eco = line.find('.eco');
     
            //console.log('allo');
            //console.log($(this).select2('data'));
     
            var data = elt.select2('data');
            price.val(data.price);
            price.attr('title', 'Prix commandé<br>moyen '+ data.price +'&euro;<br>min '+ data.priceMin +' &euro;<br>max '+ data.priceMax +' &euro;');
            price.tooltip({'html': true});
            unit.val(data.unit);
            eco.val(data.eco);
     
            $.post("/app_dev.php/billing/orderline/save/1381", line.find(':input').serialize(), function(data) {
                if (id.val() == '') {
                    // Set price
                    //price.val(data.price);
                    //price.attr('title', 'Prix commandé<br>moyen '+ data.price +'&euro;<br>min '+ data.priceMin +' &euro;<br>max '+ data.priceMax +' &euro;');
                    //price.tooltip({'html': true});
     
                    //unit.val(data.unit);
                    //eco.val(data.eco);
     
                    // Keep line select2 data and destroy it
                    //var sdata = line.find('.articleSearch').select2("data")
                    //line.find('.articleSearch').select2("destroy");
     
                    // Add new line
                    var newline = $('.clone').clone(true);
                    newline.removeClass('clone');
                    newline.appendTo($('.lines'));
     
                    // Reinit its inputs
                    newline.find('.ref').val('');
                    newline.find('.llabel').val('');
                    newline.find('.unit').val('');
                    newline.find('.price').val('0');
                    newline.find('.quantity').val('1');
                    newline.find('.discount').val('0');
                    newline.find('.articleSearchTemp').removeClass('articleSearchTemp').addClass('articleSearch');
                    newline.find('.articleSearch').select2(opts2);
                    //newline.find('.articleSearch').select2("data", {id: '', ref: 'Ajouter un article'});
     
                    // Recreate line select2
                    //line.find('.articleSearch').select2(opts2);
                    //line.find('.articleSearch').select2("data", sdata);
     
                    //Set the previous line id
                    id.val(data.id);
                }
            }, 'json');
        }
     
        $(document).on("click", '.order-form .out', function(e) {
            e.preventDefault();
            $(this).prev().remove();
            $(this).prev().remove();
            $(this).parent().append('<input type="hidden" name="article_id"><input type="text" name="ref" class="ref callSave" placeholder="Référence" /><input type="text" name="label" class="llabel callSave" placeholder="Libéllé" /><a href="#" class="btn btn-info in" title="Dans base article"><i class="icon-signin"></i></a>');
            $(this).remove();
     
        });
     
        $(document).on("click", '.order-form .in', function(e) {
            e.preventDefault();
            $(this).prev().remove();
            $(this).prev().remove();
            $(this).parent().append('<input type="hidden" name="article_id" class="articleSearch"><a href="#" class="btn btn-danger out" title="Hors base article"><i class="icon-signout"></i></a>');
            $(this).parent().find('.articleSearch').select2(opts2);
            $(this).parent().find('.articleSearch').select2("data", {id: '', ref: 'Ajouter un article'});
            $(this).remove();
     
        });
     
        $(document).on("change", '.callSave', function(event){
            var elt = $(this);
     
     
            var line = elt.closest('tr');
            var id = line.find('.line-id');
            var article = line.find("input[name='article_id']");
            //alert(id);
     
     
     
            if (elt.hasClass('ref')) {
            //console.log('change1 '+elt);           
                            $.post("/app_dev.php/billing/orderline/check-article?company=15", line.find(':input').serialize(), function(data) {
                    if (data.id > 0) {
                        article.val(data.id);
                        line.find('.in').click();
                        //console.log('1 '+data.id);
                        //console.log(data.ref);
                        line.find('.articleSearch').select2(opts2);
                        line.find(".articleSearch").select2("data", data);
                        articleChange(line.find(".articleSearch"));
                        //line.find(".articleSearch").change();
                    }
                });
     
            } else {
             //console.log('change2 '+elt);
     
     
                $.post("/app_dev.php/billing/orderline/save/1381", line.find(':input').serialize(), function(data) {
                    //console.log('2 '+data.id);
                    if (data.id != undefined && data.id > 0 && id.val() != data.id && !data.chapter) {
                        line.find('.articleSearch').select2("destroy");
     
                        // Add new line
                        var newline = line.clone(true);
                        newline.appendTo($('.lines'));
     
                        // Reinit its inputs
                        newline.find('.ref').val('');
                        newline.find('.llabel').val('');
                        newline.find('.price').val('0');
                        newline.find('.quantity').val('1');
                        newline.find('.discount').val('0');
                        newline.find('.articleSearch').select2(opts2);
                        newline.find('.articleSearch').select2("data", {id: '', ref: 'Ajouter un article'});
     
                        // Recreate line select2
                        line.find('.articleSearch').select2(opts2);
                    }
     
                    id.val(data.id);
                    article.val(data.article_id);
     
                    $('.callSave').prop('readonly', false);
                });
            }
     
            updateTotals();
        });
     
        $(document).on("click", '.remove', function(event){
            event.preventDefault();
            var line = $(this).parent().parent();
            var id = line.find('.line-id');
     
            $.post("/app_dev.php/billing/orderline/delete", {id: id.val()}, function(data) {
                line.remove();
            });
        });
     
        $(document).on("click", '.addSupplier', function(event){
            $('#modal input[type=text]').val('');
        });    
     
        $(document).on("click", '.modalSave', function(event){
            event.preventDefault();
     
            $.post("/app_dev.php/stock/supplier/create", $('.supplierForm').serialize(), function(data) {
                if (data != null) {
                    $(".supplierSearch").select2("data", {id: data.id, name: data.name});
                    $('#modal').modal('hide');
                }
            }, 'json');
        });
     
         $(document).on("click", '.closeModal', function(event){
            event.preventDefault();
            $('#modal').modal('hide');
        });
     
        updateTotals();
     
    });
     
    function updateTotals() {
        var total = 0;
        var counter = 0;
        var totalspan = $('span.total');
        var counterspan = $('span.counter');
     
        $('.lines tbody tr').each(function( index ) {
            var price = parseFloat($(this).find('.price').val());
            var quantity = parseFloat($(this).find('.quantity').val());
            var eco = parseFloat($(this).find('.eco').val());
            var discount = parseFloat($(this).find('.discount').val());
            var line_total = $(this).find('.total');
     
            tot = (price + eco) * quantity;
            if (discount > 0) {
                tot = tot * (1 - (discount/100));
            }
            if (!isNaN(tot)) {
                line_total.html(tot.toFixed(2));
                total = total + tot;
                counter++;
            }
     
        });
     
        totalspan.html(total.toFixed(2));
        counterspan.html(counter);
    }
    </script>
     
    </div>
     
     
                                    </div>
     
     
                </div>
     
                                <div class="pull-right clearfix"></div>
                        </div>
                        <script>
                    $(function(){
                        // automate sevice selection on every service select field
                                            // automate tahiti source selection
                        $(".source-intervention").val('2');
                        $(".source-intervention").parent().parent().hide();
                    });
                </script>
                </body>
    </html>

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