All properties 'type_libelle' were renamed into 'type_label'.

This commit is contained in:
Laurent Destailleur 2019-11-02 11:12:57 +01:00
parent 82bda63920
commit 68c971a2b5
24 changed files with 133 additions and 124 deletions

View File

@ -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. * 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 'libstatut', 'labelstatut', 'labelstatus' were renamed into 'labelStatus'.
* All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'. * 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 ***** ***** 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. IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card.

View File

@ -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_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
print "</tr>\n"; print "</tr>\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.= " 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.= " 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,"; $sql.= " pct.code as payment_code,";
@ -185,12 +185,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
// Label // Label
print '<td>'; print '<td>';
$socialcontrib->id=$obj->rowid; $socialcontrib->id=$obj->rowid;
$socialcontrib->ref=$obj->rowid; $socialcontrib->ref=$obj->label;
$socialcontrib->label=$obj->libelle; $socialcontrib->label=$obj->label;
print $socialcontrib->getNomUrl(1, '20'); print $socialcontrib->getNomUrl(1, '20');
print '</td>'; print '</td>';
// Type // Type
print '<td><a href="../sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->lib.'</a></td>'; print '<td><a href="../sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->label.'</a></td>';
// Expected to pay // Expected to pay
print '<td class="right">'.price($obj->total).'</td>'; print '<td class="right">'.price($obj->total).'</td>';
// Ref payment // Ref payment

View File

@ -624,12 +624,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$chargestatic=new ChargeSociales($db); $chargestatic=new ChargeSociales($db);
$sql = "SELECT c.rowid, c.amount, c.date_ech, c.paye,"; $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.= " SUM(pc.amount) as sumpaid";
$sql.= " FROM (".MAIN_DB_PREFIX."c_chargesociales as cc, ".MAIN_DB_PREFIX."chargesociales as c)"; $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.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = c.rowid";
$sql.= " WHERE c.fk_type = cc.id"; $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"; $sql.= " AND c.paye = 0";
// Add where from hooks // Add where from hooks
$parameters=array(); $parameters=array();
@ -662,7 +662,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$chargestatic->id=$obj->rowid; $chargestatic->id=$obj->rowid;
$chargestatic->ref=$obj->rowid; $chargestatic->ref=$obj->rowid;
$chargestatic->label=$obj->libelle; $chargestatic->label=$obj->label;
$chargestatic->paye=$obj->paye; $chargestatic->paye=$obj->paye;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -672,6 +672,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print '<td class="nowrap right">'.price($obj->sumpaid).'</td>'; print '<td class="nowrap right">'.price($obj->sumpaid).'</td>';
print '<td align="center">'.$chargestatic->getLibStatut(3).'</td>'; print '<td align="center">'.$chargestatic->getLibStatut(3).'</td>';
print '</tr>'; print '</tr>';
$tot_ttc+=$obj->amount; $tot_ttc+=$obj->amount;
$i++; $i++;
} }

View File

