From 7583146b7371b4f63157e0888557161d39123b5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 17 Sep 2005 00:14:36 +0000 Subject: [PATCH] =?UTF-8?q?New:=20Ajout=20caract=E9ristique=20"rapprochabl?= =?UTF-8?q?e"=20sur=20les=20comptes=20bancaires.=20Uniformisation=20page?= =?UTF-8?q?=20des=20journaux=20de=20comptes=20Debuggage=20de=20la=20foncti?= =?UTF-8?q?on=20des=20graphiques=20de=20solde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/bank/account.class.php | 19 +- htdocs/compta/bank/account.php | 287 +++++++++++++++------------ htdocs/compta/bank/config.php | 13 +- htdocs/compta/bank/fiche.php | 72 ++++--- htdocs/compta/bank/graph.php | 56 +++--- htdocs/compta/bank/index.php | 50 +++-- htdocs/compta/bank/ligne.php | 191 ++++++++++-------- htdocs/langs/en_US/banks.lang | 13 +- htdocs/langs/fr_FR/banks.lang | 13 +- htdocs/master.inc.php | 3 + htdocs/viewimage.php | 4 +- 11 files changed, 423 insertions(+), 298 deletions(-) diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php index 0538c6edca2..883d1341469 100644 --- a/htdocs/compta/bank/account.class.php +++ b/htdocs/compta/bank/account.class.php @@ -43,6 +43,8 @@ class Account var $type; var $bank; var $clos; + var $rappro; + var $code_banque; var $code_guichet; var $number; @@ -68,6 +70,9 @@ class Account $this->type_lib[1]=$langs->trans("BankType1"); $this->type_lib[2]=$langs->trans("BankType2"); + $this->status[0]=$langs->trans("StatusAccountOpened"); + $this->status[1]=$langs->trans("StatusAccountClosed"); + return 1; } @@ -76,6 +81,8 @@ class Account */ function deleteline($rowid) { + $this->db->begin(); + $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=$rowid"; $result = $this->db->query($sql); @@ -84,6 +91,8 @@ class Account $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=$rowid"; $result = $this->db->query($sql); + + $this->db->commit(); } /** @@ -236,7 +245,7 @@ class Account $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_account"); if ( $this->update() ) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank (datec, label, amount, fk_account,datev,dateo,fk_type,rappro) "; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank (datec, label, amount, fk_account, datev, dateo, fk_type, rappro) "; $sql .= " VALUES (now(),'".$langs->trans("Balance")."','" . ereg_replace(',','.',$this->solde) . "','$this->id','".$this->db->idate($this->date_solde)."','".$this->db->idate($this->date_solde)."','SOLD',1);"; $this->db->query($sql); } @@ -288,6 +297,7 @@ class Account $sql .= ",adresse_proprio = '".$this->adresse_proprio."'"; $sql .= ",courant = ".$this->courant; $sql .= ",clos = ".$this->clos; + $sql .= ",rappro = ".$this->rappro; $sql .= " WHERE rowid = ".$this->id; @@ -310,8 +320,9 @@ class Account function fetch($id) { $this->id = $id; - $sql = "SELECT rowid, label, bank, number, courant, clos, code_banque, code_guichet, cle_rib, bic, iban_prefix, domiciliation, proprio, adresse_proprio FROM ".MAIN_DB_PREFIX."bank_account"; - $sql .= " WHERE rowid = ".$id; + $sql = "SELECT rowid, label, bank, number, courant, clos, rappro,"; + $sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix, domiciliation, proprio, adresse_proprio FROM ".MAIN_DB_PREFIX."bank_account"; + $sql.= " WHERE rowid = ".$id; $result = $this->db->query($sql); @@ -326,6 +337,8 @@ class Account $this->courant = $obj->courant; $this->bank = $obj->bank; $this->clos = $obj->clos; + $this->rappro = $obj->rappro; + $this->code_banque = $obj->code_banque; $this->code_guichet = $obj->code_guichet; $this->number = $obj->number; diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index edd05e91477..654b289a146 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -40,7 +40,7 @@ $vline=isset($_GET["vline"])?$_GET["vline"]:$_POST["vline"]; $action=isset($_GET["action"])?$_GET["action"]:$_POST["action"]; $page=isset($_GET["page"])?$_GET["page"]:0; -if ($_POST["action"] == 'add' && $account) +if ($_POST["action"] == 'add' && $account && ! isset($_POST["cancel"])) { if ($_POST["credit"] > 0) @@ -100,21 +100,24 @@ if ($account > 0) $acct = new Account($db); $acct->fetch($account); - // Chargement des categories dans $options - $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;"; - $result = $db->query($sql); - if ($result) + // Chargement des categories dans $options + $nbcategories=0; + $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;"; + $result = $db->query($sql); + if ($result) { - $var=True; - $num = $db->num_rows($result); - $i = 0; - $options = ""; - while ($i < $num) - { - $obj = $db->fetch_object($result); - $options .= "\n"; $i++; - } - $db->free($result); + $var=True; + $num = $db->num_rows($result); + $i = 0; + $options = ""; + while ($i < $num) + { + $obj = $db->fetch_object($result); + $options .= "\n"; + $nbcategories++; + $i++; + } + $db->free($result); } /* @@ -190,131 +193,150 @@ if ($account > 0) { $mesg.= ''.img_next().''; } - print_fiche_titre("Journal de trésorerie du compte : " .$acct->label,$mesg); + + print_fiche_titre("Journal de trésorerie du compte : " .$acct->label,$mesg); - print '
'; - print ''; + print '
'; + print '
'; + + /* + * Affiche tableau des transactions bancaires + * + */ - /* - * Affiche tableau des transactions bancaires - * - */ - - 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 ""; + + print "\n"; } - else + + // Ligne de titre + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + print "\n"; + + /* Another solution + * create temporary table solde type=heap select amount from llx_bank limit 100 ; + * select sum(amount) from solde ; + */ + + $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type"; + $sql .= " FROM ".MAIN_DB_PREFIX."bank as b "; + $sql .= " WHERE fk_account=".$acct->id; + + if ($req_debit) { - print " "; + $sql .= " AND b.amount = -".$req_debit; } - print ''; - print "\n"; - print "\n"; - - /* Another solution - * create temporary table solde type=heap select amount from llx_bank limit 100 ; - * select sum(amount) from solde ; - */ - - $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type"; - $sql .= " FROM ".MAIN_DB_PREFIX."bank as b "; - $sql .= " WHERE fk_account=".$acct->id; - - if ($req_debit) - { - $sql .= " AND b.amount = -".$req_debit; - } - - $sql .= $sql_rech; - - if ($vue) + + $sql .= $sql_rech; + + if ($vue) { - if ($vue == 'credit') - { - $sql .= " AND b.amount >= 0 "; - } - else - { - $sql .= " AND b.amount < 0 "; - } + if ($vue == 'credit') + { + $sql .= " AND b.amount >= 0 "; + } + else + { + $sql .= " AND b.amount < 0 "; + } } - - $sql .= " ORDER BY b.datev ASC"; - $sql .= $db->plimit($limitsql, 0); - - $result = $db->query($sql); - if ($result) + + $sql .= " ORDER BY b.datev ASC"; + $sql .= $db->plimit($limitsql, 0); + + $result = $db->query($sql); + if ($result) { - _print_lines($db, $result, $sql, $acct); - $db->free($result); + _print_lines($db, $result, $sql, $acct); + $db->free($result); } + + + print "
'.$langs->trans("Date").''.$langs->trans("Value").''.$langs->trans("Type").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("BankBalance").''; - if ($acct->type != 2) print $langs->trans("AccountStatement"); - else print ' '; - print '
Graph'; - if ($user->rights->banque->modifier && $acct->type != 2) // Si non compte cash + // Formulaire de saisie d'une opération hors factures + if ($user->rights->banque->modifier && $_GET["action"]=='rappro') { - print ''.$langs->trans("Rappro").''; + $html=new Form($db); + + print ''; + print ''; + print ''; + print ''; + + print '
Saisie d\'une écriture manuelle hors facture
YYYY MMDD '.$langs->trans("Description").'0000.000000.00 '; + print '
'; + print ''; + print ''; + $html->select_types_paiements('','operation','1,2',1); + print ''; + print ''; + if ($nbcategories) + { + print '
'.$langs->trans("Category").': '; + } + print '
'; + print '
'; + print ''; + print '
 
'.$langs->trans("Date").''.$langs->trans("Value").''.$langs->trans("Type").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("BankBalance").''; + if ($acct->type != 2 && $acct->rappro) print $langs->trans("AccountStatement"); + else print ' '; + print '
Graph 
"; - /* - * Formulaire de saisie d'une opération hors factures - * - */ - if ($user->rights->banque->modifier) + /* + * Boutons actions + */ + if ($_GET["action"] != 'rappro') { - $html=new Form($db); - - print '
'; - print ''; - print ''; - print ''; - print " \n"; - - print ""; - print "Saisie d'une transaction hors facture"; - print ''; - print 'YYYY MMDD '.$langs->trans("Description").'0000.000000.00'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $html->select_types_paiements('','operation','1,2',1); - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print "
"; + print '
'; + + if ($user->rights->banque->modifier && $acct->type != 2 && $acct->rappro) // Si non compte cash et rapprochable + { + print ''.$langs->trans("Conciliate").''; + } + + if ($user->rights->banque->modifier) + { + print ''.$langs->trans("AddBankRecord").''; + } + + print '
'; } - - print ""; + print '
'; + } else { @@ -356,8 +378,8 @@ function _print_lines($db,$result,$sql,$acct) print ""; print "".dolibarr_print_date($objp->do,"%d/%m/%y")."\n"; - print "".dolibarr_print_date($objp->dv,"%d/%m/%y")."\n"; - print "".$objp->fk_type." ".($objp->num_chq?$objp->num_chq:"")."\n"; + print " ".dolibarr_print_date($objp->dv,"%d/%m/%y")."\n"; + print " ".$objp->fk_type." ".($objp->num_chq?$objp->num_chq:"")."\n"; print "rowid&account=$acct->id\">$objp->label"; /* * Ajout les liens @@ -378,18 +400,18 @@ function _print_lines($db,$result,$sql,$acct) } else { - print " ".price($objp->amount)."\n"; + print "  ".price($objp->amount)."\n"; } if ($action !='search') { - if ($total > 0) + if ($total >= 0) { - print ''.price($total)."\n"; + print ' '.price($total).''; } else { - print "".price($total)."\n"; + print ' '.price($total).''; } } else @@ -397,9 +419,10 @@ function _print_lines($db,$result,$sql,$acct) print '-'; } - if ($objp->rappro && $acct->type != 2) // Si non compte cash) + // Relevé rappro ou lien edition + if ($objp->rappro && $acct->type != 2) // Si non compte cash { - print ""; + print "  "; print "num_releve&account=$acct->id\">$objp->num_releve"; print ""; } diff --git a/htdocs/compta/bank/config.php b/htdocs/compta/bank/config.php index 9daf4272eb2..5af7b5decbc 100644 --- a/htdocs/compta/bank/config.php +++ b/htdocs/compta/bank/config.php @@ -39,12 +39,13 @@ print_titre($langs->trans("AccountSetup")); print '
'; print ''; print ""; -print ""; -print ""; -print ""; +print ''; +print ''; +print ''; +print ''; print "\n"; -$sql = "SELECT rowid, label, number, bank, courant as type, clos"; +$sql = "SELECT rowid, label, number, bank, courant as type, clos, rappro"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " ORDER BY label"; @@ -66,7 +67,9 @@ if ($result) $var=!$var; print ""; print ''; - print ""; + print ''; + print ''; + print ''; $i++; } diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index a4a57c3c16f..773ce6fce98 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -49,6 +49,7 @@ if ($_POST["action"] == 'add') $account->label = trim($_POST["label"]); $account->courant = $_POST["type"]; $account->clos = $_POST["clos"]; + $account->rappro = $_POST["norappro"]?1:0; $account->bank = trim($_POST["bank"]); $account->code_banque = $_POST["code_banque"]; @@ -89,6 +90,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"]) $account->label = trim($_POST["label"]); $account->courant = $_POST["type"]; $account->clos = $_POST["clos"]; + $account->rappro = (isset($_POST["norappro"]) && $_POST["norappro"]=='on')?0:1; $account->bank = $_POST["bank"]; $account->code_banque = $_POST["code_banque"]; @@ -154,7 +156,7 @@ if ($_GET["action"] == 'create') print '
".$langs->trans("Ref")."".$langs->trans("Label")."".$langs->trans("Type")."".$langs->trans("Bank")."".$langs->trans("Numero")."".$langs->trans("Closed")."'.$langs->trans("Ref")."".$langs->trans("Label")."".$langs->trans("Type")."".$langs->trans("Bank").''.$langs->trans("AccountIdShort").''.$langs->trans("Conciliable").''.$langs->trans("Status").'
$objp->rowidrowid\">$objp->label'.$account->type_lib[$objp->type].'$objp->bank $objp->number ".yn($objp->clos)."
'.$objp->bank.' '.$objp->number.' '.yn($objp->rappro).''.$account->status[$objp->clos].'
'; 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 ''; + print ''; print ''; - print ''; + print ''; print '"; print ''; - print ''; + print ''; print '"; print ''; @@ -245,9 +250,16 @@ else print ''; print ''; - print ''; + print ''; - if ($account->type == 0 || $account->type == 1) { + print ''; + print ''; + + if ($account->type == 0 || $account->type == 1) + { print ''; print ''; @@ -326,45 +338,51 @@ else print '
'.$langs->trans("LabelBankCashAccount").'
'.$langs->trans("AccountType").''; @@ -163,7 +165,7 @@ if ($_GET["action"] == 'create') print '
'.$langs->trans("InitialBankBalance").'
'.$langs->trans("Date").''; $now=time(); @@ -172,32 +174,35 @@ if ($_GET["action"] == 'create') print ''; print '
  '.$langs->trans("DisableConciliation").'
'.$langs->trans("IfBankAccount").'...
'.$langs->trans("Bank").'
Code BanqueCode GuichetNuméroClé RIB
'.$langs->trans("IBAN").'
'.$langs->trans("BIC").'
'.$langs->trans("BankAccountDomiciliation").''; - print "
'.$langs->trans("BankAccountOwner").'
'.$langs->trans("BankAccountOwnerAddress").''; - print "
'.$account->type_lib[$account->type].'
'.$langs->trans("Status").''.($account->clos?$langs->trans("Closed"):$langs->trans("Opened")).'
'.$account->status[$account->clos].'
'.$langs->trans("Conciliable").''; + if ($account->type == 0 || $account->type == 1) print ($account->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')')); + if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')'; + print '
'.$langs->trans("Bank").''.$account->bank.'
'; print ''; - print ''; + print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; + print ''; + print ''; + if ($account->type == 0 || $account->type == 1) { print ''; - print ''; + print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '"; print ''; - print ''; + print ''; print "\n"; print '"; } diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index b390eae5c79..3aa138d4a89 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -17,7 +17,6 @@ * * $Id$ * $Source$ - * */ /** \file htdocs/compta/bank/graph.php @@ -38,29 +37,36 @@ $account = $_GET["id"]; if ($account > 0) { - $datetime = time(); - $month = strftime("%m", $datetime); - $year = strftime("%Y", $datetime); - - $acct = new Account($db); - $acct->fetch($account); - - print_fiche_titre("Journal de trésorerie du compte : " .$acct->label,$mesg); - - print '
'.$langs->trans("Label").'
'.$langs->trans("AccountType").''.$account->type_lib[$account->type].'
'.$langs->trans("Closed").'
'.$langs->trans("Status").''; - $form->selectyesnonum("clos",$account->clos); + $form->select_array("clos",array(0=>$account->status[0],1=>$account->status[1]),$account->clos); print '
'.$langs->trans("Conciliable").''; + if ($account->type == 0 || $account->type == 1) print 'rappro?'':'checked="true"').'"> '.$langs->trans("DisableConciliation"); + if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')'; + print '
'.$langs->trans("Bank").'
Code BanqueCode GuichetNuméroClé RIB
'.$langs->trans("IBAN").'
'.$langs->trans("BIC").'
'.$langs->trans("BankAccountDomiciliation").''; - print "
'.$langs->trans("BankAccountOwner").'
'.$langs->trans("BankAccountOwnerAddress").''; - print "
'; - - print '
'; - - $file = "solde.$account.$year.png"; - - print ''; - - print '
'; - - $file = "solde.$account.png"; - - print ''; - - print '
'; + $datetime = time(); + $month = strftime("%m", $datetime); + $year = strftime("%Y", $datetime); + + $acct = new Account($db); + $acct->fetch($account); + + print_fiche_titre("Journal de trésorerie du compte : " .$acct->label,$mesg); + + + print ''; + + print '
'; + + $file = "solde.$account.$year.png"; + if (! file_exists($file)) + { + print "Pour générer ou regénérer les graphiques, lancer le script scripts/banque/graph-solde.php en ligne de commande.
"; + print '
'; + } + else + { + print ''; + } + print '
'; + + $file = "solde.$account.png"; + + print ''; + + print '
'; } ?> diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 2bf9aab80f7..6b8326aedea 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -59,7 +58,7 @@ print '
'; // On charge tableau des comptes financiers (ouverts par defaut) $accounts = array(); -$sql = "SELECT rowid, courant"; +$sql = "SELECT rowid, courant, rappro"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; if ($statut != 'all') { $sql .= " WHERE clos = 0"; @@ -87,7 +86,10 @@ if ($resql) print ''; print ''; print ''; -print ''; +print ''; +print ''; +print ''; +print ''; print "\n"; $total = 0; @@ -105,14 +107,17 @@ foreach ($accounts as $key=>$type) print '"; - print ''; + print ''; + print ''; + print ''; + print ''; $total += $solde; } } // Total -print ''; +print ''; print ''; @@ -123,7 +128,10 @@ print ''; */ print '
'.$langs->trans("CurrentAccounts").''.$langs->trans("Bank").''.$langs->trans("Numero").''.$langs->trans("BankBalance").''.$langs->trans("Closed").''.$langs->trans("AccountIdShort").''.$langs->trans("Conciliable").''.$langs->trans("Status").''.$langs->trans("BankBalance").'
'; print ''.$acc->label.''; print ''.$acc->bank."$acc->number'.price($solde).''.yn($acc->clos).'
'.yn($acc->rappro).''.$acc->status[$acc->clos].''.price($solde).'
'.$langs->trans("Total").''.price($total).' 
 '.$langs->trans("Total").''.price($total).'
 
 
