indexSuccess.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <div class="content-add01">
  2. <div class="heading01"><h1>Liste des demandes 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_cart_filter') ?>
  8. <?php echo select_tag('filter_status', options_for_select(KataoCartPeer::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::getAllUsersGroupedByNode(), $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_cart_filter_reset') ?>">[annuler]</a></div>
  13. </form>
  14. </div>
  15. <div class="filter-right">&nbsp;</div>
  16. </div>
  17. <?php if (empty($katao_cartList)): ?>
  18. <p>Aucune demande.</p>
  19. <?php else : ?>
  20. <?php echo link_to('Supprimer les demandes sélectionnées (' . multiple_action_info_selected('katao_cart') . ')', '@katao_cart_delete_multiple', array('class' => 'delete', 'confirm' => 'Êtes-vous sûr de vouloir supprimer les demandes sélectionnées ?')) ?>
  21. <span class="pdf">Exporter les demandes : </span><?php echo link_to('toutes', '@katao_cart_export_pdf_all') ?> | <?php echo link_to('sélectionnées (' . multiple_action_info_selected('katao_cart') . ')', '@katao_cart_export_pdf_selected') ?>
  22. <?php echo link_to('Générer les commandes fournisseurs', '@katao_cart_generate_orders', array('class' => 'order')) ?>
  23. <table class="admin-list">
  24. <tr>
  25. <th nowrap="nowrap" width="1%"><?php echo multiple_action_checkbox_all('katao_cart') ?></th>
  26. <th nowrap="nowrap">N&deg; <?php echo sort_links($sf_request, 'no', 'kataoCart/index') ?></th>
  27. <th nowrap="nowrap">Date <?php echo sort_links($sf_request, 'date', 'kataoCart/index') ?></th>
  28. <th nowrap="nowrap">Etat <?php echo sort_links($sf_request, 'status', 'kataoCart/index') ?></th>
  29. <th nowrap="nowrap">Adhérent <?php echo sort_links($sf_request, 'member', 'kataoCart/index') ?></th>
  30. <th nowrap="nowrap">Montant</th>
  31. <th nowrap="nowrap">Noeud <?php echo sort_links($sf_request, 'node', 'kataoCart/index') ?></th>
  32. <th nowrap="nowrap">Période <?php echo sort_links($sf_request, 'period', 'kataoCart/index') ?></th>
  33. <th width="1%">Actions</th>
  34. </tr>
  35. <?php foreach ($katao_cartList as/*(KataoCart)*/ $katao_cart): ?>
  36. <?php $katao_cart_products = $katao_cart->getKataoCartProductsOrderByProductName() ?>
  37. <?php
  38. $total = 0;
  39. $katao_cart_products_data = array();
  40. foreach ($katao_cart_products as/*(KataoCartProduct)*/ $katao_cart_product) {
  41. $quantity_asked = $katao_cart_product->getQuantity();
  42. $quantity_adjusted = $katao_cart_product->gethasBeenAdjusted()?$katao_cart_product->getQuantityAdjusted():CONST_N_A;
  43. $quantity_delivered = $katao_cart_product->getKataoOrderProduct()?($katao_cart_product->getKataoOrderProduct()->getHasBeenDelivered()?$katao_cart_product->getQuantityDelivered():CONST_N_A):CONST_N_A;
  44. $quantity = $quantity_delivered;
  45. if (CONST_N_A === $quantity) {
  46. $quantity = $quantity_adjusted;
  47. }
  48. if (CONST_N_A === $quantity) {
  49. $quantity = $quantity_asked;
  50. }
  51. $price = $katao_cart_product->getProductPriceWithTaxes();
  52. $sub_total = $quantity * $price;
  53. $total += $sub_total;
  54. $katao_cart_products_data[] = array('product_name' => $katao_cart_product->getProductName(),
  55. 'quantity_asked' => $quantity_asked,
  56. 'quantity_adjusted' => $quantity_adjusted,
  57. 'quantity_delivered' => $quantity_delivered,
  58. 'price' => $price,
  59. 'sub_total' => $sub_total,
  60. );
  61. }
  62. ?>
  63. <tr valign="top" class="line">
  64. <td class="center"><?php echo multiple_action_checkbox_line('katao_cart', $katao_cart->getId()) ?></td>
  65. <td nowrap="nowrap">
  66. <a href="javascript://" onclick="toggleDetails('<?php echo $katao_cart->getId() ?>');" title="Détails"><?php echo image_tag('actions/expand.png', array('alt' => 'Détails', 'id' => 'cart-icon-' . $katao_cart->getId(), 'align' => 'bottom')) ?></a>
  67. <?php echo $katao_cart->getNumber() ?>
  68. </td>
  69. <td nowrap="nowrap"><?php echo $katao_cart->getCreatedAtStr() ?></td>
  70. <td nowrap="nowrap"><?php echo $katao_cart->getStatusStr() ?></td>
  71. <td><?php echo $katao_cart->getMemberLink() ?></td>
  72. <td nowrap="nowrap" style="text-align:right!important"><?php echo Utils::formatCurrencyEuro($total) ?></td>
  73. <td nowrap="nowrap"><?php echo $katao_cart->getNodeLink() ?></td>
  74. <td nowrap="nowrap"><?php echo $katao_cart->getPeriodLink() ?></td>
  75. <td nowrap="nowrap">
  76. <?php if (KataoCart::STATUS_IN_PROGRESS == $katao_cart->getStatus()): ?>
  77. <?php echo catalyz_link_to_image_tag('@katao_cart_validate?id=' . $katao_cart->getId(), 'actions/validate.png', array('title' => 'Valider', 'confirm' => 'Êtes-vous sûr de vouloir valider cette demande ?'), array('alt' => 'Valider')) ?>
  78. <?php elseif (KataoCart::STATUS_VALIDATED == $katao_cart->getStatus()): ?>
  79. <?php echo catalyz_link_to_image_tag('@katao_cart_unvalidate?id=' . $katao_cart->getId(), 'actions/unvalidate.png', array('title' => 'Dé-valider', 'confirm' => 'Êtes-vous sûr de vouloir dé-valider cette demande ?'), array('alt' => 'Dé-valider')) ?>
  80. <?php endif ?>
  81. <?php echo catalyz_link_to_image_tag('@katao_cart_pdf?id=' . $katao_cart->getId(), 'actions/pdf.png', array('title' => 'Exporter en PDF'), array('alt' => 'Exporter en PDF')) ?>
  82. <?php echo catalyz_link_to_image_tag('@katao_cart_delete?id=' . $katao_cart->getId(), 'actions/delete.png', array('title' => 'Supprimer', 'confirm' => 'Êtes-vous sûr de vouloir supprimer cette demande ?'), array('alt' => 'Supprimer')) ?>
  83. </td>
  84. </tr>
  85. <tr valign="top" style="display: none" id="cart-details-<?php echo $katao_cart->getId() ?>">
  86. <td colspan="9">
  87. <?php if(0 == count($katao_cart_products)): ?>
  88. <p>Aucun produit.</p>
  89. <?php else: ?>
  90. <table class="admin-sub-list">
  91. <tr>
  92. <th>Produit</th>
  93. <th nowrap="nowrap" width="1%"><?php echo image_tag('actions/cart.png', array('alt' => 'Quantité demandée', 'title' => 'Quantité demandée')) ?></th>
  94. <th nowrap="nowrap" width="1%"><?php echo image_tag('actions/adjust.png', array('alt' => 'Quantité commandée', 'title' => 'Quantité commandée')) ?></th>
  95. <th nowrap="nowrap" width="1%"><?php echo image_tag('actions/deliver.png', array('alt' => 'Quantité délivrée', 'title' => 'Quantité délivrée')) ?></th>
  96. <th nowrap="nowrap" width="1%">P.U. TTC</th>
  97. <th nowrap="nowrap" width="1%">Total TTC</th>
  98. </tr>
  99. <?php foreach($katao_cart_products_data as $katao_cart_product_infos): ?>
  100. <tr valign="top">
  101. <td><?php echo $katao_cart_product_infos['product_name'] ?></td>
  102. <td nowrap="nowrap" style="text-align:right!important"><?php echo $katao_cart_product_infos['quantity_asked'] ?></td>
  103. <td nowrap="nowrap" style="text-align:right!important"><?php echo $katao_cart_product_infos['quantity_adjusted'] ?></td>
  104. <td nowrap="nowrap" style="text-align:right!important"><?php echo $katao_cart_product_infos['quantity_delivered'] ?></td>
  105. <td nowrap="nowrap" style="text-align:right!important"><?php echo utils::formatCurrencyEuro($katao_cart_product_infos['price']) ?></td>
  106. <td nowrap="nowrap" style="text-align:right!important"><?php echo utils::formatCurrencyEuro($katao_cart_product_infos['sub_total']) ?></td>
  107. </tr>
  108. <?php endforeach ?>
  109. <tr>
  110. <td style="border:none!important">&nbsp;</td>
  111. <th colspan="4" nowrap="nowrap" style="text-align:right!important">MONTANT TOTAL TTC</th>
  112. <th nowrap="nowrap" style="text-align:right!important"><?php echo utils::formatCurrencyEuro($total) ?></th>
  113. </tr>
  114. </table>
  115. <?php endif ?>
  116. </td>
  117. </tr>
  118. <?php endforeach ?>
  119. </table>
  120. <?php echo pager($pager, sprintf('kataoCart/index?sort=%s%s', $sf_request->getParameter('sort', 'date'), $sf_request->hasParameter('desc')?'&desc=on':''), 'katao_cart') ?>
  121. <?php endif ?>
  122. <script type="text/javascript" language="JavaScript">
  123. /* <![CDATA[ */
  124. function toggleDetails( id ){
  125. $('cart-details-'+id).toggle();
  126. if($('cart-details-'+id).visible()) {
  127. $('cart-icon-'+id).src = '<?php echo image_path('actions/collapse.png') ?>';
  128. } else {
  129. $('cart-icon-'+id).src = '<?php echo image_path('actions/expand.png') ?>';
  130. }
  131. }
  132. /* ]]> */
  133. </script>