Task #1532 : detail payment

This commit is contained in:
Dany De Bontridder 2020-05-24 21:46:34 +02:00 committed by Dany De Bontridder
parent e7f4184ef8
commit 577229bde9

View file

@ -48,10 +48,12 @@ require_once NOALYSS_INCLUDE.'/class/stock_goods.class.php';
*/
class Acc_Ledger_Purchase extends Acc_Ledger
{
private $payment_operation; /*<! id of the payment , set in insert */
function __construct ($p_cn,$p_init)
{
$this->ledger_type='ACH';
parent::__construct($p_cn,$p_init);
$this->payment_operation=-1;
}
/*!\brief verify that the data are correct before inserting or confirming
*\param an array (usually $_POST)
@ -878,7 +880,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$acc_pay->grpt=$acseq;
$acc_pay->jrn=$mp->get_parameter('ledger_target');
$acc_pay->periode=$tperiode;
$acc_pay->type=($famount>=0)?'c':'d';
$acc_pay->type=($famount>=0)?'c':'d';
$acc_pay->insert_jrnx();
/* Insert supplier */
@ -899,6 +901,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$acc_pay->desc=(!isset($e_comm_paiement) || strlen(trim($e_comm_paiement)) == 0) ?$e_comm:$e_comm_paiement;
$mp_jr_id=$acc_pay->insert_jrn();
$this->payment_operation=$mp_jr_id;
$acjrn->grpt_id=$acseq;
$acjrn->update_internal_code($acinternal);
// add an automatic PJ if ODS
@ -1700,19 +1703,30 @@ EOF;
*/
if ( $e_mp!=0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) != 0 )
{
$r.="<p>";
$r.=HtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.$e_mp});
$r.=HtmlInput::hidden('acompte',$acompte);
$r.=HtmlInput::hidden('e_comm_paiement',$e_comm_paiement);
$r.=HtmlInput::hidden('mp_date',$mp_date);
$r.=HtmlInput::hidden('e_comm_paiement',$e_comm_paiement);
$r.=HtmlInput::hidden('mp_date',$mp_date);
/* needed for generating a invoice */
$r.=HtmlInput::hidden('qcode_benef', ${'e_mp_qcode_' . $e_mp});
$fname = new Fiche($this->db);
$fname->get_by_qcode(${'e_mp_qcode_' . $e_mp});
$detail_payment="";
// payment operation
if ($this->payment_operation != 1) {
$pay_internal=$this->db->get_value("select jr_internal from jrn where jr_id=$1",
[$this->payment_operation]);
$detail_payment=HtmlInput::detail_op($this->payment_operation,$pay_internal);
}
$r.='<h2>' . _("Payé par")." " . ${'e_mp_qcode_' . $e_mp} .
" " . $fname->getName() . '</h2> ' . '<p class="decale">' . _('Déduction acompte ') . h($acompte) . '</p>' .
" " . $fname->getName() .$detail_payment. '</h2> ' ;
$r.='<p class="decale">' . _('Déduction acompte ') . h($acompte) . '</p>' .
_('Libellé :') . h($e_comm_paiement) ;
$r.='<br>';
$r.='<br>';
$r.="</p>";
}
// check for upload piece
/*