deliverSuccess.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <div class="content-add01">
  2. <div class="heading01"><h1>Livraison de la facture "<?php echo $katao_invoice->getNumber() ?>" de l'adhérent "<?php echo $katao_invoice->getMemberName() ?>" pour la période "<?php echo $katao_invoice->getKataoPeriod()->getName() ?>"</h1></div>
  3. </div>
  4. <?php echo form_tag('@katao_invoice_deliver?id=' . $katao_invoice->getId()) ?>
  5. <table class="admin-sub-list">
  6. <tr>
  7. <td style="border:none!important">&nbsp;</td>
  8. <th colspan="3" style="text-align:center!important">Quantités</th>
  9. </tr>
  10. <tr>
  11. <th>Produit</th>
  12. <th nowrap="nowrap" width="1%" style="text-align:center!important">Commandée</th>
  13. <th nowrap="nowrap" width="1%" style="text-align:center!important">Délivrée</th>
  14. <th nowrap="nowrap" width="1%" style="text-align:center!important">EN COURS / TOTAL</th>
  15. </tr>
  16. <?php $criteria = new Criteria();
  17. $criteria->addAscendingOrderByColumn(KataoInvoiceProductPeer::PRODUCT_NAME); ?>
  18. <?php foreach ($katao_invoice->getKataoInvoiceProductsJoinKataoProduct($criteria) as/*(KataoInvoiceProduct)*/ $katao_invoice_product): ?>
  19. <?php $katao_product = $katao_invoice_product->getKataoProduct() ?>
  20. <?php $quantity = $katao_invoice_product->getQuantityDelivered() ?>
  21. <?php $total_delivered_quantity = $katao_product->getTotalDeliveredQuantity($katao_invoice->getId(), $katao_invoice->getKataoPeriodId(), $katao_invoice->getKataoNodeId()) ?>
  22. <tr>
  23. <td><?php echo $katao_invoice_product->getProductName() ?></td>
  24. <td style="text-align:center!important"><?php echo $katao_invoice_product->getQuantity() ?></td>
  25. <td nowrap="nowrap" style="text-align:center!important">
  26. <a href="javascript://" onclick="document.getElementById('quantity_<?php echo $katao_invoice_product->getId() ?>').value = Math.max(0, parseInt(document.getElementById('quantity_<?php echo $katao_invoice_product->getId() ?>').value) - 1); updateCurrentDelivered(<?php echo $katao_invoice_product->getId() ?>, <?php echo $total_delivered_quantity ?>);" title="Diminuer la quantité"><?php echo image_tag('minus.png', array('alt' => 'Diminuer la quantité', 'align' => 'top')) ?></a>
  27. <?php echo input_tag('quantity[' . $katao_invoice_product->getId() . ']', $quantity, array('style' => 'width: 20px; text-align: center;', 'class' => 'quantity-delivered', 'onchange' => 'updateCurrentDelivered(' . $katao_invoice_product->getId() . ', ' . $total_delivered_quantity . ');')) ?>
  28. <a href="javascript://" onclick="document.getElementById('quantity_<?php echo $katao_invoice_product->getId() ?>').value = parseInt(document.getElementById('quantity_<?php echo $katao_invoice_product->getId() ?>').value) + 1; updateCurrentDelivered(<?php echo $katao_invoice_product->getId() ?>, <?php echo $total_delivered_quantity ?>);" title="Augmenter la quantité"><?php echo image_tag('plus.png', array('alt' => 'Augmenter la quantité', 'align' => 'top')) ?></a>
  29. </td>
  30. <td style="text-align:center!important"><span id="current-quantity-<?php echo $katao_invoice_product->getId() ?>"><?php echo $total_delivered_quantity + $quantity ?></span> / <?php echo $katao_product->getTotalReceivedQuantity($katao_invoice->getKataoPeriodId(), $katao_invoice->getKataoNodeId()) ?></td>
  31. </tr>
  32. <?php endforeach ?>
  33. <tr>
  34. <td colspan="4"><?php echo select_tag('new_product', options_for_select($katao_invoice->getOtherProducts(), false, array('include_custom' => '&mdash;&nbsp;Autre produit&nbsp;&mdash;'))) ?>&nbsp;<?php echo submit_tag('Ajouter') ?></td>
  35. </tr>
  36. </table>
  37. <br /><?php echo submit_tag('Délivrer') ?> ou <a href="<?php echo url_for('kataoInvoice/index') ?>">annuler</a>
  38. </form>
  39. <script type="text/javascript" language="JavaScript">
  40. /* <![CDATA[ */
  41. function updateCurrentDelivered(id, total_delivered_quantity){
  42. $('current-quantity-' + id).innerHTML = total_delivered_quantity + parseInt($F('quantity_' + id));
  43. }
  44. /* ]]> */
  45. </script>