Merge branch 'develop' into socid

This commit is contained in:
Laurent Destailleur 2019-11-02 12:01:06 +01:00 committed by GitHub
commit 25e64b0610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
82 changed files with 1000 additions and 723 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

@ -431,10 +431,10 @@ class Subscription extends CommonObject
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
* @param int $statut Id statut * @param int $status Id status
* @return string Label * @return string Label
*/ */
public function LibStatut($statut) public function LibStatut($status)
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;

View File

@ -54,7 +54,7 @@ if (! isset($cotis))
$sql = "SELECT d.login, d.pass, d.datefin"; $sql = "SELECT d.login, d.pass, d.datefin";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d "; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
$sql .= " WHERE d.statut = $statut "; $sql .= " WHERE d.statut = ".$statut;
if ($cotis==1) if ($cotis==1)
{ {
$sql .= " AND datefin > '".$db->idate($now)."'"; $sql .= " AND datefin > '".$db->idate($now)."'";

View File

@ -236,7 +236,7 @@ foreach($listofnotifiedevents as $notifiedevent)
$s='<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator. $s='<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
$arrayemail=explode(',', $value); $arrayemail=explode(',', $value);
$showwarning=0; $showwarning=0;
foreach($arrayemail as $key=>$valuedet) foreach($arrayemail as $keydet => $valuedet)
{ {
$valuedet=trim($valuedet); $valuedet=trim($valuedet);
if (! empty($valuedet) && ! isValidEmail($valuedet, 1)) $showwarning++; if (! empty($valuedet) && ! isValidEmail($valuedet, 1)) $showwarning++;

View File

@ -458,7 +458,7 @@ if ($mode == 'searchkey')
//print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder; //print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder;
$title = $langs->trans("TranslationKeySearch"); $title = $langs->trans("TranslationKeySearch");
if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')'; if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')';
print print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit)."\n"; print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit);
print '<input type="hidden" id="action" name="action" value="search">'; print '<input type="hidden" id="action" name="action" value="search">';
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">'; print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
@ -466,7 +466,7 @@ if ($mode == 'searchkey')
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder).'</td>'; print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder); //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);

View File

@ -45,43 +45,67 @@ class ActionComm extends CommonObject
*/ */
public $table_element = 'actioncomm'; public $table_element = 'actioncomm';
/**
* @var string Name of id column
*/
public $table_rowid = 'id'; public $table_rowid = 'id';
/** /**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png * @var string Name of icon for actioncomm object. Filename of icon is object_action.png
*/ */
public $picto = 'action'; public $picto = 'action';
/** /**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
/** /**
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty * @var integer 0=Default
* @var integer * 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
* 2=Same than 1 but accept record if fksoc is empty
*/ */
public $restrictiononfksoc = 2; public $restrictiononfksoc = 2;
/** /**
* Id of the event * @var int Id of the event
* @var int
*/ */
public $id; public $id;
/** /**
* Id of the event. Use $id as possible * @var int Id of the event. Use $id as possible
* @var int
*/ */
public $ref; public $ref;
public $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set) /**
public $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH. * @var int Id into parent table llx_c_actioncomm (used only if option to use type is set)
*/
public $type_id;
/**
* @var string Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
*/
public $type_code;
/**
* @var string Type label
*/
public $type_label; public $type_label;
public $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set)
public $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set) /**
public $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) * @var string Label into parent table llx_c_actioncomm (used only if option to use type is set)
*/
public $type;
/**
* @var string Color into parent table llx_c_actioncomm (used only if option to use type is set)
*/
public $type_color;
/**
* @var string Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
*/
public $code;
/** /**
* @var string Agenda event label * @var string Agenda event label
@ -89,72 +113,56 @@ class ActionComm extends CommonObject
public $label; public $label;
/** /**
* Date creation record (datec) * @var integer Date creation record (datec)
*
* @var integer
*/ */
public $datec; public $datec;
/** /**
* Date end record (datef) * @var integer Date end record (datef)
*
* @var integer
*/ */
public $datef; public $datef;
/** /**
* Duration (duree) * @var integer Duration (duree)
*
* @var integer
*/ */
public $duree; public $duree;
/** /**
* Date modification record (tms) * @var integer Date modification record (tms)
*
* @var integer
*/ */
public $datem; public $datem;
/** /**
* Object user that create action * @var User Object user that create action
* @var User
* @deprecated * @deprecated
* @see $authorid * @see $authorid
*/ */
public $author; public $author;
/** /**
* Object user that modified action * @var User Object user that modified action
* @var User
* @deprecated * @deprecated
* @see $usermodid * @see $usermodid
*/ */
public $usermod; public $usermod;
/** /**
* Id user that create action * @var int Id user that create action
* @var int
*/ */
public $authorid; public $authorid;
/** /**
* Id user that modified action * @var int Id user that modified action
* @var int
*/ */
public $usermodid; public $usermodid;
/** /**
* Date action start (datep) * @var integer Date action start (datep)
*
* @var integer
*/ */
public $datep; public $datep;
/** /**
* Date action end (datep2) * @var integer Date action end (datep2)
*
* @var integer
*/ */
public $datep2; public $datep2;
@ -163,83 +171,171 @@ class ActionComm extends CommonObject
* @deprecated * @deprecated
*/ */
public $durationp = -1; public $durationp = -1;
public $fulldayevent = 0; // 1=Event on full day
/** /**
* Milestone * @var int 1=Event on full day
* @var int */
public $fulldayevent = 0;
/**
* @var int Milestone
* @deprecated Milestone is already event with end date = start date * @deprecated Milestone is already event with end date = start date
*/ */
public $punctual = 1; public $punctual = 1;
public $percentage; // Percentage
public $location; // Location
public $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events) /**
public $priority; // Small int (0 By default) * @var integer Percentage
*/
public $percentage;
public $userassigned = array(); // Array of user ids /**
public $userownerid; // Id of user owner = fk_user_action into table * @var string Location
public $userdoneid; // Id of user done (deprecated) */
public $location;
public $socpeopleassigned = array(); // Array of contact ids /**
* @var int Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events)
*/
public $transparency;
public $otherassigned = array(); // Array of other contact emails (not user, not contact) /**
* @var int (0 By default)
*/
public $priority;
/**
* @var int[] Array of user ids
*/
public $userassigned = array();
/**
* @var int Id of user owner = fk_user_action into table
*/
public $userownerid;
/**
* @var int Id of user done (deprecated)
* @deprecated
*/
public $userdoneid;
/**
* @var int[] Array of contact ids
*/
public $socpeopleassigned = array();
/**
* @var int[] Array of other contact emails (not user, not contact)
*/
public $otherassigned = array();
/** /**
* Object user of owner * @var User Object user of owner
* @var User
* @deprecated * @deprecated
* @see userownerid * @see userownerid
*/ */
public $usertodo; public $usertodo;
/** /**
* Object user that did action * @var User Object user that did action
* @var User
* @deprecated * @deprecated
* @see userdoneid * @see userdoneid
*/ */
public $userdone; public $userdone;
/**
* @var int thirdparty id linked to action
*/
public $socid; public $socid;
/**
* @var int socpeople id linked to action
*/
public $contactid; public $contactid;
/** /**
* Company linked to action (optional) * @var Societe|null Company linked to action (optional)
* @var Societe|null
* @deprecated * @deprecated
* @see socid * @see socid
*/ */
public $societe; public $societe;
/** /**
* Contact linked to action (optional) * @var Contact|null Contact linked to action (optional)
* @var Contact|null
* @deprecated * @deprecated
* @see contactid * @see contactid
*/ */
public $contact; public $contact;
// Properties for links to other objects // Properties for links to other objects
/**
* @var int Id of linked object
*/
public $fk_element; // Id of record public $fk_element; // Id of record
public $elementid; // Id of record alternative for API
public $elementtype; // Type of record. This if property ->element of object linked to.
// Ical /**
* @var int Id of record alternative for API
*/
public $elementid;
/**
* @var string Type of record. This if property ->element of object linked to.
*/
public $elementtype;
/**
* @var string Ical name
*/
public $icalname; public $icalname;
/**
* @var string Ical color
*/
public $icalcolor; public $icalcolor;
/**
* @var array Actions
*/
public $actions=array(); public $actions=array();
// Fields for emails /**
* @var string Email msgid
*/
public $email_msgid; public $email_msgid;
/**
* @var string Email from
*/
public $email_from; public $email_from;
/**
* @var string Email sender
*/
public $email_sender; public $email_sender;
/**
* @var string Email to
*/
public $email_to; public $email_to;
/**
* @var string Email tocc
*/
public $email_tocc; public $email_tocc;
/**
* @var string Email tobcc
*/
public $email_tobcc; public $email_tobcc;
/**
* @var string Email subject
*/
public $email_subject; public $email_subject;
/**
* @var string Email errors to
*/
public $errors_to; public $errors_to;