@ -220,7 +220,7 @@ print $form->editfieldval("Date", 'datep', $object->date, $object, $user->rights
print '</td></tr>'; print '</td></tr>';
// Payment type (VIR, LIQ, ...) // 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 '<tr><td>'.$langs->trans('PaymentMode').'</td><td>'.$labeltype; print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>'.$labeltype;
print $object->num_paiement?' - '.$object->num_paiement:''; print $object->num_paiement?' - '.$object->num_paiement:'';
print '</td></tr>'; print '</td></tr>';

View File

@ -78,7 +78,7 @@ class Paiement extends CommonObject
/** /**
* @var string type libelle * @var string type libelle
*/ */
public $type_libelle; public $type_label;
/** /**
* @var string type code * @var string type code
@ -160,7 +160,7 @@ class Paiement extends CommonObject
public function fetch($id, $ref = '', $fk_bank = '') 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 = '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.= ' p.num_paiement as num_payment, p.note,';
$sql.= ' b.fk_account'; $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'; $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->montant = $obj->amount; // deprecated
$this->amount = $obj->amount; $this->amount = $obj->amount;
$this->note = $obj->note; $this->note = $obj->note;
$this->type_libelle = $obj->type_libelle; $this->type_label = $obj->type_label;
$this->type_code = $obj->type_code; $this->type_code = $obj->type_code;
$this->statut = $obj->statut; $this->statut = $obj->statut;
$this->ext_payment_id = $obj->ext_payment_id; $this->ext_payment_id = $obj->ext_payment_id;

View File

@ -202,7 +202,7 @@ if ($action == 'create')
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td><a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$chid.'">'.$chid.'</a></td></tr>'; print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td><a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$chid.'">'.$chid.'</a></td></tr>';
print '<tr><td>'.$langs->trans("Type")."</td><td>".$charge->type_libelle."</td></tr>\n"; print '<tr><td>'.$langs->trans("Type")."</td><td>".$charge->type_label."</td></tr>\n";
print '<tr><td>'.$langs->trans("Period")."</td><td>".dol_print_date($charge->periode, 'day')."</td></tr>\n"; print '<tr><td>'.$langs->trans("Period")."</td><td>".dol_print_date($charge->periode, 'day')."</td></tr>\n";
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$charge->label."</td></tr>\n"; print '<tr><td>'.$langs->trans("Label").'</td><td>'.$charge->label."</td></tr>\n";
/*print '<tr><td>'.$langs->trans("DateDue")."</td><td>".dol_print_date($charge->date_ech,'day')."</td></tr>\n"; /*print '<tr><td>'.$langs->trans("DateDue")."</td><td>".dol_print_date($charge->date_ech,'day')."</td></tr>\n";

View File

@ -259,7 +259,7 @@ if ($resql)
print "</td>\n"; print "</td>\n";
// Type // Type
print '<td>'; print '<td>';
print $socialcontrib->type_libelle; print $socialcontrib->type_label;
/*print $socialcontrib->type;*/ /*print $socialcontrib->type;*/
print "</td>\n"; print "</td>\n";
// Label // Label

View File

@ -514,7 +514,7 @@ if ($id > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Type // Type
print '<tr><td class="titlefield">'.$langs->trans("Type")."</td><td>".$object->type_libelle."</td>"; print '<tr><td class="titlefield">'.$langs->trans("Type")."</td><td>".$object->type_label."</td>";
print "</tr>"; print "</tr>";
// Period end date // Period end date

View File

@ -57,7 +57,7 @@ class ChargeSociales extends CommonObject
public $date_ech; public $date_ech;
public $label; public $label;
public $type; public $type;
public $type_libelle; public $type_label;
public $amount; public $amount;
public $paye; public $paye;
public $periode; public $periode;
@ -136,7 +136,7 @@ class ChargeSociales extends CommonObject
$this->lib = $obj->label; $this->lib = $obj->label;
$this->label = $obj->label; $this->label = $obj->label;
$this->type = $obj->fk_type; $this->type = $obj->fk_type;
$this->type_libelle = $obj->libelle; $this->type_label = $obj->libelle;
$this->fk_account = $obj->fk_account; $this->fk_account = $obj->fk_account;
$this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_id = $obj->fk_mode_reglement;
$this->mode_reglement_code = $obj->mode_reglement_code; $this->mode_reglement_code = $obj->mode_reglement_code;
@ -556,8 +556,8 @@ class ChargeSociales extends CommonObject
$label .= '<br><b>'.$langs->trans('Ref') . ':</b> ' . $this->ref; $label .= '<br><b>'.$langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->label)) if (! empty($this->label))
$label .= '<br><b>'.$langs->trans('Label') . ':</b> ' . $this->label; $label .= '<br><b>'.$langs->trans('Label') . ':</b> ' . $this->label;
if (! empty($this->type_libelle)) if (! empty($this->type_label))
$label .= '<br><b>'.$langs->trans('Type') . ':</b> ' . $this->type_libelle; $label .= '<br><b>'.$langs->trans('Type') . ':</b> ' . $this->type_label;
$linkclose=''; $linkclose='';
if (empty($notooltip) && $user->rights->facture->lire) if (empty($notooltip) && $user->rights->facture->lire)
@ -689,6 +689,6 @@ class ChargeSociales extends CommonObject
$this->amount=100; $this->amount=100;
$this->label = 'Social contribution label'; $this->label = 'Social contribution label';
$this->type = 1; $this->type = 1;
$this->type_libelle = 'Type of social contribution'; $this->type_label = 'Type of social contribution';
} }
} }

View File

