diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 9a5a19a1e09..26265316ea6 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -33,6 +33,7 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; @@ -42,7 +43,6 @@ require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("banks"); $langs->load("categories"); diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 6115c0f6c84..9acf83db399 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -147,7 +147,7 @@ if (!empty($id)) { if (! preg_match('/,/', $id)) { - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); } else { diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/bankentries.php similarity index 75% rename from htdocs/compta/bank/search.php rename to htdocs/compta/bank/bankentries.php index 4b03250e76a..4f05210f411 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/bankentries.php @@ -21,7 +21,7 @@ */ /** - * \file htdocs/compta/bank/search.php + * \file htdocs/compta/bank/bankentries.php * \ingroup banque * \brief List of bank transactions */ @@ -29,6 +29,7 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; @@ -48,10 +49,31 @@ $langs->load("bills"); $langs->load("categories"); $langs->load("companies"); $langs->load("margins"); +$langs->load("salaries"); +$langs->load("loan"); +$langs->load("donations"); +$langs->load("trips"); +$langs->load("members"); + +$id = GETPOST('id','int'); +$ref = GETPOST('ref','alpha'); +$action=GETPOST('action','alpha'); +$cancel=GETPOST('cancel','alpha'); +$confirm=GETPOST('confirm','alpha'); // Security check -if ($user->societe_id) $socid=$user->societe_id; -$result=restrictedArea($user,'banque'); +$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :'')); +$fieldtype = (! empty($ref) ? 'ref' :'rowid'); +if ($fielvalue) +{ + if ($user->societe_id) $socid=$user->societe_id; + $result=restrictedArea($user,'banque',$fieldvalue,'bank_account&bank_account','','',$fieldtype); +} +else +{ + if ($user->societe_id) $socid=$user->societe_id; + $result=restrictedArea($user,'banque'); +} $search_ref=GETPOST('search_ref','alpha'); $description=GETPOST("description",'alpha'); @@ -90,11 +112,20 @@ if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid') && $a if (strtolower($sortorder) == 'desc') $mode_balance_ok = false; +$object = new Account($db); +if ($id > 0 || ! empty($ref)) +{ + $result=$object->fetch($id, $ref); + $account = $object->id; // Force the search field on id of account +} + + // Initialize technical object to manage context to save list fields -$contextpage='banktransactionlist'; +$contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id); +//var_dump($contextpage); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array($contextpage)); +$hookmanager->initHooks(array('banktransactionlist', $contextpage)); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels @@ -109,7 +140,7 @@ $arrayfields=array( 'type'=>array('label'=>$langs->trans("Type"), 'checked'=>1), 'b.num_chq'=>array('label'=>$langs->trans("Numero"), 'checked'=>1), 'bu.label'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>500), - 'ba.ref'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>1, 'position'=>1000), + 'ba.ref'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>(($id > 0 || ! empty($ref))?0:1), 'position'=>1000), 'b.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1, 'position'=>600), 'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>605), 'balance'=>array('label'=>$langs->trans("Balance"), 'checked'=>1, 'position'=>1000), @@ -166,6 +197,69 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } +$dateop=-1; + +if (GETPOST('save') && $id && ! $cancel && $user->rights->banque->modifier) +{ + $error = 0; + + if (price2num($_POST["addcredit"]) > 0) + { + $amount = price2num($_POST["addcredit"]); + } + else + { + $amount = - price2num($_POST["adddebit"]); + } + + $dateop = dol_mktime(12,0,0,$_POST["opmonth"],$_POST["opday"],$_POST["opyear"]); + $operation=$_POST["operation"]; + $num_chq=$_POST["num_chq"]; + $label=$_POST["label"]; + $cat1=$_POST["cat1"]; + + if (! $dateop) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); + } + if (! $operation) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Type")), null, 'errors'); + } + if (! $amount) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors'); + } + + if (! $error) + { + $object->fetch($id); + $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user); + if ($insertid > 0) + { + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + exit; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + else + { + $action='addline'; + } +} + +if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->modifier) +{ + $accline=new AccountLine($db); + $result=$accline->fetch(GETPOST("rowid")); + $result=$accline->delete($user); +} + + /* * View @@ -193,7 +287,74 @@ $banklinestatic=new AccountLine($db); $now = dol_now(); -llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param); + + +if ($id > 0 || ! empty($ref)) +{ + $title = $langs->trans("FinancialAccount").' - '.$langs->trans("Transactions"); + $helpurl = ""; + llxHeader('',$title,$helpurl); + + // Load bank groups + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; + $bankcateg = new BankCateg($db); + $options = array(); + + foreach ($bankcateg->fetchAll() as $bankcategory) { + $options[$bankcategory->id] = $bankcategory->label; + } + + // Onglets + $head=bank_prepare_head($object); + dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account'); + + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); + + dol_fiche_end(); + + + + /* + * Buttons actions + */ + + //if ($action != 'delete') + //{ + print '
'; + + if ($action != 'addline') + { + if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) + { + if ($user->rights->banque->modifier) { + print 'id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").''; + } else { + print ''.$langs->trans("AddBankRecord").''; + } + } else { + print ''.$langs->trans("AddBankRecord").''; + } + } + + if ($object->canBeConciliated() > 0) { + // If not cash account and can be reconciliate + if ($user->rights->banque->consolidate) { + print ''.$langs->trans("Conciliate").''; + } else { + print ''.$langs->trans("Conciliate").''; + } + } + + print '
'; + //} + +} +else +{ + llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param); +} $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq,"; $sql.= " b.fk_account, b.fk_type,"; @@ -261,7 +422,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->plimit($limit+1,$offset); -dol_syslog('compta/bank/search.php::', LOG_DEBUG); +dol_syslog('compta/bank/bankentries.php', LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -273,6 +434,8 @@ if ($resql) $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($id > 0) $param.='&id='.urlencode($id); + if (!empty($ref)) $param.='&ref='.urlencode($ref); if (!empty($search_ref)) $param.='&search_ref='.urlencode($search_ref); if (!empty($description)) $param.='&description='.urlencode($description); if (!empty($type)) $param.='&type='.urlencode($type); @@ -303,6 +466,15 @@ if ($resql) if ($massaction == 'presend') $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + + // Confirmation delete + if ($action == 'delete') + { + $text=$langs->trans('ConfirmDeleteTransaction'); + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"), $langs->trans('DeleteTransaction'), $text, 'confirm_delete', null, '', 1); + } + + // Lines of title fields print '
'."\n"; if ($optioncss != '') print ''; @@ -312,8 +484,55 @@ if ($resql) print ''; print ''; print ''; + print ''; + print ''; if (! empty($_REQUEST['bid'])) print ''; + + // Form to add a transaction with no invoice + if ($user->rights->banque->modifier && $action == 'addline') + { + print load_fiche_titre($langs->trans("AddBankRecordLong"),'',''); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("Date").' '.$langs->trans("Type").''.$langs->trans("Numero").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").' 
'; + $form->select_date($dateop,'op',0,0,0,'transaction'); + print ''; + $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == Account::TYPE_CASH ? 'LIQ' : '')),'operation','1,2',2,1); + print ''; + print ''; + print ''; + if ($options) { + print '
'.$langs->trans("Rubrique").': '; + print Form::selectarray('cat1', $options, GETPOST('cat1'), 1); + } + print '
'; + print '
'; + print ''; + print '
'; + print '
'; + } + + + $i = 0; // Title @@ -324,14 +543,16 @@ if ($resql) $morehtml.='/'.$nbtotalofpages.' '; $morehtml.=''; + $picto='title_bank'; + if ($id > 0 || ! empty($ref)) $picto=''; if (GETPOST("bid")) { $result=$bankcateg->fetch(GETPOST("bid")); - print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_bank.png', 0, $morehtml, '', $limit); + print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit); } else { - print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_bank.png', 0, $morehtml, '', $limit); + print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit); } $moreforfilter = ''; @@ -433,7 +654,7 @@ if ($resql) if (! empty($arrayfields['ba.ref']['checked'])) { print ''; - $form->select_comptes($account,'account',0,'',1); + $form->select_comptes($account,'account',0,'',1, ($id > 0 || ! empty($ref)?' disabled="disabled"':'')); print ''; } if (! empty($arrayfields['b.debit']['checked'])) @@ -664,7 +885,7 @@ if ($resql) } // Num cheque - if (! empty($arrayfields['b.num_releve']['checked'])) + if (! empty($arrayfields['b.num_chq']['checked'])) { print ''.($objp->num_chq?$objp->num_chq:"")."\n"; if (! $i) $totalarray['nbfield']++; @@ -734,7 +955,7 @@ if ($resql) // Balance if (! empty($arrayfields['balance']['checked'])) { - if ($mode_balance_ok) + if ($mode_balance_ok) { if ($total >= 0) { @@ -751,60 +972,68 @@ if ($resql) } } - // Transaction reconciliated or edit link - if ($objp->rappro && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated + if (! empty($arrayfields['b.num_releve']['checked'])) { - print ''; - print ''; - print img_edit(); - print ''; - print "  "; - print ''.$objp->num_releve.''; - print ""; - } - else - { - print ''; - if ($user->rights->banque->modifier || $user->rights->banque->consolidate) - { - print ''; - print img_edit(); - print ''; - } - else - { - print ''; - print img_view(); - print ''; - } - if ($bankaccount->canBeConciliated() > 0 && empty($objp->rappro)) - { - if ($db->jdate($objp->dv) < ($now - $conf->bank->rappro->warning_delay)) - { - print ' '.img_warning($langs->trans("Late")); - } - } - print ' '; - if ($user->rights->banque->modifier) - { - print 'rowid.'&id='.$object->id.'&page='.$page.'">'; - print img_delete(); - print ''; - } - print ''; + print ''; + // Transaction reconciliated or edit link + if ($objp->rappro && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated + { + print ''; + print img_edit(); + print ''; + print "  "; + print ''.$objp->num_releve.''; + } + else + { + if ($user->rights->banque->modifier || $user->rights->banque->consolidate) + { + print ''; + print img_edit(); + print ''; + } + else + { + print ''; + print img_view(); + print ''; + } + if ($bankaccount->canBeConciliated() > 0 && empty($objp->rappro)) + { + if ($db->jdate($objp->dv) < ($now - $conf->bank->rappro->warning_delay)) + { + print ' '.img_warning($langs->trans("Late")); + } + } + print ' '; + if ($user->rights->banque->modifier) + { + print 'rowid.'&id='.$object->id.'&page='.$page.'">'; + print img_delete(); + print ''; + } + } + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; + } + print ''; + if (! $i) $totalarray['nbfield']++; } // Action column - print ''; - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - { - $selected=0; - if (in_array($obj->rowid, $arrayofselected)) $selected=1; - print ''; - } - print ''; - if (! $i) $totalarray['nbfield']++; - + print ''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; + } + print ''; + if (! $i) $totalarray['nbfield']++; + print ""; $i++; diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index 666ad0085e1..cd6d2adb796 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -76,7 +76,7 @@ if ($result) $objp = $db->fetch_object($result); $var=!$var; print ""; - print "rowid\">$objp->label"; + print "rowid\">$objp->label"; print ''.$objp->nombre.''; print ''.price(abs($objp->somme)).""; print ''.price(abs(price2num($objp->somme / $objp->nombre,'MT'))).""; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index dfeea54c510..ac5430c74be 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1234,7 +1234,7 @@ class Account extends CommonObject } else if ($mode == 'transactions') { - $link = ''; } else if ($mode == 'receipts') diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 9db2bb35233..bf69fe98a3b 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -771,7 +771,7 @@ if ($account) if ($_GET["option"]!='all') { $morehtml=''.$langs->trans("ShowAllAccounts").''; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam, 0, '', '', 1); } else { diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index a29e3643812..7d3073d7129 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -423,7 +423,7 @@ foreach ($accounts as $key=>$type) print ''; print ''.$acc->getLibStatut(2).''; print ''; - print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; + print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print ''; // Action column diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 0d307115ed9..f02b4326a31 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -271,7 +271,7 @@ if ($result) print ''; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; // Ref print '"; diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index 8f6cd29afdb..e3ef2ea5a57 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -181,7 +181,7 @@ if ($resql) $var=True; $num = $db->num_rows($resql); - print load_fiche_titre($langs->trans("Reconciliation").': '.$acct->label.'', '', 'title_bank.png'); + print load_fiche_titre($langs->trans("Reconciliation").': '.$acct->label.'', '', 'title_bank.png'); print '
'; // Show last bank receipts diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index ff50b3e66e5..06c213485f8 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -126,24 +126,13 @@ if (empty($num)) $head=bank_prepare_head($object); dol_fiche_head($head,'statement',$langs->trans("FinancialAccount"),0,'account'); - print '
'.$langs->trans("Ref")."
'; - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - print ''; - - // Label - print ''; - print ''; - - print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref'); - print '
'.$langs->trans("Label").''.$object->label.'
'; - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); + dol_fiche_end(); + print '
'; if ($object->canBeConciliated() > 0) { diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/transfer.php similarity index 92% rename from htdocs/compta/bank/virement.php rename to htdocs/compta/bank/transfer.php index abb06d17d76..9e26d532348 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/transfer.php @@ -21,7 +21,7 @@ */ /** - * \file htdocs/compta/bank/virement.php + * \file htdocs/compta/bank/transfer.php * \ingroup banque * \brief Page de saisie d'un virement */ @@ -91,11 +91,11 @@ if ($action == 'add') $result=0; // By default, electronic transfert from bank to bank - $typefrom='PRE'; + $typefrom='VIR'; $typeto='VIR'; if ($accountto->courant == Account::TYPE_CASH || $accountfrom->courant == Account::TYPE_CASH) { - // This is transfert of change + // This is transfer of change $typefrom='LIQ'; $typeto='LIQ'; } @@ -112,7 +112,7 @@ if ($action == 'add') if (! $error) { - $mesgs = $langs->trans("TransferFromToDone","id."\">".$accountfrom->label."","id."\">".$accountto->label."",$amount,$langs->transnoentities("Currency".$conf->currency)); + $mesgs = $langs->trans("TransferFromToDone","id."\">".$accountfrom->label."","id."\">".$accountto->label."",$amount,$langs->transnoentities("Currency".$conf->currency)); setEventMessages($mesgs, null, 'mesgs'); $db->commit(); } @@ -157,7 +157,7 @@ print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'title_ban print $langs->trans("TransferDesc"); print "