View File

@ -488,7 +488,7 @@ if ($resql)
if (! empty($arrayfields['a.tms']['checked'])) print '<td class="liste_titre"></td>'; if (! empty($arrayfields['a.tms']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['a.percent']['checked'])) { if (! empty($arrayfields['a.percent']['checked'])) {
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
print $formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2); $formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2);
print ajax_combobox('selectstatus'); print ajax_combobox('selectstatus');
print '</td>'; print '</td>';
} }

View File

@ -13,7 +13,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -95,8 +95,17 @@ class Propal extends CommonObject
*/ */
public $socid; public $socid;
/**
* ID of the contact
* @var int
*/
public $contactid; public $contactid;
public $author; public $author;
/**
* Ref from thirdparty
* @var string
*/
public $ref_client; public $ref_client;
/** /**
@ -240,7 +249,7 @@ class Propal extends CommonObject
* @param int $socid Id third party * @param int $socid Id third party
* @param int $propalid Id proposal * @param int $propalid Id proposal
*/ */
public function __construct($db, $socid = "", $propalid = 0) public function __construct($db, $socid = 0, $propalid = 0)
{ {
global $conf,$langs; global $conf,$langs;

View File

@ -53,19 +53,22 @@ class Commande extends CommonOrder
public $table_element='commande'; public $table_element='commande';
/** /**
* @var int Name of subtable line * @var string Name of subtable line
*/ */
public $table_element_line = 'commandedet'; public $table_element_line = 'commandedet';
/**
* @var string Name of class line
*/
public $class_element_line = 'OrderLine'; public $class_element_line = 'OrderLine';
/** /**
* @var int Field with ID of parent key if this field has a parent * @var string Field name with ID of parent key if this field has a parent
*/ */
public $fk_element = 'fk_commande'; public $fk_element = 'fk_commande';
/** /**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for commande class. Here is object_order.png
*/ */
public $picto = 'order'; public $picto = 'order';
@ -87,13 +90,23 @@ class Commande extends CommonOrder
protected $table_ref_field = 'ref'; protected $table_ref_field = 'ref';
/** /**
* Client ID * @var int Thirparty ID
* @var int
*/ */
public $socid; public $socid;
/**
* @var string Thirparty ref of order
*/
public $ref_client; public $ref_client;
/**
* @var string Internal ref for order
*/
public $ref_int; public $ref_int;
/**
* @var int Contact ID
*/
public $contactid; public $contactid;
/** /**
@ -103,10 +116,9 @@ class Commande extends CommonOrder
public $statut; public $statut;
/** /**
* Billed * @var int Status Billed or not
* @var int
*/ */
public $billed; // billed or not public $billed;
/** /**
* @var int Draft Status of the order * @var int Draft Status of the order
@ -115,25 +127,22 @@ class Commande extends CommonOrder
public $cond_reglement_code; public $cond_reglement_code;
/** /**
* @var int ID * @var int bank account ID
*/ */
public $fk_account; public $fk_account;
/** /**
* It holds the label of the payment mode. Use it in case translation cannot be found. * @var string It holds the label of the payment mode. Use it in case translation cannot be found.
* @var string
*/ */
public $mode_reglement; public $mode_reglement;
/** /**
* Payment mode id * @var int Payment mode id
* @var int
*/ */
public $mode_reglement_id; public $mode_reglement_id;
/** /**
* Payment mode code * @var string Payment mode code
* @var string
*/ */
public $mode_reglement_code; public $mode_reglement_code;
@ -157,9 +166,13 @@ class Commande extends CommonOrder
public $demand_reason_id; // Source reason. Why we receive order (after a phone campaign, ...) public $demand_reason_id; // Source reason. Why we receive order (after a phone campaign, ...)
public $demand_reason_code; public $demand_reason_code;
public $date; // Date commande /**
* @var int Date of order
*/
public $date;
/** /**
* @var int Date of order
* @deprecated * @deprecated
* @see $date * @see $date
*/ */
@ -182,7 +195,14 @@ class Commande extends CommonOrder
public $linked_objects=array(); public $linked_objects=array();
/**
* @var int User author ID
*/
public $user_author_id; public $user_author_id;
/**
* @var int User validator ID
*/
public $user_valid; public $user_valid;
/** /**
@ -192,7 +212,7 @@ class Commande extends CommonOrder
// Multicurrency // Multicurrency
/** /**
* @var int ID * @var int Currency ID
*/ */
public $fk_multicurrency; public $fk_multicurrency;
@ -202,6 +222,9 @@ class Commande extends CommonOrder
public $multicurrency_total_tva; public $multicurrency_total_tva;
public $multicurrency_total_ttc; public $multicurrency_total_ttc;
/**
* @var Commande clone of order object
*/
public $oldcopy; public $oldcopy;
//! key of module source when order generated from a dedicated module ('cashdesk', 'takepos', ...) //! key of module source when order generated from a dedicated module ('cashdesk', 'takepos', ...)

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->libelle; $socialcontrib->ref=$obj->label;
$socialcontrib->lib=$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();
@ -661,8 +661,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$chargestatic->id=$obj->rowid; $chargestatic->id=$obj->rowid;
$chargestatic->ref=$obj->libelle; $chargestatic->ref=$obj->rowid;
$chargestatic->lib=$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

@ -79,8 +79,8 @@ dol_fiche_head($head, 'info', $langs->trans("SocialContribution"), -1, 'bill');
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
// Label of social contribution // Label of social contribution
$morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project // Project
if (! empty($conf->projet->enabled)) if (! empty($conf->projet->enabled))
{ {

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->lib=$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

@ -176,8 +176,8 @@ 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->libelle; $socialcontrib->ref=$obj->rowid;
$socialcontrib->lib=$obj->libelle; $socialcontrib->label=$obj->libelle;
print $socialcontrib->getNomUrl(1, '20'); print $socialcontrib->getNomUrl(1, '20');
print '</td>'; print '</td>';
// Type // Type

View File

@ -2068,10 +2068,10 @@ class Contrat extends CommonObject
/** /**
* Return list of line rowid * Return list of line rowid
* *
* @param int $statut Status of lines to get * @param int $status Status of lines to get
* @return array|int Array of line's rowid or <0 if error * @return array|int Array of line's rowid or <0 if error
*/ */
public function array_detail($statut = -1) public function array_detail($status = -1)
{ {
// phpcs:enable // phpcs:enable
$tab=array(); $tab=array();
@ -2079,7 +2079,7 @@ class Contrat extends CommonObject
$sql = "SELECT cd.rowid"; $sql = "SELECT cd.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd"; $sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
$sql.= " WHERE fk_contrat =".$this->id; $sql.= " WHERE fk_contrat =".$this->id;
if ($statut >= 0) $sql.= " AND statut = '$statut'"; if ($status >= 0) $sql.= " AND statut = ".$status;
dol_syslog(get_class($this)."::array_detail()", LOG_DEBUG); dol_syslog(get_class($this)."::array_detail()", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@ -135,7 +135,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png"; $filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$endyear.'.png'; // default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessuppliernbinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessuppliernbinyear-'.$endyear.'.png';
$px1 = new DolGraph(); $px1 = new DolGraph();
@ -180,7 +181,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png"; $filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$endyear.'.png'; // default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessupplieramountinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessupplieramountinyear-'.$endyear.'.png';
$px2 = new DolGraph(); $px2 = new DolGraph();

View File

@ -132,7 +132,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png"; $filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$year.'.png'; // default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessuppliernbinyear-'.$year.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessuppliernbinyear-'.$year.'.png';
$px1 = new DolGraph(); $px1 = new DolGraph();
@ -143,7 +144,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px1->SetData($data1); $px1->SetData($data1);
unset($data1); unset($data1);
$i=$startyear;$legend=array(); $i=$startyear;
$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
if ($startmonth != 1) if ($startmonth != 1)
@ -177,7 +179,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png"; $filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$year.'.png'; // default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessupplieramountinyear-'.$year.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessupplieramountinyear-'.$year.'.png';
$px2 = new DolGraph(); $px2 = new DolGraph();

View File

@ -135,7 +135,8 @@ class box_graph_orders_permonth extends ModeleBoxes
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png"; $filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png'; // default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=ordersnbinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=ordersnbinyear-'.$endyear.'.png';
$px1 = new DolGraph(); $px1 = new DolGraph();
@ -144,7 +145,8 @@ class box_graph_orders_permonth extends ModeleBoxes
{ {
$px1->SetData($data1); $px1->SetData($data1);
unset($data1); unset($data1);
$i=$startyear;$legend=array(); $i=$startyear;
$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
if ($startmonth != 1) if ($startmonth != 1)
@ -178,7 +180,8 @@ class box_graph_orders_permonth extends ModeleBoxes
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png"; $filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png'; // default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=ordersamountinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=ordersamountinyear-'.$endyear.'.png';
$px2 = new DolGraph(); $px2 = new DolGraph();

View File

@ -134,7 +134,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png"; $filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png'; // default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssuppliernbinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssuppliernbinyear-'.$endyear.'.png';
$px1 = new DolGraph(); $px1 = new DolGraph();
@ -143,7 +144,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
{ {
$px1->SetData($data1); $px1->SetData($data1);
unset($data1); unset($data1);
$i=$startyear;$legend=array(); $i=$startyear;
$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
if ($startmonth != 1) if ($startmonth != 1)
@ -177,7 +179,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png"; $filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png'; // default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssupplieramountinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssupplieramountinyear-'.$endyear.'.png';
$px2 = new DolGraph(); $px2 = new DolGraph();

View File

@ -1057,13 +1057,13 @@ abstract class CommonObject
/** /**
* Get array of all contacts for an object * Get array of all contacts for an object
* *
* @param int $statut Status of links to get (-1=all) * @param int $status Status of links to get (-1=all)
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user) * @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id * @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...) * @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
* @return array|int Array of contacts, -1 if error * @return array|int Array of contacts, -1 if error
*/ */
public function liste_contact($statut = -1, $source = 'external', $list = 0, $code = '') public function liste_contact($status = -1, $source = 'external', $list = 0, $code = '')
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@ -1086,7 +1086,7 @@ abstract class CommonObject
if ($source == 'internal') $sql.= " AND tc.source = 'internal'"; if ($source == 'internal') $sql.= " AND tc.source = 'internal'";
if ($source == 'external' || $source == 'thirdparty') $sql.= " AND tc.source = 'external'"; if ($source == 'external' || $source == 'thirdparty') $sql.= " AND tc.source = 'external'";
$sql.= " AND tc.active=1"; $sql.= " AND tc.active=1";
if ($statut >= 0) $sql.= " AND ec.statut = '".$statut."'"; if ($status >= 0) $sql.= " AND ec.statut = ".$status;
$sql.=" ORDER BY t.lastname ASC"; $sql.=" ORDER BY t.lastname ASC";
dol_syslog(get_class($this)."::liste_contact", LOG_DEBUG); dol_syslog(get_class($this)."::liste_contact", LOG_DEBUG);

View File

@ -3765,7 +3765,7 @@ class Form
* *
* @param string $selected Id account pre-selected * @param string $selected Id account pre-selected
* @param string $htmlname Name of select zone * @param string $htmlname Name of select zone
* @param int $statut Status of searched accounts (0=open, 1=closed, 2=both) * @param int $status Status of searched accounts (0=open, 1=closed, 2=both)
* @param string $filtre To filter list * @param string $filtre To filter list
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param string $moreattrib To add more attribute on select * @param string $moreattrib To add more attribute on select
@ -3773,7 +3773,7 @@ class Form
* @param string $morecss More CSS * @param string $morecss More CSS
* @return int <0 if error, Num of bank account found if OK (0, 1, 2, ...) * @return int <0 if error, Num of bank account found if OK (0, 1, 2, ...)
*/ */
public function select_comptes($selected = '', $htmlname = 'accountid', $statut = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '') public function select_comptes($selected = '', $htmlname = 'accountid', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '')
{ {
// phpcs:enable // phpcs:enable
global $langs, $conf; global $langs, $conf;
@ -3784,7 +3784,7 @@ class Form
$sql = "SELECT rowid, label, bank, clos as status, currency_code"; $sql = "SELECT rowid, label, bank, clos as status, currency_code";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity IN (".getEntity('bank_account').")"; $sql.= " WHERE entity IN (".getEntity('bank_account').")";
if ($statut != 2) $sql.= " AND clos = '".$statut."'"; if ($status != 2) $sql.= " AND clos = ".(int) $status;
if ($filtre) $sql.=" AND ".$filtre; if ($filtre) $sql.=" AND ".$filtre;
$sql.= " ORDER BY label"; $sql.= " ORDER BY label";
@ -3815,7 +3815,7 @@ class Form
} }
print trim($obj->label); print trim($obj->label);
if ($showcurrency) print ' ('.$obj->currency_code.')'; if ($showcurrency) print ' ('.$obj->currency_code.')';
if ($statut == 2 && $obj->status == 1) print ' ('.$langs->trans("Closed").')'; if ($status == 2 && $obj->status == 1) print ' ('.$langs->trans("Closed").')';
print '</option>'; print '</option>';
$i++; $i++;
} }
@ -3823,7 +3823,7 @@ class Form
} }
else else
{ {
if ($statut == 0) print '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; if ($status == 0) print '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
else print '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>'; else print '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
} }
} }
@ -3839,13 +3839,13 @@ class Form
* *
* @param string $selected Id establishment pre-selected * @param string $selected Id establishment pre-selected
* @param string $htmlname Name of select zone * @param string $htmlname Name of select zone
* @param int $statut Status of searched establishment (0=open, 1=closed, 2=both) * @param int $status Status of searched establishment (0=open, 1=closed, 2=both)
* @param string $filtre To filter list * @param string $filtre To filter list
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param string $moreattrib To add more attribute on select * @param string $moreattrib To add more attribute on select
* @return int <0 if error, Num of establishment found if OK (0, 1, 2, ...) * @return int <0 if error, Num of establishment found if OK (0, 1, 2, ...)
*/ */
public function selectEstablishments($selected = '', $htmlname = 'entity', $statut = 0, $filtre = '', $useempty = 0, $moreattrib = '') public function selectEstablishments($selected = '', $htmlname = 'entity', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '')
{ {
// phpcs:enable // phpcs:enable
global $langs, $conf; global $langs, $conf;
@ -3856,7 +3856,7 @@ class Form
$sql = "SELECT rowid, name, fk_country, status, entity"; $sql = "SELECT rowid, name, fk_country, status, entity";
$sql.= " FROM ".MAIN_DB_PREFIX."establishment"; $sql.= " FROM ".MAIN_DB_PREFIX."establishment";
$sql.= " WHERE 1=1"; $sql.= " WHERE 1=1";
if ($statut != 2) $sql.= " AND status = '".$statut."'"; if ($status != 2) $sql.= " AND status = ".(int) $status;
if ($filtre) $sql.=" AND ".$filtre; if ($filtre) $sql.=" AND ".$filtre;
$sql.= " ORDER BY name"; $sql.= " ORDER BY name";
@ -3886,7 +3886,7 @@ class Form
print '<option value="'.$obj->rowid.'">'; print '<option value="'.$obj->rowid.'">';
} }
print trim($obj->name); print trim($obj->name);
if ($statut == 2 && $obj->status == 1) print ' ('.$langs->trans("Closed").')'; if ($status == 2 && $obj->status == 1) print ' ('.$langs->trans("Closed").')';
print '</option>'; print '</option>';
$i++; $i++;
} }
@ -3894,7 +3894,7 @@ class Form
} }
else else
{ {
if ($statut == 0) print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; if ($status == 0) print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
else print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; else print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
} }
} }
@ -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

