Skip to content

Commit

Permalink
clean and update code
Browse files Browse the repository at this point in the history
  • Loading branch information
grandoc committed Jul 23, 2018
1 parent 45c7a47 commit 1dd39a4
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -21,7 +21,7 @@
*/

/**
* \file accounting/bookkeeping/thirdparty_lettrage.php
* \file accountancy/bookkeeping/thirdparty_lettrage_supplier.php
* \ingroup Advanced accountancy
* \brief Tab to setup lettering
*/
Expand Down Expand Up @@ -86,8 +86,9 @@
$object = new Societe($db);
$object->id = $socid;
$result = $object->fetch($socid);
if ($result<0) {
setEventMessage($object->error,'errors');
if ($result<0)
{
setEventMessages($object->error, $object->errors, 'errors');
}

$form = new Form($db);
Expand Down Expand Up @@ -133,7 +134,7 @@


/*
* Affichage onglets
* Display tabs
*/
$head = societe_prepare_head($object);

Expand Down Expand Up @@ -272,7 +273,6 @@
print '</td>';
print '</tr>';

$var = false;
$solde = 0;
$tmp = '';
while ($obj = $db->fetch_object($resql)) {
Expand All @@ -281,11 +281,10 @@
$tmp = $obj->lettering_code;

if ($tmp != $obj->lettering_code || empty($obj->lettering_code))
$var = ! $var;

$solde += ($obj->credit - $obj->debit);

print "<tr $bc[$var]>";
print '<tr class="oddeven">';

if (empty($obj->lettering_code)) {
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
Expand Down Expand Up @@ -320,7 +319,7 @@
print '<td colspan="5"></td>';
print "</tr>\n";

print "<tr $bc[$var]>";
print '<tr class="oddeven">';
print '<td colspan="9">Solde Comptable</td>' . "\n";
print '<td><strong>' . price($credit - $debit) . '</strong></td>';
print '<td colspan="5"></td>';
Expand Down

0 comments on commit 1dd39a4

Please sign in to comment.