New: Prepare code to be able to choose bank account to show when
building pdf and payment mode is withdraw.
This commit is contained in:
parent
c4c5e247af
commit
327f4062c7
@ -1615,10 +1615,8 @@ else if ($action == 'builddoc') // En get ou en post
|
|||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
if (GETPOST('model'))
|
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model'));
|
||||||
{
|
if (GETPOST('fk_bank')) $object->fk_bank=GETPOST('fk_bank');
|
||||||
$object->setDocModel($user, GETPOST('model'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
|
|||||||
@ -100,6 +100,7 @@ class Facture extends CommonInvoice
|
|||||||
var $cond_reglement_code; // Code in llx_c_paiement
|
var $cond_reglement_code; // Code in llx_c_paiement
|
||||||
var $mode_reglement_id; // Id in llx_c_paiement
|
var $mode_reglement_id; // Id in llx_c_paiement
|
||||||
var $mode_reglement_code; // Code in llx_c_paiement
|
var $mode_reglement_code; // Code in llx_c_paiement
|
||||||
|
var $fk_bank; // Field to store bank id to use when payment mode is withdraw
|
||||||
var $modelpdf;
|
var $modelpdf;
|
||||||
var $products=array(); // deprecated
|
var $products=array(); // deprecated
|
||||||
var $lines=array();
|
var $lines=array();
|
||||||
|
|||||||
@ -775,10 +775,11 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
// If payment mode not forced or forced to VIR, show payment with BAN
|
// If payment mode not forced or forced to VIR, show payment with BAN
|
||||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->FACTURE_RIB_NUMBER))
|
if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER))
|
||||||
{
|
{
|
||||||
|
$bankid=(empty($object->fk_bank)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_bank);
|
||||||
$account = new Account($this->db);
|
$account = new Account($this->db);
|
||||||
$account->fetch($conf->global->FACTURE_RIB_NUMBER);
|
$account->fetch($bankid);
|
||||||
|
|
||||||
$curx=$this->marge_gauche;
|
$curx=$this->marge_gauche;
|
||||||
$cury=$posy;
|
$cury=$posy;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user