@ -236,7 +236,7 @@ class PaymentSocialContribution extends CommonObject
$sql.= " t.fk_bank,"; $sql.= " t.fk_bank,";
$sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_creat,";
$sql.= " t.fk_user_modif,"; $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.= ' 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.= " 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'; $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->fk_user_modif = $obj->fk_user_modif;
$this->type_code = $obj->type_code; $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_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank; $this->bank_line = $obj->fk_bank;
@ -592,7 +592,7 @@ class PaymentSocialContribution extends CommonObject
{ {
$socialcontrib = new ChargeSociales($this->db); $socialcontrib = new ChargeSociales($this->db);
$socialcontrib->fetch($key); $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); if ($result <= 0) dol_print_error($this->db);
} }
} }

View File

@ -110,8 +110,8 @@ $chargesociale_static=new ChargeSociales($db);
llxHeader('', $langs->trans("SocialContributions")); llxHeader('', $langs->trans("SocialContributions"));
$sql = "SELECT cs.rowid as id, cs.fk_type as type, "; $sql = "SELECT cs.rowid as id, cs.fk_type as type, ";
$sql.= " cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode,"; $sql.= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode,";
$sql.= " c.libelle as type_lib,"; $sql.= " c.libelle as type_label,";
$sql.= " SUM(pc.amount) as alreadypayed"; $sql.= " SUM(pc.amount) as alreadypayed";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs";
@ -261,8 +261,8 @@ if ($resql)
$chargesociale_static->id=$obj->id; $chargesociale_static->id=$obj->id;
$chargesociale_static->ref=$obj->id; $chargesociale_static->ref=$obj->id;
$chargesociale_static->label=$obj->libelle; $chargesociale_static->label=$obj->label;
$chargesociale_static->type_libelle=$obj->type_lib; $chargesociale_static->type_label=$obj->type_label;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -272,10 +272,10 @@ if ($resql)
print '</td>'; print '</td>';
// Label // Label
print '<td>'.dol_trunc($obj->libelle, 42).'</td>'; print '<td>'.dol_trunc($obj->label, 42).'</td>';
// Type // Type
print '<td>'.$obj->type_lib.'</td>'; print '<td>'.$obj->type_label.'</td>';
// Date end period // Date end period
print '<td align="center">'; print '<td align="center">';

View File

@ -5344,13 +5344,14 @@ class Form
* @param int $disabled Disable input fields * @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 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 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 datetime $adddateof Add a link "Date of invoice" using the following date. See also $labeladddateof for the label used.
* @param string $openinghours Specify hour strat and hour end for the select ex 8,20 * @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 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 * @return string Html for selectDate
* @see form_date(), select_month(), select_year(), select_dayofweek() * @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; global $conf,$langs;
@ -5737,7 +5738,8 @@ class Form
if ($conf->use_javascript_ajax && $adddateof) if ($conf->use_javascript_ajax && $adddateof)
{ {
$tmparray=dol_getdate($adddateof); $tmparray=dol_getdate($adddateof);
$retstring.=' - <button class="dpInvisibleButtons datenowlink" id="dateofinvoice" type="button" name="_dateofinvoice" value="now" onclick="jQuery(\'#re\').val(\''.dol_print_date($adddateof, 'day').'\');jQuery(\'#reday\').val(\''.$tmparray['mday'].'\');jQuery(\'#remonth\').val(\''.$tmparray['mon'].'\');jQuery(\'#reyear\').val(\''.$tmparray['year'].'\');">'.$langs->trans("DateInvoice").'</a>'; if (empty($labeladddateof)) $labeladddateof = $langs->trans("DateInvoice");
$retstring.=' - <button class="dpInvisibleButtons datenowlink" id="dateofinvoice" type="button" name="_dateofinvoice" value="now" onclick="jQuery(\'#re\').val(\''.dol_print_date($adddateof, 'day').'\');jQuery(\'#reday\').val(\''.$tmparray['mday'].'\');jQuery(\'#remonth\').val(\''.$tmparray['mon'].'\');jQuery(\'#reyear\').val(\''.$tmparray['year'].'\');">'.$labeladddateof.'</a>';
} }
return $retstring; return $retstring;

View File

