diff --git a/htdocs/accountancy/admin/journal.php b/htdocs/accountancy/admin/journal.php index 0487538a906..2a868969c3d 100644 --- a/htdocs/accountancy/admin/journal.php +++ b/htdocs/accountancy/admin/journal.php @@ -1,26 +1,26 @@ - * Copyright (C) 2013-2015 Alexandre Spangaro -* Copyright (C) 2014 Florian Henry -* Copyright (C) 2014 Marcos García -* Copyright (C) 2014 Juanjo Menent -* Copyright (C) 2015 Jean-François Ferry -* Copyright (C) 2016 Laurent Destailleur -* -* 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 -* the Free Software Foundation; either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -*/ + * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2014 Marcos García + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Laurent Destailleur + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ /** * \file htdocs/accountancy/admin/journal.php @@ -121,7 +121,7 @@ dol_fiche_head($head, 'journal', $langs->trans("Configuration"), 0, 'cron'); print ''; print ''; -print ''; +print ''; print "\n"; foreach ( $list as $key ) { @@ -145,11 +145,11 @@ print '
'; print '
' . $langs->trans('Journaux') . '' . $langs->trans('Journaux') . '
'; print ''; -print ''; +print ''; print "\n"; // Bank account -$sql = "SELECT rowid, label, number, accountancy_journal"; +$sql = "SELECT rowid, ref, label, number, account_number, accountancy_journal"; $sql .= " FROM " . MAIN_DB_PREFIX . "bank_account"; $sql .= " WHERE entity = " . $conf->entity; $sql .= " AND clos = 0"; @@ -162,30 +162,33 @@ if ($resql) { if ($numr > 0) - $bankaccountstatic=new Account($db); + $bankaccountstatic = new Account($db); while ( $i < $numr ) { $objp = $db->fetch_object($resql); - + $var = ! $var; - + + $bankaccountstatic->rowid = $objp->rowid; $bankaccountstatic->id = $objp->rowid; + $bankaccountstatic->ref = $objp->ref; $bankaccountstatic->label = $objp->label; $bankaccountstatic->number = $objp->number; + $bankaccountstatic->account_number = $objp->account_number; $bankaccountstatic->accountancy_journal = $objp->accountancy_journal; - + print ''; - + // Param print ''; - + // Value print ''; - + $i ++; } $db->free($resql); diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index e59144abc2e..eaff46ddc2c 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -70,7 +70,8 @@ class ProductFournisseur extends Product var $fourn_unitcharges; // old version used a buggy system to calculate margin of a charge field on supplier price. Now margin is on pmp, best supplier price or cost price. var $fk_supplier_price_expression; - + var $supplier_reputation; // reputation of supplier + var $reputations=array(); // list of available supplier reputations /** * Constructor @@ -79,7 +80,11 @@ class ProductFournisseur extends Product */ function __construct($db) { + global $langs; + $this->db = $db; + $langs->load("suppliers"); + $this->reputations= array('-1'=>'', 'FAVORITE'=>$langs->trans('Favorite'),'NOTTHGOOD'=>$langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER'=>$langs->trans('DoNotOrderThisProductToThisSupplier')); } diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 27b3780e2a7..69a9344832b 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -77,8 +77,6 @@ if ($id > 0 || $ref) $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); -$reputations=array('-1'=>'', 'FAVORITE'=>$langs->trans('Favorite'),'NOTTHGOOD'=>$langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER'=>$langs->trans('DoNotOrderThisProductToThisSupplier')); - if (! $sortfield) $sortfield="s.nom"; if (! $sortorder) $sortorder="ASC"; @@ -527,7 +525,7 @@ if ($id > 0 || $ref) // Reputation print ''; // Option to define a transport cost on supplier price @@ -673,8 +671,8 @@ if ($id > 0 || $ref) // Reputation print '';
' . $langs->trans('JournalFinancial') . ' ('.$langs->trans('Opened').')' . $langs->trans('JournalFinancial') . ' ('.$langs->trans('Opened').')
'; print ''; print '
'.$langs->trans("SupplierReputation").''; - echo $form->selectarray('supplier_reputation', $reputations, $supplier_reputation?$supplier_reputation:$object->supplier_reputation); + echo $form->selectarray('supplier_reputation', $object->reputations, $supplier_reputation?$supplier_reputation:$object->supplier_reputation); print '
'; - if (!empty($productfourn->supplier_reputation) && !empty($reputations[$productfourn->supplier_reputation])) { - print $reputations[$productfourn->supplier_reputation]; + if (!empty($productfourn->supplier_reputation) && !empty($object->reputations[$productfourn->supplier_reputation])) { + print $object->reputations[$productfourn->supplier_reputation]; } print'