@ -1991,8 +1991,6 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = false, $
if ($second< 0 || $second > 60) return ''; if ($second< 0 || $second > 60) return '';
} }
if (method_exists('DateTime', 'getTimestamp'))
{
if (empty($gm) || $gm === 'server') if (empty($gm) || $gm === 'server')
{ {
$default_timezone=@date_default_timezone_get(); // Example 'Europe/Berlin' $default_timezone=@date_default_timezone_get(); // Example 'Europe/Berlin'
@ -2036,12 +2034,6 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = false, $
//var_dump($date); //var_dump($date);
return $date; return $date;
} }
else
{
dol_print_error('', 'PHP version must be 5.4+');
return '';
}
}
/** /**

View File

@ -1749,12 +1749,12 @@ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
* @param int $socid Id thirdparty * @param int $socid Id thirdparty
* @param int $projectsListId Id of project I have permission on * @param int $projectsListId Id of project I have permission on
* @param int $mytasks Limited to task I am contact to * @param int $mytasks Limited to task I am contact to
* @param int $statut -1=No filter on statut, 0 or 1 = Filter on status * @param int $status -1=No filter on statut, 0 or 1 = Filter on status
* @param array $listofoppstatus List of opportunity status * @param array $listofoppstatus List of opportunity status
* @param array $hiddenfields List of info to not show ('projectlabel', 'declaredprogress', '...', ) * @param array $hiddenfields List of info to not show ('projectlabel', 'declaredprogress', '...', )
* @return void * @return void
*/ */
function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $statut = -1, $listofoppstatus = array(), $hiddenfields = array()) function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array())
{ {
global $langs,$conf,$user,$bc; global $langs,$conf,$user,$bc;
@ -1768,7 +1768,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
$project_year_filter=0; $project_year_filter=0;
$title=$langs->trans("Projects"); $title=$langs->trans("Projects");
if (strcmp($statut, '') && $statut >= 0) $title=$langs->trans("Projects").' '.$langs->trans($projectstatic->statuts_long[$statut]); if (strcmp($status, '') && $status >= 0) $title=$langs->trans("Projects").' '.$langs->trans($projectstatic->statuts_long[$status]);
$arrayidtypeofcontact=array(); $arrayidtypeofcontact=array();
@ -1797,9 +1797,9 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
$sql.= " AND ec.fk_c_type_contact = ctc.rowid"; // Replace the 2 lines with ec.fk_c_type_contact in $arrayidtypeofcontact $sql.= " AND ec.fk_c_type_contact = ctc.rowid"; // Replace the 2 lines with ec.fk_c_type_contact in $arrayidtypeofcontact
$sql.= " AND ctc.element = 'project_task'"; $sql.= " AND ctc.element = 'project_task'";
} }
if ($statut >= 0) if ($status >= 0)
{ {
$sql.= " AND p.fk_statut = ".$statut; $sql.= " AND p.fk_statut = ".(int) $status;
} }
if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE)) if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE))
{ {

View File

@ -31,6 +31,10 @@ class mailing_advthirdparties extends MailingTargets
public $require_admin=0; public $require_admin=0;
public $require_module=array("none"); // This module should not be displayed as Selector in mailling public $require_module=array("none"); // This module should not be displayed as Selector in mailling
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='company'; public $picto='company';
/** /**

View File

@ -37,6 +37,10 @@ class mailing_contacts1 extends MailingTargets
public $desc='Contacts of thirdparties (prospects, customers, suppliers...)'; public $desc='Contacts of thirdparties (prospects, customers, suppliers...)';
public $require_module=array("societe"); // Module mailing actif si modules require_module actifs public $require_module=array("societe"); // Module mailing actif si modules require_module actifs
public $require_admin=0; // Module mailing actif pour user admin ou non public $require_admin=0; // Module mailing actif pour user admin ou non
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='contact'; public $picto='contact';
/** /**

View File

@ -36,6 +36,10 @@ class mailing_example extends MailingTargets
public $tooltip='MyTooltipLangKey'; public $tooltip='MyTooltipLangKey';
public $require_module=array(); public $require_module=array();
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto=''; public $picto='';
/** /**

View File

@ -40,6 +40,10 @@ class mailing_fraise extends MailingTargets
public $require_admin=0; public $require_admin=0;
public $require_module=array('adherent'); public $require_module=array('adherent');
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='user'; public $picto='user';
/** /**

View File

@ -35,6 +35,10 @@ class mailing_pomme extends MailingTargets
public $desc='Dolibarr users with emails'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e public $desc='Dolibarr users with emails'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_module=array(); // Module mailing actif si modules require_module actifs
public $require_admin=1; // Module mailing actif pour user admin ou non public $require_admin=1; // Module mailing actif pour user admin ou non
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='user'; public $picto='user';
/** /**

View File

@ -30,6 +30,10 @@ class mailing_thirdparties extends MailingTargets
public $require_admin=0; public $require_admin=0;
public $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated public $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='company'; public $picto='company';
/** /**

View File

@ -28,6 +28,10 @@ class mailing_thirdparties_services_expired extends MailingTargets
public $require_admin=0; public $require_admin=0;
public $require_module=array('contrat'); public $require_module=array('contrat');
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='company'; public $picto='company';
/** /**

View File

@ -35,6 +35,10 @@ class mailing_xinputfile extends MailingTargets
public $desc='EMails from a file'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e public $desc='EMails from a file'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_module=array(); // Module mailing actif si modules require_module actifs
public $require_admin=0; // Module mailing actif pour user admin ou non public $require_admin=0; // Module mailing actif pour user admin ou non
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='generic'; public $picto='generic';
public $tooltip='UseFormatFileEmailToTarget'; public $tooltip='UseFormatFileEmailToTarget';

View File

@ -35,6 +35,10 @@ class mailing_xinputuser extends MailingTargets
public $desc='EMails input by user'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e public $desc='EMails input by user'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_module=array(); // Module mailing actif si modules require_module actifs
public $require_admin=0; // Module mailing actif pour user admin ou non public $require_admin=0; // Module mailing actif pour user admin ou non
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='generic'; public $picto='generic';
public $tooltip='UseFormatInputEmailToTarget'; public $tooltip='UseFormatInputEmailToTarget';

View File

@ -37,6 +37,10 @@ class printing_printgcp extends PrintingDriver
{ {
public $name = 'printgcp'; public $name = 'printgcp';
public $desc = 'PrintGCPDesc'; public $desc = 'PrintGCPDesc';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'printer'; public $picto = 'printer';
public $active = 'PRINTING_PRINTGCP'; public $active = 'PRINTING_PRINTGCP';
public $conf = array(); public $conf = array();

View File

@ -32,6 +32,10 @@ class printing_printipp extends PrintingDriver
{ {
public $name = 'printipp'; public $name = 'printipp';
public $desc = 'PrintIPPDesc'; public $desc = 'PrintIPPDesc';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'printer'; public $picto = 'printer';
public $active = 'PRINTING_PRINTIPP'; public $active = 'PRINTING_PRINTIPP';
public $conf = array(); public $conf = array();

View File

@ -564,7 +564,7 @@ if (! empty($id) && $action == 'edit')
} }
// Payment mode // Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n"; print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
if ($object->modepaymentid) $selected = $object->modepaymentid; if ($object->mode_reglement_id) $selected = $object->mode_reglement_id;
else $selected = ''; else $selected = '';
$form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1); $form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1);
print "</td></tr>\n"; print "</td></tr>\n";
@ -708,7 +708,7 @@ if (! empty($id) && $action != 'edit')
// Payment mode // Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>"; print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
$form->form_modes_reglement(null, $object->modepaymentid, 'none'); $form->form_modes_reglement(null, $object->mode_reglement_id, 'none');
print "</td></tr>\n"; print "</td></tr>\n";
// Other attributes // Other attributes

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

@ -43,7 +43,7 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="d.datedon"; if (! $sortfield) $sortfield="d.datedon";
$statut=(GETPOST("statut", 'intcomma')!='')?GETPOST("statut", 'intcomma'):"-1"; $search_status=(GETPOST("search_status", 'intcomma') != '') ? GETPOST("search_status", 'intcomma') : "-1";
$search_all=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml')); $search_all=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
$search_ref=GETPOST('search_ref', 'alpha'); $search_ref=GETPOST('search_ref', 'alpha');
$search_company=GETPOST('search_company', 'alpha'); $search_company=GETPOST('search_company', 'alpha');
@ -87,13 +87,13 @@ $donationstatic=new Don($db);
// Genere requete de liste des dons // Genere requete de liste des dons
$sql = "SELECT d.rowid, d.datedon, d.fk_soc as socid, d.firstname, d.lastname, d.societe,"; $sql = "SELECT d.rowid, d.datedon, d.fk_soc as socid, d.firstname, d.lastname, d.societe,";
$sql.= " d.amount, d.fk_statut as statut, "; $sql.= " d.amount, d.fk_statut as status,";
$sql.= " p.rowid as pid, p.ref, p.title, p.public"; $sql.= " p.rowid as pid, p.ref, p.title, p.public";
$sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p";
$sql.= " ON p.rowid = d.fk_projet WHERE d.entity IN (".getEntity('donation').")"; $sql.= " ON p.rowid = d.fk_projet WHERE d.entity IN (".getEntity('donation').")";
if ($statut != '' && $statut != '-1') if ($search_status != '' && $search_status != '-1')
{ {
$sql .= " AND d.fk_statut IN (".$db->escape($statut).")"; $sql .= " AND d.fk_statut IN (".$db->escape($search_status).")";
} }
if (trim($search_ref) != '') if (trim($search_ref) != '')
{ {
@ -135,9 +135,13 @@ if ($resql)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
$param = '&statut='.$statut; $param = '';
//if ($page > 0) $param.= '&page='.$page; if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($search_status && $search_status != -1) $param .= '&search_status='.urlencode($search_status);
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
if ($search_company) $param .= '&search_company='.urlencode($search_company);
if ($search_name) $param .= '&search_name='.urlencode($search_name);
if ($search_amount) $param .= '&search_amount='.urlencode($search_amount);
$newcardbutton=''; $newcardbutton='';
if ($user->rights->don->creer) if ($user->rights->don->creer)
@ -257,7 +261,7 @@ if ($resql)
print "</td>\n"; print "</td>\n";
} }
print '<td class="right">'.price($objp->amount).'</td>'; print '<td class="right">'.price($objp->amount).'</td>';
print '<td class="right">'.$donationstatic->LibStatut($objp->statut, 5).'</td>'; print '<td class="right">'.$donationstatic->LibStatut($objp->status, 5).'</td>';
print '<td></td>'; print '<td></td>';
print "</tr>"; print "</tr>";
$i++; $i++;

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->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
$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,41 +153,10 @@ if ($action == 'add_payment')
* View * View
*/ */
llxHeader();
$form=new Form($db); $form=new Form($db);
llxHeader();
// Form to create donation payment
if (GETPOST('action', 'aZ09') == 'create')
{
$don = new Don($db);
$don->fetch($chid);
$total = $don->amount;
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 '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="rowid" value="'.$chid.'">';
print '<input type="hidden" name="chid" value="'.$chid.'">';
print '<input type="hidden" name="action" value="add_payment">';
dol_fiche_head();
print '<table cellspacing="0" class="border" width="100%" cellpadding="2">';
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 = "SELECT sum(p.amount) as total";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_donation as p"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_donation as p";
@ -197,29 +168,43 @@ if (GETPOST('action', 'aZ09') == 'create')
$sumpaid = $obj->total; $sumpaid = $obj->total;
$db->free(); $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>'; // Form to create donation payment
print '</tr>'; if ($action == 'create')
{
$object->fetch($chid);
$total = $object->amount;
print load_fiche_titre($langs->trans("DoPayment"));
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="rowid" value="'.$chid.'">';
print '<input type="hidden" name="chid" value="'.$chid.'">';
print '<input type="hidden" name="action" value="add_payment">';
dol_fiche_head();
print '<table class="border centpercent tableforfieldcreate">';
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

@ -46,6 +46,10 @@ class ExpenseReport extends CommonObject
public $table_element_line = 'expensereport_det'; public $table_element_line = 'expensereport_det';
public $fk_element = 'fk_expensereport'; public $fk_element = 'fk_expensereport';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'trip'; public $picto = 'trip';
public $lines=array(); public $lines=array();

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,21 +276,22 @@ 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;
$i = 0; $i = 0;
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

@ -42,6 +42,10 @@ class FichinterRec extends Fichinter
public $table_element = 'fichinter_rec'; public $table_element = 'fichinter_rec';
public $table_element_line = 'fichinter_rec'; public $table_element_line = 'fichinter_rec';
public $fk_element = 'fk_fichinter'; public $fk_element = 'fk_fichinter';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'intervention'; public $picto = 'intervention';
public $title; public $title;

View File

@ -62,6 +62,9 @@ class CommandeFournisseur extends CommonOrder
*/ */
public $fk_element = 'fk_commande'; public $fk_element = 'fk_commande';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='order'; public $picto='order';
/** /**
@ -3586,7 +3589,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
* @param int $notrigger 1=Disable call to triggers * @param int $notrigger 1=Disable call to triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function delete($notrigger) public function delete($notrigger = 0)
{ {
global $user; global $user;
@ -3594,7 +3597,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
$this->db->begin(); $this->db->begin();
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid=".$this->rowid; $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid=".$this->id;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@ -63,6 +63,9 @@ class FactureFournisseur extends CommonInvoice
*/ */
public $fk_element='fk_facture_fourn'; public $fk_element='fk_facture_fourn';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='bill'; public $picto='bill';
/** /**

View File

@ -46,6 +46,9 @@ class PaiementFourn extends Paiement
*/ */
public $table_element='paiementfourn'; public $table_element='paiementfourn';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'payment'; public $picto = 'payment';
public $statut; //Status of payment. 0 = unvalidated; 1 = validated public $statut; //Status of payment. 0 = unvalidated; 1 = validated
@ -56,7 +59,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 +126,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

@ -54,6 +54,9 @@ class Holiday extends CommonObject
*/ */
public $fk_element = 'fk_holiday'; public $fk_element = 'fk_holiday';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'holiday'; public $picto = 'holiday';
/** /**

View File

@ -173,6 +173,10 @@ llxHeader('', $langs->trans('CPTitreMenu'));
$typeleaves=$holiday->getTypes(1, 1); $typeleaves=$holiday->getTypes(1, 1);
$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user.
if ($result < 0) {
setEventMessages($holiday->error, $holiday->errors, 'errors');
}
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
@ -189,21 +193,14 @@ print load_fiche_titre($langs->trans('MenuConfCP'), '', 'title_hrm.png');
print '<div class="info">'.$langs->trans('LastUpdateCP').': '."\n"; print '<div class="info">'.$langs->trans('LastUpdateCP').': '."\n";
$lastUpdate = $holiday->getConfCP('lastUpdate'); $lastUpdate = $holiday->getConfCP('lastUpdate');
if ($lastUpdate) if ($lastUpdate) {
{ print '<strong>'.dol_print_date($db->jdate($lastUpdate), 'dayhour').'</strong>';
$monthLastUpdate = $lastUpdate[4].$lastUpdate[5]; print '<br>'.$langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$langs->trans('Month'.substr($lastUpdate, 4, 2)).' '.substr($lastUpdate, 0, 4).'</strong>'."\n";
$yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3]; } else {
print '<strong>'.dol_print_date($db->jdate($holiday->getConfCP('lastUpdate')), 'dayhour', 'tzuser').'</strong>'; print $langs->trans('None');
print '<br>'.$langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$yearLastUpdate.'-'.$monthLastUpdate.'</strong>'."\n";
} }
else print $langs->trans('None');
print "</div><br>\n"; print "</div><br>\n";
$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user.
if ($result < 0)
{
setEventMessages($holiday->error, $holiday->errors, 'errors');
}
$filters = ''; $filters = '';

View File

@ -55,6 +55,9 @@ class Establishment extends CommonObject
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='building'; public $picto='building';
/** /**

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

@ -64,7 +64,12 @@ class Livraison extends CommonObject
public $ref_customer; public $ref_customer;
public $date_delivery; // Date really received public $date_delivery; // Date really received
/**
* @var integer|string date_creation
*/
public $date_creation; public $date_creation;
public $date_valid; public $date_valid;
public $model_pdf; public $model_pdf;

View File

@ -41,6 +41,9 @@ class Loan extends CommonObject
*/ */
public $table_element='loan'; public $table_element='loan';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'bill'; public $picto = 'bill';
/** /**

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;

View File

@ -26,6 +26,10 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
public $enabled=0; public $enabled=0;
public $require_module=array(); public $require_module=array();
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='mymodule@mymodule'; public $picto='mymodule@mymodule';
/** /**

View File

@ -235,8 +235,11 @@ else
print '</div></div></div>'; print '</div></div></div>';
$parameters = array('type' => $type, 'user' => $user); $parameters = array(
$reshook = $hookmanager->executeHooks('dashboardMRP', $parameters, null); // Note that $action and $object may have been modified by hook //'type' => $type,
'user' => $user,
);
$reshook = $hookmanager->executeHooks('dashboardMRP', $parameters);
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -44,6 +44,9 @@ class Opensurveysondage extends CommonObject
*/ */
public $table_element='opensurvey_sondage'; public $table_element='opensurvey_sondage';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'opensurvey'; public $picto = 'opensurvey';
public $id_sondage; public $id_sondage;

View File

@ -450,12 +450,13 @@ class Products extends DolibarrApi
* Get prices per customer for a product * Get prices per customer for a product
* *
* @param int $id ID of product * @param int $id ID of product
* @param string $thirdparty_id Thirdparty id to filter orders of (example '1') {@pattern /^[0-9,]*$/i}
* *
* @return mixed * @return mixed
* *
* @url GET {id}/selling_multiprices/per_customer * @url GET {id}/selling_multiprices/per_customer
*/ */
public function getCustomerPricesPerCustomer($id) public function getCustomerPricesPerCustomer($id, $thirdparty_id = '')
{ {
global $conf; global $conf;
@ -472,12 +473,20 @@ class Products extends DolibarrApi
throw new RestException(404, 'Product not found'); throw new RestException(404, 'Product not found');
} }
if ($result < 0) { if ($result > 0) {
throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
$prodcustprice = new Productcustomerprice($this->db);
$filter = array();
$filter['t.fk_product'] .= $id;
if ($thirdparty_id) $filter['t.fk_soc'] .= $thirdparty_id;
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
} }
throw new RestException(501, 'Feature not yet available'); if ( empty($prodcustprice->lines)) {
//return $result; throw new RestException(404, 'Prices not found');
}
return $prodcustprice->lines;
} }
/** /**

View File

@ -44,6 +44,9 @@ class Entrepot extends CommonObject
*/ */
public $table_element='entrepot'; public $table_element='entrepot';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='stock'; public $picto='stock';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe

View File

@ -45,6 +45,9 @@ class Productlot extends CommonObject
*/ */
public $table_element = 'product_lot'; public $table_element = 'product_lot';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='barcode'; public $picto='barcode';
/** /**

View File

@ -60,6 +60,9 @@ class Project extends CommonObject
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'projectpub'; public $picto = 'projectpub';
/** /**

View File

@ -47,6 +47,9 @@ class Task extends CommonObject
*/ */
public $fk_element='fk_task'; public $fk_element='fk_task';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'task'; public $picto = 'task';
/** /**

View File

@ -48,6 +48,10 @@ class Reception extends CommonObject
public $table_element="reception"; public $table_element="reception";
public $table_element_line="commande_fournisseur_dispatch"; public $table_element_line="commande_fournisseur_dispatch";
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'reception'; public $picto = 'reception';
public $socid; public $socid;
@ -80,7 +84,13 @@ class Reception extends CommonObject
* @var int * @var int
*/ */
public $date_reception; public $date_reception;
/**
* @var integer|string date_creation
*/
public $date_creation; public $date_creation;
public $date_valid; public $date_valid;
public $meths; public $meths;

View File

@ -39,6 +39,9 @@ class Dolresource extends CommonObject
*/ */
public $table_element='resource'; public $table_element='resource';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'resource'; public $picto = 'resource';
public $resource_id; public $resource_id;

View File

@ -69,6 +69,9 @@ class Societe extends CommonObject
*/ */
protected $childtablesoncascade=array("societe_prices", "societe_log", "societe_address", "product_fournisseur_price", "product_customer_price_log", "product_customer_price", "socpeople", "adherent", "societe_account", "societe_rib", "societe_remise", "societe_remise_except", "societe_commerciaux", "categorie", "notify", "notify_def", "actioncomm"); protected $childtablesoncascade=array("societe_prices", "societe_log", "societe_address", "product_fournisseur_price", "product_customer_price_log", "product_customer_price", "socpeople", "adherent", "societe_account", "societe_rib", "societe_remise", "societe_remise_except", "societe_commerciaux", "categorie", "notify", "notify_def", "actioncomm");
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'company'; public $picto = 'company';
/** /**
@ -316,11 +319,12 @@ class Societe extends CommonObject
* @var string * @var string
*/ */
public $user_modification; public $user_modification;
/** /**
* Date of creation * @var integer|string date_creation
* @var string
*/ */
public $date_creation; public $date_creation;
/** /**
* User that created the thirdparty * User that created the thirdparty
* @var User * @var User

View File

@ -124,7 +124,13 @@ class SocieteAccount extends CommonObject
public $date_last_login; public $date_last_login;
public $date_previous_login; public $date_previous_login;
public $note_private; public $note_private;
/**
* @var integer|string date_creation
*/
public $date_creation; public $date_creation;
public $tms; public $tms;
/** /**

View File

@ -66,6 +66,9 @@ class SupplierProposal extends CommonObject
*/ */
public $fk_element='fk_supplier_proposal'; public $fk_element='fk_supplier_proposal';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='propal'; public $picto='propal';
/** /**
@ -1698,22 +1701,22 @@ class SupplierProposal extends CommonObject
* Close the askprice * Close the askprice
* *
* @param User $user Object user that close * @param User $user Object user that close
* @param int $statut Statut * @param int $status Status
* @param string $note Comment * @param string $note Comment
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function cloture($user, $statut, $note) public function cloture($user, $status, $note)
{ {
global $langs,$conf; global $langs,$conf;
$this->statut = $statut; $this->statut = $status;
$error=0; $error=0;
$now=dol_now(); $now=dol_now();
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposal"; $sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposal";
$sql.= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($note)."', date_cloture='".$this->db->idate($now)."', fk_user_cloture=".$user->id; $sql.= " SET fk_statut = ".$status.", note_private = '".$this->db->escape($note)."', date_cloture='".$this->db->idate($now)."', fk_user_cloture=".$user->id;
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -1722,7 +1725,7 @@ class SupplierProposal extends CommonObject
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED:$this->modelpdf; $modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED:$this->modelpdf;
$trigger_name='SUPPLIER_PROPOSAL_CLOSE_REFUSED'; $trigger_name='SUPPLIER_PROPOSAL_CLOSE_REFUSED';
if ($statut == 2) if ($status == 2)
{ {
$trigger_name='SUPPLIER_PROPOSAL_CLOSE_SIGNED'; $trigger_name='SUPPLIER_PROPOSAL_CLOSE_SIGNED';
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf; $modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf;
@ -1732,7 +1735,7 @@ class SupplierProposal extends CommonObject
$result = $this->updateOrCreatePriceFournisseur($user); $result = $this->updateOrCreatePriceFournisseur($user);
} }
} }
if ($statut == 4) if ($status == 4)
{ {
$trigger_name='SUPPLIER_PROPOSAL_CLASSIFY_BILLED'; $trigger_name='SUPPLIER_PROPOSAL_CLASSIFY_BILLED';
} }
@ -2258,15 +2261,16 @@ class SupplierProposal extends CommonObject
if ($resql) if ($resql)
{ {
$label = $labelShort = ''; $label = $labelShort = '';
$status = '';
if ($mode == 'opened') { if ($mode == 'opened') {
$delay_warning=$conf->supplier_proposal->cloture->warning_delay; $delay_warning=$conf->supplier_proposal->cloture->warning_delay;
$statut = self::STATUS_VALIDATED; $status = self::STATUS_VALIDATED;
$label = $langs->trans("SupplierProposalsToClose"); $label = $langs->trans("SupplierProposalsToClose");
$labelShort = $langs->trans("ToAcceptRefuse"); $labelShort = $langs->trans("ToAcceptRefuse");
} }
if ($mode == 'signed') { if ($mode == 'signed') {
$delay_warning=$conf->supplier_proposal->facturation->warning_delay; $delay_warning=$conf->supplier_proposal->facturation->warning_delay;
$statut = self::STATUS_SIGNED; $status = self::STATUS_SIGNED;
$label = $langs->trans("SupplierProposalsToProcess"); // May be billed or ordered $label = $langs->trans("SupplierProposalsToProcess"); // May be billed or ordered
$labelShort = $langs->trans("ToClose"); $labelShort = $langs->trans("ToClose");
} }
@ -2275,7 +2279,7 @@ class SupplierProposal extends CommonObject
$response->warning_delay = $delay_warning/60/60/24; $response->warning_delay = $delay_warning/60/60/24;
$response->label = $label; $response->label = $label;
$response->labelShort = $labelShort; $response->labelShort = $labelShort;
$response->url = DOL_URL_ROOT.'/supplier_proposal/list.php?viewstatut='.$statut; $response->url = DOL_URL_ROOT.'/supplier_proposal/list.php?viewstatut='.$status;
$response->img = img_object('', "propal"); $response->img = img_object('', "propal");
// This assignment in condition is not a bug. It allows walking the results. // This assignment in condition is not a bug. It allows walking the results.

View File

@ -954,22 +954,22 @@ class User extends CommonObject
/** /**
* Change status of a user * Change status of a user
* *
* @param int $statut Status to set * @param int $status Status to set
* @return int <0 if KO, 0 if nothing is done, >0 if OK * @return int <0 if KO, 0 if nothing is done, >0 if OK
*/ */
public function setstatus($statut) public function setstatus($status)
{ {
global $conf,$langs,$user; global $conf,$langs,$user;
$error=0; $error=0;
// Check parameters // Check parameters
if ($this->statut == $statut) return 0; if ($this->statut == $status) return 0;
else $this->statut = $statut; else $this->statut = $status;
$this->db->begin(); $this->db->begin();
// Deactivate user // Save in database
$sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql = "UPDATE ".MAIN_DB_PREFIX."user";
$sql.= " SET statut = ".$this->statut; $sql.= " SET statut = ".$this->statut;
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;

View File

@ -52,6 +52,9 @@ class UserGroup extends CommonObject
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='group'; public $picto='group';
/** /**