@ -83,6 +83,10 @@ class PaymentDonation extends CommonObject
*/ */
public $total; public $total;
public $type_code;
public $type_label;
/** /**
* Constructor * Constructor
* *
@ -121,7 +125,7 @@ class PaymentDonation extends CommonObject
if (isset($this->amount)) $this->amount=trim($this->amount); if (isset($this->amount)) $this->amount=trim($this->amount);
if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment); 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->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_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_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_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
@ -148,7 +152,7 @@ class PaymentDonation extends CommonObject
$sql.= " VALUES ($this->chid, '".$this->db->idate($now)."',"; $sql.= " VALUES ($this->chid, '".$this->db->idate($now)."',";
$sql.= " '".$this->db->idate($this->datepaid)."',"; $sql.= " '".$this->db->idate($this->datepaid)."',";
$sql.= " ".$totalamount.","; $sql.= " ".$totalamount.",";
$sql.= " ".$this->paymenttype.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.","; $sql.= " ".$this->paymenttype.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".$user->id.",";
$sql.= " 0)"; $sql.= " 0)";
dol_syslog(get_class($this)."::create", LOG_DEBUG); dol_syslog(get_class($this)."::create", LOG_DEBUG);
@ -205,11 +209,11 @@ class PaymentDonation extends CommonObject
$sql.= " t.amount,"; $sql.= " t.amount,";
$sql.= " t.fk_typepayment,"; $sql.= " t.fk_typepayment,";
$sql.= " t.num_payment,"; $sql.= " t.num_payment,";
$sql.= " t.note,"; $sql.= " t.note as note_public,";
$sql.= " t.fk_bank,"; $sql.= " t.fk_bank,";
$sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_creat,";
$sql.= " t.fk_user_modif,"; $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.= ' b.fk_account';
$sql.= " FROM ".MAIN_DB_PREFIX."payment_donation as t"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_donation as t";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id";
@ -234,13 +238,13 @@ class PaymentDonation extends CommonObject
$this->amount = $obj->amount; $this->amount = $obj->amount;
$this->fk_typepayment = $obj->fk_typepayment; $this->fk_typepayment = $obj->fk_typepayment;
$this->num_payment = $obj->num_payment; $this->num_payment = $obj->num_payment;
$this->note = $obj->note; $this->note_public = $obj->note_public;
$this->fk_bank = $obj->fk_bank; $this->fk_bank = $obj->fk_bank;
$this->fk_user_creat = $obj->fk_user_creat; $this->fk_user_creat = $obj->fk_user_creat;
$this->fk_user_modif = $obj->fk_user_modif; $this->fk_user_modif = $obj->fk_user_modif;
$this->type_code = $obj->type_code; $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_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank; $this->bank_line = $obj->fk_bank;
@ -275,7 +279,7 @@ class PaymentDonation extends CommonObject
if (isset($this->amount)) $this->amount=trim($this->amount); if (isset($this->amount)) $this->amount=trim($this->amount);
if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment); 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->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_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_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_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
@ -292,7 +296,7 @@ class PaymentDonation extends CommonObject
$sql.= " amount=".(isset($this->amount)?$this->amount:"null").","; $sql.= " amount=".(isset($this->amount)?$this->amount:"null").",";
$sql.= " fk_typepayment=".(isset($this->fk_typepayment)?$this->fk_typepayment:"null").","; $sql.= " fk_typepayment=".(isset($this->fk_typepayment)?$this->fk_typepayment:"null").",";
$sql.= " num_payment=".(isset($this->num_payment)?"'".$this->db->escape($this->num_payment)."'":"null").","; $sql.= " num_payment=".(isset($this->num_payment)?"'".$this->db->escape($this->num_payment)."'":"null").",";
$sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").","; $sql.= " note=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").",";
$sql.= " fk_bank=".(isset($this->fk_bank)?$this->fk_bank:"null").","; $sql.= " fk_bank=".(isset($this->fk_bank)?$this->fk_bank:"null").",";
$sql.= " fk_user_creat=".(isset($this->fk_user_creat)?$this->fk_user_creat:"null").","; $sql.= " fk_user_creat=".(isset($this->fk_user_creat)?$this->fk_user_creat:"null").",";
$sql.= " fk_user_modif=".(isset($this->fk_user_modif)?$this->fk_user_modif:"null").""; $sql.= " fk_user_modif=".(isset($this->fk_user_modif)?$this->fk_user_modif:"null")."";
@ -505,7 +509,7 @@ class PaymentDonation extends CommonObject
$this->amount=''; $this->amount='';
$this->fk_typepayment=''; $this->fk_typepayment='';
$this->num_payment=''; $this->num_payment='';
$this->note=''; $this->note_public='';
$this->fk_bank=''; $this->fk_bank='';
$this->fk_user_creat=''; $this->fk_user_creat='';
$this->fk_user_modif=''; $this->fk_user_modif='';

View File

@ -172,8 +172,8 @@ print '<tr><td>'.$langs->trans('Number').'</td><td>'.$object->num_payment.'</td>
// Amount // Amount
print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>'; print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
// Note // Note public
print '<tr><td>'.$langs->trans('Note').'</td><td>'.nl2br($object->note).'</td></tr>'; print '<tr><td>'.$langs->trans('Note').'</td><td>'.nl2br($object->note_public).'</td></tr>';
// Bank account // Bank account
if (! empty($conf->banque->enabled)) 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) if ($user->rights->don->supprimer)
{ {

View File

@ -39,6 +39,8 @@ if ($user->societe_id > 0) {
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$object = new Don($db);
/* /*
* Actions * Actions
@ -59,17 +61,17 @@ if ($action == 'add_payment')
if (! $_POST["paymenttype"] > 0) if (! $_POST["paymenttype"] > 0)
{ {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), null, 'errors');
$error++; $error++;
} }
if ($datepaid == '') if ($datepaid == '')
{ {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors');
$error++; $error++;
} }
if (! empty($conf->banque->enabled) && ! $_POST["accountid"] > 0) 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++; $error++;
} }
@ -103,9 +105,9 @@ if ($action == 'add_payment')
$payment->chid = $chid; $payment->chid = $chid;
$payment->datepaid = $datepaid; $payment->datepaid = $datepaid;
$payment->amounts = $amounts; // Tableau de montant $payment->amounts = $amounts; // Tableau de montant
$payment->paymenttype = $_POST["paymenttype"]; $payment->paymenttype = GETPOST("paymenttype", 'int');
$payment->num_payment = $_POST["num_payment"]; $payment->num_payment = GETPOST("num_payment", 'alphanohtml');
$payment->note = $_POST["note"]; $payment->note_public = GETPOST("note_public", 'none');
if (! $error) if (! $error)
{ {
@ -143,7 +145,7 @@ if ($action == 'add_payment')
} }
} }
$_GET["action"]='create'; $action = 'create';
} }
@ -151,26 +153,32 @@ if ($action == 'add_payment')
* View * View
*/ */
$form=new Form($db);
llxHeader(); 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 // Form to create donation payment
if (GETPOST('action', 'aZ09') == 'create') if ($action == 'create')
{ {
$don = new Don($db); $object->fetch($chid);
$don->fetch($chid);
$total = $don->amount; $total = $object->amount;
print load_fiche_titre($langs->trans("DoPayment")); print load_fiche_titre($langs->trans("DoPayment"));
if ($mesg)
{
print "<div class=\"error\">$mesg</div>";
}
print '<form name="add_payment" action="'.$_SERVER['PHP_SELF'].'" method="post">'; print '<form name="add_payment" action="'.$_SERVER['PHP_SELF'].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="rowid" value="'.$chid.'">'; print '<input type="hidden" name="rowid" value="'.$chid.'">';
@ -179,47 +187,24 @@ if (GETPOST('action', 'aZ09') == 'create')
dol_fiche_head(); dol_fiche_head();
print '<table cellspacing="0" class="border" width="100%" cellpadding="2">'; print '<table class="border centpercent tableforfieldcreate">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Donation").'</td>';
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2"><a href="'.DOL_URL_ROOT.'/don/card.php?rowid='.$chid.'">'.$chid.'</a></td></tr>';
print '<tr><td>'.$langs->trans("Date")."</td><td colspan=\"2\">".dol_print_date($don->date, 'day')."</td></tr>\n";
print '<tr><td>'.$langs->trans("Amount")."</td><td colspan=\"2\">".price($don->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
$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 '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td colspan="2">'.price($sumpaid, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
print '<tr><td class="tdtop">'.$langs->trans("RemainderToPay").'</td><td colspan="2">'.price($total-$sumpaid, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
print '<tr class="liste_titre">';
print "<td colspan=\"3\">".$langs->trans("Payment").'</td>';
print '</tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">'; print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
$datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $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; $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 "</td>"; print "</td>";
print '</tr>'; print '</tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td colspan="2">'; print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td colspan="2">';
$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 "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';
print '<tr>'; print '<tr>';
print '<td class="fieldrequired">'.$langs->trans('AccountToCredit').'</td>'; print '<td class="fieldrequired">'.$langs->trans('AccountToCredit').'</td>';
print '<td colspan="2">'; print '<td colspan="2">';
$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 '</td></tr>'; print '</td></tr>';
// Number // Number
@ -230,7 +215,7 @@ if (GETPOST('action', 'aZ09') == 'create')
print '<tr>'; print '<tr>';
print '<td class="tdtop">'.$langs->trans("Comments").'</td>'; print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
print '<td valign="top" colspan="2"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>'; print '<td valign="top" colspan="2"><textarea name="note_public" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
@ -246,6 +231,7 @@ if (GETPOST('action', 'aZ09') == 'create')
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Donation").'</td>';
print '<td class="right">'.$langs->trans("Amount").'</td>'; print '<td class="right">'.$langs->trans("Amount").'</td>';
print '<td class="right">'.$langs->trans("AlreadyPaid").'</td>'; print '<td class="right">'.$langs->trans("AlreadyPaid").'</td>';
print '<td class="right">'.$langs->trans("RemainderToPay").'</td>'; print '<td class="right">'.$langs->trans("RemainderToPay").'</td>';
@ -257,10 +243,12 @@ if (GETPOST('action', 'aZ09') == 'create')
while ($i < $num) while ($i < $num)
{ {
$objp = $don; $objp = $object;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$object->getNomUrl(1)."</td>";
print '<td class="right">'.price($objp->amount)."</td>"; print '<td class="right">'.price($objp->amount)."</td>";
print '<td class="right">'.price($sumpaid)."</td>"; print '<td class="right">'.price($sumpaid)."</td>";

View File

@ -25,8 +25,8 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; 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 class PaymentExpenseReport extends CommonObject
{ {
@ -83,9 +83,9 @@ class PaymentExpenseReport extends CommonObject
*/ */
public $fk_user_modif; public $fk_user_modif;
//Unknow field public $type_code;
public $chid; public $type_label;
public $total;
/** /**
* Constructor * Constructor
@ -124,10 +124,10 @@ class PaymentExpenseReport extends CommonObject
if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment); 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->num_payment)) $this->num_payment=trim($this->num_payment);
if (isset($this->note)) $this->note=trim($this->note); 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_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_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_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
if (! empty($this->fk_expensereport)) $this->chid = $this->fk_expensereport;
$totalamount = 0; $totalamount = 0;
foreach ($this->amounts as $key => $value) // How payment is dispatch 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 = "INSERT INTO ".MAIN_DB_PREFIX."payment_expensereport (fk_expensereport, datec, datep, amount,";
$sql.= " fk_typepayment, num_payment, note, fk_user_creat, fk_bank)"; $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.= " '".$this->db->idate($this->datepaid)."',";
$sql.= " ".$totalamount.","; $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)"; $sql.= " 0)";
dol_syslog(get_class($this)."::create", LOG_DEBUG); dol_syslog(get_class($this)."::create", LOG_DEBUG);
@ -188,7 +188,6 @@ class PaymentExpenseReport extends CommonObject
*/ */
public function fetch($id) public function fetch($id)
{ {
global $langs;
$sql = "SELECT"; $sql = "SELECT";
$sql.= " t.rowid,"; $sql.= " t.rowid,";
$sql.= " t.fk_expensereport,"; $sql.= " t.fk_expensereport,";
@ -198,11 +197,11 @@ class PaymentExpenseReport extends CommonObject
$sql.= " t.amount,"; $sql.= " t.amount,";
$sql.= " t.fk_typepayment,"; $sql.= " t.fk_typepayment,";
$sql.= " t.num_payment,"; $sql.= " t.num_payment,";
$sql.= " t.note,"; $sql.= " t.note as note_public,";
$sql.= " t.fk_bank,"; $sql.= " t.fk_bank,";
$sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_creat,";
$sql.= " t.fk_user_modif,"; $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.= ' b.fk_account';
$sql.= " FROM ".MAIN_DB_PREFIX."payment_expensereport as t"; $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"; $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->amount = $obj->amount;
$this->fk_typepayment = $obj->fk_typepayment; $this->fk_typepayment = $obj->fk_typepayment;
$this->num_payment = $obj->num_payment; $this->num_payment = $obj->num_payment;
$this->note = $obj->note; $this->note_public = $obj->note_public;
$this->fk_bank = $obj->fk_bank; $this->fk_bank = $obj->fk_bank;
$this->fk_user_creat = $obj->fk_user_creat; $this->fk_user_creat = $obj->fk_user_creat;
$this->fk_user_modif = $obj->fk_user_modif; $this->fk_user_modif = $obj->fk_user_modif;
$this->type_code = $obj->type_code; $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_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank; $this->bank_line = $obj->fk_bank;
@ -540,8 +539,7 @@ class PaymentExpenseReport extends CommonObject
$acc->fetch($accountid); $acc->fetch($accountid);
//Fix me field //Fix me field
$this->total = $this->amount; $total = $this->amount;
$total = $this->total;
if ($mode == 'payment_expensereport') $amount=$total; if ($mode == 'payment_expensereport') $amount=$total;

View File

@ -162,8 +162,8 @@ print '<tr><td>'.$langs->trans('Numero').'</td><td colspan="3">'.$object->num_pa
// Amount // Amount
print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>'; print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
// Note // Note public
print '<tr><td class="tdtop">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>'; print '<tr><td class="tdtop">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note_public).'</td></tr>';
$disable_delete = 0; $disable_delete = 0;
// Bank account // Bank account
@ -258,7 +258,7 @@ if ($resql)
print '<td class="right">'.price($objp->amount).'</td>'; print '<td class="right">'.price($objp->amount).'</td>';
// Remain to pay // Remain to pay
print '<td class="right">'.price($remaintopay).'</td>'; print '<td class="right">'.price($objp->total_ttc - $objp->amount).'</td>';
// Status // Status
print '<td class="center">'.$expensereport->getLibStatut(4, $objp->amount).'</td>'; print '<td class="center">'.$expensereport->getLibStatut(4, $objp->amount).'</td>';

View File

@ -113,13 +113,13 @@ if ($action == 'add_payment')
// Create a line of payments // Create a line of payments
$payment = new PaymentExpenseReport($db); $payment = new PaymentExpenseReport($db);
$payment->chid = $expensereport->id; $payment->fk_expensereport = $expensereport->id;
$payment->datepaid = $datepaid; $payment->datepaid = $datepaid;
$payment->amounts = $amounts; // Tableau de montant $payment->amounts = $amounts; // Tableau de montant
$payment->total = $total; $payment->total = $total;
$payment->fk_typepayment = $_POST["fk_typepayment"]; $payment->fk_typepayment = GETPOST("fk_typepayment", 'int');
$payment->num_payment = $_POST["num_payment"]; $payment->num_payment = GETPOST("num_payment", 'alphanothtml');
$payment->note = $_POST["note"]; $payment->note_public = GETPOST("note_public", 'none');
if (! $error) if (! $error)
{ {
@ -239,9 +239,11 @@ if ($action == 'create' || empty($action))
print '</table>'; print '</table>';
print '<br>'; print '</div>';
print '<div class="underbanner clearboth"></div>'; dol_fiche_end();
dol_fiche_head();
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent">'."\n";
@ -274,14 +276,14 @@ if ($action == 'create' || empty($action))
print '<tr>'; print '<tr>';
print '<td class="tdtop">'.$langs->trans("Comments").'</td>'; print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
print '<td valign="top" colspan="2"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>'; print '<td valign="top" colspan="2"><textarea name="note_public" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '</div>'; dol_fiche_end();
dol_fiche_end(); print '<br>';
// List of expenses ereport not already paid completely // List of expenses ereport not already paid completely
$num = 1; $num = 1;
@ -289,6 +291,7 @@ if ($action == 'create' || empty($action))
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("ExpenseReport").'</td>';
print '<td class="right">'.$langs->trans("Amount").'</td>'; print '<td class="right">'.$langs->trans("Amount").'</td>';
print '<td class="right">'.$langs->trans("AlreadyPaid").'</td>'; print '<td class="right">'.$langs->trans("AlreadyPaid").'</td>';
print '<td class="right">'.$langs->trans("RemainderToPay").'</td>'; print '<td class="right">'.$langs->trans("RemainderToPay").'</td>';
@ -304,6 +307,7 @@ if ($action == 'create' || empty($action))
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$expensereport->getNomUrl(1)."</td>";
print '<td class="right">'.price($objp->total_ttc)."</td>"; print '<td class="right">'.price($objp->total_ttc)."</td>";
print '<td class="right">'.price($sumpaid)."</td>"; print '<td class="right">'.price($sumpaid)."</td>";
print '<td class="right">'.price($objp->total_ttc - $sumpaid)."</td>"; print '<td class="right">'.price($objp->total_ttc - $sumpaid)."</td>";

View File

@ -56,7 +56,7 @@ class PaiementFourn extends Paiement
* Label of payment type * Label of payment type
* @var string * @var string
*/ */
public $type_libelle; public $type_label;
/** /**
* Code of Payment type * Code of Payment type
@ -123,7 +123,7 @@ class PaiementFourn extends Paiement
$this->note = $obj->note; $this->note = $obj->note;
$this->note_private = $obj->note; $this->note_private = $obj->note;
$this->type_code = $obj->paiement_code; $this->type_code = $obj->paiement_code;
$this->type_libelle = $obj->paiement_type; $this->type_label = $obj->paiement_type;
$this->statut = $obj->statut; $this->statut = $obj->statut;
$error = 1; $error = 1;
} }

View File

@ -197,7 +197,7 @@ if ($result > 0)
print '</td></tr>'; print '</td></tr>';
// Payment mode // 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 '<tr><td colspan="2">'.$langs->trans('PaymentMode').'</td><td colspan="3">'.$labeltype; print '<tr><td colspan="2">'.$langs->trans('PaymentMode').'</td><td colspan="3">'.$labeltype;
print $object->num_paiement?' - '.$object->num_paiement:''; print $object->num_paiement?' - '.$object->num_paiement:'';
print '</td></tr>'; print '</td></tr>';

View File

@ -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 = 'VolumeUnitm3' WHERE code IN ('M3');
UPDATE llx_c_units SET label = 'SurfaceUnitm2' WHERE code IN ('M2'); 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 -- For v11

View File

@ -17,6 +17,7 @@ DonationStatusPromiseNotValidatedShort=Draft
DonationStatusPromiseValidatedShort=Validated DonationStatusPromiseValidatedShort=Validated
DonationStatusPaidShort=Received DonationStatusPaidShort=Received
DonationTitle=Donation receipt DonationTitle=Donation receipt
DonationDate=Donation date
DonationDatePayment=Payment date DonationDatePayment=Payment date
ValidPromess=Validate promise ValidPromess=Validate promise
DonationReceipt=Donation receipt DonationReceipt=Donation receipt

View File

@ -94,6 +94,10 @@ class LoanSchedule extends CommonObject
*/ */
public $total; public $total;
public $type_code;
public $type_label;
/** /**
* Constructor * Constructor
* *
@ -213,7 +217,7 @@ class LoanSchedule extends CommonObject
$sql.= " t.fk_bank,"; $sql.= " t.fk_bank,";
$sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_creat,";
$sql.= " t.fk_user_modif,"; $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.= ' b.fk_account';
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t"; $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"; $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->fk_user_modif = $obj->fk_user_modif;
$this->type_code = $obj->type_code; $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_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank; $this->bank_line = $obj->fk_bank;

View File

@ -90,6 +90,10 @@ class PaymentLoan extends CommonObject
*/ */
public $fk_user_modif; public $fk_user_modif;
public $type_code;
public $type_label;
/** /**
* Constructor * Constructor
* *
@ -208,7 +212,7 @@ class PaymentLoan extends CommonObject
$sql.= " t.fk_bank,"; $sql.= " t.fk_bank,";
$sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_creat,";
$sql.= " t.fk_user_modif,"; $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.= ' b.fk_account';
$sql.= " FROM ".MAIN_DB_PREFIX."payment_loan as t"; $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"; $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->fk_user_modif = $obj->fk_user_modif;
$this->type_code = $obj->type_code; $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_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank; $this->bank_line = $obj->fk_bank;