'; print ''; -print ''; +print ''; +print ''; +print ''; +print ''; print "\n"; $total = 0; @@ -141,14 +149,17 @@ foreach ($accounts as $key=>$type) print ""; - print ''; + print ''; + print ''; + print ''; + print ''; $total += $solde; } } // Total -print ''; +print ''; print ''; @@ -159,7 +170,10 @@ print ''; */ print '
'.$langs->trans("SavingAccounts").''.$langs->trans("Bank").''.$langs->trans("Numero").''.$langs->trans("BankBalance").''.$langs->trans("Closed").''.$langs->trans("Numero").''.$langs->trans("Conciliable").''.$langs->trans("Status").''.$langs->trans("BankBalance").'
"; print ''.$acc->label.''; print "$acc->bank$acc->number'.price($solde).''.yn($acc->clos).'
'.yn($acc->rappro).''.$acc->status[$acc->clos].''.price($solde).'
'.$langs->trans("Total").''.price($total).' 
 '.$langs->trans("Total").''.price($total).'
 
 
'; print ''; -print ''; +print ''; +print ''; +print ''; +print ''; print "\n"; $total = 0; @@ -176,22 +190,26 @@ foreach ($accounts as $key=>$type) print ""; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; $total += $solde; } } // Total -print ''; +print ''; /* * Dettes */ print ''; -print ''; +print ''; // TVA if ($conf->compta->tva) @@ -204,7 +222,7 @@ if ($conf->compta->tva) $total = $total + $tva_solde; - print "".''; + print "".''; } @@ -216,10 +234,10 @@ $chs_a_payer = $chs->solde(); $total = $total - $chs_a_payer; -print "".''; +print "".''; // Total -print ''; +print ''; print "
'.$langs->trans("CashAccounts").'  '.$langs->trans("BankBalance").''.$langs->trans("Closed").'  '.$langs->trans("Status").''.$langs->trans("BankBalance").'
"; print ''.$acc->label.''; - print "$acc->bank '.price($solde).''.yn($acc->clos).'
'.$acc->bank.'  '.$acc->status[$acc->clos].''.price($solde).'
'.$langs->trans("Total").''.price($total).' 
 '.$langs->trans("Total").''.price($total).'
 
