fix merge

This commit is contained in:
Philippe GRAND 2018-09-06 19:27:28 +02:00
commit e9c2a475bc
63 changed files with 389 additions and 243 deletions

View File

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

View File

@ -42,6 +42,10 @@ class AccountingJournal extends CommonObject
public $fk_element = '';
public $ismultientitymanaged = 0; // 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 = 'generic';
/**

View File

@ -53,66 +53,69 @@ class Adherent extends CommonObject
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $mesgs;
public $mesgs;
var $login;
public $login;
//! Clear password in memory
var $pass;
public $pass;
//! Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0)
var $pass_indatabase;
public $pass_indatabase;
//! Encrypted password in database (always defined)
var $pass_indatabase_crypted;
public $pass_indatabase_crypted;
var $societe;
var $company;
var $address;
var $zip;
var $town;
public $societe;
public $company;
public $address;
public $zip;
public $town;
var $state_id; // Id of department
var $state_code; // Code of department
var $state; // Label of department
public $state_id; // Id of department
public $state_code; // Code of department
public $state; // Label of department
var $email;
var $skype;
var $phone;
var $phone_perso;
var $phone_mobile;
public $email;
public $skype;
public $phone;
public $phone_perso;
public $phone_mobile;
var $morphy;
var $public;
var $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
var $photo;
public $morphy;
public $public;
public $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
public $photo;
var $datec;
var $datem;
var $datefin;
var $datevalid;
var $birth;
public $datec;
public $datem;
public $datefin;
public $datevalid;
public $birth;
var $note_public;
var $note_private;
public $note_public;
public $note_private;
var $typeid; // Id type adherent
var $type; // Libelle type adherent
var $need_subscription;
public $typeid; // Id type adherent
public $type; // Libelle type adherent
public $need_subscription;
var $user_id;
var $user_login;
public $user_id;
public $user_login;
var $fk_soc;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
// Fields loaded by fetch_subscriptions()
var $first_subscription_date;
var $first_subscription_amount;
var $last_subscription_date;
var $last_subscription_date_start;
var $last_subscription_date_end;
var $last_subscription_amount;
var $subscriptions=array();
public $first_subscription_date;
public $first_subscription_amount;
public $last_subscription_date;
public $last_subscription_date_start;
public $last_subscription_date_end;
public $last_subscription_amount;
public $subscriptions=array();
var $oldcopy; // To contains a clone of this when we need to save old properties of object
public $oldcopy; // To contains a clone of this when we need to save old properties of object
/**
* @var int Entity

View File

@ -36,13 +36,17 @@ class AdherentType extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'adherent_type';
/**
* @var string ID to identify managed object
*/
public $element = 'adherent_type';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'group';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
@ -51,19 +55,25 @@ class AdherentType extends CommonObject
* @see label
*/
public $libelle;
/** @var string Label */
public $label;
/**
* @var int Subsription required (0 or 1)
* @since 5.0
*/
public $subscription;
/** @var string Public note */
public $note;
/** @var integer Can vote */
public $vote;
/** @var string Email sent during validation */
public $mail_valid;
/** @var array Array of members */
public $members=array();

View File

@ -36,21 +36,24 @@ class Subscription extends CommonObject
* @var string ID to identify managed object
*/
public $element='subscription';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='subscription';
public $picto='payment';
var $datec; // Date creation
var $datem; // Date modification
var $dateh; // Subscription start date (date subscription)
var $datef; // Subscription end date
var $fk_adherent;
var $amount;
var $fk_bank;
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='payment';
public $datec; // Date creation
public $datem; // Date modification
public $dateh; // Subscription start date (date subscription)
public $datef; // Subscription end date
public $fk_adherent;
public $amount;
public $fk_bank;
/**

View File

@ -122,6 +122,13 @@ $modules=array(
),
);
$labelmeteo = array(0=>$langs->trans("No"), 1=>$langs->trans("Yes"), 2=>$langs->trans("OnMobileOnly"));
/*
* Actions
*/
if ($action == 'update')
{
foreach($modules as $module => $delays)
@ -201,9 +208,10 @@ if ($action == 'edit')
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
$var=false;
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '</td></tr>';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';
print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (empty($conf->global->MAIN_DISABLE_METEO)?0:$conf->global->MAIN_DISABLE_METEO));
print '</td></tr>';
print '</table>';
}
@ -241,7 +249,9 @@ else
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">' . yn($conf->global->MAIN_DISABLE_METEO) . '</td></tr>';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';
print $labelmeteo[$conf->global->MAIN_DISABLE_METEO];
print '</td></tr>';
print '</table>';

View File

@ -114,7 +114,11 @@ class Asset extends CommonObject
public $label;
public $amount;
public $fk_soc;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
/**
* @var string description

View File

@ -33,25 +33,34 @@ class AssetType extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'asset_type';
/**
* @var string ID to identify managed object
*/
public $element = 'asset_type';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'group';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/** @var string Label */
public $label;
/** @var string Accountancy code asset */
public $accountancy_code_asset;
/** @var string Accountancy code depreciation asset */
public $accountancy_code_depreciation_asset;
/** @var string Accountancy code depreciation expense */
public $accountancy_code_depreciation_expense;
/** @var string Public note */
public $note;
/** @var array Array of asset */
public $asset=array();

View File