"; -print ""; +print ''; print ''; print ''; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index ebfd598ee0b..df02264badc 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -191,7 +191,7 @@ if ($resql) // Bank print ''; - if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.$objp->label.''; + if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.$objp->label.''; else print ' '; print ''; diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index b5371e6fa53..74078740080 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2006-2016 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent @@ -42,8 +42,8 @@ function bank_prepare_head(Account $object) $head[$h][2] = 'bankname'; $h++; - $head[$h][0] = DOL_URL_ROOT . "/compta/bank/account.php?id=" . $object->id; - $head[$h][1] = $langs->trans("Transactions"); + $head[$h][0] = DOL_URL_ROOT . "/compta/bank/bankentries.php?id=" . $object->id; + $head[$h][1] = $langs->trans("BankTransactions"); $head[$h][2] = 'journal'; $h++; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 691ac3a8a3c..892c6c1fc2b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -926,9 +926,10 @@ function dol_get_fiche_end($notab=0) * @param int $nodbprefix Do not include DB prefix to forge table name * @param string $morehtmlleft More html code to show before ref * @param string $morehtmlright More html code to show before navigation arrows + * @param int $onlybanner Put this to 1, if the card will contains only a banner * @return void */ -function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlright='') +function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlright='', $onlybanner=0) { global $conf, $form, $user, $langs; @@ -943,7 +944,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->element == 'user') $modulepart='userphoto'; if ($object->element == 'product') $modulepart='product'; - print '
'; + print '
'; if ($object->element == 'product') { $width=80; $cssclass='photoref'; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 507bca321c6..63d846171a9 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -268,9 +268,9 @@ 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->banque->enabled', __HANDLER__, 'left', 2600__+MAX_llx_menu__, 'accountancy', 'bank', 14__+MAX_llx_menu__, '/compta/bank/index.php?leftmenu=bank&mainmenu=bank', 'MenuBankCash', 0, 'banks', '$user->rights->banque->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->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2601__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/card.php?action=create&leftmenu=bank', 'MenuNewFinancialAccount', 1, 'banks', '$user->rights->banque->configurer', '', 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->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2602__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/categ.php?leftmenu=bank', 'Rubriques', 1, 'categories', '$user->rights->banque->configurer', '', 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->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/search.php?leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->rights->banque->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->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/bankentries.php?leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->rights->banque->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->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2604__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/budget.php?leftmenu=bank', 'ListTransactionsByCategory', 1, 'banks', '$user->rights->banque->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->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/virement.php?leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->rights->banque->transfer', '', 0, 5, __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->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/transfer.php?leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->rights->banque->transfer', '', 0, 5, __ENTITY__); -- Account - Categories 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->categorie->enabled', __HANDLER__, 'left', 2650__+MAX_llx_menu__, 'accountancy', 'cat', 14__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=5', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __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->categorie->enabled', __HANDLER__, 'left', 2651__+MAX_llx_menu__, 'accountancy', '', 2650__+MAX_llx_menu__, '/categories/card.php?action=create&type=5', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index a0278f2527e..c3373cd6fb2 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1073,10 +1073,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/compta/bank/card.php?action=create",$langs->trans("MenuNewFinancialAccount"),1,$user->rights->banque->configurer); $newmenu->add("/compta/bank/index.php?leftmenu=bank&mainmenu=bank",$langs->trans("List"),1,$user->rights->banque->lire, '', $mainmenu, 'bank'); - $newmenu->add("/compta/bank/search.php",$langs->trans("ListTransactions"),1,$user->rights->banque->lire); + $newmenu->add("/compta/bank/bankentries.php",$langs->trans("ListTransactions"),1,$user->rights->banque->lire); $newmenu->add("/compta/bank/budget.php",$langs->trans("ListTransactionsByCategory"),1,$user->rights->banque->lire); - $newmenu->add("/compta/bank/virement.php",$langs->trans("MenuBankInternalTransfer"),1,$user->rights->banque->transfer); + $newmenu->add("/compta/bank/transfer.php",$langs->trans("MenuBankInternalTransfer"),1,$user->rights->banque->transfer); } if (! empty($conf->categorie->enabled)) { diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 3ad6451d66b..bcf000bc3aa 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -708,7 +708,7 @@ if (empty($action)) print ''.$objp->num_paiement.''; print ''; - if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).''; + if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).''; else print ' '; print ''; diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 31cbdae740a..b603bb3d2e6 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -55,16 +55,16 @@ AccountCard=Account card DeleteAccount=Delete account ConfirmDeleteAccount=Are you sure you want to delete this account? Account=Account -BankTransactionByCategories=Bank transactions by categories -BankTransactionForCategory=Bank transactions for category %s +BankTransactionByCategories=Bank entries by categories +BankTransactionForCategory=Bank entries for category %s RemoveFromRubrique=Remove link with category -RemoveFromRubriqueConfirm=Are you sure you want to remove link between the transaction and the category? -ListBankTransactions=List of bank transactions +RemoveFromRubriqueConfirm=Are you sure you want to remove link between the entry and the category? +ListBankTransactions=List of bank entries IdTransaction=Transaction ID -BankTransactions=Bank transactions -ListTransactions=List transactions -ListTransactionsByCategory=List transaction/category -TransactionsToConciliate=Transactions to reconcile +BankTransactions=Bank entries +ListTransactions=List entries +ListTransactionsByCategory=List entries/category +TransactionsToConciliate=Entries to reconcile Conciliable=Can be reconciled Conciliate=Reconcile Conciliation=Reconciliation @@ -74,16 +74,16 @@ AccountToCredit=Account to credit AccountToDebit=Account to debit DisableConciliation=Disable reconciliation feature for this account ConciliationDisabled=Reconciliation feature disabled -LinkedToAConciliatedTransaction=Linked to a conciliated transaction +LinkedToAConciliatedTransaction=Linked to a conciliated entry StatusAccountOpened=Open StatusAccountClosed=Closed AccountIdShort=Number LineRecord=Transaction -AddBankRecord=Add transaction -AddBankRecordLong=Add transaction manually +AddBankRecord=Add entry +AddBankRecordLong=Add entry manually ConciliatedBy=Reconciled by DateConciliating=Reconcile date -BankLineConciliated=Transaction reconciled +BankLineConciliated=Entry reconciled Reconciled=Reconciled NotReconciled=Not reconciled CustomerInvoicePayment=Customer payment @@ -107,13 +107,13 @@ BankChecks=Bank checks BankChecksToReceipt=Checks awaiting deposit ShowCheckReceipt=Show check deposit receipt NumberOfCheques=Nb of check -DeleteTransaction=Delete transaction -ConfirmDeleteTransaction=Are you sure you want to delete this transaction? -ThisWillAlsoDeleteBankRecord=This will also delete generated bank transactions +DeleteTransaction=Delete entry +ConfirmDeleteTransaction=Are you sure you want to delete this entry? +ThisWillAlsoDeleteBankRecord=This will also delete generated bank entry BankMovements=Movements -PlannedTransactions=Planned transactions +PlannedTransactions=Planned entries Graph=Graphics -ExportDataset_banque_1=Bank transactions and account statement +ExportDataset_banque_1=Bank entries and account statement ExportDataset_banque_2=Deposit slip TransactionOnTheOtherAccount=Transaction on the other account PaymentNumberUpdateSucceeded=Payment number updated successfully @@ -121,7 +121,7 @@ PaymentNumberUpdateFailed=Payment number could not be updated PaymentDateUpdateSucceeded=Payment date updated successfully PaymentDateUpdateFailed=Payment date could not be updated Transactions=Transactions -BankTransactionLine=Bank transaction +BankTransactionLine=Bank entry AllAccounts=All bank/cash accounts BackToAccount=Back to account ShowAllAccounts=Show for all accounts diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 00b151620fb..a572d15cbcf 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -69,7 +69,7 @@ ErrorLDAPSetupNotComplete=Dolibarr-LDAP matching is not complete. ErrorLDAPMakeManualTest=A .ldif file has been generated in directory %s. Try to load it manually from command line to have more information on errors. ErrorCantSaveADoneUserWithZeroPercentage=Can't save an action with "statut not started" if field "done by" is also filled. ErrorRefAlreadyExists=Ref used for creation already exists. -ErrorPleaseTypeBankTransactionReportName=Please type bank receipt name where transaction is reported (Format YYYYMM or YYYYMMDD) +ErrorPleaseTypeBankTransactionReportName=Please type bank receipt name where entry is reported (Format YYYYMM or YYYYMMDD) ErrorRecordHasChildren=Failed to delete record since it has some childs. ErrorRecordIsUsedCantDelete=Can't delete record. It is already used or included into other object. ErrorModuleRequireJavascript=Javascript must not be disabled to have this feature working. To enable/disable Javascript, go to menu Home->Setup->Display. @@ -131,7 +131,7 @@ ErrorWarehouseMustDiffers=Source and target warehouses must differs ErrorBadFormat=Bad format! ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, this member is not yet linked to any third party. Link member to an existing third party or create a new third party before creating subscription with invoice. ErrorThereIsSomeDeliveries=Error, there is some deliveries linked to this shipment. Deletion refused. -ErrorCantDeletePaymentReconciliated=Can't delete a payment that had generated a bank transaction that was conciliated +ErrorCantDeletePaymentReconciliated=Can't delete a payment that had generated a bank entry that was reconciled ErrorCantDeletePaymentSharedWithPayedInvoice=Can't delete a payment shared by at least one invoice with status Payed ErrorPriceExpression1=Cannot assign to constant '%s' ErrorPriceExpression2=Cannot redefine built-in function '%s' diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index 6be0af4fd1a..336b20bff16 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -175,7 +175,7 @@ MigrationReopeningContracts=Open contract closed by error MigrationReopenThisContract=Reopen contract %s MigrationReopenedContractsNumber=%s contracts modified MigrationReopeningContractsNothingToUpdate=No closed contract to open -MigrationBankTransfertsUpdate=Update links between bank transaction and a bank transfer +MigrationBankTransfertsUpdate=Update links between bank entry and a bank transfer MigrationBankTransfertsNothingToUpdate=All links are up to date MigrationShipmentOrderMatching=Sendings receipt update MigrationDeliveryOrderMatching=Delivery receipt update diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 56639e43127..08a5ff6f8a0 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -705,7 +705,7 @@ PublicUrl=Public URL AddBox=Add box SelectElementAndClickRefresh=Select an element and click Refresh PrintFile=Print File %s -ShowTransaction=Show transaction on bank account +ShowTransaction=Show entry on bank account GoIntoSetupToChangeLogo=Go into Home - Setup - Company to change logo or go into Home - Setup - Display to hide. Deny=Deny Denied=Denied diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index d249131a507..c123fed51a5 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -127,8 +127,8 @@ NoThirdPartyAssociatedToMember=No third party associated to this member MembersAndSubscriptions= Members and Subscriptions MoreActions=Complementary action on recording MoreActionsOnSubscription=Complementary action, suggested by default when recording a subscription -MoreActionBankDirect=Create a direct transaction record on account -MoreActionBankViaInvoice=Create an invoice and payment on account +MoreActionBankDirect=Create a direct entry on bank account +MoreActionBankViaInvoice=Create an invoice, and a payment on bank account MoreActionInvoiceOnly=Create an invoice with no payment LinkToGeneratedPages=Generate visit cards LinkToGeneratedPagesDesc=This screen allows you to generate PDF files with business cards for all your members or a particular member.