From 68c971a2b5db057cf8c29572f3a5b7a0a27ed235 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Nov 2019 11:12:57 +0100 Subject: [PATCH] All properties 'type_libelle' were renamed into 'type_label'. --- ChangeLog | 1 + htdocs/compta/charges/index.php | 8 +- htdocs/compta/index.php | 7 +- htdocs/compta/paiement/card.php | 2 +- .../compta/paiement/class/paiement.class.php | 6 +- htdocs/compta/paiement_charge.php | 2 +- htdocs/compta/payment_sc/card.php | 2 +- htdocs/compta/sociales/card.php | 2 +- .../sociales/class/chargesociales.class.php | 10 +-- .../class/paymentsocialcontribution.class.php | 6 +- htdocs/compta/sociales/list.php | 12 +-- htdocs/core/class/html.form.class.php | 10 ++- htdocs/don/class/paymentdonation.class.php | 22 ++--- htdocs/don/payment/card.php | 6 +- htdocs/don/payment/payment.php | 80 ++++++++----------- .../class/paymentexpensereport.class.php | 28 +++---- htdocs/expensereport/payment/card.php | 6 +- htdocs/expensereport/payment/payment.php | 22 ++--- htdocs/fourn/class/paiementfourn.class.php | 4 +- htdocs/fourn/paiement/card.php | 2 +- .../install/mysql/migration/10.0.0-11.0.0.sql | 2 + htdocs/langs/en_US/donations.lang | 1 + htdocs/loan/class/loanschedule.class.php | 8 +- htdocs/loan/class/paymentloan.class.php | 8 +- 24 files changed, 133 insertions(+), 124 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fa1458c534..2c534cfff8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ Following changes may create regressions for some external modules, but were nec * If your logo was visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible agin in menu. * All properties 'libstatut', 'labelstatut', 'labelstatus' were renamed into 'labelStatus'. * All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'. +* All properties 'type_libelle' were renamed into 'type_label'. ***** ChangeLog for 10.0.3 compared to 10.0.2 ***** IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card. diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 04c2cdd76d1..9694166590f 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -138,7 +138,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder); print "\n"; - $sql = "SELECT c.id, c.libelle as lib,"; + $sql = "SELECT c.id, c.libelle as label,"; $sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,"; $sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,"; $sql.= " pct.code as payment_code,"; @@ -185,12 +185,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) // Label print ''; $socialcontrib->id=$obj->rowid; - $socialcontrib->ref=$obj->rowid; - $socialcontrib->label=$obj->libelle; + $socialcontrib->ref=$obj->label; + $socialcontrib->label=$obj->label; print $socialcontrib->getNomUrl(1, '20'); print ''; // Type - print ''.$obj->lib.''; + print ''.$obj->label.''; // Expected to pay print ''.price($obj->total).''; // Ref payment diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index fb23929f7a8..a7df3685175 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -624,12 +624,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $chargestatic=new ChargeSociales($db); $sql = "SELECT c.rowid, c.amount, c.date_ech, c.paye,"; - $sql.= " cc.libelle,"; + $sql.= " cc.libelle as label,"; $sql.= " SUM(pc.amount) as sumpaid"; $sql.= " FROM (".MAIN_DB_PREFIX."c_chargesociales as cc, ".MAIN_DB_PREFIX."chargesociales as c)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = c.rowid"; $sql.= " WHERE c.fk_type = cc.id"; - $sql.= " AND c.entity = ".$conf->entity; + $sql.= " AND c.entity IN (".getEntity('tax').')'; $sql.= " AND c.paye = 0"; // Add where from hooks $parameters=array(); @@ -662,7 +662,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $chargestatic->id=$obj->rowid; $chargestatic->ref=$obj->rowid; - $chargestatic->label=$obj->libelle; + $chargestatic->label=$obj->label; $chargestatic->paye=$obj->paye; print ''; @@ -672,6 +672,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''.price($obj->sumpaid).''; print ''.$chargestatic->getLibStatut(3).''; print ''; + $tot_ttc+=$obj->amount; $i++; } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index e11da654bdd..3def70036ee 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -220,7 +220,7 @@ print $form->editfieldval("Date", 'datep', $object->date, $object, $user->rights print ''; // Payment type (VIR, LIQ, ...) -$labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->type_libelle; +$labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->type_label; print ''.$langs->trans('PaymentMode').''.$labeltype; print $object->num_paiement?' - '.$object->num_paiement:''; print ''; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index e6d2a27087c..e4a4a275029 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -78,7 +78,7 @@ class Paiement extends CommonObject /** * @var string type libelle */ - public $type_libelle; + public $type_label; /** * @var string type code @@ -160,7 +160,7 @@ class Paiement extends CommonObject public function fetch($id, $ref = '', $fk_bank = '') { $sql = 'SELECT p.rowid, p.ref, p.datep as dp, p.amount, p.statut, p.ext_payment_id, p.ext_payment_site, p.fk_bank,'; - $sql.= ' c.code as type_code, c.libelle as type_libelle,'; + $sql.= ' c.code as type_code, c.libelle as type_label,'; $sql.= ' p.num_paiement as num_payment, p.note,'; $sql.= ' b.fk_account'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; @@ -188,7 +188,7 @@ class Paiement extends CommonObject $this->montant = $obj->amount; // deprecated $this->amount = $obj->amount; $this->note = $obj->note; - $this->type_libelle = $obj->type_libelle; + $this->type_label = $obj->type_label; $this->type_code = $obj->type_code; $this->statut = $obj->statut; $this->ext_payment_id = $obj->ext_payment_id; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 6cc91072a34..e2a4bdac11f 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -202,7 +202,7 @@ if ($action == 'create') print ''; print ''; - print '\n"; + print '\n"; print '\n"; print '\n"; /*print '\n"; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 605f5cec3bc..aaff1a99c9f 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -259,7 +259,7 @@ if ($resql) print "\n"; // Type print '\n"; // Label diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index e2bf729a396..3054e64320e 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -514,7 +514,7 @@ if ($id > 0) print '
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Type")."".$charge->type_libelle."
'.$langs->trans("Type")."".$charge->type_label."
'.$langs->trans("Period")."".dol_print_date($charge->periode, 'day')."
'.$langs->trans("Label").''.$charge->label."
'.$langs->trans("DateDue")."".dol_print_date($charge->date_ech,'day')."
'; - print $socialcontrib->type_libelle; + print $socialcontrib->type_label; /*print $socialcontrib->type;*/ print "
'; // Type - print '"; + print '"; print ""; // Period end date diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 50474f3d52c..fe3f8267c3d 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -57,7 +57,7 @@ class ChargeSociales extends CommonObject public $date_ech; public $label; public $type; - public $type_libelle; + public $type_label; public $amount; public $paye; public $periode; @@ -136,7 +136,7 @@ class ChargeSociales extends CommonObject $this->lib = $obj->label; $this->label = $obj->label; $this->type = $obj->fk_type; - $this->type_libelle = $obj->libelle; + $this->type_label = $obj->libelle; $this->fk_account = $obj->fk_account; $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; @@ -556,8 +556,8 @@ class ChargeSociales extends CommonObject $label .= '
'.$langs->trans('Ref') . ': ' . $this->ref; if (! empty($this->label)) $label .= '
'.$langs->trans('Label') . ': ' . $this->label; - if (! empty($this->type_libelle)) - $label .= '
'.$langs->trans('Type') . ': ' . $this->type_libelle; + if (! empty($this->type_label)) + $label .= '
'.$langs->trans('Type') . ': ' . $this->type_label; $linkclose=''; if (empty($notooltip) && $user->rights->facture->lire) @@ -689,6 +689,6 @@ class ChargeSociales extends CommonObject $this->amount=100; $this->label = 'Social contribution label'; $this->type = 1; - $this->type_libelle = 'Type of social contribution'; + $this->type_label = 'Type of social contribution'; } } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index e13738fd5f4..4fb2f27b53f 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -236,7 +236,7 @@ class PaymentSocialContribution extends CommonObject $sql.= " t.fk_bank,"; $sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_modif,"; - $sql.= " pt.code as type_code, pt.libelle as type_libelle,"; + $sql.= " pt.code as type_code, pt.libelle as type_label,"; $sql.= ' b.fk_account'; $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as t LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepaiement = pt.id"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid'; @@ -267,7 +267,7 @@ class PaymentSocialContribution extends CommonObject $this->fk_user_modif = $obj->fk_user_modif; $this->type_code = $obj->type_code; - $this->type_libelle = $obj->type_libelle; + $this->type_label = $obj->type_label; $this->bank_account = $obj->fk_account; $this->bank_line = $obj->fk_bank; @@ -592,7 +592,7 @@ class PaymentSocialContribution extends CommonObject { $socialcontrib = new ChargeSociales($this->db); $socialcontrib->fetch($key); - $result=$acc->add_url_line($bank_line_id, $socialcontrib->id, DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_libelle.(($socialcontrib->lib && $socialcontrib->lib!=$socialcontrib->type_libelle)?' ('.$socialcontrib->lib.')':''), 'sc'); + $result=$acc->add_url_line($bank_line_id, $socialcontrib->id, DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_label.(($socialcontrib->lib && $socialcontrib->lib!=$socialcontrib->type_label)?' ('.$socialcontrib->lib.')':''), 'sc'); if ($result <= 0) dol_print_error($this->db); } } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index c2d5c94d1a3..06e0135dd67 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -110,8 +110,8 @@ $chargesociale_static=new ChargeSociales($db); llxHeader('', $langs->trans("SocialContributions")); $sql = "SELECT cs.rowid as id, cs.fk_type as type, "; -$sql.= " cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode,"; -$sql.= " c.libelle as type_lib,"; +$sql.= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode,"; +$sql.= " c.libelle as type_label,"; $sql.= " SUM(pc.amount) as alreadypayed"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; @@ -261,8 +261,8 @@ if ($resql) $chargesociale_static->id=$obj->id; $chargesociale_static->ref=$obj->id; - $chargesociale_static->label=$obj->libelle; - $chargesociale_static->type_libelle=$obj->type_lib; + $chargesociale_static->label=$obj->label; + $chargesociale_static->type_label=$obj->type_label; print ''; @@ -272,10 +272,10 @@ if ($resql) print ''; // Label - print ''; + print ''; // Type - print ''; + print ''; // Date end period print ' // Amount print ''; -// Note -print ''; +// Note public +print ''; // Bank account if (! empty($conf->banque->enabled)) @@ -282,7 +282,7 @@ if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) } */ -if ($_GET['action'] == '') +if (empty($action)) { if ($user->rights->don->supprimer) { diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 612ea5a553b..72882a79068 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -39,6 +39,8 @@ if ($user->societe_id > 0) { $socid = $user->societe_id; } +$object = new Don($db); + /* * Actions @@ -59,17 +61,17 @@ if ($action == 'add_payment') if (! $_POST["paymenttype"] > 0) { - $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), null, 'errors'); $error++; } if ($datepaid == '') { - $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); $error++; } if (! empty($conf->banque->enabled) && ! $_POST["accountid"] > 0) { - $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); $error++; } @@ -103,9 +105,9 @@ if ($action == 'add_payment') $payment->chid = $chid; $payment->datepaid = $datepaid; $payment->amounts = $amounts; // Tableau de montant - $payment->paymenttype = $_POST["paymenttype"]; - $payment->num_payment = $_POST["num_payment"]; - $payment->note = $_POST["note"]; + $payment->paymenttype = GETPOST("paymenttype", 'int'); + $payment->num_payment = GETPOST("num_payment", 'alphanohtml'); + $payment->note_public = GETPOST("note_public", 'none'); if (! $error) { @@ -143,7 +145,7 @@ if ($action == 'add_payment') } } - $_GET["action"]='create'; + $action = 'create'; } @@ -151,26 +153,32 @@ if ($action == 'add_payment') * View */ +$form=new Form($db); + llxHeader(); -$form=new Form($db); + +$sql = "SELECT sum(p.amount) as total"; +$sql.= " FROM ".MAIN_DB_PREFIX."payment_donation as p"; +$sql.= " WHERE p.fk_donation = ".$chid; +$resql = $db->query($sql); +if ($resql) +{ + $obj=$db->fetch_object($resql); + $sumpaid = $obj->total; + $db->free(); +} // Form to create donation payment -if (GETPOST('action', 'aZ09') == 'create') +if ($action == 'create') { - $don = new Don($db); - $don->fetch($chid); + $object->fetch($chid); - $total = $don->amount; + $total = $object->amount; print load_fiche_titre($langs->trans("DoPayment")); - if ($mesg) - { - print "
$mesg
"; - } - print ''; print ''; print ''; @@ -179,47 +187,24 @@ if (GETPOST('action', 'aZ09') == 'create') dol_fiche_head(); - print '
'.$langs->trans("Type")."".$object->type_libelle."
'.$langs->trans("Type")."".$object->type_label."
'.dol_trunc($obj->libelle, 42).''.dol_trunc($obj->label, 42).''.$obj->type_lib.''.$obj->type_label.''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6790ec43cae..41633f927c8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5344,13 +5344,14 @@ class Form * @param int $disabled Disable input fields * @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59 * @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field. - * @param datetime $adddateof Add a link "Date of invoice" using the following date. - * @param string $openinghours Specify hour strat and hour end for the select ex 8,20 + * @param datetime $adddateof Add a link "Date of invoice" using the following date. See also $labeladddateof for the label used. + * @param string $openinghours Specify hour start and hour end for the select ex 8,20 * @param int $stepminutes Specify step for minutes between 1 and 30 + * @param string $labeladddateof Label to use for the $adddateof parameter. * @return string Html for selectDate * @see form_date(), select_month(), select_year(), select_dayofweek() */ - public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '', $openinghours = '', $stepminutes = 1) + public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '', $openinghours = '', $stepminutes = 1, $labeladddateof = '') { global $conf,$langs; @@ -5737,7 +5738,8 @@ class Form if ($conf->use_javascript_ajax && $adddateof) { $tmparray=dol_getdate($adddateof); - $retstring.=' -
'.$langs->trans('Number').''.$object->num_payment.'
'.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Note').''.nl2br($object->note).'
'.$langs->trans('Note').''.nl2br($object->note_public).'
'; - - print ''; - - print ''; - print '\n"; - print ''; - - $sql = "SELECT sum(p.amount) as total"; - $sql.= " FROM ".MAIN_DB_PREFIX."payment_donation as p"; - $sql.= " WHERE p.fk_donation = ".$chid; - $resql = $db->query($sql); - if ($resql) - { - $obj=$db->fetch_object($resql); - $sumpaid = $obj->total; - $db->free(); - } - print ''; - print ''; - - print ''; - print "'; - print ''; + print '
'.$langs->trans("Donation").'
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Date")."".dol_print_date($don->date, 'day')."
'.$langs->trans("Amount")."".price($don->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans("AlreadyPaid").''.price($sumpaid, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans("RemainderToPay").''.price($total-$sumpaid, 0, $outputlangs, 1, -1, -1, $conf->currency).'
".$langs->trans("Payment").'
'; print '"; print ''; print '\n"; print ''; print ''; print ''; print ''; // Number @@ -230,7 +215,7 @@ if (GETPOST('action', 'aZ09') == 'create') print ''; print ''; - print ''; + print ''; print ''; print '
'.$langs->trans("Date").''; $datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaid):0; - print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); + print $form->selectDate($datepayment, '', 0, 0, 0, "add_payment", 1, 1, 0, '', '', $object->date, '', 1, $langs->trans("DonationDate")); print "
'.$langs->trans("PaymentMode").''; - $form->select_types_paiements(isset($_POST["paymenttype"])?$_POST["paymenttype"]:$don->paymenttype, "paymenttype"); + $form->select_types_paiements(isset($_POST["paymenttype"])?$_POST["paymenttype"]:$object->paymenttype, "paymenttype"); print "
'.$langs->trans('AccountToCredit').''; - $form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$don->accountid, "accountid", 0, '', 1); // Show open bank account list + $form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$object->accountid, "accountid", 0, '', 1); // Show open bank account list print '
'.$langs->trans("Comments").'
'; @@ -246,6 +231,7 @@ if (GETPOST('action', 'aZ09') == 'create') print ''; print ''; + print ''; print ''; print ''; print ''; @@ -257,10 +243,12 @@ if (GETPOST('action', 'aZ09') == 'create') while ($i < $num) { - $objp = $don; + $objp = $object; print ''; + print '"; + print '"; print '"; diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 074250d2347..6fb4e539d9d 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -25,8 +25,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -/** \class PaymentExpenseReport - * \brief Class to manage payments of expense report +/** + * Class to manage payments of expense report */ class PaymentExpenseReport extends CommonObject { @@ -83,9 +83,9 @@ class PaymentExpenseReport extends CommonObject */ public $fk_user_modif; - //Unknow field - public $chid; - public $total; + public $type_code; + public $type_label; + /** * Constructor @@ -124,10 +124,10 @@ class PaymentExpenseReport extends CommonObject 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->note_public)) $this->note_public=trim($this->note_public); 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 (! empty($this->fk_expensereport)) $this->chid = $this->fk_expensereport; $totalamount = 0; foreach ($this->amounts as $key => $value) // How payment is dispatch @@ -148,10 +148,10 @@ class PaymentExpenseReport extends CommonObject { $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_expensereport (fk_expensereport, datec, datep, amount,"; $sql.= " fk_typepayment, num_payment, note, fk_user_creat, fk_bank)"; - $sql.= " VALUES ($this->chid, '".$this->db->idate($now)."',"; + $sql.= " VALUES ($this->fk_expensereport, '".$this->db->idate($now)."',"; $sql.= " '".$this->db->idate($this->datepaid)."',"; $sql.= " ".$totalamount.","; - $sql.= " ".$this->fk_typepayment.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.","; + $sql.= " ".$this->fk_typepayment.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".$user->id.","; $sql.= " 0)"; dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -188,7 +188,6 @@ class PaymentExpenseReport extends CommonObject */ public function fetch($id) { - global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; $sql.= " t.fk_expensereport,"; @@ -198,11 +197,11 @@ class PaymentExpenseReport extends CommonObject $sql.= " t.amount,"; $sql.= " t.fk_typepayment,"; $sql.= " t.num_payment,"; - $sql.= " t.note,"; + $sql.= " t.note as note_public,"; $sql.= " t.fk_bank,"; $sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_modif,"; - $sql.= " pt.code as type_code, pt.libelle as type_libelle,"; + $sql.= " pt.code as type_code, pt.libelle as type_label,"; $sql.= ' b.fk_account'; $sql.= " FROM ".MAIN_DB_PREFIX."payment_expensereport as t"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id"; @@ -227,13 +226,13 @@ class PaymentExpenseReport extends CommonObject $this->amount = $obj->amount; $this->fk_typepayment = $obj->fk_typepayment; $this->num_payment = $obj->num_payment; - $this->note = $obj->note; + $this->note_public = $obj->note_public; $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_label = $obj->type_label; $this->bank_account = $obj->fk_account; $this->bank_line = $obj->fk_bank; @@ -540,8 +539,7 @@ class PaymentExpenseReport extends CommonObject $acc->fetch($accountid); //Fix me field - $this->total = $this->amount; - $total = $this->total; + $total = $this->amount; if ($mode == 'payment_expensereport') $amount=$total; diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index e168c1aa5b8..99c4c81d294 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -162,8 +162,8 @@ print ''; -// Note -print ''; +// Note public +print ''; $disable_delete = 0; // Bank account @@ -258,7 +258,7 @@ if ($resql) print ''; // Remain to pay - print ''; + print ''; // Status print ''; diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index 8d1c568332d..fd3f725da5a 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -113,13 +113,13 @@ if ($action == 'add_payment') // Create a line of payments $payment = new PaymentExpenseReport($db); - $payment->chid = $expensereport->id; + $payment->fk_expensereport = $expensereport->id; $payment->datepaid = $datepaid; $payment->amounts = $amounts; // Tableau de montant $payment->total = $total; - $payment->fk_typepayment = $_POST["fk_typepayment"]; - $payment->num_payment = $_POST["num_payment"]; - $payment->note = $_POST["note"]; + $payment->fk_typepayment = GETPOST("fk_typepayment", 'int'); + $payment->num_payment = GETPOST("num_payment", 'alphanothtml'); + $payment->note_public = GETPOST("note_public", 'none'); if (! $error) { @@ -239,9 +239,11 @@ if ($action == 'create' || empty($action)) print '
'.$langs->trans("Donation").''.$langs->trans("Amount").''.$langs->trans("AlreadyPaid").''.$langs->trans("RemainderToPay").'
'.$object->getNomUrl(1)."'.price($objp->amount)."'.price($sumpaid)."
'.$langs->trans('Numero').''.$object->num_pa // Amount print '
'.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Note').''.nl2br($object->note).'
'.$langs->trans('Note').''.nl2br($object->note_public).'
'.price($objp->amount).''.price($remaintopay).''.price($objp->total_ttc - $objp->amount).''.$expensereport->getLibStatut(4, $objp->amount).'
'; - print '
'; + print ''; - print '
'; + dol_fiche_end(); + + dol_fiche_head(); print ''."\n"; @@ -274,14 +276,14 @@ if ($action == 'create' || empty($action)) print ''; print ''; - print ''; + print ''; print ''; print '
'.$langs->trans("Comments").'
'; - print ''; + dol_fiche_end(); - dol_fiche_end(); + print '
'; // List of expenses ereport not already paid completely $num = 1; @@ -289,6 +291,7 @@ if ($action == 'create' || empty($action)) print ''; print ''; + print ''; print ''; print ''; print ''; @@ -304,6 +307,7 @@ if ($action == 'create' || empty($action)) print ''; + print '"; print '"; print '"; print '"; diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 14d09c20d6e..98fafd3609f 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -56,7 +56,7 @@ class PaiementFourn extends Paiement * Label of payment type * @var string */ - public $type_libelle; + public $type_label; /** * Code of Payment type @@ -123,7 +123,7 @@ class PaiementFourn extends Paiement $this->note = $obj->note; $this->note_private = $obj->note; $this->type_code = $obj->paiement_code; - $this->type_libelle = $obj->paiement_type; + $this->type_label = $obj->paiement_type; $this->statut = $obj->statut; $error = 1; } diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 8b65d8be7c0..1d8f72d94a3 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -197,7 +197,7 @@ if ($result > 0) print ''; // Payment mode - $labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->type_libelle; + $labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->type_label; print ''; diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index d599f1b40ed..59cd6473e57 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -46,6 +46,8 @@ UPDATE llx_c_units SET scale = -3, active = 0 WHERE code IN ('L'); UPDATE llx_c_units SET label = 'VolumeUnitm3' WHERE code IN ('M3'); UPDATE llx_c_units SET label = 'SurfaceUnitm2' WHERE code IN ('M2'); +ALTER TABLE llx_adherent_type ADD UNIQUE INDEX uk_adherent_type_libelle (libelle, entity); + -- For v11 diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang index 5edc8d62033..a810c61c8f4 100644 --- a/htdocs/langs/en_US/donations.lang +++ b/htdocs/langs/en_US/donations.lang @@ -17,6 +17,7 @@ DonationStatusPromiseNotValidatedShort=Draft DonationStatusPromiseValidatedShort=Validated DonationStatusPaidShort=Received DonationTitle=Donation receipt +DonationDate=Donation date DonationDatePayment=Payment date ValidPromess=Validate promise DonationReceipt=Donation receipt diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index c9a8fd9354e..c5335496313 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -94,6 +94,10 @@ class LoanSchedule extends CommonObject */ public $total; + public $type_code; + public $type_label; + + /** * Constructor * @@ -213,7 +217,7 @@ class LoanSchedule extends CommonObject $sql.= " t.fk_bank,"; $sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_modif,"; - $sql.= " pt.code as type_code, pt.libelle as type_libelle,"; + $sql.= " pt.code as type_code, pt.libelle as type_label,"; $sql.= ' b.fk_account'; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id"; @@ -245,7 +249,7 @@ class LoanSchedule extends CommonObject $this->fk_user_modif = $obj->fk_user_modif; $this->type_code = $obj->type_code; - $this->type_libelle = $obj->type_libelle; + $this->type_label = $obj->type_label; $this->bank_account = $obj->fk_account; $this->bank_line = $obj->fk_bank; diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index d3c497cbbae..eb0508c3768 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -90,6 +90,10 @@ class PaymentLoan extends CommonObject */ public $fk_user_modif; + public $type_code; + public $type_label; + + /** * Constructor * @@ -208,7 +212,7 @@ class PaymentLoan extends CommonObject $sql.= " t.fk_bank,"; $sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_modif,"; - $sql.= " pt.code as type_code, pt.libelle as type_libelle,"; + $sql.= " pt.code as type_code, pt.libelle as type_label,"; $sql.= ' b.fk_account'; $sql.= " FROM ".MAIN_DB_PREFIX."payment_loan as t"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id"; @@ -242,7 +246,7 @@ class PaymentLoan extends CommonObject $this->fk_user_modif = $obj->fk_user_modif; $this->type_code = $obj->type_code; - $this->type_libelle = $obj->type_libelle; + $this->type_label = $obj->type_label; $this->bank_account = $obj->fk_account; $this->bank_line = $obj->fk_bank;
'.$langs->trans("ExpenseReport").''.$langs->trans("Amount").''.$langs->trans("AlreadyPaid").''.$langs->trans("RemainderToPay").'
'.$expensereport->getNomUrl(1)."'.price($objp->total_ttc)."'.price($sumpaid)."'.price($objp->total_ttc - $sumpaid)."
'.$langs->trans('PaymentMode').''.$labeltype; print $object->num_paiement?' - '.$object->num_paiement:''; print '