@ -39,7 +39,11 @@ class Bookmark extends CommonObject
public $table_element='bookmark';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto = 'bookmark';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'bookmark';
/**
* @var DoliDB Database handler.
@ -56,12 +60,12 @@ class Bookmark extends CommonObject
*/
public $fk_user;
var $datec;
var $url;
var $target; // 0=replace, 1=new window
var $title;
var $position;
var $favicon;
public $datec;
public $url;
public $target; // 0=replace, 1=new window
public $title;
public $position;
public $favicon;
/**

View File

@ -51,8 +51,11 @@ class Categorie extends CommonObject
const TYPE_USER = 'user';
const TYPE_PROJECT = 'project';
const TYPE_ACCOUNT = 'bank_account';
const TYPE_BANK_LINE = 'bank_line';
const TYPE_BANK_LINE = 'bank_line';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'category';

View File

@ -45,7 +45,11 @@ class ActionComm extends CommonObject
public $table_element = 'actioncomm';
public $table_rowid = 'id';
public $picto='action';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='action';
/**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe

View File

@ -219,7 +219,7 @@ class AgendaEvents extends DolibarrApi
/**
* Update Agenda Event general fields (won't touch lines of expensereport)
* Update Agenda Event general fields
*
* @param int $id Id of Agenda Event to update
* @param array $request_data Datas
@ -236,20 +236,20 @@ class AgendaEvents extends DolibarrApi
throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
}
$result = $this->expensereport->fetch($id);
$result = $this->actioncomm->fetch($id);
if ( ! $result ) {
throw new RestException(404, 'expensereport not found');
throw new RestException(404, 'actioncomm not found');
}
if ( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) {
if ( ! DolibarrApi::_checkAccessToResource('actioncomm',$this->actioncomm->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
foreach($request_data as $field => $value) {
if ($field == 'id') continue;
$this->expensereport->$field = $value;
$this->actioncomm->$field = $value;
}
if ($this->expensereport->update($id, DolibarrApiAccess::$user,1,'','','update'))
if ($this->actioncomm->update($id, DolibarrApiAccess::$user,1,'','','update'))
return $this->get($id);
return false;

View File

@ -54,7 +54,11 @@ class CActionComm
public $active;
public $color;
public $picto;
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto;
public $type_actions=array();

View File

@ -35,39 +35,42 @@ class Mailing extends CommonObject
* @var string ID to identify managed object
*/
public $element='mailing';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='mailing';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='email';
var $titre;
var $sujet;
var $body;
var $nbemail;
var $bgcolor;
var $bgimage;
public $titre;
public $sujet;
public $body;
public $nbemail;
public $bgcolor;
public $bgimage;
var $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely
public $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely
var $email_from;
var $email_replyto;
var $email_errorsto;
public $email_from;
public $email_replyto;
public $email_errorsto;
var $joined_file1;
var $joined_file2;
var $joined_file3;
var $joined_file4;
public $joined_file1;
public $joined_file2;
public $joined_file3;
public $joined_file4;
var $user_creat;
var $user_valid;
public $user_creat;
public $user_valid;
var $date_creat;
var $date_valid;
public $date_creat;
public $date_valid;
var $extraparams=array();
public $extraparams=array();
public $statut_dest=array();
public $statuts=array();

View File

