deliverSuccess.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. <?php echo input_number_tag('quantity[' . $katao_invoice_product->getId() . ']', $quantity, array('style' => 'width: 60px; height: 20px; text-align: center;', 'class' => 'quantity-delivered', 'onchange' => 'updateCurrentDelivered(' . $katao_invoice_product->getId() . ', ' . $total_delivered_quantity . ');')) ?>
  27. </td>
  28. <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>
  29. </tr>
  30. <?php endforeach ?>
  31. <tr>
  32. <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>
  33. </tr>
  34. </table>
  35. <br /><?php echo submit_tag('Délivrer') ?> ou <a href="<?php echo url_for('kataoInvoice/index') ?>">annuler</a>
  36. </form>
  37. <script type="text/javascript" language="JavaScript">
  38. /* <![CDATA[ */
  39. function updateCurrentDelivered(id, total_delivered_quantity){
  40. $('current-quantity-' + id).innerHTML = total_delivered_quantity + parseFloat($F('quantity_' + id));
  41. }
  42. /* ]]> */
  43. </script>