From ab275054feda09cb08e7b4fc53a295bc018d5221 Mon Sep 17 00:00:00 2001 From: Serghei MIHAI Date: Thu, 10 Jul 2014 17:06:53 +0200 Subject: [PATCH] id_piece in refdet is on 6 positions and is zero filled if not complete --- .../templates/tipi_payment_plugin/tipi.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tipi_payment_plugin/templates/tipi_payment_plugin/tipi.html b/tipi_payment_plugin/templates/tipi_payment_plugin/tipi.html index 6698c26..3fca947 100644 --- a/tipi_payment_plugin/templates/tipi_payment_plugin/tipi.html +++ b/tipi_payment_plugin/templates/tipi_payment_plugin/tipi.html @@ -44,20 +44,26 @@ function call_tipi() { var idpiece = document.getElementById('idpiece').value.trim(); var idligne = document.getElementById('idligne').value.trim(); var idpiece_padding = ''; + var idligne_padding = ''; var exer = params.exer('exer'); if (!idpiece || isNaN(idpiece)) { document.getElementById('refdet_error').style.display='inline'; return false; } - for (var i=0;i<8-idpiece.length;i++) - idpiece_padding += '0'; - idpiece = idpiece_padding + idpiece; if (!idligne || isNaN(idligne)) { document.getElementById('refdet_error').style.display='inline'; return false; } - idligne = '0' + idligne; + + for (var i=0;i<8-idpiece.length;i++) + idpiece_padding += '0'; + idpiece = idpiece_padding + idpiece; + + for (var i=0;i<6-idligne.length;i++) + idligne_padding += '0'; + idligne = idligne_padding + idligne; + {% if instance.saisie == 'T' %} return "999900000000999999"; {% else %}