@ -65,6 +65,9 @@ class Propal extends CommonObject
*/
public $fk_element ='fk_propal';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='propal';
/**
@ -4235,7 +4238,7 @@ class PropaleLigne extends CommonObjectLine
* Update DB line fields total_xxx
* Used by migration
*
* @return int <0 if ko, >0 if ok
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_total()

View File

@ -679,7 +679,7 @@ if (empty($reshook))
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error++;
}
if ($prod_entry_mode == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && (! ($price_ht_devise >= 0) || $price_ht_devise == '')) // Unit price can be 0 but not ''
if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '' && $price_ht_devise == '') // Unit price can be 0 but not ''. Also price can be negative for order.
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;

View File

@ -4315,9 +4315,10 @@ class OrderLine extends CommonOrderLine
}
/**
* Update totals of order into database
* Update DB line fields total_xxx
* Used by migration
*
* @return int <0 if ko, >0 if ok
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_total()

View File

@ -513,7 +513,7 @@ if (empty($reshook))
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change)
{
if (! $idwarehouse || $idwarehouse == - 1) {
$error ++;
$error++;
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$action = '';
}
@ -573,7 +573,7 @@ if (empty($reshook))
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change)
{
if (! $idwarehouse || $idwarehouse == - 1) {
$error ++;
$error++;
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$action = '';
}
@ -832,7 +832,7 @@ if (empty($reshook))
}
if (! ($_POST['fac_replacement'] > 0)) {
$error ++;
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors');
}
@ -878,14 +878,14 @@ if (empty($reshook))
$sourceinvoice = GETPOST('fac_avoir');
if (! ($sourceinvoice > 0) && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE))
{
$error ++;
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors');
}
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($dateinvoice))
{
$error ++;
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors');
}
@ -1109,7 +1109,7 @@ if (empty($reshook))
{
if (GETPOST('socid', 'int') < 1)
{
$error ++;
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors');
}
@ -1279,7 +1279,7 @@ if (empty($reshook))
}
} else {
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
$error ++;
$error++;
}
}
@ -1373,7 +1373,7 @@ if (empty($reshook))
$result = $object->insert_discount($discountid); // This include link_to_invoice
} else {
setEventMessages($discount->error, $discount->errors, 'errors');
$error ++;
$error++;
break;
}
} else {
@ -1429,7 +1429,7 @@ if (empty($reshook))
$lineid = $result;
} else {
$lineid = 0;
$error ++;
$error++;
break;
}
@ -1441,7 +1441,7 @@ if (empty($reshook))
}
} else {
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
$error ++;
$error++;
}
}
@ -1665,37 +1665,46 @@ if (empty($reshook))
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error ++;
$error++;
}
if (!$prod_entry_mode)
{
if (GETPOST('type') < 0 && ! GETPOST('search_idprod'))
{
setEventMessages($langs->trans('ErrorChooseBetweenFreeEntryOrPredefinedProduct'), null, 'errors');
$error ++;
$error++;
}
}
if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error ++;
$error++;
}
if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error ++;
if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
else
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
}
if ($qty == '') {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error ++;
$error++;
}
if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
$error ++;
$error++;
}
if ($qty < 0) {
$langs->load("errors");
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
$error ++;
$error++;
}
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') {
@ -1709,7 +1718,7 @@ if (empty($reshook))
else
{
setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors');
$error ++;
$error++;
}
}
}
@ -2115,7 +2124,7 @@ if (empty($reshook))
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error ++;
$error++;
}
} else {
$type = GETPOST('type');
@ -2124,14 +2133,29 @@ if (empty($reshook))
// Check parameters
if (GETPOST('type') < 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$error ++;
$error++;
}
}
if ($qty < 0) {
$langs->load("errors");
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
$error ++;
$error++;
}
if (empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') // Unit price can be 0 but not ''
{
if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
else
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
}
// Update line
if (! $error) {

View File

@ -1209,9 +1209,9 @@ class Facture extends CommonInvoice
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_localtax1))
$label.= '<br><b>' . $langs->trans('LT1') . ':</b> ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_localtax2))
if (! empty($this->total_localtax1) && $this->total_localtax1 != 0) // We keep test != 0 because $this->total_localtax1 can be '0.00000000'
$label.= '<br><b>eee' . $langs->trans('LT1') . ':</b> ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_localtax2) && $this->total_localtax2 != 0)
$label.= '<br><b>' . $langs->trans('LT2') . ':</b> ' . price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
@ -4841,8 +4841,8 @@ class FactureLigne extends CommonInvoiceLine
}
/**
* Mise a jour en base des champs total_xxx de ligne de facture
* TODO What is goal of this method ?
* Update DB line fields total_xxx
* Used by migration
*
* @return int <0 if KO, >0 if OK
*/

View File

@ -511,8 +511,9 @@ if (! $sall)
$sql.= ' typent.code,';
$sql.= ' state.code_departement, state.nom,';
$sql.= ' country.code,';
$sql.= " p.rowid, p.ref";
$sql.= " p.rowid, p.ref, p.title";
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
{
$sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');

View File

@ -154,7 +154,7 @@ $arrayfields=array(
'p.phone'=>array('label'=>"Phone", 'checked'=>1),
'p.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0),
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1),
'p.fax'=>array('label'=>"Fax", 'checked'=>1),
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
'p.email'=>array('label'=>"EMail", 'checked'=>1),
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))),
'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
@ -307,7 +307,7 @@ if ($search_societe) $sql.= natural_search('s.nom', $search_socie
if ($search_country) $sql .= " AND p.fk_pays IN (".$search_country.')';
if (strlen($search_poste)) $sql.= natural_search('p.poste', $search_poste);
if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $search_phone_perso);
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone);
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone_pro);
if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile);
if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);

View File

@ -523,6 +523,9 @@ class Conf
// By default, we open card if one found
if (! isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE=1;
// By default, we show state code in combo list
if (! isset($this->global->MAIN_SHOW_STATE_CODE)) $this->global->MAIN_SHOW_STATE_CODE=1;
// Define list of limited modules (value must be key found for "name" property of module, so for example 'supplierproposal' for Module "Supplier Proposal"
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog'; // '' means 'all'. Note that contact is added here as it should be a module later.
if (! empty($this->modules_parts['moduleforexternal'])) // Module part to include an external module into the MAIN_MODULES_FOR_EXTERNAL list

View File

@ -48,7 +48,11 @@ class DiscountAbsolute
*/
public $id;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
public $discount_type; // 0 => customer discount, 1 => supplier discount
public $amount_ht; //
public $amount_tva; //

View File

@ -960,7 +960,7 @@ class DolGraph
var percent=Math.round(series.percent);
var number=series.data[0][1];
return \'';
$this->stringtoshow.='<div style="font-size:8pt;text-align:center;padding:2px;color:black;">';
$this->stringtoshow.='<span style="font-size:8pt;text-align:center;padding:2px;color:black;">';
if ($urltemp) $this->stringtoshow.='<a style="color: #FFFFFF;" border="0" href="'.$urltemp.'">';
$this->stringtoshow.='\'+';
$this->stringtoshow.=($showlegend?'':'label+\' \'+'); // Hide label if already shown in legend
@ -968,7 +968,7 @@ class DolGraph
$this->stringtoshow.=($showpercent?'\'<br/>\'+percent+\'%\'+':'');
$this->stringtoshow.='\'';
if ($urltemp) $this->stringtoshow.='</a>';
$this->stringtoshow.='</div>\';
$this->stringtoshow.='</span>\';
},
background: {
opacity: 0.0,

View File

@ -6674,16 +6674,17 @@ class Form
* @param string $imagesize 'mini', 'small' or '' (original)
* @param int $addlinktofullsize Add link to fullsize image
* @param int $cache 1=Accept to use image in cache
* @param string $forcecapture Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if empty.
* @return string HTML code to output photo
*/
static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0)
static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0, $forcecapture='')
{
global $conf,$langs;
$entity = (! empty($object->entity) ? $object->entity : $conf->entity);
$id = (! empty($object->id) ? $object->id : $object->rowid);
$ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';
$ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';$capture='';
if ($modulepart=='societe')
{
$dir=$conf->societe->multidir_output[$entity];
@ -6707,6 +6708,7 @@ class Form
$originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
}
$email=$object->email;
$capture='user';
}
else if ($modulepart=='userphoto')
{
@ -6720,6 +6722,7 @@ class Form
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
$capture='user';
}
else if ($modulepart=='memberphoto')
{
@ -6733,6 +6736,7 @@ class Form
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
$capture='user';
}
else
{
@ -6749,6 +6753,8 @@ class Form
$email=$object->email;
}
if ($forcecapture) $capture = $forcecapture;
if ($dir)
{
if ($file && file_exists($dir."/".$file))
@ -6805,7 +6811,7 @@ class Form
if ($object->photo) $ret.="<br>\n";
$ret.='<table class="nobordernopadding centpercent">';
if ($object->photo) $ret.='<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
$ret.='<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput"></td></tr>';
$ret.='<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput"'.($capture?' capture="'.$capture.'"':'').'></td></tr>';
$ret.='</table>';
}

