Task #0001704: Faciliter l'ajout de plusieurs lignes

This commit is contained in:
Dany De Bontridder 2020-03-02 20:39:15 +01:00
parent 3fe0a06a63
commit 5bd1ed9373
8 changed files with 23 additions and 6 deletions

View file

@ -344,6 +344,22 @@ function ledger_fin_add_row()
nb.value++;
}
/**
* Add multiple row
* @param p_numrow
*/
function ledger_add_multiple(p_elid)
{
var nbrow=$(p_elid).value;
if (nbrow == NaN) {nbrow=1;}
var type_ledger=$(p_elid+"_ledger").value;
var i=0;
for (i=0;i<nbrow;i++) {
if ( type_ledger == 'O' ) {ledger_add_row();}
if ( type_ledger == 'F') { ledger_fin_add_row();}
if ( type_ledger == 'M') { quick_writing_add_row();}
}
}
/**
* add a line in the form for the purchase ledger
* @param p_dossier folder id

View file

@ -48,6 +48,7 @@ require_once NOALYSS_INCLUDE.'/class/acc_payment.class.php';
require_once NOALYSS_INCLUDE.'/class/acc_ledger_history.class.php';
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
require_once NOALYSS_INCLUDE.'/class/pre_op_ods.class.php';
require_once NOALYSS_INCLUDE.'/class/html_input_noalyss.class.php';
/** \file
* @brief Class for jrn, class acc_ledger for manipulating the ledger

View file

@ -1332,7 +1332,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
// Set correctly the REQUEST param for jrn_type
$r.= HtmlInput::hidden('jrn_type','ACH');
$r.= HtmlInput::button('add_item',_('Ajout article'), ' onClick="ledger_add_row()"');
$r.= Html_Input_Noalyss::ledger_add_item("O");

View file

@ -1330,8 +1330,7 @@ EOF;
// Set correctly the REQUEST param for jrn_type
$r.=HtmlInput::hidden('jrn_type', 'VEN');
$r.=HtmlInput::button('add_item', _('Ajout article'), ' onClick="ledger_add_row()"');
$r.= Html_Input_Noalyss::ledger_add_item("O");
$r.= create_script("$('" . $Date->id . "').focus()");
return $r;
}

View file

@ -284,6 +284,7 @@ class Pre_Op_Advanced extends Pre_operation_detail
// If readonly == 1 then show CA
}
$ret.='</table>';
$ret.=Html_Input_Noalyss::ledger_add_item("M");
return $ret;
}
}

View file

@ -406,8 +406,8 @@ class Pre_op_ven extends Pre_operation_detail
// Set correctly the REQUEST param for jrn_type
$r.=HtmlInput::hidden('jrn_type','VEN');
$r.= Html_Input_Noalyss::ledger_add_item("O");
$r.=HtmlInput::button('add_item',_('Ajout article'), ' onClick="ledger_add_row()"');
return $r;
}
}

View file

@ -145,7 +145,7 @@ try
{
echo $Ledger->input($array);
echo HtmlInput::button('add_item',_('Ajout article'), ' onClick="ledger_fin_add_row()"');
echo Html_Input_Noalyss::ledger_add_item("F");
echo HtmlInput::submit('save',_('Sauve'));
echo HtmlInput::reset(_('Effacer'));

View file

@ -94,7 +94,7 @@ $iconcerned->amount_id="totalDeb";
printf (_("Opération rapprochée : %s"),$iconcerned->input());
echo '<p>';
echo HtmlInput::button('add', _('Ajout d\'une ligne'), 'onClick="quick_writing_add_row()"');
echo Html_Input_Noalyss::ledger_add_item("M");
echo HtmlInput::submit('summary', _('Sauvez'));
echo '</p>';