indexSuccess.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <div class="content-add01">
  2. <div class="heading01"><h1>Liste des factures adhérents (<?php echo $pager->getNbResults() ?>)</h1></div>
  3. </div>
  4. <div class="filter">
  5. <div class="filter-left">&nbsp;</div>
  6. <div class="filter-middle">
  7. <?php echo form_tag('@katao_invoice_filter') ?>
  8. <?php echo select_tag('filter_status', options_for_select(KataoInvoicePeer::getAllStatuses(), $filter_status, array('include_custom' => '&mdash;&nbsp;Etat&nbsp;&mdash;'))) ?>
  9. <?php echo image_tag('separator02.gif', array('alt' => '')) ?>&nbsp;<?php echo select_tag('filter_member', options_for_select(KataoMemberPeer::getAllGroupedByNode(), $filter_member, array('include_custom' => '&mdash;&nbsp;Adhérent&nbsp;&mdash;'))) ?>
  10. <?php echo image_tag('separator02.gif', array('alt' => '')) ?>&nbsp;<?php echo select_tag('filter_node', options_for_select(KataoNodePeer::getAllArray(), $filter_node, array('include_custom' => '&mdash;&nbsp;Noeud&nbsp;&mdash;'))) ?>
  11. <?php echo image_tag('separator02.gif', array('alt' => '')) ?>&nbsp;<?php echo select_tag('filter_period', options_for_select(KataoPeriodPeer::getAll(), $filter_period, array('include_custom' => '&mdash;&nbsp;Période&nbsp;&mdash;'))) ?>
  12. <?php echo submit_tag('', array('class' => 'btn-search', 'title' => 'Filtrer')) ?><div style="float:right"><a href="<?php echo url_for('@katao_invoice_filter_reset') ?>">[annuler]</a></div>
  13. </form>
  14. </div>
  15. <div class="filter-right">&nbsp;</div>
  16. </div>
  17. <?php if (empty($katao_invoiceList)): ?>
  18. <p>Aucune facture.</p>
  19. <?php else : ?>
  20. <?php echo link_to('Valider les factures', '@katao_invoice_validate', array('class' => 'validate')) ?>
  21. <?php echo link_to('Supprimer les factures sélectionnées (' . multiple_action_info_selected('katao_invoice') . ')', '@katao_invoice_delete_multiple', array('class' => 'delete', 'confirm' => 'Êtes-vous sûr de vouloir supprimer les factures sélectionnées ?')) ?>
  22. <div style="padding-top:4px">
  23. <span class="pdf">Exporter les factures : </span><?php echo link_to('toutes', '@katao_invoice_export_pdf_all') ?> | <?php echo link_to('sélectionnées (' . multiple_action_info_selected('katao_invoice') . ')', '@katao_invoice_export_pdf_selected') ?>
  24. <?php echo link_to('Envoyer les factures sélectionnées (' . multiple_action_info_selected('katao_invoice') . ')', '@katao_invoice_send_multiple', array('class' => 'send')) ?>
  25. </div>
  26. <table class="admin-list">
  27. <tr>
  28. <th nowrap="nowrap" width="1%"><?php echo multiple_action_checkbox_all('katao_invoice') ?></th>
  29. <th nowrap="nowrap">N&deg; <?php echo sort_links($sf_request, 'no', 'kataoInvoice/index') ?></th>
  30. <th nowrap="nowrap">Date <?php echo sort_links($sf_request, 'date', 'kataoInvoice/index') ?></th>
  31. <th nowrap="nowrap">Etat <?php echo sort_links($sf_request, 'status', 'kataoInvoice/index') ?></th>
  32. <th nowrap="nowrap">Adhérent <?php echo sort_links($sf_request, 'member', 'kataoInvoice/index') ?></th>
  33. <th nowrap="nowrap">Montant</th>
  34. <th nowrap="nowrap">Noeud <?php echo sort_links($sf_request, 'node', 'kataoInvoice/index') ?></th>
  35. <th nowrap="nowrap">Période <?php echo sort_links($sf_request, 'period', 'kataoInvoice/index') ?></th>
  36. <th nowrap="nowrap" width="1%">Actions</th>
  37. </tr>
  38. <?php foreach ($katao_invoiceList as/*(KataoInvoice)*/ $katao_invoice): ?>
  39. <tr valign="top" class="line">
  40. <td class="center"><?php echo multiple_action_checkbox_line('katao_invoice', $katao_invoice->getId()) ?></td>
  41. <td nowrap="nowrap">
  42. <a href="javascript://" onclick="toggleDetails('<?php echo $katao_invoice->getId() ?>');" title="Détails"><?php echo image_tag('actions/expand.png', array('alt' => 'Détails', 'id' => 'invoice-icon-' . $katao_invoice->getId(), 'align' => 'bottom')) ?></a>
  43. <?php echo $katao_invoice->getNumber() ?>
  44. </td>
  45. <td nowrap="nowrap"><?php echo $katao_invoice->getCreatedAtStr() ?></td>
  46. <td nowrap="nowrap"><?php echo $katao_invoice->getStatusStr() ?></td>
  47. <td><?php echo $katao_invoice->getMemberName() ?></td>
  48. <td nowrap="nowrap" style="text-align:right!important"><?php echo $katao_invoice->sumProductsStr() ?></td>
  49. <td nowrap="nowrap"><?php echo $katao_invoice->getNodeLink() ?></td>
  50. <td nowrap="nowrap"><?php echo $katao_invoice->getPeriodLink() ?></td>
  51. <td nowrap="nowrap">
  52. <?php echo catalyz_link_to_image_tag('@katao_invoice_pdf?id=' . $katao_invoice->getId(), 'actions/pdf.png', array('title' => 'Exporter en PDF'), array('alt' => 'Exporter en PDF')) ?>
  53. <?php if (KataoInvoice::STATUS_VALIDATED == $katao_invoice->getStatus()): ?>
  54. <?php echo catalyz_link_to_image_tag('@katao_invoice_send?id=' . $katao_invoice->getId(), 'actions/send.png', array('title' => 'Envoyer à l\'adhérent'), array('alt' => 'Envoyer à l\'adhérent')) ?>
  55. <?php endif ?>
  56. <?php if (in_array($katao_invoice->getStatus(), array(KataoInvoice::STATUS_GENERATED, KataoInvoice::STATUS_DELIVERED))): ?>
  57. <?php echo catalyz_link_to_image_tag('@katao_invoice_deliver?id=' . $katao_invoice->getId(), 'actions/deliver.png', array('title' => 'Délivrer'), array('alt' => 'Délivrer')) ?>
  58. <?php endif ?>
  59. <?php echo catalyz_link_to_image_tag('@katao_invoice_delete?id=' . $katao_invoice->getId(), 'actions/delete.png', array('title' => 'Supprimer', 'confirm' => 'Êtes-vous sûr de vouloir supprimer cette facture ?'), array('alt' => 'Supprimer')) ?>
  60. </td>
  61. </tr>
  62. <tr valign="top" style="display: none" id="invoice-details-<?php echo $katao_invoice->getId() ?>">
  63. <td colspan="9">
  64. <table class="admin-sub-list">
  65. <tr>
  66. <th>Produit</th>
  67. <th nowrap="nowrap" width="1%"><?php echo image_tag('actions/adjust.png', array('alt' => 'Quantité commandée', 'title' => 'Quantité commandée')) ?></th>
  68. <th nowrap="nowrap" width="1%"><?php echo image_tag('actions/deliver.png', array('alt' => 'Quantité délivrée', 'title' => 'Quantité délivrée')) ?></th>
  69. <th nowrap="nowrap" width="1%">Prix TTC</th>
  70. <th nowrap="nowrap" width="1%">Total</th>
  71. </tr>
  72. <?php $total = 0 ?>
  73. <?php foreach ($katao_invoice->getKataoInvoiceProductsOrderByProduct() as/*(KataoInvoiceProduct)*/ $katao_invoice_product): ?>
  74. <?php $quantity = $katao_invoice_product->getQuantity() ?>
  75. <?php $quantity_delivered = $katao_invoice_product->getQuantityDelivered() ?>
  76. <?php $price = $katao_invoice_product->getProductPriceWithTaxes() ?>
  77. <?php $sub_total = $quantity_delivered * $price ?>
  78. <?php $total += $sub_total ?>
  79. <tr valign="top">
  80. <td><?php echo $katao_invoice_product->getProductName() ?></td>
  81. <td nowrap="nowrap" style="text-align:right!important"><?php echo $quantity ?></td>
  82. <td nowrap="nowrap" style="text-align:right!important"><?php echo (KataoInvoice::STATUS_GENERATED != $katao_invoice->getStatus())?$quantity_delivered:CONST_N_A ?></td>
  83. <td nowrap="nowrap" style="text-align:right!important"><?php echo utils::formatCurrencyEuro($price) ?></td>
  84. <td nowrap="nowrap" style="text-align:right!important"><?php echo utils::formatCurrencyEuro($sub_total) ?></td>
  85. </tr>
  86. <?php endforeach ?>
  87. <tr>
  88. <td style="border:none!important">&nbsp;</td>
  89. <th colspan="3" nowrap="nowrap" style="text-align:right!important">TOTAL :</th>
  90. <th nowrap="nowrap" style="text-align:right!important"><?php echo utils::formatCurrencyEuro($total) ?></th>
  91. </tr>
  92. </table>
  93. </td>
  94. </tr>
  95. <?php endforeach ?>
  96. </table>
  97. <?php echo pager($pager, sprintf('kataoInvoice/index?sort=%s%s', $sf_request->getParameter('sort', 'date'), $sf_request->hasParameter('desc')?'&desc=on':''), 'katao_invoice') ?>
  98. <?php endif ?>
  99. <script type="text/javascript" language="JavaScript">
  100. /* <![CDATA[ */
  101. function toggleDetails( id ){
  102. $('invoice-details-'+id).toggle();
  103. if($('invoice-details-'+id).visible()) {
  104. $('invoice-icon-'+id).src = '<?php echo image_path('actions/collapse.png') ?>';
  105. } else {
  106. $('invoice-icon-'+id).src = '<?php echo image_path('actions/expand.png') ?>';
  107. }
  108. }
  109. /* ]]> */
  110. </script>