View File

@ -276,7 +276,7 @@ class FormCompany
}
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
if(!empty($conf->global->MAIN_SHOW_STATE_CODE) &&
if (!empty($conf->global->MAIN_SHOW_STATE_CODE) &&
($conf->global->MAIN_SHOW_STATE_CODE == 1 || $conf->global->MAIN_SHOW_STATE_CODE == 2 || $conf->global->MAIN_SHOW_STATE_CODE === 'all')) {
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1) {
$out.= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));

View File

@ -445,8 +445,17 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (!empty($targetcontact->address)) {
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact));
}else {
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany));
} else {
$companytouseforaddress = $targetcompany;
// Contact on a thirdparty that is a different thirdparty than the thirdparty of object
if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id)
{
$targetcontact->fetch_thirparty();
$companytouseforaddress = $targetcontact->thirdparty;
}
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress));
}
// Country
if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {

View File

@ -883,7 +883,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1);

View File

@ -1113,7 +1113,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1);
@ -1338,7 +1338,6 @@ class pdf_crabe extends ModelePDFFactures
}
$pdf->SetTextColor(0,0,0);
$creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received
$depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
//print "x".$creditnoteamount."-".$depositsamount;exit;

View File

@ -347,6 +347,8 @@ class modAdherent extends DolibarrModules
);
// Cronjobs
$arraydate=dol_getdate(dol_now());
$datestart=dol_mktime(22, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
$this->cronjobs = array(
0=>array(
'label'=>'SendReminderForExpiredSubscriptionTitle',
@ -360,6 +362,7 @@ class modAdherent extends DolibarrModules
'priority'=>50,
'status'=>0,
'test'=>true,
'datestart'=>$datestart
),
);
}

View File

@ -113,9 +113,9 @@ class modAgenda extends DolibarrModules
// Cronjobs
//------------
$datestart=dol_now();
$this->cronjobs = array(
0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'1'),
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24)
0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'1', 'datestart'=>$datestart),
);
// Permissions

View File

@ -174,9 +174,9 @@ class modAsset extends DolibarrModules
// Cronjobs (List of cron jobs entries to add when module is enabled)
// unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
$this->cronjobs = array(
0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/asset/class/asset.class.php', 'objectname'=>'Asset', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true)
);
//$this->cronjobs = array(
// 0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/asset/class/asset.class.php', 'objectname'=>'Asset', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true)
//);
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true),
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true)
// );

View File

@ -173,9 +173,9 @@ class modDav extends DolibarrModules
// Cronjobs (List of cron jobs entries to add when module is enabled)
// unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
$this->cronjobs = array(
//$this->cronjobs = array(
//0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/dav/class/myobject.class.php', 'objectname'=>'MyObject', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true)
);
//);
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true),
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true)
// );

View File

@ -114,13 +114,14 @@ class modFacture extends DolibarrModules
2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home')
);
// Cronjobs
$this->cronjobs = array(
0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>true),
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600)
);
// Cronjobs
$arraydate=dol_getdate(dol_now());
$datestart=dol_mktime(23, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
$this->cronjobs = array(
0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>true, 'datestart'=>$datestart),
);
// Permissions
// Permissions
$this->rights = array();
$this->rights_class = 'facture';
$r = 0;

View File

@ -1060,7 +1060,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1);

View File

@ -649,7 +649,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + $object->remise), 0, 'R', 1);

View File

@ -821,7 +821,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);

View File

@ -355,7 +355,7 @@ else
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit);
print $langs->trans('CronInfo').'<br>';
print '<span class="opacitymedium">'.$langs->trans('CronInfo').'</span><br>';
$text =$langs->trans("HoursOnThisPageAreOnServerTZ").' '.$stringcurrentdate.'<br>';
if (! empty($conf->global->CRON_WARNING_DELAY_HOURS)) $text.=$langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS);

