Merge pull request #17535 from frederic34/uniformizecode
uniformize supplier cards
This commit is contained in:
commit
52d4e7e2a8
@ -315,23 +315,17 @@ if ($object->id > 0) {
|
||||
|
||||
$facidavoir = $object->getListIdAvoirFromInvoice();
|
||||
if (count($facidavoir) > 0) {
|
||||
print ' ('.$langs->transnoentities("InvoiceHasAvoir");
|
||||
$i = 0;
|
||||
foreach ($facidavoir as $id) {
|
||||
if ($i == 0) {
|
||||
print ' ';
|
||||
} else {
|
||||
print ',';
|
||||
}
|
||||
$invoicecredits = array();
|
||||
foreach ($facidavoir as $facid) {
|
||||
if ($type == 'bank-transfer') {
|
||||
$facavoir = new FactureFournisseur($db);
|
||||
} else {
|
||||
$facavoir = new Facture($db);
|
||||
}
|
||||
$facavoir->fetch($id);
|
||||
print $facavoir->getNomUrl(1);
|
||||
$facavoir->fetch($facid);
|
||||
$invoicecredits[] = $facavoir->getNomUrl(1);
|
||||
}
|
||||
print ')';
|
||||
print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')';
|
||||
}
|
||||
/*
|
||||
if ($facidnext > 0)
|
||||
|
||||
@ -2695,19 +2695,13 @@ if ($action == 'create') {
|
||||
|
||||
$facidavoir = $object->getListIdAvoirFromInvoice();
|
||||
if (count($facidavoir) > 0) {
|
||||
print ' ('.$langs->transnoentities("InvoiceHasAvoir");
|
||||
$i = 0;
|
||||
$invoicecredits = array();
|
||||
foreach ($facidavoir as $id) {
|
||||
if ($i == 0) {
|
||||
print ' ';
|
||||
} else {
|
||||
print ',';
|
||||
}
|
||||
$facavoir = new FactureFournisseur($db);
|
||||
$facavoir->fetch($id);
|
||||
print $facavoir->getNomUrl(1);
|
||||
$invoicecredits[] = $facavoir->getNomUrl(1);
|
||||
}
|
||||
print ')';
|
||||
print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')';
|
||||
}
|
||||
if (isset($facidnext) && $facidnext > 0) {
|
||||
$facthatreplace = new FactureFournisseur($db);
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -180,7 +181,9 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td colspan="4">';
|
||||
print '<span class="badgeneutral">';
|
||||
print $object->getLibType();
|
||||
print '</span>';
|
||||
if ($object->type == FactureFournisseur::TYPE_REPLACEMENT) {
|
||||
$facreplaced = new FactureFournisseur($db);
|
||||
$facreplaced->fetch($object->fk_facture_source);
|
||||
@ -194,19 +197,13 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
$facidavoir = $object->getListIdAvoirFromInvoice();
|
||||
if (count($facidavoir) > 0) {
|
||||
print ' ('.$langs->transnoentities("InvoiceHasAvoir");
|
||||
$i = 0;
|
||||
foreach ($facidavoir as $fid) {
|
||||
if ($i == 0) {
|
||||
print ' ';
|
||||
} else {
|
||||
print ',';
|
||||
}
|
||||
$invoicecredits = array();
|
||||
foreach ($facidavoir as $facid) {
|
||||
$facavoir = new FactureFournisseur($db);
|
||||
$facavoir->fetch($fid);
|
||||
print $facavoir->getNomUrl(1);
|
||||
$facavoir->fetch($facid);
|
||||
$invoicecredits[] = $facavoir->getNomUrl(1);
|
||||
}
|
||||
print ')';
|
||||
print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')';
|
||||
}
|
||||
if ($facidnext > 0) {
|
||||
$facthatreplace = new FactureFournisseur($db);
|
||||
|
||||
@ -5,7 +5,8 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -170,7 +171,9 @@ if ($object->id > 0) {
|
||||
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td>';
|
||||
print '<span class="badgeneutral">';
|
||||
print $object->getLibType();
|
||||
print '</span>';
|
||||
if ($object->type == FactureFournisseur::TYPE_REPLACEMENT) {
|
||||
$facreplaced = new FactureFournisseur($db);
|
||||
$facreplaced->fetch($object->fk_facture_source);
|
||||
@ -184,24 +187,17 @@ if ($object->id > 0) {
|
||||
|
||||
$facidavoir = $object->getListIdAvoirFromInvoice();
|
||||
if (count($facidavoir) > 0) {
|
||||
print ' ('.$langs->transnoentities("InvoiceHasAvoir");
|
||||
$i = 0;
|
||||
foreach ($facidavoir as $id) {
|
||||
if ($i == 0) {
|
||||
print ' ';
|
||||
} else {
|
||||
print ',';
|
||||
}
|
||||
$invoicecredits = array();
|
||||
foreach ($facidavoir as $facid) {
|
||||
$facavoir = new FactureFournisseur($db);
|
||||
$facavoir->fetch($id);
|
||||
print $facavoir->getNomUrl(1);
|
||||
$facavoir->fetch($facid);
|
||||
$invoicecredits[] = $facavoir->getNomUrl(1);
|
||||
}
|
||||
print ')';
|
||||
print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')';
|
||||
}
|
||||
/*
|
||||
if ($facidnext > 0)
|
||||
{
|
||||
$facthatreplace=new FactureFournisseur($db);
|
||||
if ($facidnext > 0) {
|
||||
$facthatreplace = new FactureFournisseur($db);
|
||||
$facthatreplace->fetch($facidnext);
|
||||
print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')';
|
||||
}
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -144,7 +145,9 @@ if ($object->id > 0) {
|
||||
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td>';
|
||||
print '<span class="badgeneutral">';
|
||||
print $object->getLibType();
|
||||
print '</span>';
|
||||
if ($object->type == FactureFournisseur::TYPE_REPLACEMENT) {
|
||||
$facreplaced = new FactureFournisseur($db);
|
||||
$facreplaced->fetch($object->fk_facture_source);
|
||||
@ -158,19 +161,13 @@ if ($object->id > 0) {
|
||||
|
||||
$facidavoir = $object->getListIdAvoirFromInvoice();
|
||||
if (count($facidavoir) > 0) {
|
||||
print ' ('.$langs->transnoentities("InvoiceHasAvoir");
|
||||
$i = 0;
|
||||
foreach ($facidavoir as $fid) {
|
||||
if ($i == 0) {
|
||||
print ' ';
|
||||
} else {
|
||||
print ',';
|
||||
}
|
||||
$invoicecredits = array();
|
||||
foreach ($facidavoir as $facid) {
|
||||
$facavoir = new FactureFournisseur($db);
|
||||
$facavoir->fetch($fid);
|
||||
print $facavoir->getNomUrl(1);
|
||||
$facavoir->fetch($facid);
|
||||
$invoicecredits[] = $facavoir->getNomUrl(1);
|
||||
}
|
||||
print ')';
|
||||
print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')';
|
||||
}
|
||||
if ($facidnext > 0) {
|
||||
$facthatreplace = new FactureFournisseur($db);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user