Fix Bank Transfer
This commit is contained in:
parent
a2d242356a
commit
b09a618f38
@ -225,7 +225,7 @@ if ($id > 0 || $ref)
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
$acc = new Account($db);
|
||||
$result = $acc->fetch(($object->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT));//v20
|
||||
$result = $acc->fetch(($object->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT));
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
$labelofbankfield = "BankToReceiveWithdraw";
|
||||
@ -404,7 +404,7 @@ if ($id > 0 || $ref)
|
||||
print "<td>";
|
||||
print $ligne->LibStatut($obj->statut, 2);
|
||||
print " ";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'&type='.$object->type.'">';//v20
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'&type='.$object->type.'">';
|
||||
print sprintf("%06s", $obj->rowid);
|
||||
print '</a></td>';
|
||||
|
||||
|
||||
@ -469,7 +469,7 @@ class BonPrelevement extends CommonObject
|
||||
$message = $langs->trans("InfoCreditMessage", $this->ref, dol_print_date($date, 'dayhour'));
|
||||
|
||||
//Add payment of withdrawal into bank
|
||||
$bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); //V20
|
||||
$bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
$facs = array();
|
||||
$amounts = array();
|
||||
$amountsperthirdparty = array();
|
||||
@ -1766,7 +1766,7 @@ class BonPrelevement extends CommonObject
|
||||
fputs($this->file, ' <Id>'.$CrLf);
|
||||
fputs($this->file, ' <PrvtId>'.$CrLf);
|
||||
fputs($this->file, ' <Othr>'.$CrLf);
|
||||
fputs($this->file, ' <Id>'.$conf->global->PAYMENTBYBANKTRANSFER_ICS.'</Id>'.$CrLf);//v20
|
||||
fputs($this->file, ' <Id>'.$conf->global->PAYMENTBYBANKTRANSFER_ICS.'</Id>'.$CrLf);
|
||||
fputs($this->file, ' </Othr>'.$CrLf);
|
||||
fputs($this->file, ' </PrvtId>'.$CrLf);
|
||||
fputs($this->file, ' </Id>'.$CrLf);
|
||||
@ -2186,7 +2186,7 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
// Get data of bank account
|
||||
//$id = $configuration->global->PRELEVEMENT_ID_BANKACCOUNT;
|
||||
$id=($type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); //V20
|
||||
$id=($type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
$account = new Account($this->db);
|
||||
if ($account->fetch($id) > 0)
|
||||
{
|
||||
|
||||
@ -40,7 +40,7 @@ class RejetPrelevement
|
||||
*/
|
||||
public $db;
|
||||
|
||||
public $type; //prelevement or bank transfer. v20
|
||||
public $type; //prelevement or bank transfer
|
||||
|
||||
|
||||
/**
|
||||
@ -55,7 +55,7 @@ class RejetPrelevement
|
||||
|
||||
$this->db = $db;
|
||||
$this->user = $user;
|
||||
$this->type = $type;//v20
|
||||
$this->type = $type;
|
||||
|
||||
$this->motifs = array();
|
||||
$this->facturer = array();
|
||||
@ -95,7 +95,7 @@ class RejetPrelevement
|
||||
$now = dol_now();
|
||||
|
||||
dol_syslog("RejetPrelevement::Create id $id");
|
||||
$bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); //V20
|
||||
$bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
$facs = $this->getListInvoices(1);
|
||||
|
||||
$this->db->begin();
|
||||
@ -141,7 +141,7 @@ class RejetPrelevement
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
if($this->type == 'bank-transfer'){
|
||||
$fac = new FactureFournisseur($this->db); //v20
|
||||
$fac = new FactureFournisseur($this->db);
|
||||
$pai = new PaiementFourn($this->db);
|
||||
}
|
||||
else{
|
||||
@ -161,7 +161,7 @@ class RejetPrelevement
|
||||
* PHP installs sends only the part integer negative
|
||||
*/
|
||||
|
||||
$pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * ($this->type == 'bank-transfer' ? 1: -1));//v20
|
||||
$pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * ($this->type == 'bank-transfer' ? 1: -1));
|
||||
$pai->datepaye = $date_rejet;
|
||||
$pai->paiementid = 3; // type of payment: withdrawal
|
||||
$pai->num_paiement = $fac->ref;
|
||||
@ -227,7 +227,7 @@ class RejetPrelevement
|
||||
$sql = "SELECT fk_user_demande";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql .= " WHERE pfd.fk_prelevement_bons = ".$this->bon_id;
|
||||
$sql .= " AND pfd.fk_facture".($this->type == 'bank-transfer' ? '_fourn=': '=').$fac->id;//v20
|
||||
$sql .= " AND pfd.fk_facture".($this->type == 'bank-transfer' ? '_fourn=': '=').$fac->id;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -304,7 +304,7 @@ class RejetPrelevement
|
||||
//Returns all invoices of a withdrawal
|
||||
$sql = "SELECT f.rowid as facid, pl.amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
||||
//$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)";//v20
|
||||
//$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)";
|
||||
if($this->type == 'bank-transfer') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON (pf.fk_facture_fourn = f.rowid)";
|
||||
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)";
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ if ($action == 'confirm_rejet')
|
||||
|
||||
$rej->create($user, $id, GETPOST('motif', 'alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer', 'int'));
|
||||
|
||||
header("Location: line.php?id=".$id.'&type='.$type);//v20
|
||||
header("Location: line.php?id=".$id.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -112,7 +112,7 @@ if ($action == 'confirm_rejet')
|
||||
}
|
||||
else
|
||||
{
|
||||
header("Location: line.php?id=".$id.'&type='.$type);//v20
|
||||
header("Location: line.php?id=".$id.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -134,7 +134,7 @@ llxHeader('', $title);
|
||||
$head = array();
|
||||
|
||||
$h = 0;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id.'&type='.$type;//v20
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id.'&type='.$type;
|
||||
$head[$h][1] = $title;
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
@ -203,12 +203,12 @@ if ($id)
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($lipre->socid);
|
||||
|
||||
$rej = new RejetPrelevement($db, $user,$type);//V20
|
||||
$rej = new RejetPrelevement($db, $user,$type);
|
||||
|
||||
print '<form name="confirm_rejet" method="post" action="line.php?id='.$id.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="confirm_rejet">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">'; //v20
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -259,7 +259,7 @@ if ($id)
|
||||
if ($lipre->statut == 2) {
|
||||
if ($user->rights->prelevement->bons->credit)
|
||||
{
|
||||
print '<a class="butActionDelete" href="line.php?action=rejet&type='.$type.'&id='.$lipre->id.'">'.$langs->trans("StandingOrderReject").'</a>';//v20
|
||||
print '<a class="butActionDelete" href="line.php?action=rejet&type='.$type.'&id='.$lipre->id.'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user