View File

@ -9,7 +9,7 @@
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014-2017 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Yasser Carreón <yacasia@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -1041,7 +1041,7 @@ if ($action == 'create')
if ($object->fetch_optionals() > 0) {
$expe->array_options = array_merge($expe->array_options, $object->array_options);
}
print $object->showOptionals($extrafields, 'edit');
print $expe->showOptionals($extrafields, 'edit');
}

View File

@ -147,7 +147,7 @@ class ExpenseReport extends CommonObject
// List of language codes for status
$this->statuts_short = array(0 => 'Draft', 2 => 'Validated', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused');
$this->statuts = array(0 => 'Draft', 2 => 'ValidatedWaitingApproval', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused');
$this->statuts_logo = array(0 => 'statut0', 2 => 'statut1', 4 => 'statut5', 5 => 'statut3', 6 => 'statut6', 99 => 'statut8');
$this->statuts_logo = array(0 => 'statut0', 2 => 'statut1', 4 => 'statut5', 5 => 'statut3', 6 => 'statut6', 99 => 'statut5');
return 1;
}

View File

@ -81,7 +81,7 @@ print '</form>';
$sql = "SELECT cp.rowid, cp.fk_user, cp.date_debut, cp.date_fin, ct.label, cp.description, cp.halfday";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
$sql .= " LEFT JOIN llx_user u ON cp.fk_user = u.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid";
$sql .= " WHERE cp.rowid > 0";
$sql .= " AND cp.statut = 3"; // Approved

View File

@ -221,7 +221,7 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
$userstatic->statut=$obj->statut;
print '<tr class="oddeven">';
print '<td>'.$holidaystatic->getNomUrl(1).'</td>';
print '<td class="nowraponall">'.$holidaystatic->getNomUrl(1).'</td>';
print '<td>'.$userstatic->getNomUrl(-1, 'leave').'</td>';
print '<td>'.$typeleaves[$obj->fk_type]['label'].'</td>';
@ -300,7 +300,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
$userstatic->photo=$obj->photo;
print '<tr class="oddeven">';
print '<td>'.$deplacementstatic->getNomUrl(1).'</td>';
print '<td class="nowraponall">'.$deplacementstatic->getNomUrl(1).'</td>';
print '<td>'.$userstatic->getNomUrl(-1).'</td>';
print '<td align="right">'.$obj->km.'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';
@ -373,7 +373,7 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
$userstatic->photo=$obj->photo;
print '<tr class="oddeven">';
print '<td>'.$expensereportstatic->getNomUrl(1).'</td>';
print '<td class="nowraponall">'.$expensereportstatic->getNomUrl(1).'</td>';
print '<td>'.$userstatic->getNomUrl(-1).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';

View File

@ -548,8 +548,8 @@ if ($step == 3 && $datatoimport)
print '<input type="hidden" value="'.$format.'" name="format">';
print '<input type="hidden" value="'.$excludefirstline.'" name="excludefirstline">';
print '<input type="hidden" value="'.$endatlinenb.'" name="endatlinenb">';
print '<input type="hidden" value="'.$separator.'" name="separator">';
print '<input type="hidden" value="'.$enclosure.'" name="enclosure">';
print '<input type="hidden" value="'.dol_escape_htmltag($separator).'" name="separator">';
print '<input type="hidden" value="'.dol_escape_htmltag($enclosure).'" name="enclosure">';
print '<input type="hidden" value="'.$datatoimport.'" name="datatoimport">';
print '<span class="opacitymedium">'.$langs->trans("ChooseFileToImport",img_picto('','filenew')).'</span><br><br>';
@ -648,7 +648,8 @@ if ($step == 4 && $datatoimport)
$classname = "Import".ucfirst($model);
require_once $dir.$file;
$obj = new $classname($db,$datatoimport);
if ($model == 'csv') {
if ($model == 'csv')
{
$obj->separator = $separator;
$obj->enclosure = $enclosure;
}
@ -796,9 +797,9 @@ if ($step == 4 && $datatoimport)
print '<input type="hidden" value="'.$datatoimport.'" name="datatoimport">';
print '<input type="hidden" value="'.$filetoimport.'" name="filetoimport">';
print $langs->trans("Separator").' : ';
print '<input type="text" size="1" name="separator" value="'.htmlentities($separator).'"/>';
print '<input type="text" size="1" name="separator" value="'.dol_escape_htmltag($separator).'"/>';
print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : ';
print '<input type="text" size="1" name="enclosure" value="'.htmlentities($enclosure).'"/>';
print '<input type="text" size="1" name="enclosure" value="'.dol_escape_htmltag($enclosure).'"/>';
print '<input name="update" type="submit" value="'.$langs->trans('Update').'" class="button" />';
print '</form>';
print '</td></tr>';
@ -833,8 +834,8 @@ if ($step == 4 && $datatoimport)
print '<input type="hidden" name="filetoimport" value="'.$filetoimport.'">';
print '<input type="hidden" name="excludefirstline" value="'.$excludefirstline.'">';
print '<input type="hidden" name="endatlinenb" value="'.$endatlinenb.'">';
print '<input type="hidden" name="separator" value="'.$separator.'">';
print '<input type="hidden" name="enclosure" value="'.$enclosure.'">';
print '<input type="hidden" name="separator" value="'.dol_escape_htmltag($separator).'">';
print '<input type="hidden" name="enclosure" value="'.dol_escape_htmltag($enclosure).'">';
print '<table><tr><td colspan="2" class="opacitymedium">';
print $langs->trans("SelectImportFields",img_picto('','grip_title','')).' ';
$htmlother->select_import_model($importmodelid,'importmodelid',$datatoimport,1);
@ -1116,8 +1117,8 @@ if ($step == 4 && $datatoimport)
print '<input type="hidden" name="hexa" value="'.$hexa.'">';
print '<input type="hidden" name="excludefirstline" value="'.$excludefirstline.'">';
print '<input type="hidden" name="endatlinenb" value="'.$endatlinenb.'">';
print '<input type="hidden" value="'.$separator.'" name="separator">';
print '<input type="hidden" value="'.$enclosure.'" name="enclosure">';
print '<input type="hidden" value="'.dol_escape_htmltag($separator).'" name="separator">';
print '<input type="hidden" value="'.dol_escape_htmltag($enclosure).'" name="enclosure">';
print '<table summary="selectofimportprofil" class="noborder" width="100%">';
print '<tr class="liste_titre">';
@ -1262,10 +1263,8 @@ if ($step == 5 && $datatoimport)
if ($model == 'csv') {
print '<tr><td>'.$langs->trans("CsvOptions").'</td>';
print '<td>';
print $langs->trans("Separator").' : ';
print htmlentities($separator);
print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : ';
print htmlentities($enclosure);
print $langs->trans("Separator").' : '.dol_escape_htmltag($separator);
print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : '.dol_escape_htmltag($enclosure);
print '</td></tr>';
}

View File

@ -358,7 +358,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
/*
* Dolibarr Working Board with weather
*/
$showweather=empty($conf->global->MAIN_DISABLE_METEO)?1:0;
$showweather=(empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0;
//Array that contains all WorkboardResponse classes to process them
$dashboardlines=array();
@ -536,7 +536,7 @@ $boxwork.='</tr>'."\n";
if ($showweather)
{
$boxwork.='<tr class="nohover">';
$boxwork.='<td class="nohover hideonsmartphone center valignmiddle">';
$boxwork.='<td class="nohover'.($conf->global->MAIN_DISABLE_METEO == 2 ?' hideonsmartphone' : '').' center valignmiddle">';
$text='';
if ($totallate > 0) $text=$langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",$totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')';
else $text=$langs->transnoentitiesnoconv("NoItemLate");

View File

@ -60,7 +60,7 @@ DROP TABLE llx_c_accountancy_category;
DROP TABLE llx_c_accountingaccount;
-- drop old postgresql unique key
-- VPGSQL8.2 DROP INDEX llx_usergroup_rights_fk_usergroup_fk_id_key
-- VPGSQL8.2 DROP INDEX llx_usergroup_rights_fk_usergroup_fk_id_key;
update llx_propal set fk_statut = 1 where fk_statut = -1;

View File

@ -18,7 +18,7 @@
-- ============================================================================
-- Supprimme orphelins pour permettre montee de la cle
-- Delete orphans
-- V4 DELETE llx_commande FROM llx_commande LEFT JOIN llx_societe ON llx_commande.fk_soc = llx_societe.rowid WHERE llx_societe.rowid IS NULL;
ALTER TABLE llx_commande ADD UNIQUE INDEX uk_commande_ref (ref, entity);

View File

@ -1809,3 +1809,4 @@ UseSearchToSelectResource=Use a search form to choose a resource (rather than a
DisabledResourceLinkUser=Disable feature to link a resource to users
DisabledResourceLinkContact=Disable feature to link a resource to contacts
ConfirmUnactivation=Confirm module reset
OnMobileOnly=On small screen (smartphone) only

View File

@ -79,5 +79,5 @@ CronCannotLoadObject=Class file %s was loaded, but object %s was not found into
UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Admin tools - Scheduled jobs" to see and edit scheduled jobs.
JobDisabled=Job disabled
MakeLocalDatabaseDumpShort=Local database backup
MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql' or 'pgsql'), 1, 'auto' or filename to build, number of backup files to keep
MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep
WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run.

View File

@ -116,6 +116,7 @@ ErrorLoginDoesNotExists=User with login <b>%s</b> could not be found.
ErrorLoginHasNoEmail=This user has no email address. Process aborted.
ErrorBadValueForCode=Bad value for security code. Try again with new value...
ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative
ErrorFieldCantBeNegativeOnInvoice=Field <strong>%s</strong> can't be negative on such type of invoice. If you want to add a discount line, just create the discount first with link %s on screen and apply it to invoice. You can also ask your admin to set option FACTURE_ENABLE_NEGATIVE_LINES to 1 to restore old behaviour.
ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative
ErrorWebServerUserHasNotPermission=User account <b>%s</b> used to execute web server has no permission for that
ErrorNoActivatedBarcode=No barcode type activated

View File

@ -79,5 +79,5 @@ CronCannotLoadObject=Le fichier de classe %s a été chargé, mais l'objet %s n'
UseMenuModuleToolsToAddCronJobs=Aller à la page "Accueil - Outils administration - Travaux planifiées" pour voir la listes des travaux programmées et les modifier.
JobDisabled=Travail désactivé
MakeLocalDatabaseDumpShort=Sauvegarde locale de base
MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql' ou 'pgsql'), 1, 'auto' ou nom du fichier à générer, nb de fichiers de sauvegarde à garder
MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql', 'pgsql', 'auto'), 1, 'auto' ou nom du fichier à générer, nb de fichiers de sauvegarde à garder
WarningCronDelayed=Attention, à des fins de performance, quelle que soit la prochaine date d'exécution des travaux activés, vos travaux peuvent être retardés jusqu'à %s heures avant d'être exécutés.

View File

@ -38,29 +38,34 @@ class Productcustomerprice extends CommonObject
*/
public $table_element = 'product_customer_price';
var $entity;
var $datec = '';
var $tms = '';
var $fk_product;
var $fk_soc;
var $price;
var $price_ttc;
var $price_min;
var $price_min_ttc;
var $price_base_type;
var $tva_tx;
var $recuperableonly;
var $localtax1_type;
var $localtax1_tx;
var $localtax2_type;
var $localtax2_tx;
public $entity;
public $datec = '';
public $tms = '';
public $fk_product;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
public $price;
public $price_ttc;
public $price_min;
public $price_min_ttc;
public $price_base_type;
public $tva_tx;
public $recuperableonly;
public $localtax1_type;
public $localtax1_tx;
public $localtax2_type;
public $localtax2_tx;
/**
* @var int User ID
*/
public $fk_user;
var $lines = array ();
public $lines = array ();
/**
* Constructor
@ -974,7 +979,12 @@ class PriceByCustomerLine
public $datec = '';
public $tms = '';
public $fk_product;
public $fk_soc;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
public $price;
public $price_ttc;
public $price_min;

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -319,11 +319,12 @@ if ($resql)
{
$objp = $db->fetch_object($resql);
print '<tr>';
print '<td class="nowrap">';
$product=new Product($db);
$product->fetch($objp->rowid);
$product->load_stock();
print '<tr>';
print '<td class="nowrap">';
print $product->getNomUrl(1,'',16);
//if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow"));
print '</td>';
@ -360,15 +361,13 @@ if ($resql)
}
}
// Virtual stock
if ($virtualdiffersfromphysical)
{
print '<td align="right">';
print '<td align="right">';
if ($objp->seuil_stock_alerte != '' && ($product->stock_theorique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' ';
print $product->stock_theorique;
print '</td>';
print $product->stock_theorique;
print '</td>';
}
print '<td align="right"><a href="'.DOL_URL_ROOT.'/product/stock/mouvement.php?idproduct='.$product->id.'">'.$langs->trans("Movements").'</a></td>';
print '<td align="right" class="nowrap">'.$product->LibStatut($objp->statut,5,0).'</td>';

View File

@ -292,7 +292,7 @@ $listofreferent=array(
'class'=>'SupplierProposal',
'table'=>'supplier_proposal',
'datefieldname'=>'date',
'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&socid='.$socid,
'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object
'lang'=>'supplier_proposal',
'buttonnew'=>'AddSupplierProposal',
'testnew'=>$user->rights->supplier_proposal->creer,
@ -565,8 +565,6 @@ print '<td align="right" width="100">'.$langs->trans("AmountHT").'</td>';
print '<td align="right" width="100">'.$langs->trans("AmountTTC").'</td>';
print '</tr>';
$var = false;
foreach ($listofreferent as $key => $value)
{
$name=$langs->trans($value['name']);
@ -760,9 +758,9 @@ foreach ($listofreferent as $key => $value)
if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew)
{
$addform.='<div class="inline-block valignmiddle">';
if ($testnew) $addform.='<a class="buttonxxx" href="'.$urlnew.'">'.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).'</a>';
if ($testnew) $addform.='<a class="buttonxxx" href="'.$urlnew.'">'.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' <span class="fa fa-plus-circle valignmiddle"></span></a>';
elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) {
$addform.='<a class="buttonxxx buttonRefused" disabled="disabled" href="#">'.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).'</a>';
$addform.='<a class="buttonxxx buttonRefused" disabled="disabled" href="#">'.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' <span class="fa fa-plus-circle valignmiddle"></span></a>';
}
$addform.='<div>';
}

View File

@ -534,7 +534,7 @@ if ($ispaymentok)
$listofmimes=array(dol_mimetype($file));
}
$result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1);
$result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofmimes, $listofnames, "", "", 0, -1);
if ($result < 0)
{
@ -546,6 +546,8 @@ if ($ispaymentok)
{
if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)';
else $postactionmessages[] = 'Email sent to member (without any attached document)';
// TODO Add actioncomm event
}
}
}

View File

@ -124,7 +124,11 @@ class CompanyPaymentMode extends CommonObject
*/
public $rowid;
public $fk_soc;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
public $label;
public $bank;
public $code_banque;

View File

@ -111,7 +111,12 @@ class SocieteAccount extends CommonObject
public $pass_encoding;
public $pass_crypted;
public $pass_temp;
public $fk_soc;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
public $site;
public $date_last_login;
public $date_previous_login;

View File

@ -711,48 +711,48 @@ if (! empty($arrayfields['s.nom']['checked']))
{
print '<td class="liste_titre">';
if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only;
print '<input class="flat searchstring" type="text" name="search_nom" size="8" value="'.dol_escape_htmltag($search_nom).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_nom" value="'.dol_escape_htmltag($search_nom).'">';
print '</td>';
}
if (! empty($arrayfields['s.name_alias']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat searchstring" type="text" name="search_alias" size="8" value="'.dol_escape_htmltag($search_alias).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_alias" value="'.dol_escape_htmltag($search_alias).'">';
print '</td>';
}
// Barcode
if (! empty($arrayfields['s.barcode']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat searchstring" type="text" name="search_barcode" size="6" value="'.dol_escape_htmltag($search_barcode).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_barcode" value="'.dol_escape_htmltag($search_barcode).'">';
print '</td>';
}
// Customer code
if (! empty($arrayfields['s.code_client']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="8" type="text" name="search_customer_code" value="'.dol_escape_htmltag($search_customer_code).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_customer_code" value="'.dol_escape_htmltag($search_customer_code).'">';
print '</td>';
}
// Supplier code
if (! empty($arrayfields['s.code_fournisseur']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="8" type="text" name="search_supplier_code" value="'.dol_escape_htmltag($search_supplier_code).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_supplier_code" value="'.dol_escape_htmltag($search_supplier_code).'">';
print '</td>';
}
// Account Customer code
if (! empty($arrayfields['s.code_compta']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="8" type="text" name="search_account_customer_code" value="'.dol_escape_htmltag($search_account_customer_code).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_account_customer_code" value="'.dol_escape_htmltag($search_account_customer_code).'">';
print '</td>';
}
// Account Supplier code
if (! empty($arrayfields['s.code_compta_fournisseur']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" size="8" type="text" name="search_account_supplier_code" value="'.dol_escape_htmltag($search_account_supplier_code).'">';
print '<input class="flat maxwidth50" type="text" name="search_account_supplier_code" value="'.dol_escape_htmltag($search_account_supplier_code).'">';
print '</td>';
}
// Town
@ -766,21 +766,21 @@ if (! empty($arrayfields['s.town']['checked']))
if (! empty($arrayfields['s.zip']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).'">';
print '</td>';
}
// State
if (! empty($arrayfields['state.nom']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
print '</td>';
}
// Region
if (! empty($arrayfields['region.nom']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_region" value="'.dol_escape_htmltag($search_region).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_region" value="'.dol_escape_htmltag($search_region).'">';
print '</td>';
}
// Country
@ -801,14 +801,14 @@ if (! empty($arrayfields['s.email']['checked']))
{
// Email
print '<td class="liste_titre">';
print '<input class="flat searchemail" size="4" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'">';
print '<input class="flat searchemail maxwidth50" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'">';
print '</td>';
}
if (! empty($arrayfields['s.phone']['checked']))
{
// Phone
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).'">';
print '</td>';
}
if (! empty($arrayfields['s.fax']['checked']))
@ -822,14 +822,14 @@ if (! empty($arrayfields['s.url']['checked']))
{
// Url
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_url" value="'.dol_escape_htmltag($search_url).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_url" value="'.dol_escape_htmltag($search_url).'">';
print '</td>';
}
if (! empty($arrayfields['s.siren']['checked']))
{
// IdProf1
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_idprof1" value="'.dol_escape_htmltag($search_idprof1).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_idprof1" value="'.dol_escape_htmltag($search_idprof1).'">';
print '</td>';
}
if (! empty($arrayfields['s.siret']['checked']))
@ -850,28 +850,28 @@ if (! empty($arrayfields['s.idprof4']['checked']))
{
// IdProf4
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_idprof4" value="'.dol_escape_htmltag($search_idprof4).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_idprof4" value="'.dol_escape_htmltag($search_idprof4).'">';
print '</td>';
}
if (! empty($arrayfields['s.idprof5']['checked']))
{
// IdProf5
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_idprof5" value="'.dol_escape_htmltag($search_idprof5).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_idprof5" value="'.dol_escape_htmltag($search_idprof5).'">';
print '</td>';
}
if (! empty($arrayfields['s.idprof6']['checked']))
{
// IdProf6
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_idprof6" value="'.dol_escape_htmltag($search_idprof6).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_idprof6" value="'.dol_escape_htmltag($search_idprof6).'">';
print '</td>';
}
if (! empty($arrayfields['s.tva_intra']['checked']))
{
// Vat number
print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_vat" value="'.dol_escape_htmltag($search_vat).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_vat" value="'.dol_escape_htmltag($search_vat).'">';
print '</td>';
}
@ -958,7 +958,7 @@ if (! empty($arrayfields['s.status']['checked']))
if (! empty($arrayfields['s.import_key']['checked']))
{
print '<td class="liste_titre center">';
print '<input class="flat searchstring" type="text" name="search_import_key" size="3" value="'.dol_escape_htmltag($search_import_key).'">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).'">';
print '</td>';
}
// Action column

View File

@ -33,7 +33,10 @@ class Stripe extends CommonObject
*/
public $rowid;
public $fk_soc;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
public $fk_key;

View File

@ -68,6 +68,10 @@ class ActionsTicket
public $description;
public $fk_statut;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
/**

View File

@ -2502,8 +2502,8 @@ class TicketsLine
public $track_id;
/**
* Thirdparty ID
*/
* @var int Thirdparty ID
*/
public $fk_soc;
/**

View File

@ -1010,7 +1010,7 @@ if ($action == 'create' || $action == 'adduserldap')
}
else
{
print '<input size="40" type="text" name="skype" value="'.GETPOST('skype').'">';
print '<input class="maxwidth200" type="text" name="skype" value="'.GETPOST('skype').'">';
}
print '</td></tr>';
}