From 587a193a4dd3bfa338d0dfd1df53bacdac8de8aa Mon Sep 17 00:00:00 2001 From: AlainRnet Date: Thu, 3 Sep 2015 16:03:04 +0200 Subject: [PATCH 01/31] Update lines.php - pagination - prise en compte des filtres lors d'un changement de page --- htdocs/accountancy/customer/lines.php | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index ba7d35cee70..478a9f2d539 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -184,6 +184,14 @@ if (strlen(trim($search_vat))) if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")"; } +// Count total nb of records with no order and no limits +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $resql = $db->query($sql); + if ($resql) $nbtotalofrecords = $db->num_rows($resql); + else dol_print_error($db); +} $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1,$offset); @@ -192,9 +200,17 @@ $result = $db->query($sql); if ($result) { $num_lines = $db->num_rows($result); $i = 0; - - print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); - + + $param=""; + if ($search_login) $param.="&search_login=".$search_login; + if ($search_facture) $param.="&search_facture=".$search_facture; + if ($search_ref) $param.="&search_ref=".$search_ref; + if ($search_label) $param.="&search_label=".$search_label; + if ($search_desc) $param.="&search_desc=".$search_desc; + if ($search_account) $param.="&search_account=".$search_account; + if ($filter) $param.="&filter=".$filter; + + print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines,$nbtotalofrecords); print '' . $langs->trans("DescVentilDoneCustomer") . ''; print '
'; @@ -277,5 +293,10 @@ if ($result) { print "
"; + if ($num_lines > $conf->liste_limit) + { + print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num_lines,$nbtotalofrecords,''); + } + llxFooter(); $db->close(); From f33cd85c0478d113da52c0af789f7c72dd4b955a Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 5 Sep 2015 06:15:27 +0200 Subject: [PATCH 02/31] New: refund VAT --- htdocs/compta/tva/card.php | 59 ++++++++++++++++++++++--- htdocs/compta/tva/class/tva.class.php | 4 +- htdocs/core/menus/init_menu_auguria.sql | 4 +- htdocs/core/menus/standard/eldy.lib.php | 4 +- htdocs/langs/en_US/compta.lang | 2 + 5 files changed, 60 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index e5acabd4e19..33c795ed10b 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -33,7 +33,9 @@ $langs->load("banks"); $langs->load("bills"); $id=GETPOST("id",'int'); -$action=GETPOST('action'); +$action=GETPOST("action","alpha"); +$refund=GETPOST("refund","int"); +if (empty($refund)) $refund=0; // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; @@ -46,7 +48,6 @@ $tva = new Tva($db); $hookmanager->initHooks(array('taxvatcard','globalcard')); - /** * Actions */ @@ -69,7 +70,12 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) $tva->num_payment=GETPOST("num_payment"); $tva->datev=$datev; $tva->datep=$datep; - $tva->amount=GETPOST("amount"); + + $amount = GETPOST("amount"); + if ($refund == 1) { + $amount= -$amount; + } + $tva->amount= $amount; $tva->label=GETPOST("label"); $tva->note=GETPOST("note"); @@ -182,12 +188,46 @@ if ($id) // Formulaire saisie tva if ($action == 'create') { - print "
\n"; + print_fiche_titre($langs->trans("VAT") . ' - ' . $langs->trans("New")); + + if (! empty($conf->use_javascript_ajax)) + { + print "\n".''."\n"; + } + + print ''; print ''; print ''; - print_fiche_titre($langs->trans("NewVATPayment")); - + print '
'; + print '
'; + print $langs->trans("Type").':   '; + print '
'; + print ''; + print '   '; + print ''; + print '
'; + print "
\n"; + dol_fiche_head(); print ''; @@ -202,7 +242,12 @@ if ($action == 'create') print ''; // Label - print ''; + if ($refund == 1) { + $label = $langs->trans("VATRefund"); + } else { + $label = $langs->trans("VATPayment"); + } + print ''; // Amount print ''; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index a938087c689..74f77a9f8ea 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur - * Copyright (C) 2011-2014 Alexandre Spangaro + * Copyright (C) 2011-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 @@ -508,7 +508,7 @@ class Tva extends CommonObject $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); return -3; } - if ($this->amount < 0 || $this->amount == '') + if ($this->amount == '') { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); return -4; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index b75bc8b21f1..4dd1fd33d0f 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -200,8 +200,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/charges.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'accountancy', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'NewPayment', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'Payments', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); -- Ventilation (accounting) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 33e9a745665..d47d3bdcc7c 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -866,8 +866,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) { $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); - if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer); - if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("Payments"),2,$user->rights->tax->charges->lire); + if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("New"),2,$user->rights->tax->charges->creer); + if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire); if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); global $mysoc; diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 4d6703feeac..e1c1f6eca68 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -91,6 +91,8 @@ LT1PaymentES=RE Payment LT1PaymentsES=RE Payments VATPayment=VAT Payment VATPayments=VAT Payments +VATRefund=VAT Refund +Refund=Refund SocialContributionsPayments=Social/fiscal taxes payments ShowVatPayment=Show VAT payment TotalToPay=Total to pay From ef7df3f2610d3927accf2a1e7eece30a54f9ed85 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 5 Sep 2015 08:03:06 +0200 Subject: [PATCH 03/31] New: Accountancy rename llx_accountingaccount in llx_accounting_account Fix: language key --- htdocs/accountancy/admin/account.php | 2 +- htdocs/accountancy/admin/productaccount.php | 4 ++-- .../class/accountingaccount.class.php | 18 +++++++++--------- .../class/html.formventilation.class.php | 10 +++++----- htdocs/accountancy/customer/card.php | 2 +- htdocs/accountancy/customer/index.php | 6 +++--- htdocs/accountancy/customer/lines.php | 2 +- htdocs/accountancy/customer/list.php | 16 +++++++--------- .../accountancy/journal/purchasesjournal.php | 2 +- htdocs/accountancy/journal/sellsjournal.php | 2 +- htdocs/accountancy/supplier/card.php | 2 +- htdocs/accountancy/supplier/index.php | 6 +++--- htdocs/accountancy/supplier/lines.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 2 ++ htdocs/langs/en_US/accountancy.lang | 3 ++- htdocs/langs/en_US/compta.lang | 4 ++-- 17 files changed, 43 insertions(+), 42 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 0bf37a7753e..a56701dada2 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -106,7 +106,7 @@ llxHeader('', $langs->trans("ListAccounts")); $pcgver = $conf->global->CHARTOFACCOUNTS; $sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active "; -$sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa, " . MAIN_DB_PREFIX . "accounting_system as asy"; +$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa, " . MAIN_DB_PREFIX . "accounting_system as asy"; $sql .= " WHERE aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $pcgver; diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 9898064f6d5..d79d14e74d1 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -212,11 +212,11 @@ $pcgver = $conf->global->CHARTOFACCOUNTS; IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') { $sql .= " p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL"; $sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN - (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; + (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; } else { $sql .= " p.accountancy_code_sell ='' OR p.accountancy_code_sell IS NULL "; $sql .= " OR (p.accountancy_code_sell IS NOT NULL AND p.accountancy_code_sell != '' AND p.accountancy_code_sell NOT IN - (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; + (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; } $sql .= ")"; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index cb7787610f8..856306c3304 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -72,7 +72,7 @@ class AccountingAccount extends CommonObject if ($rowid || $account_number) { $sql = "SELECT rowid, datec, tms, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, fk_user_author, fk_user_modif, active"; - $sql.= " FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE"; + $sql.= " FROM " . MAIN_DB_PREFIX . "accounting_account WHERE"; if ($rowid) { $sql .= " rowid = '" . $rowid . "'"; } elseif ($account_number) { @@ -114,7 +114,7 @@ class AccountingAccount extends CommonObject } /** - * Insert line in accountingaccount + * Insert line in accounting_account * * @param User $user Use making action * @param int $notrigger Disable triggers @@ -148,7 +148,7 @@ class AccountingAccount extends CommonObject // Put here code to add control on parameters values // Insert request - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accountingaccount("; + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_account("; $sql .= "datec"; $sql .= ", entity"; @@ -186,7 +186,7 @@ class AccountingAccount extends CommonObject } if (! $error) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accountingaccount"); + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_account"); // if (! $notrigger) { // Uncomment this and change MYOBJECT to your own tag if you @@ -225,7 +225,7 @@ class AccountingAccount extends CommonObject { $this->db->begin(); - $sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount "; + $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; $sql .= " SET fk_pcg_version = " . ($this->fk_pcg_version ? "'" . $this->db->escape($this->fk_pcg_version) . "'" : "null"); $sql .= " , pcg_type = " . ($this->pcg_type ? "'" . $this->db->escape($this->pcg_type) . "'" : "null"); $sql .= " , pcg_subtype = " . ($this->pcg_subtype ? "'" . $this->db->escape($this->pcg_subtype) . "'" : "null"); @@ -313,7 +313,7 @@ class AccountingAccount extends CommonObject // } if (! $error) { - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "accountingaccount"; + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_account"; $sql .= " WHERE rowid=" . $this->id; dol_syslog(get_class($this) . "::delete sql=" . $sql); @@ -375,7 +375,7 @@ class AccountingAccount extends CommonObject function info($id) { $sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms'; - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'accountingaccount as a'; + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a'; $sql .= ' WHERE a.rowid = ' . $id; dol_syslog(get_class($this) . '::info sql=' . $sql); @@ -417,7 +417,7 @@ class AccountingAccount extends CommonObject if ($result > 0) { $this->db->begin(); - $sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount "; + $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; $sql .= "SET active = '0'"; $sql .= " WHERE rowid = ".$this->db->escape($id); @@ -447,7 +447,7 @@ class AccountingAccount extends CommonObject { $this->db->begin(); - $sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount "; + $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; $sql .= "SET active = '1'"; $sql .= " WHERE rowid = ".$this->db->escape($id); diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php index b86c0fdd2e2..de94d645c92 100644 --- a/htdocs/accountancy/class/html.formventilation.class.php +++ b/htdocs/accountancy/class/html.formventilation.class.php @@ -94,7 +94,7 @@ class FormVentilation extends Form * @param array $event Event options * @param int $select_in $selectid value is a aa.rowid (0 default) or aa.account_number (1) * @param int $select_out set value returned by select 0=rowid (default), 1=account_number - * @param int $aabase set accountingaccount base class to display empty=all or from 1 to 8 will display only account beginning by + * @param int $aabase set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by * * @return string String with HTML select */ @@ -105,7 +105,7 @@ class FormVentilation extends Form $out = ''; $sql = "SELECT DISTINCT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version"; - $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " AND aa.active = 1"; @@ -132,7 +132,7 @@ class FormVentilation extends Form if ($select_in == 1 ) $select_value_in = $obj->account_number; if ($select_out == 0 ) $select_value_out = $obj->rowid; if ($select_out == 1 ) $select_value_out = $obj->account_number; - // Remember guy's we store in database llx_facturedet the rowid of accountingaccount and not the account_number + // Remember guy's we store in database llx_facturedet the rowid of accounting_account and not the account_number // Because same account_number can be share between different accounting_system and do have the same meaning if (($selectid != '') && $selectid == $select_value_in) { // $out .= ''; @@ -171,7 +171,7 @@ class FormVentilation extends Form $out = ''; $sql = "SELECT DISTINCT pcg_type "; - $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " ORDER BY pcg_type"; @@ -227,7 +227,7 @@ class FormVentilation extends Form $out = ''; $sql = "SELECT DISTINCT pcg_subtype "; - $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " ORDER BY pcg_subtype"; diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 03f6b817101..74083cbb215 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -85,7 +85,7 @@ if (! empty($id)) { $sql .= " l.fk_code_ventilation, aa.account_number, aa.label"; $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as l"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid"; + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture"; $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 24c0e81587f..e4c6104fd1b 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -65,12 +65,12 @@ if ($action == 'validatehistory') { if ($db->type == 'pgsql') { $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd"; $sql1 .= " SET fd.fk_code_ventilation = accnt.rowid"; - $sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accountingaccount as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; + $sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; $sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS; $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number"; $sql1 .= " AND fd.fk_code_ventilation = 0"; } else { - $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accountingaccount as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; $sql1 .= " SET fd.fk_code_ventilation = accnt.rowid"; $sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS; $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number"; @@ -154,7 +154,7 @@ $sql .= " ROUND(SUM(IF(MONTH(f.datef)=12,fd.total_ht,0)),2) AS 'Decembre',"; $sql .= " ROUND(SUM(fd.total_ht),2) as 'Total'"; $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; -$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation"; +$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; $sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'"; $sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'"; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index ba7d35cee70..5108a6c1f67 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -154,7 +154,7 @@ print ''."\n"; + $("#radiopayment").click(function() { + $("#label").val($(this).data("label")); + + }); + $("#radiorefund").click(function() { + $("#label").val($(this).data("label")); + + }); + });'; + print ''."\n"; } print ''; @@ -215,13 +215,13 @@ if ($action == 'create') print $langs->trans("Type").':   '; print ''; print ''; print '   '; print ''; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 74f77a9f8ea..68aeeebc2c8 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -577,8 +577,12 @@ class Tva extends CommonObject $result=$acc->fetch($this->accountid); if ($result <= 0) dol_print_error($this->db); - $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), '', '', $user); - + if ($this->amount > 0) { + $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), '', '', $user); + } else { + $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, abs($this->amount), '', '', $user); + } + // Update fk_bank into llx_tva. So we know vat line used to generate bank transaction if ($bank_line_id > 0) { From 702edac00a493cb017b176c0d5685d816e3e7547 Mon Sep 17 00:00:00 2001 From: Guido Schratzer Date: Wed, 9 Sep 2015 22:16:03 +0200 Subject: [PATCH 30/31] FIX: issue #3425 missing Profid keys in companies.lang for Austria issue #3425 --- htdocs/langs/en_US/companies.lang | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 764ca969350..2a6391ad934 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -122,6 +122,12 @@ ProfId3AR=- ProfId4AR=- ProfId5AR=- ProfId6AR=- +ProfId1AT=Prof Id 1 (USt.-IdNr) +ProfId2AT=Prof Id 2 (USt.-Nr) +ProfId3AT=Prof Id 3 (Handelsregister-Nr.) +ProfId4AT=- +ProfId5AT=- +ProfId6AT=- ProfId1AU=Prof Id 1 (ABN) ProfId2AU=- ProfId3AU=- From 1ad2aeaf2aefa78376018da67d3229624eb75355 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Sep 2015 01:28:39 +0200 Subject: [PATCH 31/31] Removed baf cut and paste --- htdocs/accountancy/customer/lines.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 6c9dafed89f..01f34e700cc 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -202,7 +202,6 @@ if ($result) { $i = 0; $param=""; - if ($search_login) $param.="&search_login=".$search_login; if ($search_facture) $param.="&search_facture=".$search_facture; if ($search_ref) $param.="&search_ref=".$search_ref; if ($search_label) $param.="&search_label=".$search_label;
'.$langs->trans("Label").'trans("VATPayment")).'">
'.$langs->trans("Label").'
'.$langs->trans("Amount").'