Skip to content

Commit

Permalink
New: Prepare code to be able to choose bank account to show when
Browse files Browse the repository at this point in the history
building pdf and payment mode is withdraw.
  • Loading branch information
eldy committed Feb 22, 2013
1 parent c4c5e24 commit 327f406
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 3 additions & 5 deletions htdocs/compta/facture.php
Expand Up @@ -1615,11 +1615,9 @@
$object->fetch($id);
$object->fetch_thirdparty();

if (GETPOST('model'))
{
$object->setDocModel($user, GETPOST('model'));
}

if (GETPOST('model')) $object->setDocModel($user, GETPOST('model'));
if (GETPOST('fk_bank')) $object->fk_bank=GETPOST('fk_bank');

// Define output language
$outputlangs = $langs;
$newlang='';
Expand Down
1 change: 1 addition & 0 deletions htdocs/compta/facture/class/facture.class.php
Expand Up @@ -100,6 +100,7 @@ class Facture extends CommonInvoice
var $cond_reglement_code; // Code in llx_c_paiement
var $mode_reglement_id; // Id 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 $products=array(); // deprecated
var $lines=array();
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/modules/facture/doc/pdf_crabe.modules.php
Expand Up @@ -775,10 +775,11 @@ function _tableau_info(&$pdf, $object, $posy, $outputlangs)
// 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($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->fetch($conf->global->FACTURE_RIB_NUMBER);
$account->fetch($bankid);

$curx=$this->marge_gauche;
$cury=$posy;
Expand Down

0 comments on commit 327f406

Please sign in to comment.