'.$langs->trans("Debts").'
'.$langs->trans("Debts").'
'.$langs->trans("VAT").''.price($tva_solde).' 
'.$langs->trans("VAT").''.price($tva_solde).'
'.$langs->trans("SocialContributions").''.price($chs_a_payer).' 
'.$langs->trans("SocialContributions").''.price($chs_a_payer).'
'.$langs->trans("Total").''.price($total).' 
 '.$langs->trans("Total").''.price($total).'
"; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index a428781f3d3..b43a05450ef 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -36,22 +36,22 @@ if (!$user->rights->banque->modifier) $langs->load("banks"); -llxHeader(); $rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"]; $html = new Form($db); + /* * Actions */ + if ($_GET["action"] == 'dvnext') { $ac = new Account($db); $ac->datev_next($_GET["rowid"]); } - if ($_GET["action"] == 'dvprev') { $ac = new Account($db); @@ -67,7 +67,6 @@ if ($_POST["action"] == 'confirm_delete_categ' && $_POST["confirm"] == "yes") } } - if ($_POST["action"] == 'class') { $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_POST["cat1"]; @@ -123,6 +122,12 @@ if ($_POST["action"] == 'num_releve') } +/* + * Affichage fiche ligne ecriture en mode edition + */ + +llxHeader(); + // On initialise la liste des categories $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;"; $result = $db->query($sql); @@ -141,19 +146,17 @@ if ($result) $db->free($result); } - - -print_titre("Edition de l'écriture bancaire"); - - -if ($_GET["action"] == 'delete_categ') -{ - $html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"],"Supprimer dans la catégorie","Etes-vous sûr de vouloir supprimer le classement dans la catégorie ?","confirm_delete_categ"); -} - $var=False; +$h=0; + + +$head[$h][0] = DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$_GET["rowid"]; +$head[$h][1] = $langs->trans('Card'); +$hselected=$h; +$h++; + +dolibarr_fiche_head($head, $hselected, $langs->trans('LineRecord').' : '.$_GET["rowid"]); -print ''; $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro,"; $sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, b.fk_account"; @@ -163,92 +166,108 @@ $sql.= " ORDER BY dateo ASC"; $result = $db->query($sql); if ($result) { - $i = 0; $total = 0; - if ($db->num_rows($result)) + $i = 0; $total = 0; + if ($db->num_rows($result)) { - $objp = $db->fetch_object($result); - $total = $total + $objp->amount; - - $acct=new Account($db,$objp->fk_account); - $acct->fetch($objp->fk_account); - $account = $acct->id; - // Account - print ""; + // Confirmations + if ($_GET["action"] == 'delete_categ') + { + $html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"],"Supprimer dans la catégorie","Etes-vous sûr de vouloir supprimer le classement dans la catégorie ?","confirm_delete_categ"); + print '
'; + } - print "rowid\">"; - print ""; + print '
".$langs->trans("Account")."".$acct->label."
'; - // Date - if (! $objp->rappro) - { - print ""; + + print "rowid\">"; + print ""; + + // Date + if (! $objp->rappro) + { + print "'; + print ""; + } + + // Value date + print ""; + print '"; + print ''; + + // Description + print "'; print ""; - } - // Value date - print ""; - print '"; - print ''; + // Amount + if (! $objp->rappro) + { + print "'; + print ""; + } - // Description - print "'; - print ""; + print ""; - // Amount - if (! $objp->rappro) - { - print "'; - print ""; - } + // Type paiement + print ""; - print ""; + // Author + print ""; + if ($objp->fk_user_author) { + $author=new User($db,$objp->fk_user_author); + $author->fetch(); + print ""; + } else { + print ""; + } + print ""; - // Type paiement - print ""; - - print "rowid\">"; - print ''; - print "'; - print ""; - print ""; + $i++; + } - // Author - print ""; - if ($objp->fk_user_author) { - $author=new User($db,$objp->fk_user_author); - $author->fetch(); - print ""; - } else { - print ""; - } - print ""; + // Releve rappro + if ($acct->rappro) + { + print "rowid\">"; + print ''; + print "'; + print ""; + print ""; + } - $i++; + print "
".$langs->trans("Date").""; - $html->select_date($objp->do); - //print 'do).'">'; + $objp = $db->fetch_object($result); + $total = $total + $objp->amount; + + $acct=new Account($db,$objp->fk_account); + $acct->fetch($objp->fk_account); + $account = $acct->id; + + // Account + print "
".$langs->trans("Account")."".$acct->label."
".$langs->trans("Date").""; + $html->select_date($objp->do); + print ' 
'.$langs->trans("DateValue").''.strftime("%d %b %Y",$objp->dv)."   "; + print ''; + print img_edit_remove() . " "; + print ''; + print img_edit_add() ."
".$langs->trans("Label").""; + print ''; print ' 
'.$langs->trans("DateValue").''.strftime("%d %b %Y",$objp->dv)."   "; - print ''; - print img_edit_remove() . " "; - print ''; - print img_edit_add() ."
".$langs->trans("Amount").""; + print ''; + print ' 
".$langs->trans("Label").""; - print ''; - print ' 
".$langs->trans("Amount").""; - print ''; - print ' 
".$langs->trans("Type").""; + print "
rowid\">"; + print ''; + print $html->select_types_paiements($objp->fk_type,"value",'',2); + print ''; + print '  '; + print "
"; + print "
".$langs->trans("Author")."".$author->fullname." 
".$langs->trans("Type").""; - print "
rowid\">"; - print ''; - print $html->select_types_paiements($objp->fk_type,"value",'',2); - print ''; - print '  '; - print "
"; - print "
".$langs->trans("AccountStatement").""; - print ''; - print ' 
".$langs->trans("Author")."".$author->fullname." 
".$langs->trans("Conciliation").""; + print $langs->trans("AccountStatement").' '; + print ' 
"; + + $db->free($result); } - $db->free($result); -} -print ""; +print ''; print '
'; diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 82e642443d4..4c7abafc103 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -60,7 +60,18 @@ ByCategories=By categories SearchTransaction=Search transaction TransactionsToConciliate=Transactions to conciliate Rappro=Conciliate +Conciliable=Conciliable Conciliate=Conciliate +Conciliation=Conciliation +ConciliationForAccount=Conciliate this account IncludeClosedAccount=Include closed accounts OnlyOpenedAccount=Only opened accounts -AccountToCredit=Account to credit \ No newline at end of file +AccountToCredit=Account to credit +DisableConciliation=Disable conciliation feature for this account +ConciliationDisabled=Conciliation feature disabled +StatusAccountOpened=Opened +StatusAccountClosed=Closed +AccountIdShort=Number +EditBankRecord=Edit record +LineRecord=Transaction +AddBankRecord=Add transaction \ No newline at end of file diff --git a/htdocs/langs/fr_FR/banks.lang b/htdocs/langs/fr_FR/banks.lang index 1fbdb31fe65..00f5c249dba 100644 --- a/htdocs/langs/fr_FR/banks.lang +++ b/htdocs/langs/fr_FR/banks.lang @@ -60,7 +60,18 @@ ByCategories=Par cat SearchTransaction=Recherche écriture TransactionsToConciliate=Ecritures à rapprocher Rappro=Rapprocher +Conciliable=Rapprochable Conciliate=Rapprocher +Conciliation=Rapprochement +ConciliationForAccount=Rapprochements sur ce compte IncludeClosedAccount=Inclure comptes fermés OnlyOpenedAccount=Uniquement comptes ouverts -AccountToCredit=Compte à créditer \ No newline at end of file +AccountToCredit=Compte à créditer +DisableConciliation=Désactiver la fonction de rapprochement pour ce compte +ConciliationDisabled=Fonction rapprochement désactivée +StatusAccountOpened=Ouvert +StatusAccountClosed=Fermé +AccountIdShort=Numéro +EditBankRecord=Editer écriture +LineRecord=Ecriture +AddBankRecord=Ajouter écriture \ No newline at end of file diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 8117ae1075c..a99b18629e6 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -176,6 +176,7 @@ if (! defined('PEAR_PATH')) { define('PEAR_PATH', DOL_DOCUMEN if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH',DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); } if (! defined('PHPLOT_PATH')) { define('PHPLOT_PATH', DOL_DOCUMENT_ROOT .'/includes/phplot/'); } if (! defined('MAGPIERSS_PATH')) { define('MAGPIERSS_PATH', DOL_DOCUMENT_ROOT .'/includes/magpierss/'); } +if (! defined('JPGRAPH_PATH')) { define('JPGRAPH_PATH', DOL_DOCUMENT_ROOT .'/includes/jpgraph/'); } define('FPDF_FONTPATH', FPDF_PATH . 'font/'); define('MAGPIE_DIR', MAGPIERSS_PATH); @@ -233,6 +234,8 @@ $conf->compta->enabled=defined("MAIN_MODULE_COMPTABILITE")?MAIN_MODULE_COMPTABIL $conf->compta->dir_output=DOL_DATA_ROOT."/compta"; $conf->compta->dir_images=DOL_DATA_ROOT."/compta/images"; $conf->banque->enabled=defined("MAIN_MODULE_BANQUE")?MAIN_MODULE_BANQUE:0; +$conf->banque->dir_output=DOL_DATA_ROOT."/banque"; +$conf->banque->dir_images=DOL_DATA_ROOT."/banque/images"; $conf->caisse->enabled=defined("MAIN_MODULE_CAISSE")?MAIN_MODULE_CAISSE:0; $conf->don->enabled=defined("MAIN_MODULE_DON")?MAIN_MODULE_DON:0; $conf->syslog->enabled=defined("MAIN_MODULE_SYSLOG")?MAIN_MODULE_SYSLOG:0; diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 98440e1ac27..abe0e14a516 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -153,7 +153,7 @@ if ($modulepart) $user->getrights('prelevement'); if ($user->rights->prelevement->bons->lire) $accessallowed=1; - $original_file=DOL_DATA_ROOT.'/prelevement/bon/'.$original_file; + $original_file=$conf->prelevement->dir_output.'/bon/'.$original_file; } // Wrapping pour les graph telephonie @@ -178,7 +178,7 @@ if ($modulepart) if ($modulepart == 'bank') { $accessallowed=1; - $original_file=DOL_DATA_ROOT.'/graph/banque/'.$original_file; + $original_file=$conf->banque->dir_images.'/'.$original_file; } }