From 47045e074623776307f72a7d849afdf5a3f69e0f Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 28 May 2015 21:34:35 +0200 Subject: [PATCH 1/3] Accountancy: Review presentation --- htdocs/accountancy/bookkeeping/card.php | 26 +++++++++++++--------- htdocs/accountancy/customer/index.php | 8 +++---- htdocs/accountancy/journal/bankjournal.php | 4 ++-- htdocs/accountancy/supplier/index.php | 6 ++--- htdocs/projet/card.php | 2 +- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index a24ed34e052..e25ceb976ff 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * * 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 @@ -205,36 +205,42 @@ if ($action == 'create') { print '
'; print '' . "\n"; print '' . "\n"; - + + dol_fiche_head(); + print ''; - print ''; + print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print '
' . $langs->trans("NumMvts") . '' . $next_num_mvt . '
' . $langs->trans("Docdate") . ''; print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1); print '
' . $langs->trans("Codejournal") . '' . $html->selectarray('code_journal', $code_journal_array) . '
' . $langs->trans("Docref") . '
' . $langs->trans("Doctype") . '
'; - print '
'; - print ''; - + + dol_fiche_end(); + + print '
'; + print '     '; + print '
'; + print '
'; } else diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index df635155416..5a1ffc30bb7 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -1,9 +1,9 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -172,8 +172,8 @@ if ($resql) { while ( $i < $num ) { $row = $db->fetch_row($resql); - - print '' . length_accountg($row[0]) . ''; + $var=!$var; + print '' . length_accountg($row[0]) . ''; print '' . $row[1] . ''; print '' . price($row[2]) . ''; print '' . price($row[3]) . ''; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index fc3157c318a..75e54b2a590 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -555,9 +555,9 @@ else $h=0; $head[$h][0] = $_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal; $head[$h][1] = $langs->trans("Report"); - $head[$h][2] = 'report'; + $head[$h][2] = 'card'; - dol_fiche_head($head, $hselected); + dol_fiche_head($head, 'card', $langs->trans("BankJournal"), 0, 'payment'); print '
'; print ''; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 3bdf2f45a7c..2c2392bfa27 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -158,8 +158,8 @@ if ($resql) { while ( $i < $num ) { $row = $db->fetch_row($resql); - - print ''; + $var=!$var; + print ''; print ''; print ''; print ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 60384a29da0..b7ea6bd798b 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -698,7 +698,7 @@ else if ($action == 'edit' && $userWrite > 0) { print '
'; - print '     '; + print '     '; print ''; print '
'; } From fd988ab1f3db4454690552c929314ecc208d6da3 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 29 May 2015 06:43:40 +0200 Subject: [PATCH 2/3] Review card of supplier/customer ventilation --- htdocs/accountancy/customer/card.php | 17 +++++--- htdocs/accountancy/supplier/card.php | 64 +++++++++++++++++----------- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 487f4dc2719..d3d6ff8a945 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * * 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 @@ -44,7 +44,6 @@ if ($user->societe_id > 0) /* * Actions */ - if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { if (! GETPOST('cancel', 'alpha')) { @@ -63,6 +62,10 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { } } +/* + * View + */ + llxHeader("", "", "FicheVentilation"); if ($cancel == $langs->trans("Cancel")) { @@ -108,6 +111,8 @@ if (! empty($id)) { $linkback=''.$langs->trans("Back").''; print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'title_setup'); + dol_fiche_head(); + print '
' . length_accountg($row[0]) . '
' . length_accountg($row[0]) . '' . $row[1] . '' . price($row[2]) . '' . price($row[3]) . '
'; // Ref facture @@ -120,13 +125,13 @@ if (! empty($id)) { print ''; print ''; print ''; print '
' . $langs->trans("Line") . '' . nl2br($objp->description) . '
' . $langs->trans("Account") . ''; - print $objp->account_number . '-' . $objp->label; - print '
' . $langs->trans("NewAccount") . ''; print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1); print '
'; + + dol_fiche_end(); - print '
'; + print '
'; print ''; print '     '; print ''; @@ -144,4 +149,4 @@ if (! empty($id)) { } llxFooter(); -$db->close(); +$db->close(); \ No newline at end of file diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 51d09428c25..42837680428 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -1,11 +1,11 @@ * Copyright (C) 2005 Simon TOSSER - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -34,31 +34,32 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; // Langs -$langs->load("compta"); $langs->load("bills"); -$langs->load("other"); -$langs->load("main"); $langs->load("accountancy"); -$action = GETPOST('action'); -$id = GETPOST('id', 'int'); +$action = GETPOST('action', 'alpha'); $codeventil = GETPOST('codeventil'); +$id = GETPOST('id'); // Security check if ($user->societe_id > 0) accessforbidden(); -if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) -{ - $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; - $sql .= " SET fk_code_ventilation = " . $codeventil; - $sql .= " WHERE rowid = " . $id; - - dol_syslog('accountancy/journal/sellsjournal.php:: $sql=' . $sql); - - $resql = $db->query($sql); - if (! $resql) { - setEventMessage($db->lasterror(), 'errors'); +if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { + if (! GETPOST('cancel', 'alpha')) + { + $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; + $sql .= " SET fk_code_ventilation = " . $codeventil; + $sql .= " WHERE rowid = " . $id; + + dol_syslog('accountancy/supplier/card.php:: $sql=' . $sql); + $resql = $db->query($sql); + if (! $resql) { + setEventMessage($db->lasterror(), 'errors'); + } + } else { + header("Location: ./lines.php"); + exit(); } } @@ -78,7 +79,7 @@ $form = new Form($db); $facturefournisseur_static = new FactureFournisseur($db); $formventilation = new FormVentilation($db); -if ($_GET["id"]) { +if (! empty($id)) { $sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.rowid, l.fk_code_ventilation, "; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label"; $sql .= ", aa.account_number, aa.label"; @@ -87,11 +88,14 @@ if ($_GET["id"]) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn "; $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; + if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")"; } + dol_syslog("/accounting/supplier/card.php sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); + if ($result) { $num_lines = $db->num_rows($result); $i = 0; @@ -103,7 +107,10 @@ if ($_GET["id"]) { print ''; print ''; - print_fiche_titre($langs->trans("SuppliersVentilation")); + $linkback=''.$langs->trans("Back").''; + print_fiche_titre($langs->trans('SuppliersVentilation'),$linkback,'title_setup'); + + dol_fiche_head(); print ''; @@ -119,19 +126,24 @@ if ($_GET["id"]) { print ''; print ''; print ''; - print ''; - print '
' . $langs->trans("ProductLabel") . '' . dol_trunc($objp->product_label, 24) . '
' . $langs->trans("Account") . ''; - print $objp->account_number . '-' . $objp->label; - print '
' . $langs->trans("NewAccount") . ''; print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1); print '
 
'; + + dol_fiche_end(); + + print '
'; + print ''; + print '     '; + print ''; + print '
'; + print ''; } else { - print "Error 1"; + print "Error"; } } else { - print "Error 2"; + print "Error"; } } else { print "Error ID incorrect"; From 27c0b84a136633f31b1a485a851f57ca462ba36d Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 29 May 2015 06:54:16 +0200 Subject: [PATCH 3/3] Typo on search --- htdocs/accountancy/customer/lines.php | 2 +- htdocs/accountancy/supplier/lines.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 3a368f8d3ad..7941a7df4a8 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -43,7 +43,7 @@ $search_facture = GETPOST('search_facture','alpha'); $search_label = GETPOST('search_label','alpha'); $search_desc = GETPOST('search_desc','alpha'); $search_amount = GETPOST('search_amount','alpha'); -$search_acount = GETPOST('search_account','alpha'); +$search_account = GETPOST('search_account','alpha'); // Security check if ($user->societe_id > 0) diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 9cf77779bf4..0edc9e1142f 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -44,7 +44,7 @@ $search_facture = GETPOST('search_facture','alpha'); $search_label = GETPOST('search_label','alpha'); $search_desc = GETPOST('search_desc','alpha'); $search_amount = GETPOST('search_amount','alpha'); -$search_acount = GETPOST('search_account','alpha'); +$search_account = GETPOST('search_account','alpha'); // Security check if ($user->societe_id > 0)