From ce6df7c022446ec68a803f7616faaa35bfc15aa6 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 29 Mar 2015 09:20:32 +0200 Subject: [PATCH] Debug --- htdocs/compta/bank/account.php | 22 +-- htdocs/core/lib/donation.lib.php | 5 - htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/don/card.php | 33 +++-- htdocs/don/class/don.class.php | 4 +- ...tionstats.class.php => donstats.class.php} | 0 htdocs/don/class/paymentdonation.class.php | 83 +++++------- htdocs/don/document.php | 125 ------------------ htdocs/don/payment/card.php | 21 +-- htdocs/don/stats/index.php | 3 +- htdocs/langs/en_US/donations.lang | 1 + 12 files changed, 71 insertions(+), 230 deletions(-) rename htdocs/don/class/{donationstats.class.php => donstats.class.php} (100%) delete mode 100644 htdocs/don/document.php diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 329ba2149cf..20ef8bcc3cc 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -47,6 +47,7 @@ $langs->load("categories"); $langs->load("bills"); $langs->load("companies"); $langs->load("loan"); +$langs->load("donations"); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int')); $ref = GETPOST('ref','alpha'); @@ -617,6 +618,12 @@ if ($id > 0 || ! empty($ref)) print ' '.img_object($langs->trans('ShowPayment'),'payment').' '; print ''; } + elseif ($links[$key]['type']=='payment_donation') + { + print ''; + print ' '.img_object($langs->trans('ShowPayment'),'payment').' '; + print ''; + } elseif ($links[$key]['type']=='banktransfert') { // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail. @@ -716,21 +723,6 @@ if ($id > 0 || ! empty($ref)) $chargestatic->ref=$chargestatic->lib; print $chargestatic->getNomUrl(1,16); } - else if ($links[$key]['type']=='donation') - { - $donstatic->id=$links[$key]['url_id']; - if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg)) - { - if ($reg[1]=='donation') $reg[1]='Donation'; - $donstatic->lib=$langs->trans($reg[1]); - } - else - { - $donstatic->lib=$links[$key]['label']; - } - $donstatic->ref=$donstatic->lib; - print $donstatic->getNomUrl(1,16); - } else if ($links[$key]['type']=='loan') { $loanstatic->id=$links[$key]['url_id']; diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 4155d5ce60e..ed6407b1e84 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -78,11 +78,6 @@ function donation_prepare_head($object) // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation'); - - $head[$h][0] = DOL_URL_ROOT . '/don/document.php?id='.$object->id; - $head[$h][1] = $langs->trans("Documents"); - $head[$h][2] = 'documents'; - $h++; $head[$h][0] = DOL_URL_ROOT . '/don/info.php?id=' . $object->id; $head[$h][1] = $langs->trans("Info"); diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 3eab01619f1..ffb33138bcc 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -175,7 +175,7 @@ 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->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'accountancy', 'donations', 6__+MAX_llx_menu__, '/don/index.php?leftmenu=donations&mainmenu=accountancy', 'Donations', 0, 'donations', '$user->rights->don->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->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/card.php?leftmenu=donations&mainmenu=accountancy&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 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->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/list.php?leftmenu=donations&mainmenu=accountancy', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 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->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=accountancy', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 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->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=accountancy', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- Special expenses 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 || $conf->salaries->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'accountancy', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read)', '', 0, 6, __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->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'accountancy', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=accountancy', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 1d35db720b7..9eba6b79dd6 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -810,7 +810,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=accountancy",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); if (empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/don/card.php?action=create",$langs->trans("NewDonation"), 1, $user->rights->don->creer); if (empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/don/list.php",$langs->trans("List"), 1, $user->rights->don->lire); - if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->rights->don->lire); + // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->rights->don->lire); } // Taxes and social contributions diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 8f33ee7fb1b..d3ce60a5381 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -214,7 +214,7 @@ if ($action == 'set_cancel') } if ($action == 'set_paid') { - if ($object->set_paye($id, $modepayment) >= 0) + if ($object->set_paid($id, $modepayment) >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; @@ -223,17 +223,6 @@ if ($action == 'set_paid') setEventMessage($object->error, 'errors'); } } -if ($action == 'set_encaisse') -{ - if ($object->set_encaisse($id) >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); - exit; - } - else { - setEventMessage($object->error, 'errors'); - } -} /* * Build doc @@ -398,6 +387,7 @@ if (! empty($id) && $action == 'edit') print ''; print ''; + print ''; // Ref print "".''.$langs->trans("Ref").''; @@ -408,13 +398,22 @@ if (! empty($id) && $action == 'edit') $nbrows=12; if (! empty($conf->projet->enabled)) $nbrows++; - // Date + // Date print "".''.$langs->trans("Date").''; $form->select_date($object->date,'','','','',"update"); print ''; // Amount - print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).''; + if ($object->statut == 0) + { + print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).''; + } + else + { + print ''.$langs->trans("Amount").''; + print price($object->amount,0,$langs,0,0,-1,$conf->currency); + print ''; + } print ''.$langs->trans("PublicDonation").""; print $form->selectyesno("public",1,1); @@ -549,7 +548,7 @@ if (! empty($id) && $action != 'edit') /* * Payments */ - $sql = "SELECT p.rowid, p.num_payment, datep as dp, p.amount,"; + $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount,"; $sql.= "c.code as type_code,c.libelle as paiement_type"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_donation as p"; $sql.= ", ".MAIN_DB_PREFIX."c_paiement as c "; @@ -558,7 +557,7 @@ if (! empty($id) && $action != 'edit') $sql.= " AND p.fk_donation = d.rowid"; $sql.= " AND d.entity = ".$conf->entity; $sql.= " AND p.fk_typepayment = c.id"; - $sql.= " ORDER BY dp DESC"; + $sql.= " ORDER BY dp"; //print $sql; $resql = $db->query($sql); @@ -581,7 +580,7 @@ if (! empty($id) && $action != 'edit') $objp = $db->fetch_object($resql); $var=!$var; print ""; - print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''; + print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''; print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; $labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->paiement_type; print "".$labeltype.' '.$object->num_paiement."\n"; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index c4f9d66a3ec..ce041351eed 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -718,7 +718,7 @@ class Don extends CommonObject { $sql .= ", fk_payment=$modepayment"; } - $sql .= " WHERE rowid = $rowid AND fk_statut = 1"; + $sql .= " WHERE rowid = $id AND fk_statut = 1"; $resql=$this->db->query($sql); if ($resql) @@ -809,7 +809,7 @@ class Don extends CommonObject $result=''; $label=$langs->trans("ShowDonation").': '.$this->id; - $link = ''; + $link = ''; $linkend=''; $picto='generic'; diff --git a/htdocs/don/class/donationstats.class.php b/htdocs/don/class/donstats.class.php similarity index 100% rename from htdocs/don/class/donationstats.class.php rename to htdocs/don/class/donstats.class.php diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 4a42c677ec9..a6c56f9f235 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -82,14 +82,14 @@ class PaymentDonation extends CommonObject } // Clean parameters - if (isset($this->fk_donation)) $this->fk_donation=trim($this->fk_donation); - if (isset($this->amount)) $this->amount=trim($this->amount); - if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment); - if (isset($this->num_payment)) $this->num_payment=trim($this->num_payment); - if (isset($this->note)) $this->note=trim($this->note); - if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank); - if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat); - if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif); + if (isset($this->fk_donation)) $this->fk_donation=trim($this->fk_donation); + if (isset($this->amount)) $this->amount=trim($this->amount); + if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment); + if (isset($this->num_payment)) $this->num_payment=trim($this->num_payment); + if (isset($this->note)) $this->note=trim($this->note); + if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank); + if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat); + if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif); $totalamount = 0; foreach ($this->amounts as $key => $value) // How payment is dispatch @@ -183,23 +183,23 @@ class PaymentDonation extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->rowid; - $this->fk_donation = $obj->fk_donation; - $this->datec = $this->db->jdate($obj->datec); - $this->tms = $this->db->jdate($obj->tms); - $this->datep = $this->db->jdate($obj->datep); - $this->amount = $obj->amount; - $this->fk_typepayment = $obj->fk_typepayment; - $this->num_payment = $obj->num_payment; - $this->note = $obj->note; - $this->fk_bank = $obj->fk_bank; - $this->fk_user_creat = $obj->fk_user_creat; - $this->fk_user_modif = $obj->fk_user_modif; + $this->fk_donation = $obj->fk_donation; + $this->datec = $this->db->jdate($obj->datec); + $this->tms = $this->db->jdate($obj->tms); + $this->datep = $this->db->jdate($obj->datep); + $this->amount = $obj->amount; + $this->fk_typepayment = $obj->fk_typepayment; + $this->num_payment = $obj->num_payment; + $this->note = $obj->note; + $this->fk_bank = $obj->fk_bank; + $this->fk_user_creat = $obj->fk_user_creat; + $this->fk_user_modif = $obj->fk_user_modif; - $this->type_code = $obj->type_code; - $this->type_libelle = $obj->type_libelle; + $this->type_code = $obj->type_code; + $this->type_libelle = $obj->type_libelle; - $this->bank_account = $obj->fk_account; - $this->bank_line = $obj->fk_bank; + $this->bank_account = $obj->fk_account; + $this->bank_line = $obj->fk_bank; } $this->db->free($resql); @@ -227,14 +227,14 @@ class PaymentDonation extends CommonObject // Clean parameters - if (isset($this->fk_donation)) $this->fk_donation=trim($this->fk_donation); - if (isset($this->amount)) $this->amount=trim($this->amount); - if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment); - if (isset($this->num_payment)) $this->num_payment=trim($this->num_payment); - if (isset($this->note)) $this->note=trim($this->note); - if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank); - if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat); - if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif); + if (isset($this->fk_donation)) $this->fk_donation=trim($this->fk_donation); + if (isset($this->amount)) $this->amount=trim($this->amount); + if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment); + if (isset($this->num_payment)) $this->num_payment=trim($this->num_payment); + if (isset($this->note)) $this->note=trim($this->note); + if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank); + if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat); + if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif); @@ -482,14 +482,14 @@ class PaymentDonation extends CommonObject $acc->fetch($accountid); $total=$this->total; - if ($mode == 'payment_donation') $total=-$total; + if ($mode == 'payment_donation') $amount=$total; // Insert payment into llx_bank $bank_line_id = $acc->addline( $this->datepaid, $this->paymenttype, // Payment mode id or code ("CHQ or VIR for example") $label, - $total, + $amount, $this->num_payment, '', $user, @@ -520,19 +520,6 @@ class PaymentDonation extends CommonObject dol_print_error($this->db); } } - - // Add link 'thirdparty' in bank_url between donation and bank transaction (for each donation concerned by payment) - $linkaddedforthirdparty=array(); - foreach ($this->amounts as $key => $value) - { - if ($mode == 'payment_donation') - { - $don = new Don($this->db); - $don->fetch($key); - $result=$acc->add_url_line($bank_line_id, $don->rowid, DOL_URL_ROOT.'/don/card.php?rowid=', $don->type_libelle.(($don->lib && $don->lib!=$don->type_libelle)?' ('.$don->lib.')':''),'donation'); - if ($result <= 0) dol_print_error($this->db); - } - } } else { @@ -553,7 +540,7 @@ class PaymentDonation extends CommonObject /** - * Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee + * Update link between the donation payment and the generated line in llx_bank * * @param int $id_bank Id if bank * @return int >0 if OK, <=0 if KO @@ -593,7 +580,7 @@ class PaymentDonation extends CommonObject if (!empty($this->id)) { - $link = ''; + $link = ''; $linkend=''; if ($withpicto) $result.=($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' '); diff --git a/htdocs/don/document.php b/htdocs/don/document.php deleted file mode 100644 index 200e4180252..00000000000 --- a/htdocs/don/document.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/don/document.php - * \ingroup donations - * \brief Page of linked files into donations - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; - -$langs->load("other"); -$langs->load("donations"); -$langs->load("companies"); -$langs->load("interventions"); - -$id = GETPOST('id','int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action','alpha'); -$confirm = GETPOST('confirm','alpha'); - -// Security check -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'don', $id, ''); - -// Get parameters -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); -if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="name"; - -$object = new Don($db); -$object->fetch($id, $ref); - -$upload_dir = $conf->dons->dir_output.'/'.dol_sanitizeFileName($object->ref); -$modulepart='don'; - - -/* - * Actions - */ - -include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; - - -/* - * View - */ - -$form = new Form($db); - -llxHeader("","",$langs->trans("Don")); - - -if ($object->id) -{ - $object->fetch_thirdparty(); - - $head=donation_prepare_head($object); - - dol_fiche_head($head, 'documents', $langs->trans("Don"), 0, 'bill'); - - - // Built files list - $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - $totalsize=0; - foreach($filearray as $key => $file) - { - $totalsize+=$file['size']; - } - - - print ''; - - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - print ''; - print ''; - print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', ''); - print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - - print ''; - - $modulepart = 'don'; - $permission = $user->rights->don->creer; - $param = '&id=' . $object->id; - include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - -} -else -{ - print $langs->trans("ErrorUnknown"); -} - -llxFooter(); - -$db->close(); diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 5cdb7f20446..4c59f566ba5 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -126,7 +126,7 @@ $head[$h][1] = $langs->trans("Card"); $hselected = $h; $h++; -dol_fiche_head($head, $hselected, $langs->trans("PaymentDonation"), 0, 'payment'); +dol_fiche_head($head, $hselected, $langs->trans("DonationPayment"), 0, 'payment'); /* * Confirmation de la suppression du paiement @@ -151,19 +151,19 @@ if ($action == 'valide') print ''; // Ref -print ''; +print ''; print ''; // Date -print ''; +print ''; // Mode print ''; // Number -print ''; +print ''; // Amount print ''; @@ -196,7 +196,7 @@ print '
'.$langs->trans('Ref').'
'.$langs->trans('Ref').''; print $form->showrefnav($payment,'id','',1,'rowid','id'); print '
'.$langs->trans('Date').''.dol_print_date($payment->datep,'day').'
'.$langs->trans('Date').''.dol_print_date($payment->datep,'day').'
'.$langs->trans('Mode').''.$langs->trans("PaymentType".$payment->type_code).'
'.$langs->trans('Number').''.$payment->num_paiement.'
'.$langs->trans('Number').''.$payment->num_payment.'
'.$langs->trans('Amount').''.price($payment->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'; */ $disable_delete = 0; -$sql = 'SELECT d.rowid as did, d.libelle, d.paid, d.amount as d_amount, pd.amount, pd.libelle as d_type'; +$sql = 'SELECT d.rowid as did, d.paid, d.amount as d_amount, pd.amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'payment_donation as pd,'.MAIN_DB_PREFIX.'don as d'; $sql.= ' WHERE pd.fk_donation = d.rowid'; $sql.= ' AND d.entity = '.$conf->entity; @@ -213,9 +213,7 @@ if ($resql) print '
'; print ''; print ''; - print ''; - print ''; - print ''; + print ''; print ''; print ''; print "\n"; @@ -235,13 +233,6 @@ if ($resql) $don->fetch($objp->did); print $don->getNomUrl(1); print "\n"; - // Type - print '\n"; - // Label - print ''; // Expected to pay print ''; // Status diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 798b1b5a392..91f4465f376 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 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 @@ -25,7 +26,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -require_once DOL_DOCUMENT_ROOT.'/don/class/dontats.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/donstats.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang index 627cc9a076c..8b4c2ca8756 100644 --- a/htdocs/langs/en_US/donations.lang +++ b/htdocs/langs/en_US/donations.lang @@ -40,3 +40,4 @@ FrenchOptions=Options for France DONATION_ART200=Show article 200 from CGI if you are concerned DONATION_ART238=Show article 238 from CGI if you are concerned DONATION_ART885=Show article 885 from CGI if you are concerned +DonationPayment=Donation payment
'.$langs->trans('Donation').''.$langs->trans('Type').''.$langs->trans('Label').''.$langs->trans('ExpectedToPay').''.$langs->trans('ExpectedToPay').''.$langs->trans('Status').''.$langs->trans('PayedByThisPayment').'
'; - print $don->type_libelle; - /*print $don->type;*/ - print "'.$objp->libelle.''.price($objp->d_amount).'