Fix: We try to create bank link record twice
Fix: Bad url
This commit is contained in:
parent
81f8de8266
commit
6961a82dbf
@ -376,32 +376,32 @@ class Paiement
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$linkaddedforthirdparty=array();
|
$linkaddedforthirdparty=array();
|
||||||
foreach ($this->amounts as $key => $value)
|
foreach ($this->amounts as $key => $value) // We should have always same third party but we loop in case of.
|
||||||
{
|
{
|
||||||
if ($mode == 'payment')
|
if ($mode == 'payment')
|
||||||
{
|
{
|
||||||
$fac = new Facture($this->db);
|
$fac = new Facture($this->db);
|
||||||
$fac->fetch($key);
|
$fac->fetch($key);
|
||||||
$fac->fetch_thirdparty(); // This should be always same third party but we loop in case of.
|
$fac->fetch_thirdparty();
|
||||||
if (! in_array($fac->client->id,$linkaddedforthirdparty)) // Not yet done for this thirdparty
|
if (! in_array($fac->thirdparty->id,$linkaddedforthirdparty)) // Not yet done for this thirdparty
|
||||||
{
|
{
|
||||||
$result=$acc->add_url_line($bank_line_id, $fac->client->id,
|
$result=$acc->add_url_line($bank_line_id, $fac->thirdparty->id,
|
||||||
DOL_URL_ROOT.'/compta/fiche.php?socid=', $fac->client->nom, 'company');
|
DOL_URL_ROOT.'/compta/fiche.php?socid=', $fac->thirdparty->nom, 'company');
|
||||||
if ($result <= 0) dol_print_error($this->db);
|
if ($result <= 0) dol_print_error($this->db);
|
||||||
$linkaddedforthirdparty[$fac->client->id]=$fac->client->id; // Mark as done for this thirdparty
|
$linkaddedforthirdparty[$fac->thirdparty->id]=$fac->thirdparty->id; // Mark as done for this thirdparty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($mode == 'payment_supplier')
|
if ($mode == 'payment_supplier')
|
||||||
{
|
{
|
||||||
$fac = new FactureFournisseur($this->db);
|
$fac = new FactureFournisseur($this->db);
|
||||||
$fac->fetch($key);
|
$fac->fetch($key);
|
||||||
$fac->fetch_fournisseur(); // This should be always same third party but we loop in case of.
|
$fac->fetch_thirdparty();
|
||||||
if (! in_array($fac->client->id,$linkaddedforthirdparty)) // Not yet done for this thirdparty
|
if (! in_array($fac->thirdparty->id,$linkaddedforthirdparty)) // Not yet done for this thirdparty
|
||||||
{
|
{
|
||||||
$result=$acc->add_url_line($bank_line_id, $fac->fournisseur->id,
|
$result=$acc->add_url_line($bank_line_id, $fac->thirdparty->id,
|
||||||
DOL_URL_ROOT.'/fourn/fiche.php?socid=', $fac->fournisseur->nom, 'company');
|
DOL_URL_ROOT.'/fourn/fiche.php?socid=', $fac->thirdparty->nom, 'company');
|
||||||
if ($result <= 0) dol_print_error($this->db);
|
if ($result <= 0) dol_print_error($this->db);
|
||||||
$linkaddedforthirdparty[$fac->fournisseur->id]=$fac->fournisseur->id; // Mark as done for this thirdparty
|
$linkaddedforthirdparty[$fac->thirdparty->id]=$fac->thirdparty->id; // Mark as done for this thirdparty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
@ -22,8 +22,8 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/compta/paiement/fiche.php
|
* \file htdocs/compta/paiement/fiche.php
|
||||||
* \ingroup facture
|
* \ingroup facture
|
||||||
* \brief Onglet paiement d'un paiement client
|
* \brief Page of a customer payment
|
||||||
* \remarks Fichier presque identique a fournisseur/paiement/fiche.php
|
* \remarks Nearly same file than fournisseur/paiement/fiche.php
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -114,6 +114,8 @@ if ($_REQUEST['action'] == 'confirm_valide' && $_REQUEST['confirm'] == 'yes' &&
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
$thirdpartystatic=new Societe($db);
|
||||||
|
|
||||||
$paiement = new Paiement($db);
|
$paiement = new Paiement($db);
|
||||||
$result=$paiement->fetch($_GET['id']);
|
$result=$paiement->fetch($_GET['id']);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
@ -254,7 +256,11 @@ if ($resql)
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.'</a></td>';
|
print '<td>';
|
||||||
|
$thirdpartystatic->id=$objp->socid;
|
||||||
|
$thirdpartystatic->nom=$objp->nom;
|
||||||
|
print $thirdpartystatic->getNomUrl(1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Expected to pay
|
// Expected to pay
|
||||||
print '<td align="right">'.price($objp->total_ttc).'</td>';
|
print '<td align="right">'.price($objp->total_ttc).'</td>';
|
||||||
|
|||||||
@ -381,19 +381,9 @@ class FactureFournisseur extends Facture
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Load supplier
|
* Delete invoice from database
|
||||||
*/
|
* @param rowid Id of invoice to delete
|
||||||
function fetch_fournisseur()
|
* @return int <0 if KO, >0 if OK
|
||||||
{
|
|
||||||
$fournisseur = new Fournisseur($this->db);
|
|
||||||
$fournisseur->fetch($this->socid);
|
|
||||||
$this->fournisseur = $fournisseur;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Delete invoice in database
|
|
||||||
* \param rowid Id of invoice to delete
|
|
||||||
* \return int <0 if KO, >0 if OK
|
|
||||||
*/
|
*/
|
||||||
function delete($rowid)
|
function delete($rowid)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -128,7 +128,7 @@ if ($facid > 0)
|
|||||||
$facture = new FactureFournisseur($db);
|
$facture = new FactureFournisseur($db);
|
||||||
if ($facture->fetch($facid))
|
if ($facture->fetch($facid))
|
||||||
{
|
{
|
||||||
$facture->fetch_fournisseur();
|
$facture->fetch_thirdparty();
|
||||||
|
|
||||||
$upload_dir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($facture->id,2).$facture->id;
|
$upload_dir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($facture->id,2).$facture->id;
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ if ($facid > 0)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Societe
|
// Societe
|
||||||
print '<tr><td>'.$langs->trans('Supplier').'</td><td colspan="3">'.$facture->fournisseur->getNomUrl(1).'</td></tr>';
|
print '<tr><td>'.$langs->trans('Supplier').'</td><td colspan="3">'.$facture->thirdparty->getNomUrl(1).'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('NbOfAttachedFiles').'</td><td colspan="3">'.sizeof($filearray).'</td></tr>';
|
print '<tr><td>'.$langs->trans('NbOfAttachedFiles').'</td><td colspan="3">'.sizeof($filearray).'</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -92,7 +92,7 @@ llxHeader();
|
|||||||
|
|
||||||
if ($_GET["facid"])
|
if ($_GET["facid"])
|
||||||
{
|
{
|
||||||
$fac->fetch_fournisseur();
|
$fac->fetch_thirdparty();
|
||||||
|
|
||||||
$head = facturefourn_prepare_head($fac);
|
$head = facturefourn_prepare_head($fac);
|
||||||
$titre=$langs->trans('SupplierInvoice');
|
$titre=$langs->trans('SupplierInvoice');
|
||||||
@ -112,7 +112,7 @@ if ($_GET["facid"])
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
print '<tr><td>'.$langs->trans('Supplier').'</td><td colspan="3">'.$fac->fournisseur->getNomUrl(1).'</td></tr>';
|
print '<tr><td>'.$langs->trans('Supplier').'</td><td colspan="3">'.$fac->thirdparty->getNomUrl(1).'</td></tr>';
|
||||||
|
|
||||||
// Note publique
|
// Note publique
|
||||||
print '<tr><td valign="top">'.$langs->trans("NotePublic").' :</td>';
|
print '<tr><td valign="top">'.$langs->trans("NotePublic").' :</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user