Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop-api

This commit is contained in:
Neil Orley 2017-10-26 11:07:50 +02:00
commit dcc5adf93b
64 changed files with 4273 additions and 3528 deletions

View File

@ -29,7 +29,7 @@ class AccountingJournal extends CommonObject
public $element='accounting_journal';
public $table_element='accounting_journal';
public $fk_element = '';
protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $rowid;

View File

@ -43,7 +43,7 @@ class Adherent extends CommonObject
{
public $element='member';
public $table_element='adherent';
protected $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
var $mesgs;

View File

@ -421,9 +421,13 @@ if ($mode == 'feature')
$i=0;
foreach($objMod->tabs as $val)
{
$tmp=explode(':',$val,3);
$text.=($i?', ':'').$tmp[0].':'.$tmp[1];
$i++;
if (is_array($val)) $val=$val['data'];
if (is_string($val))
{
$tmp=explode(':',$val,3);
$text.=($i?', ':'').$tmp[0].':'.$tmp[1];
$i++;
}
}
}
else $text.=$langs->trans("No");

View File

@ -30,7 +30,7 @@ class Bookmark extends CommonObject
{
public $element='bookmark';
public $table_element='bookmark';
protected $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
public $picto = 'bookmark';
var $db;

View File

@ -36,7 +36,7 @@ class ActionComm extends CommonObject
public $element='action';
public $table_element = 'actioncomm';
public $table_rowid = 'id';
protected $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
public $picto='action';
/**

View File

@ -48,7 +48,7 @@ class Propal extends CommonObject
public $table_element='propal';
public $table_element_line='propaldet';
public $fk_element='fk_propal';
protected $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
public $picto='propal';
/**

View File

@ -46,7 +46,7 @@ class Commande extends CommonOrder
public $table_element_line = 'commandedet';
public $class_element_line = 'OrderLine';
public $fk_element = 'fk_commande';
protected $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
public $picto = 'order';
/**

View File

@ -35,7 +35,7 @@ class Deplacement extends CommonObject
public $table_element='deplacement';
public $table_element_line = '';
public $fk_element = '';
protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $datec; // Creation date
var $dated;

View File

@ -52,7 +52,7 @@ class Facture extends CommonInvoice
public $table_element='facture';
public $table_element_line = 'facturedet';
public $fk_element = 'fk_facture';
protected $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
public $picto='bill';
/**

View File

@ -39,7 +39,7 @@ class Contact extends CommonObject
{
public $element='contact';
public $table_element='socpeople';
protected $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
public $civility_id; // In fact we store civility_code
public $civility_code;

View File

@ -44,7 +44,7 @@ class Contrat extends CommonObject
public $table_element='contrat';
public $table_element_line='contratdet';
public $fk_element='fk_contrat';
protected $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
public $picto='contract';
/**

View File

@ -46,7 +46,11 @@ if ($action == 'add' && ! empty($permissiontoadd))
{
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; // Ignore special fields
$object->$key=GETPOST($key,'alpha');
$value = GETPOST($key,'alpha');
if (preg_match('/^integer:/i', $object->fields[$key]['type']) && $value == '-1') $value=''; // This is an implicit foreign key field
if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field
$object->$key=$value;
if ($val['notnull'] > 0 && $object->$key == '')
{
$error++;
@ -85,7 +89,11 @@ if ($action == 'update' && ! empty($permissiontoadd))
{
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; // Ignore special fields
$object->$key=GETPOST($key,'alpha');
$value = GETPOST($key,'alpha');
if (preg_match('/^integer:/i', $object->fields[$key]['type']) && $value == '-1') $value=''; // This is an implicit foreign key field
if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field
$object->$key=$value;
if ($val['notnull'] > 0 && $object->$key == '')
{
$error++;

View File

@ -0,0 +1,86 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/ajax/selectobject.php
* \brief File to return Ajax response on a selection list request
*/
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
require '../../main.inc.php';
$objectdesc=GETPOST('objectdesc', 'alpha');
$htmlname=GETPOST('htmlname', 'aZ09');
$sqlfilter=GETPOST('sqlfilter', 'alpha');
$outjson=(GETPOST('outjson', 'int') ? GETPOST('outjson', 'int') : 0);
$action=GETPOST('action', 'alpha');
$id=GETPOST('id', 'int');
/*
* View
*/
//print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
dol_syslog(join(',', $_GET));
//print_r($_GET);
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form = new Form($db);
//$langs->load("companies");
top_httphead();
if (empty($htmlname)) return;
$InfoFieldList = explode(":", $objectdesc);
$classname=$InfoFieldList[0];
$classpath=$InfoFieldList[1];
if (! empty($classpath))
{
dol_include_once($classpath);
if ($classname && class_exists($classname))
{
$objecttmp = new $classname($db);
}
}
if (! is_object($objecttmp))
{
dol_syslog('Error bad param objectdesc', LOG_WARNING);
print 'Error bad param objectdesc';
}
// When used from jQuery, the search term is added as GET param "term".
$searchkey=(($id && GETPOST($id, 'alpha'))?GETPOST($id, 'alpha'):(($htmlname && GETPOST($htmlname, 'alpha'))?GETPOST($htmlname, 'alpha'):''));
// TODO Add a security test to avoid to get content of all tables
$arrayresult=$form->selectForFormsList($objecttmp, $htmlname, '', 0, $searchkey, '', '', '', 0, 1);
$db->close();
if ($outjson) print json_encode($arrayresult);

View File

@ -4663,12 +4663,19 @@ abstract class CommonObject
* @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names)
* @param mixed $showsize Value for css to define size. May also be a numeric.
* @param int $objectid Current object id
* @return string
*/
function showInputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $showsize=0, $objectid=0)
function showInputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $showsize=0)
{
global $conf,$langs;
global $conf,$langs,$form;
if (! is_object($form))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form=new Form($this->db);
}
$objectid = $this->id;
$label=$val['label'];
$type =$val['type'];
@ -4696,7 +4703,6 @@ abstract class CommonObject
$hidden=(abs($val['visible'])!=1 ? 1 : 0);
$help=$val['help'];
if ($computed)
{
if (! preg_match('/^search_/', $keyprefix)) return '<span class="opacitymedium">'.$langs->trans("AutomaticallyCalculated").'</span>';
@ -4756,10 +4762,6 @@ abstract class CommonObject
// Do not show current date when field not required (see select_date() method)
if (!$required && $value == '') $value = '-1';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
global $form;
if (! is_object($form)) $form=new Form($this->db);
// TODO Must also support $moreparam
$out = $form->select_date($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, ($keyprefix != 'search_' ? 1 : 0), 1, 0, 1);
}
@ -4817,7 +4819,7 @@ abstract class CommonObject
}
$out.='<select class="flat '.$showsize.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam?$moreparam:'').'>';
$out.='<option value="0">&nbsp;</option>';
if ((! isset($val['default'])) || ($val['notnull'] != 1)) $out.='<option value="0">&nbsp;</option>';
foreach ($param['options'] as $key => $val)
{
if ((string) $key == '') continue;
@ -4996,12 +4998,8 @@ abstract class CommonObject
}
elseif ($type == 'checkbox')
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form = new Form($db);
$value_arr=explode(',',$value);
$out=$form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options'])?null:$param['options']), $value_arr, '', 0, '', 0, '100%');
}
elseif ($type == 'radio')
{
@ -5151,9 +5149,6 @@ abstract class CommonObject
}
$this->db->free($resql);
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form = new Form($db);
$out=$form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%');
} else {
@ -5164,33 +5159,9 @@ abstract class CommonObject
}
elseif ($type == 'link')
{
$out='';
$param_list=array_keys($param['options']);
// 0 : ObjectName
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
if ($InfoFieldList[0] && class_exists($InfoFieldList[0]))
{
$valuetoshow=$value;
if (!empty($value))
{
$object = new $InfoFieldList[0]($this->db);
$resfetch=$object->fetch($value);
if ($resfetch > 0)
{
$valuetoshow=$object->ref;
if ($object->element == 'societe') $valuetoshow=$object->name; // Special case for thirdparty because ->ref is not name but id (because name is not unique)
}
}
$out.='<input type="text" class="flat '.$showsize.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$valuetoshow.'" >';
}
else
{
dol_syslog('Error bad setup of type for field '.$InfoFieldList, LOG_WARNING);
$out.='Error bad setup of type for field '.join(',', $InfoFieldList);
}
$param_list=array_keys($param['options']); // $param_list='ObjectName:classPath'
$showempty=(($val['notnull'] == 1 && $val['default'] != '')?0:1);
$out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty);
}
elseif ($type == 'password')
{
@ -5208,6 +5179,328 @@ abstract class CommonObject
}
/**
* Return HTML string to show a field into a page
* Code very similar with showOutputField of extra fields
*
* @param array $val Array of properties for field to show
* @param string $key Key of attribute
* @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value)
* @param string $moreparam To add more parametes on html input tag
* @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names)
* @param mixed $showsize Value for css to define size. May also be a numeric.
* @return string
*/
function showOutputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $showsize=0)
{
global $conf,$langs,$form;
if (! is_object($form))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form=new Form($this->db);
}
$objectid = $this->id;
$label=$val['label'];
$type =$val['type'];
$size =$val['css'];
// Convert var to be able to share same code than showOutputField of extrafields
if (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) int varchar
if (is_array($val['arrayofkeyval'])) $type='select';
if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) $type='link';
//$elementtype=$this->attribute_elementtype[$key]; // seems to not be used
$default=$val['default'];
$computed=$val['computed'];
$unique=$val['unique'];
$required=$val['required'];
$param=$val['param'];
if (is_array($val['arrayofkeyval'])) $param['options'] = $val['arrayofkeyval'];
if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg))
{
$type='link';
$param['options']=array($reg[1].':'.$reg[2]=>$reg[1].':'.$reg[2]);
}
$langfile=$val['langfile'];
$list=$val['list'];
$hidden=(abs($val['visible'])!=1 ? 1 : 0);
$help=$val['help'];
if ($hidden) return '';
// If field is a computed field, value must become result of compute
if ($computed)
{
// Make the eval of compute string
//var_dump($computed);
$value = dol_eval($computed, 1, 0);
}
$showsize=0;
if ($type == 'date')
{
$showsize=10;
$value=dol_print_date($value,'day');
}
elseif ($type == 'datetime')
{
$showsize=19;
$value=dol_print_date($value,'dayhour');
}
elseif ($type == 'int')
{
$showsize=10;
}
elseif ($type == 'double')
{
if (!empty($value)) {
$value=price($value);
}
}
elseif ($type == 'boolean')
{
$checked='';
if (!empty($value)) {
$checked=' checked ';
}
$value='<input type="checkbox" '.$checked.' '.($moreparam?$moreparam:'').' readonly disabled>';
}
elseif ($type == 'mail')
{
$value=dol_print_email($value,0,0,0,64,1,1);
}
elseif ($type == 'url')
{
$value=dol_print_url($value,'_blank',32,1);
}
elseif ($type == 'phone')
{
$value=dol_print_phone($value, '', 0, 0, '', '&nbsp;', 1);
}
elseif ($type == 'price')
{
$value=price($value,0,$langs,0,0,-1,$conf->currency);
}
elseif ($type == 'select')
{
$value=$params['options'][$value];
}
elseif ($type == 'sellist')
{
$param_list=array_keys($params['options']);
$InfoFieldList = explode(":", $param_list[0]);
$selectkey="rowid";
$keyList='rowid';
if (count($InfoFieldList)>=3)
{
$selectkey = $InfoFieldList[2];
$keyList=$InfoFieldList[2].' as rowid';
}
$fields_label = explode('|',$InfoFieldList[1]);
if(is_array($fields_label)) {
$keyList .=', ';
$keyList .= implode(', ', $fields_label);
}
$sql = 'SELECT '.$keyList;
$sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0];
if (strpos($InfoFieldList[4], 'extra')!==false)
{
$sql.= ' as main';
}
if ($selectkey=='rowid' && empty($value)) {
$sql.= " WHERE ".$selectkey."=0";
} elseif ($selectkey=='rowid') {
$sql.= " WHERE ".$selectkey."=".$this->db->escape($value);
}else {
$sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
}
//$sql.= ' AND entity = '.$conf->entity;
dol_syslog(get_class($this).':showOutputField:$type=sellist', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
$value=''; // value was used, so now we reste it to use it to build final output
$obj = $this->db->fetch_object($resql);
// Several field into label (eq table:code|libelle:rowid)
$fields_label = explode('|',$InfoFieldList[1]);
if(is_array($fields_label) && count($fields_label)>1)
{
foreach ($fields_label as $field_toshow)
{
$translabel='';
if (!empty($obj->$field_toshow)) {
$translabel=$langs->trans($obj->$field_toshow);
}
if ($translabel!=$field_toshow) {
$value.=dol_trunc($translabel,18).' ';
}else {
$value.=$obj->$field_toshow.' ';
}
}
}
else
{
$translabel='';
if (!empty($obj->{$InfoFieldList[1]})) {
$translabel=$langs->trans($obj->{$InfoFieldList[1]});
}
if ($translabel!=$obj->{$InfoFieldList[1]}) {
$value=dol_trunc($translabel,18);
}else {
$value=$obj->{$InfoFieldList[1]};
}
}
}
else dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
}
elseif ($type == 'radio')
{
$value=$params['options'][$value];
}
elseif ($type == 'checkbox')
{
$value_arr=explode(',',$value);
$value='';
if (is_array($value_arr))
{
foreach ($value_arr as $keyval=>$valueval) {
$toprint[]='<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$params['options'][$valueval].'</li>';
}
}
$value='<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
}
elseif ($type == 'chkbxlst')
{
$value_arr = explode(',', $value);
$param_list = array_keys($params['options']);
$InfoFieldList = explode(":", $param_list[0]);
$selectkey = "rowid";
$keyList = 'rowid';
if (count($InfoFieldList) >= 3) {
$selectkey = $InfoFieldList[2];
$keyList = $InfoFieldList[2] . ' as rowid';
}
$fields_label = explode('|', $InfoFieldList[1]);
if (is_array($fields_label)) {
$keyList .= ', ';
$keyList .= implode(', ', $fields_label);
}
$sql = 'SELECT ' . $keyList;
$sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList[0];
if (strpos($InfoFieldList[4], 'extra') !== false) {
$sql .= ' as main';
}
// $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
// $sql.= ' AND entity = '.$conf->entity;
dol_syslog(get_class($this) . ':showOutputField:$type=chkbxlst',LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$value = ''; // value was used, so now we reste it to use it to build final output
$toprint=array();
while ( $obj = $this->db->fetch_object($resql) ) {
// Several field into label (eq table:code|libelle:rowid)
$fields_label = explode('|', $InfoFieldList[1]);
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
if (is_array($fields_label) && count($fields_label) > 1) {
foreach ( $fields_label as $field_toshow ) {
$translabel = '';
if (! empty($obj->$field_toshow)) {
$translabel = $langs->trans($obj->$field_toshow);
}
if ($translabel != $field_toshow) {
$toprint[]='<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.dol_trunc($translabel, 18).'</li>';
} else {
$toprint[]='<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$obj->$field_toshow.'</li>';
}
}
} else {
$translabel = '';
if (! empty($obj->{$InfoFieldList[1]})) {
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
}
if ($translabel != $obj->{$InfoFieldList[1]}) {
$toprint[]='<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.dol_trunc($translabel, 18).'</li>';
} else {
$toprint[]='<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$obj->{$InfoFieldList[1]}.'</li>';
}
}
}
}
$value='<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
} else {
dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING);
}
}
elseif ($type == 'link')
{
$out='';
// only if something to display (perf)
if ($value)
{
$param_list=array_keys($param['options']); // $param_list='ObjectName:classPath'
$InfoFieldList = explode(":", $param_list[0]);
$classname=$InfoFieldList[0];
$classpath=$InfoFieldList[1];
if (! empty($classpath))
{
dol_include_once($InfoFieldList[1]);
if ($classname && class_exists($classname))
{
$object = new $classname($this->db);
$object->fetch($value);
$value=$object->getNomUrl(3);
}
}
else
{
dol_syslog('Error bad setup of extrafield', LOG_WARNING);
return 'Error bad setup of extrafield';
}
}
}
elseif ($type == 'text')
{
$value=dol_htmlentitiesbr($value);
}
elseif ($type == 'password')
{
$value=preg_replace('/./i','*',$value);
}
else
{
$showsize=round($size);
if ($showsize > 48) $showsize=48;
}
//print $type.'-'.$size;
$out=$value;
return $out;
}
/**
* Function to show lines of extrafields with output datas
@ -5737,6 +6030,8 @@ abstract class CommonObject
*/
public function createCommon(User $user, $notrigger = false)
{
global $langs;
$error = 0;
$now=dol_now();
@ -5749,10 +6044,27 @@ abstract class CommonObject
$keys=array();
$values = array();
foreach ($fieldvalues as $k => $v) {
$keys[] = $k;
$values[] = $this->quote($v, $this->fields[$k]);
$keys[$k] = $k;
$value = $this->fields[$k];
$values[$k] = $this->quote($v, $value);
}
// Clean and check mandatory
foreach($keys as $key)
{
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') $values[$key]=''; // This is an implicit foreign key field
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]=''; // This is an explicit foreign key field
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
if ($this->fields[$key]['notnull'] == 1 && empty($values[$key]))
{
$error++;
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
}
}
if ($error) return -1;
$this->db->begin();
if (! $error)
@ -5846,6 +6158,8 @@ abstract class CommonObject
*/
public function updateCommon(User $user, $notrigger = false)
{
global $langs;
$error = 0;
$fieldvalues = $this->set_save_query();
@ -5866,6 +6180,21 @@ abstract class CommonObject
}
$tmp[] = $k.'='.$this->quote($v, $this->fields[$k]);
}
// Clean and check mandatory
foreach($keys as $key)
{
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') $values[$key]=''; // This is an implicit foreign key field
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]=''; // This is an explicit foreign key field
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
if ($this->fields[$key]['notnull'] == 1 && empty($values[$key]))
{
$error++;
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
}
}
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET '.implode( ',', $tmp ).' WHERE rowid='.$this->id ;
$this->db->begin();

View File

@ -81,14 +81,16 @@ class DolGraph
/**
* Constructor
*
* @param string $library 'jflot' (default) or 'artichow' (no more supported)
*/
function __construct()
function __construct($library='jflot')
{
global $conf;
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
// To use old feature
if (isset($conf->global->MAIN_GRAPH_LIBRARY) && $conf->global->MAIN_GRAPH_LIBRARY == 'artichow')
if ($library == 'artichow')
{
$this->_library='artichow';
@ -586,7 +588,7 @@ class DolGraph
}
/**
* Build a graph onto disk using correct library
* Build a graph into memory using correct library (may also be wrote on disk, depending on library used)
*
* @param string $file Image file name to use to save onto disk (also used as javascript unique id)
* @param string $fileurl Url path to show image if saved onto disk

View File

@ -46,7 +46,7 @@ class EmailSenderProfile extends CommonObject
/**
* @var array Does emailsenderprofile support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
protected $ismultientitymanaged = 1;
public $ismultientitymanaged = 1;
/**
* @var string String with name of icon for emailsenderprofile
*/

View File

@ -809,7 +809,13 @@ class ExtraFields
*/
function showInputField($key, $value, $moreparam='', $keysuffix='', $keyprefix='', $showsize=0, $objectid=0)
{
global $conf,$langs;
global $conf,$langs,$form;
if (! is_object($form))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form=new Form($this->db);
}
$keyprefix = $keyprefix.'options_'; // Because we work on extrafields
@ -885,10 +891,6 @@ class ExtraFields
// Do not show current date when field not required (see select_date() method)
if (!$required && $value == '') $value = '-1';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
global $form;
if (! is_object($form)) $form=new Form($this->db);
// TODO Must also support $moreparam
$out = $form->select_date($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, ($keyprefix != 'search_' ? 1 : 0), 1, 0, 1);
}
@ -1125,12 +1127,8 @@ class ExtraFields
}
elseif ($type == 'checkbox')
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form = new Form($db);
$value_arr=explode(',',$value);
$out=$form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options'])?null:$param['options']), $value_arr, '', 0, '', 0, '100%');
}
elseif ($type == 'radio')
{
@ -1280,9 +1278,6 @@ class ExtraFields
}
$this->db->free($resql);
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form = new Form($db);
$out=$form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%');
} else {
@ -1293,33 +1288,9 @@ class ExtraFields
}
elseif ($type == 'link')
{
$out='';
$param_list=array_keys($param['options']);
// 0 : ObjectName
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
if ($InfoFieldList[0] && class_exists($InfoFieldList[0]))
{
$valuetoshow=$value;
if (!empty($value))
{
$object = new $InfoFieldList[0]($this->db);
$resfetch=$object->fetch($value);
if ($resfetch > 0)
{
$valuetoshow=$object->ref;
if ($object->element == 'societe') $valuetoshow=$object->name; // Special case for thirdparty because ->ref is not name but id (because name is not unique)
}
}
$out.='<input type="text" class="flat '.$showsize.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$valuetoshow.'" >';
}
else
{
dol_syslog('Error bad setup of extrafield', LOG_WARNING);
$out.='Error bad setup of extrafield';
}
$param_list=array_keys($param['options']); // $param_list='ObjectName:classPath'
$showempty=(($val['notnull'] == 1 && $val['default'] != '')?0:1);
$out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty);
}
elseif ($type == 'password')
{
@ -1357,11 +1328,13 @@ class ExtraFields
$computed=$this->attribute_computed[$key];
$unique=$this->attribute_unique[$key];
$required=$this->attribute_required[$key];
$params=$this->attribute_param[$key];
$param=$this->attribute_param[$key];
$perms=$this->attribute_perms[$key];
$langfile=$this->attribute_langfile[$key];
$list=$this->attribute_list[$key];
$hidden=$this->attribute_hidden[$key]; // warning, do not rely on this. If your module need a hidden data, it must use its own table.
$hidden=(abs($list)!=1 ? 1 : 0);
if ($hidden) return '';
// If field is a computed field, value must become result of compute
if ($computed)
@ -1418,11 +1391,11 @@ class ExtraFields
}
elseif ($type == 'select')
{
$value=$params['options'][$value];
$value=$param['options'][$value];
}
elseif ($type == 'sellist')
{
$param_list=array_keys($params['options']);
$param_list=array_keys($param['options']);
$InfoFieldList = explode(":", $param_list[0]);
$selectkey="rowid";
@ -1499,7 +1472,7 @@ class ExtraFields
}
elseif ($type == 'radio')
{
$value=$params['options'][$value];
$value=$param['options'][$value];
}
elseif ($type == 'checkbox')
{
@ -1508,7 +1481,7 @@ class ExtraFields
if (is_array($value_arr))
{
foreach ($value_arr as $keyval=>$valueval) {
$toprint[]='<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$params['options'][$valueval].'</li>';
$toprint[]='<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$param['options'][$valueval].'</li>';
}
}
$value='<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
@ -1517,7 +1490,7 @@ class ExtraFields
{
$value_arr = explode(',', $value);
$param_list = array_keys($params['options']);
$param_list = array_keys($param['options']);
$InfoFieldList = explode(":", $param_list[0]);
$selectkey = "rowid";
@ -1589,22 +1562,26 @@ class ExtraFields
// only if something to display (perf)
if ($value)
{
$param_list=array_keys($params['options']);
// 0 : ObjectName
// 1 : classPath
$param_list=array_keys($param['options']); // $param_list='ObjectName:classPath'
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
if ($InfoFieldList[0] && class_exists($InfoFieldList[0]))
{
$object = new $InfoFieldList[0]($this->db);
$object->fetch($value);
$value=$object->getNomUrl(3);
}
else
{
dol_syslog('Error bad setup of extrafield', LOG_WARNING);
$out.='Error bad setup of extrafield';
}
$classname=$InfoFieldList[0];
$classpath=$InfoFieldList[1];
if (! empty($classpath))
{
dol_include_once($InfoFieldList[1]);
if ($classname && class_exists($classname))
{
$object = new $classname($this->db);
$object->fetch($value);
$value=$object->getNomUrl(3);
}
}
else
{
dol_syslog('Error bad setup of extrafield', LOG_WARNING);
return 'Error bad setup of extrafield';
}
}
}
elseif ($type == 'text')
@ -1624,10 +1601,6 @@ class ExtraFields
//print $type.'-'.$size;
$out=$value;
if (!empty($hidden)) {
$out='';
}
return $out;
}

View File

@ -32,7 +32,7 @@ class Fiscalyear extends CommonObject
public $table_element='accounting_fiscalyear';
public $table_element_line = '';
public $fk_element = '';
protected $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
var $rowid;

View File

@ -727,7 +727,7 @@ class Form
* @param string $page Defined the form action
* @param string $htmlname Name of html select object
* @param string $htmloption Options html on select object
* @param int $forcecombo Force to use standard combo box (no ajax use)
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
* @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @return string HTML string with select and input
*/
@ -959,7 +959,7 @@ class Form
* @param int $filter Filter on thirdparty
* @param int $limit Limit on number of returned lines
* @param array $ajaxoptions Options for ajax_autocompleter
* @param int $forcecombo Force to use combo box
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
* @return string Return select box for thirdparty.
* @deprecated 3.8 Use select_company instead. For exemple $form->select_thirdparty(GETPOST('socid'),'socid','',0) => $form->select_company(GETPOST('socid'),'socid','',1,0,0,array(),0)
*/
@ -976,7 +976,7 @@ class Form
* @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)')
* @param string $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty')
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
* @param int $forcecombo Force to use combo box
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
* @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param int $limit Maximum number of elements
* @param string $morecss Add more css styles to the SELECT component
@ -1007,11 +1007,7 @@ class Form
// mode 1
$urloption='htmlname='.$htmlname.'&outjson=1&filter='.$filter.($showtype?'&showtype='.$showtype:'');
$out.= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
$out.='<style type="text/css">
.ui-autocomplete {
z-index: 250;
}
</style>';
$out.='<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
else if ($hidelabel > 1) {
if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"';
@ -1020,7 +1016,7 @@ class Form
$out.= img_picto($langs->trans("Search"), 'search');
}
}
$out.= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
$out.= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
if ($hidelabel == 3) {
$out.= img_picto($langs->trans("Search"), 'search');
}
@ -1043,7 +1039,7 @@ class Form
* @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client in (1,3)')
* @param string $showempty Add an empty field (Can be '1' or text to use on empty line like 'SelectThirdParty')
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
* @param int $forcecombo Force to use combo box
* @param int $forcecombo Force to use standard HTML select component without beautification
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param string $filterkey Filter on key value
* @param int $outputmode 0=HTML select string, 1=Array
@ -1152,17 +1148,23 @@ class Form
if ($obj->fournisseur) $label.=($obj->client?', ':'').$langs->trans("Supplier");
if ($obj->client || $obj->fournisseur) $label.=')';
}
if ($selected > 0 && $selected == $obj->rowid)
if (empty($outputmode))
{
$out.= '<option value="'.$obj->rowid.'" selected>'.$label.'</option>';
if ($selected > 0 && $selected == $obj->rowid)
{
$out.= '<option value="'.$obj->rowid.'" selected>'.$label.'</option>';
}
else
{
$out.= '<option value="'.$obj->rowid.'">'.$label.'</option>';
}
}
else
{
$out.= '<option value="'.$obj->rowid.'">'.$label.'</option>';
array_push($outarray, array('key'=>$obj->rowid, 'value'=>$label, 'label'=>$label));
}
array_push($outarray, array('key'=>$obj->rowid, 'value'=>$label, 'label'=>$label));
$i++;
if (($i % 10) == 0) $out.="\n";
}
@ -5121,6 +5123,202 @@ class Form
}
/**
* Generic method to select a component from a combo list.
* This is the generic method that will replace all specific existing methods.
*
* @param string $objectdesc Objectclassname:Objectclasspath
* @param string $htmlname Name of HTML select component
* @param int $preselectedvalue Preselected value (ID of element)
* @param string $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...)
* @param string $searchkey Search criteria
* @param string $placeholder Place holder
* @param string $morecss More CSS
* @param string $moreparams More params provided to ajax call
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
* @return string Return HTML string
* @see selectForFormsList select_thirdparty
*/
function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0)
{
global $conf, $user;
$objecttmp = null;
$InfoFieldList = explode(":", $objectdesc);
$classname=$InfoFieldList[0];
$classpath=$InfoFieldList[1];
if (! empty($classpath))
{
dol_include_once($classpath);
if ($classname && class_exists($classname))
{
$objecttmp = new $classname($this->db);
}
}
if (! is_object($objecttmp))
{
dol_syslog('Error bad setup of type for field '.$InfoFieldList, LOG_WARNING);
return 'Error bad setup of type for field '.join(',', $InfoFieldList);
}
$prefixforautocompletemode=$objecttmp->element;
if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode='company';
$confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
dol_syslog(get_class($this)."::selectForForms", LOG_DEBUG);
$out='';
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->$confkeyforautocompletemode) && ! $forcecombo)
{
$objectdesc=$classname.':'.$classpath;
$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
//if ($objecttmp->element == 'societe') $urlforajaxcall = DOL_URL_ROOT.'/societe/ajax/company.php';
// No immediate load of all database
$urloption='htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.($moreparams?$moreparams:'');
// Activate the auto complete using ajax call.
$out.= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
$out.= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
if ($placeholder) $placeholder=' placeholder="'.$placeholder.'"';
$out.= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$preselectedvalue.'"'.$placeholder.' />';
}
else
{
// Immediate load of all database
$out.=$this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo);
}
return $out;
}
/**
* Output html form to select an object.
* Note, this function is called by selectForForms or by ajax selectobject.php
*
* @param Object $objecttmp Object
* @param string $htmlname Name of HTML select component
* @param int $preselectedvalue Preselected value (ID of element)
* @param string $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...)
* @param string $searchkey Search value
* @param string $placeholder Place holder
* @param string $morecss More CSS
* @param string $moreparams More params provided to ajax call
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
* @param int $outputmode 0=HTML select string, 1=Array
* @return string Return HTML string
* @see selectForForms
*/
function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0, $outputmode=0)
{
global $conf, $langs, $user;
$prefixforautocompletemode=$objecttmp->element;
if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode='company';
$confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
$fieldstoshow='t.ref';
if (! empty($objecttmp->fields))
{
$tmpfieldstoshow='';
foreach($objecttmp->fields as $key => $val)
{
if ($val['showoncombobox']) $tmpfieldstoshow.=($tmpfieldstoshow?',':'').'t.'.$key;
}
if ($tmpfieldstoshow) $fieldstoshow = $tmpfieldstoshow;
}
$out='';
$outarray=array();
$num=0;
// Search data
$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".MAIN_DB_PREFIX .$objecttmp->table_element." as t";
if ($objecttmp->ismultientitymanaged == 2)
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE t.entity IN (".getEntity($objecttmp->table_element).")";
if ($objecttmp->ismultientitymanaged == 1 && ! empty($user->societe_id)) $sql.= " AND t.fk_soc = ".$user->societe_id;
if ($searchkey != '') $sql.=natural_search(explode(',',$fieldstoshow), $searchkey);
if ($objecttmp->ismultientitymanaged == 2)
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND t.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.=$this->db->order($fieldstoshow,"ASC");
//$sql.=$this->db->plimit($limit, 0);
// Build output string
$resql=$this->db->query($sql);
if ($resql)
{
if ($conf->use_javascript_ajax && ! $forcecombo)
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement =ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode);
$out.= $comboenhancement;
}
// Construct $out and $outarray
$out.= '<select id="'.$htmlname.'" class="flat'.($morecss?' '.$morecss:'').'"'.($moreparams?' '.$moreparams:'').' name="'.$htmlname.'">'."\n";
// Warning: Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4
$textifempty='&nbsp;';
//if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
if (! empty($conf->global->$confkeyforautocompletemode))
{
if ($showempty && ! is_numeric($showempty)) $textifempty=$langs->trans($showempty);
else $textifempty.=$langs->trans("All");
}
if ($showempty) $out.= '<option value="-1">'.$textifempty.'</option>'."\n";
$num = $this->db->num_rows($resql);
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$label='';
$tmparray=explode(',', $fieldstoshow);
foreach($tmparray as $key => $val)
{
$val = preg_replace('/t\./','',$val);
$label .= (($label && $obj->$val)?' - ':'').$obj->$val;
}
if (empty($outputmode))
{
if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid)
{
$out.= '<option value="'.$obj->rowid.'" selected>'.$label.'</option>';
}
else
{
$out.= '<option value="'.$obj->rowid.'">'.$label.'</option>';
}
}
else
{
array_push($outarray, array('key'=>$obj->rowid, 'value'=>$label, 'label'=>$label));
}
$i++;
if (($i % 10) == 0) $out.="\n";
}
}
$out.= '</select>'."\n";
}
else
{
dol_print_error($this->db);
}
$this->result=array('nbofelement'=>$num);
if ($outputmode) return $outarray;
return $out;
}
/**
* Return a HTML select string, built from an array of key+value.
* Note: Do not apply langs->trans function on returned content, content may be entity encoded twice.
@ -5437,7 +5635,7 @@ class Form
*
* @param string $htmlname Name of select
* @param array $array Array with array of fields we could show. This array may be modified according to setup of user.
* @param string $varpage Id of context for page. Can be set with $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
* @param string $varpage Id of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage);
* @return string HTML multiselect string
* @see selectarray
*/

View File

@ -624,7 +624,7 @@ class Translate
$str=str_replace(array('<','>','"',),array('__lt__','__gt__','__quot__'),$str);
// Crypt string into HTML
$str=htmlentities($str,ENT_QUOTES,$this->charset_output);
$str=htmlentities($str, ENT_COMPAT, $this->charset_output); // Do not convert simple quotes in translation (strings in html are enmbraced by "). Use dol_escape_htmltag around text in HTML content
// Restore HTML tags
$str=str_replace(array('__lt__','__gt__','__quot__'),array('<','>','"',),$str);

View File

@ -27,9 +27,9 @@
/**
* Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: /societe/ajaxcompanies.php).
* The HTML field must be an input text with id=search_$htmlname.
* This use the jQuery "autocomplete" function.
* This use the jQuery "autocomplete" function. If we want to use the select2, we must also convert the input into select on funcntions that call this method.
*
* @param string $selected Preselecte value
* @param string $selected Preselected value
* @param string $htmlname HTML name of input field
* @param string $url Url for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list)
* @param string $urloption More parameters on URL request

View File

@ -321,56 +321,27 @@ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=N
}
}
// Else, retreive default values if we are not doing a sort
elseif (! isset($_GET['sortfield']) && ! empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) // If we did a click on a field to sort, we do no apply default values. Same if option MAIN_ENABLE_DEFAULT_VALUES is not set
elseif (! isset($_GET['sortfield'])) // If we did a click on a field to sort, we do no apply default values. Same if option MAIN_ENABLE_DEFAULT_VALUES is not set
{
if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
{
if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values'
// Search default value from $object->field
global $object;
if (is_object($object) && isset($object->fields[$paramname]['default']))
{
if (isset($user->default_values[$relativepathstring]['createform']))
{
foreach($user->default_values[$relativepathstring]['createform'] as $defkey => $defval)
{
$qualified = 0;
if ($defkey != '_noquery_')
{
$tmpqueryarraytohave=explode('&', $defkey);
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
$foundintru=0;
foreach($tmpqueryarraytohave as $tmpquerytohave)
{
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
}
if (! $foundintru) $qualified=1;
//var_dump($defkey.'-'.$qualified);
}
else $qualified = 1;
if ($qualified)
{
//var_dump($user->default_values[$relativepathstring][$defkey]['createform']);
if (isset($user->default_values[$relativepathstring]['createform'][$defkey][$paramname]))
{
$out = $user->default_values[$relativepathstring]['createform'][$defkey][$paramname];
break;
}
}
}
}
$out = $object->fields[$paramname]['default'];
}
}
// Management of default search_filters and sort order
//elseif (preg_match('/list.php$/', $_SERVER["PHP_SELF"]) && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
elseif (! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
if (! empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES))
{
if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values'
if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
{
//var_dump($user->default_values[$relativepathstring]);
if ($paramname == 'sortfield' || $paramname == 'sortorder') // Sorted on which fields ? ASC or DESC ?
// Now search in setup to overwrite default values
if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values'
{
if (isset($user->default_values[$relativepathstring]['sortorder'])) // Even if paramname is sortfield, data are stored into ['sortorder...']
if (isset($user->default_values[$relativepathstring]['createform']))
{
foreach($user->default_values[$relativepathstring]['sortorder'] as $defkey => $defval)
foreach($user->default_values[$relativepathstring]['createform'] as $defkey => $defval)
{
$qualified = 0;
if ($defkey != '_noquery_')
@ -389,67 +360,108 @@ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=N
if ($qualified)
{
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
foreach($user->default_values[$relativepathstring]['sortorder'][$defkey] as $key => $val)
//var_dump($user->default_values[$relativepathstring][$defkey]['createform']);
if (isset($user->default_values[$relativepathstring]['createform'][$defkey][$paramname]))
{
if ($out) $out.=', ';
if ($paramname == 'sortfield')
{
$out.=dol_string_nospecial($key, '', $forbidden_chars_to_replace);
}
if ($paramname == 'sortorder')
{
$out.=dol_string_nospecial($val, '', $forbidden_chars_to_replace);
}
$out = $user->default_values[$relativepathstring]['createform'][$defkey][$paramname];
break;
}
//break; // No break for sortfield and sortorder so we can cumulate fields (is it realy usefull ?)
}
}
}
}
elseif (isset($user->default_values[$relativepathstring]['filters']))
}
// Management of default search_filters and sort order
//elseif (preg_match('/list.php$/', $_SERVER["PHP_SELF"]) && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
elseif (! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
{
if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values'
{
foreach($user->default_values[$relativepathstring]['filters'] as $defkey => $defval)
//var_dump($user->default_values[$relativepathstring]);
if ($paramname == 'sortfield' || $paramname == 'sortorder') // Sorted on which fields ? ASC or DESC ?
{
$qualified = 0;
if ($defkey != '_noquery_')
if (isset($user->default_values[$relativepathstring]['sortorder'])) // Even if paramname is sortfield, data are stored into ['sortorder...']
{
$tmpqueryarraytohave=explode('&', $defkey);
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
$foundintru=0;
foreach($tmpqueryarraytohave as $tmpquerytohave)
foreach($user->default_values[$relativepathstring]['sortorder'] as $defkey => $defval)
{
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
}
if (! $foundintru) $qualified=1;
//var_dump($defkey.'-'.$qualified);
}
else $qualified = 1;
$qualified = 0;
if ($defkey != '_noquery_')
{
$tmpqueryarraytohave=explode('&', $defkey);
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
$foundintru=0;
foreach($tmpqueryarraytohave as $tmpquerytohave)
{
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
}
if (! $foundintru) $qualified=1;
//var_dump($defkey.'-'.$qualified);
}
else $qualified = 1;
if ($qualified)
if ($qualified)
{
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
foreach($user->default_values[$relativepathstring]['sortorder'][$defkey] as $key => $val)
{
if ($out) $out.=', ';
if ($paramname == 'sortfield')
{
$out.=dol_string_nospecial($key, '', $forbidden_chars_to_replace);
}
if ($paramname == 'sortorder')
{
$out.=dol_string_nospecial($val, '', $forbidden_chars_to_replace);
}
}
//break; // No break for sortfield and sortorder so we can cumulate fields (is it realy usefull ?)
}
}
}
}
elseif (isset($user->default_values[$relativepathstring]['filters']))
{
foreach($user->default_values[$relativepathstring]['filters'] as $defkey => $defval)
{
if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all']))
$qualified = 0;
if ($defkey != '_noquery_')
{
// We made a search from quick search menu, do we still use default filter ?
if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH))
$tmpqueryarraytohave=explode('&', $defkey);
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
$foundintru=0;
foreach($tmpqueryarraytohave as $tmpquerytohave)
{
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
}
if (! $foundintru) $qualified=1;
//var_dump($defkey.'-'.$qualified);
}
else $qualified = 1;
if ($qualified)
{
if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all']))
{
// We made a search from quick search menu, do we still use default filter ?
if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH))
{
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
}
}
else
{
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
}
break;
}
else
{
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
}
break;
}
}
}
}
}
}
}
// Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters)

View File

@ -194,23 +194,23 @@ function exportWebSite($website)
{
global $db, $conf;
dol_mkdir($conf->websites->dir_temp);
$srcdir = $conf->websites->dir_output.'/'.$website->ref;
$destdir = $conf->websites->dir_temp.'/'.$website->ref;
dol_mkdir($conf->website->dir_temp);
$srcdir = $conf->website->dir_output.'/'.$website->ref;
$destdir = $conf->website->dir_temp.'/'.$website->ref;
$arrayreplacement=array();
dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacement);
$srcdir = DOL_DATA_ROOT.'/medias/images/'.$website->ref;
$destdir = $conf->websites->dir_temp.'/'.$website->ref.'/medias/images/'.$website->ref;
$destdir = $conf->website->dir_temp.'/'.$website->ref.'/medias/images/'.$website->ref;
dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacement);
// Build sql file
dol_mkdir($conf->websites->dir_temp.'/'.$website->ref.'/export');
dol_mkdir($conf->website->dir_temp.'/'.$website->ref.'/export');
$filesql = $conf->websites->dir_temp.'/'.$website->ref.'/export/pages.sql';
$filesql = $conf->website->dir_temp.'/'.$website->ref.'/export/pages.sql';
$fp = fopen($filesql,"w");
$objectpages = new WebsitePage($db);
@ -267,9 +267,9 @@ function exportWebSite($website)
@chmod($filesql, octdec($conf->global->MAIN_UMASK));
// Build zip file
$filedir = $conf->websites->dir_temp.'/'.$website->ref;
$fileglob = $conf->websites->dir_temp.'/'.$website->ref.'/export/'.$website->ref.'_export_*.zip';
$filename = $conf->websites->dir_temp.'/'.$website->ref.'/export/'.$website->ref.'_export_'.dol_print_date(dol_now(),'dayhourlog').'.zip';
$filedir = $conf->website->dir_temp.'/'.$website->ref;
$fileglob = $conf->website->dir_temp.'/'.$website->ref.'/export/website_'.$website->ref.'-*.zip';
$filename = $conf->website->dir_temp.'/'.$website->ref.'/export/website_'.$website->ref.'-'.dol_print_date(dol_now(),'dayhourlog').'.zip';
dol_delete_file($fileglob, 0);
dol_compress_file($filedir, $filename, 'zip');

View File

@ -34,8 +34,10 @@ if ($action == 'presend')
$object->fetch_projet();
if (! in_array($object->element, array('societe', 'user')))
if (! in_array($object->element, array('societe', 'user', 'member')))
{
// TODO get also the main_lastdoc field of $object. If not found, try to guess with following code
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
@ -75,19 +77,17 @@ if ($action == 'presend')
}
// Build document if it not exists
if (! in_array($object->element, array('societe', 'user')))
if (! in_array($object->element, array('societe', 'user', 'member')))
{
if (! $file || ! is_readable($file)) {
if ($object->element != 'member')
{
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) {
dol_print_error($db, $object->error, $object->errors);
exit();
}
$fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
$file = $fileparams['fullname'];
if ((! $file || ! is_readable($file)) && method_exists($object, 'generateDocument'))
{
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) {
dol_print_error($db, $object->error, $object->errors);
exit();
}
$fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
$file = $fileparams['fullname'];
}
}

View File

@ -0,0 +1,51 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Need to have following variables defined:
* $object (invoice, order, ...)
* $action
* $conf
* $langs
*/
?>
<!-- BEGIN PHP TEMPLATE commonfields_add.tpl.php -->
<?php
foreach($object->fields as $key => $val)
{
if (abs($val['visible']) != 1) continue; // Discard such field from form
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
print '<tr id="field_'.$key.'">';
print '<td';
print ' class="titlefieldcreate';
if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text') print ' tdtop';
print '"';
print '>';
print $langs->trans($val['label']);
print '</td>';
print '<td>';
if (in_array($val['type'], array('int', 'integer'))) $value = GETPOST($key, 'int');
elseif ($val['type'] == 'text') $value = GETPOST($key, 'none');
else $value = GETPOST($key, 'alpha');
print $object->showInputField($val, $key, $value, '', '', '', 0);
print '</td>';
print '</tr>';
}
?>
<!-- END PHP TEMPLATE commonfields_add.tpl.php -->

View File

@ -0,0 +1,48 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Need to have following variables defined:
* $object (invoice, order, ...)
* $action
* $conf
* $langs
*/
?>
<!-- BEGIN PHP TEMPLATE commonfields_edit.tpl.php -->
<?php
foreach($object->fields as $key => $val)
{
if (abs($val['visible']) != 1) continue; // Discard such field from form
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
print '<tr><td';
print ' class="titlefieldcreate';
if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text') print ' tdtop';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
if (in_array($val['type'], array('int', 'integer'))) $value = GETPOSTISSET($key)?GETPOST($key, 'int'):$object->$key;
elseif ($val['type'] == 'text') $value = GETPOSTISSET($key)?GETPOST($key,'none'):$object->$key;
else $value = GETPOSTISSET($key)?GETPOST($key, 'alpha'):$object->$key;
print $object->showInputField($val, $key, $value, '', '', '', 0);
print '</td>';
print '</tr>';
}
?>
<!-- END PHP TEMPLATE commonfields_edit.tpl.php -->

View File

@ -0,0 +1,84 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Need to have following variables defined:
* $object (invoice, order, ...)
* $action
* $conf
* $langs
*/
?>
<!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php -->
<?php
foreach($object->fields as $key => $val)
{
if (abs($val['visible']) != 1) continue; // Discard such field from form
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
if ($key == 'status') continue; // Status is alreadt in dol_banner
$value=$object->$key;
print '<tr><td';
print ' class="titlefield';
if ($val['notnull'] > 0) print ' fieldrequired';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
print $object->showOutputField($val, $key, $value, '', '', '', 0);
//print dol_escape_htmltag($object->$key, 1, 1);
print '</td>';
print '</tr>';
//if ($key == 'targetsrcfile3') break; // key used for break on second column
}
print '</table>';
print '</div>';
print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
$alreadyoutput = 1;
foreach($object->fields as $key => $val)
{
if ($alreadyoutput)
{
//if ($key == 'targetsrcfile3') $alreadyoutput = 0; // key used for break on second column
continue;
}
if (abs($val['visible']) != 1) continue; // Discard such field from form
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
if ($key == 'status') continue; // Status is alreadt in dol_banner
$value=$object->$key;
print '<tr><td';
print ' class="titlefield';
if ($val['notnull'] > 0) print ' fieldrequired';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
print $object->showOutputField($val, $key, $value, '', '', '', 0);
//print dol_escape_htmltag($object->$key, 1, 1);
print '</td>';
print '</tr>';
}
?>
<!-- END PHP TEMPLATE commonfields_view.tpl.php -->

View File

@ -111,7 +111,7 @@ if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element][
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="'.$fieldid.'" value="' . $object->id . '">';
print $extrafields->showInputField($key, $value,'','','',0,$object->id);
print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id);
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';

View File

@ -37,7 +37,7 @@ class Don extends CommonObject
public $element='don'; // Id that identify managed objects
public $table_element='don'; // Name of table without prefix where object is stored
public $fk_element = 'fk_donation';
protected $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
var $picto = 'generic';
var $date;

View File

@ -47,7 +47,7 @@ class Expedition extends CommonObject
public $fk_element="fk_expedition";
public $table_element="expedition";
public $table_element_line="expeditiondet";
protected $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
public $picto = 'sending';
var $socid;

View File

@ -43,7 +43,7 @@ class CommandeFournisseur extends CommonOrder
public $table_element='commande_fournisseur';
public $table_element_line = 'commande_fournisseurdet';
public $fk_element = 'fk_commande';
protected $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
public $picto='order';
/**

View File

@ -44,7 +44,7 @@ class FactureFournisseur extends CommonInvoice
public $table_element='facture_fourn';
public $table_element_line='facture_fourn_det';
public $fk_element='fk_facture_fourn';
protected $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
public $picto='bill';
/**

View File

@ -34,7 +34,7 @@ class Holiday extends CommonObject
{
public $element='holiday';
public $table_element='holiday';
protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto = 'holiday';
/**

View File

@ -32,7 +32,7 @@ class Establishment extends CommonObject
public $table_element='establishment';
public $table_element_line = '';
public $fk_element = 'fk_establishment';
protected $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
public $picto='building';
public $id;

View File

@ -1,259 +1,259 @@
--
-- Descriptif plan comptable Suisse
--
INSERT INTO llx_const (name, value, type, note, visible, entity) values ('ACCOUNTING_MANAGE_ZERO','1','chaine','Manage the "0" for the accountancy account',1,0);
INSERT INTO llx_const (name, value, type, note, visible, entity) values ('ACCOUNTING_MANAGE_ZERO','1','chaine','Manage the 0 for the accountancy account',1,0);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13000,'PCG_SUISSE','XXXXXX','XXXXXX','1',0,"Actifs",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13001,'PCG_SUISSE','XXXXXX','XXXXXX','10',13000,"Actifs circulants",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13002,'PCG_SUISSE','XXXXXX','XXXXXX','100',13001,"Liquidités",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13003,'PCG_SUISSE','XXXXXX','XXXXXX','1000',13002,"Caisse",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13004,'PCG_SUISSE','XXXXXX','XXXXXX','1020',13002,"Banque (Avoir)",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13005,'PCG_SUISSE','XXXXXX','XXXXXX','106',13001,"Avoirs à courts terme côtés en bourse",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13006,'PCG_SUISSE','XXXXXX','XXXXXX','1060',13005,"Titres",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13007,'PCG_SUISSE','XXXXXX','XXXXXX','1069',13005,"Ajustement de la valeur des titres",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13008,'PCG_SUISSE','XXXXXX','XXXXXX','110',13001,"Créances résultant de livraisons et prestations",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13009,'PCG_SUISSE','XXXXXX','XXXXXX','1100',13008,"Créances provenant de livraisons et de prestations (Débiteurs)",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13010,'PCG_SUISSE','XXXXXX','XXXXXX','1109',13008,"Ducroire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13011,'PCG_SUISSE','XXXXXX','XXXXXX','1110',13008,"Créances résultant de livr. et prest. envers les sociétés du groupe",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13012,'PCG_SUISSE','XXXXXX','XXXXXX','114',13001,"Autres créances à court terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13013,'PCG_SUISSE','XXXXXX','XXXXXX','1140',13012,"Avances et prêts",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13014,'PCG_SUISSE','XXXXXX','XXXXXX','1149',13012,"Ajustement de la valeur des avances et des prêts",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13015,'PCG_SUISSE','XXXXXX','XXXXXX','1170',13008,"Impôt préalable: TVA s/matériel, marchandises, prestations et énergie",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13016,'PCG_SUISSE','XXXXXX','XXXXXX','1171',13008,"Impôt préalable: TVA s/investissements et autres charges d'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13017,'PCG_SUISSE','XXXXXX','XXXXXX','1176',13008,"Impôt anticipé",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13018,'PCG_SUISSE','XXXXXX','XXXXXX','1180',13008,"Créance envers les assurances sociales et institutions de prévoyance",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13019,'PCG_SUISSE','XXXXXX','XXXXXX','1189',13008,"Impôt à la source",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13020,'PCG_SUISSE','XXXXXX','XXXXXX','1190',13008,"Autres créances à court terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13021,'PCG_SUISSE','XXXXXX','XXXXXX','1199',13008,"Ajustement de la valeur des créances à court terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13022,'PCG_SUISSE','XXXXXX','XXXXXX','120',13001,"Stocks et prestations non facturées",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13023,'PCG_SUISSE','XXXXXX','XXXXXX','1200',13022,"Marchandises commerciales",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13024,'PCG_SUISSE','XXXXXX','XXXXXX','1210',13022,"Matières premières",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13025,'PCG_SUISSE','XXXXXX','XXXXXX','1220',13022,"Matières auxiliaires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13026,'PCG_SUISSE','XXXXXX','XXXXXX','1230',13022,"Matières consommables",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13027,'PCG_SUISSE','XXXXXX','XXXXXX','1250',13022,"Marchandises en consignation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13028,'PCG_SUISSE','XXXXXX','XXXXXX','1260',13022,"Stocks de produits fnis",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13029,'PCG_SUISSE','XXXXXX','XXXXXX','1280',13022,"Travaux en cours",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13030,'PCG_SUISSE','XXXXXX','XXXXXX','130',13001,"Compte de régularisation de l'actif",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13031,'PCG_SUISSE','XXXXXX','XXXXXX','1300',13030,"Charges payées d'avance",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13032,'PCG_SUISSE','XXXXXX','XXXXXX','1301',13030,"Produits à recevoir",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13033,'PCG_SUISSE','XXXXXX','XXXXXX','14',13000,"Actifs immobilisés",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13034,'PCG_SUISSE','XXXXXX','XXXXXX','140',13033,"Immobilisations financières",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13035,'PCG_SUISSE','XXXXXX','XXXXXX','1400',13034,"Titres à long terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13036,'PCG_SUISSE','XXXXXX','XXXXXX','1409',13034,"Ajustement de la valeur des titres",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13037,'PCG_SUISSE','XXXXXX','XXXXXX','1440',13034,"Prêts",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13038,'PCG_SUISSE','XXXXXX','XXXXXX','1441',13034,"Hypothèques",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13039,'PCG_SUISSE','XXXXXX','XXXXXX','1449',13034,"Ajustement de la valeur des créances à long terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13040,'PCG_SUISSE','XXXXXX','XXXXXX','148',13033,"Participations",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13041,'PCG_SUISSE','XXXXXX','XXXXXX','1480',13040,"Participations",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13042,'PCG_SUISSE','XXXXXX','XXXXXX','1489',13040,"Ajustement de la valeur des participations",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13043,'PCG_SUISSE','XXXXXX','XXXXXX','150',13000,"Immobilisations corporelles meublés",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13044,'PCG_SUISSE','XXXXXX','XXXXXX','1500',13043,"Machines et appareils",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13045,'PCG_SUISSE','XXXXXX','XXXXXX','1509',13043,"Ajustement de la valeur des machines et appareils",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13046,'PCG_SUISSE','XXXXXX','XXXXXX','1510',13043,"Mobilier et installations",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13047,'PCG_SUISSE','XXXXXX','XXXXXX','1519',13043,"Ajustement de la valeur du mobilier et des installations",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13048,'PCG_SUISSE','XXXXXX','XXXXXX','1520',13043,"Machines de bureau, informatique, système de communication",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13049,'PCG_SUISSE','XXXXXX','XXXXXX','1529',13043,"Ajustement de la valeur des machines de bureau, inf. et syst. comm.",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13050,'PCG_SUISSE','XXXXXX','XXXXXX','1530',13043,"Véhicules",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13051,'PCG_SUISSE','XXXXXX','XXXXXX','1539',13043,"Ajustement de la valeur des véhicules",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13052,'PCG_SUISSE','XXXXXX','XXXXXX','1540',13043,"Outillages et appareils",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13053,'PCG_SUISSE','XXXXXX','XXXXXX','1549',13043,"Ajustement de la valeur des outillages et appareils",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13054,'PCG_SUISSE','XXXXXX','XXXXXX','160',13000,"Immobilisations corporelles Immeubles",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13055,'PCG_SUISSE','XXXXXX','XXXXXX','1600',13054,"Immeubles d'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13056,'PCG_SUISSE','XXXXXX','XXXXXX','1609',13054,"Ajustements de la valeur des immeubles d'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13057,'PCG_SUISSE','XXXXXX','XXXXXX','170',13000,"Immobilisations incorporelles",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13058,'PCG_SUISSE','XXXXXX','XXXXXX','1700',13057,"Brevets, know-how, licences, droits, dév.",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13059,'PCG_SUISSE','XXXXXX','XXXXXX','1709',13057,"Ajustement de la valeur des brevets, know-how, licences, droits, dév.",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13060,'PCG_SUISSE','XXXXXX','XXXXXX','1770',13057,"Goodwill",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13061,'PCG_SUISSE','XXXXXX','XXXXXX','1779',13057,"Ajustement de la valeur du goodwill",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13062,'PCG_SUISSE','XXXXXX','XXXXXX','180',13000,"Capital non versé : capital social, capital de fondation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13063,'PCG_SUISSE','XXXXXX','XXXXXX','1850',13062,"Capital actions, capital social, droits de participations ou capital de fondation non versés",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13064,'PCG_SUISSE','XXXXXX','XXXXXX','2',0,"Passif",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13065,'PCG_SUISSE','XXXXXX','XXXXXX','20',13064,"Dettes à court terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13066,'PCG_SUISSE','XXXXXX','XXXXXX','200',13065,"Dettes à court terme résultant d'achats et de prestations de services",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13067,'PCG_SUISSE','XXXXXX','XXXXXX','2000',13066,"Dettes résultant d'achats et des prestations de services (créanciers)",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13068,'PCG_SUISSE','XXXXXX','XXXXXX','2030',13066,"Acomptes de clients",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13069,'PCG_SUISSE','XXXXXX','XXXXXX','2050',13066,"Dettes résultant d'achats et de prestations de services envers des sociétés du groupe",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13070,'PCG_SUISSE','XXXXXX','XXXXXX','210',13065,"Dettes à court terme rémunérés",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13071,'PCG_SUISSE','XXXXXX','XXXXXX','2100',13070,"Dettes bancaires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13072,'PCG_SUISSE','XXXXXX','XXXXXX','2120',13070,"Engagements de financement par leasing",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13073,'PCG_SUISSE','XXXXXX','XXXXXX','2140',13070,"Autres dettes à court terme rémunérées",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13074,'PCG_SUISSE','XXXXXX','XXXXXX','2151',13070,"Salaires à payer",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13075,'PCG_SUISSE','XXXXXX','XXXXXX','2152',13070,"Charges sociales à payer (AVS/AC/ALFA)",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13076,'PCG_SUISSE','XXXXXX','XXXXXX','21521',13075,"Créancier AVS/AI/APG/AC",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13077,'PCG_SUISSE','XXXXXX','XXXXXX','21522',13075,"Créancier Allocations Familiales",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13078,'PCG_SUISSE','XXXXXX','XXXXXX','2153',13070,"Assurances sociales à payer (LAA, IJM, FT, LPP)",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13079,'PCG_SUISSE','XXXXXX','XXXXXX','21531',13078,"Créancier Assurance Accidents",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13080,'PCG_SUISSE','XXXXXX','XXXXXX','21532',13078,"Créancier Assurance Accidents complémentaire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13081,'PCG_SUISSE','XXXXXX','XXXXXX','21533',13078,"Créancier Prévoyance Professionnelle",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13082,'PCG_SUISSE','XXXXXX','XXXXXX','21534',13078,"Créancier Prévoyance Professionnelle complémentaire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13083,'PCG_SUISSE','XXXXXX','XXXXXX','21535',13078,"Créancier Assurance Indemnités Journalières Maladie",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13084,'PCG_SUISSE','XXXXXX','XXXXXX','21536',13078,"Créancier Assurance Indemnités Journalières Maladie complémentaire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13085,'PCG_SUISSE','XXXXXX','XXXXXX','21539',13078,"Créancier autres caisses et assurances",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13086,'PCG_SUISSE','XXXXXX','XXXXXX','2154',13070,"Impôt source",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13087,'PCG_SUISSE','XXXXXX','XXXXXX','2155',13070,"Autres charges",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13088,'PCG_SUISSE','XXXXXX','XXXXXX','21551',13087,"Taxe réfugiés",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13089,'PCG_SUISSE','XXXXXX','XXXXXX','21552',13087,"Office des Poursuites",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13090,'PCG_SUISSE','XXXXXX','XXXXXX','21553',13087,"Retraite anticipée",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13091,'PCG_SUISSE','XXXXXX','XXXXXX','21554',13087,"Caisse professionnelle",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13092,'PCG_SUISSE','XXXXXX','XXXXXX','21559',13087,"Autres retenues employé à payer",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13093,'PCG_SUISSE','XXXXXX','XXXXXX','2158',13070,"Provisions 13ème et vacances à payer",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13094,'PCG_SUISSE','XXXXXX','XXXXXX','2160',13070,"Indemnités d'assurances",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13095,'PCG_SUISSE','XXXXXX','XXXXXX','21601',13094,"Indemnités d'assurance accidents",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13096,'PCG_SUISSE','XXXXXX','XXXXXX','21602',13094,"Indemnités d'assurance maladie",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13097,'PCG_SUISSE','XXXXXX','XXXXXX','21603',13094,"Indemnités d'assurance maternité",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13098,'PCG_SUISSE','XXXXXX','XXXXXX','21604',13094,"Indemnités d'assurance maternité complémentaire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13099,'PCG_SUISSE','XXXXXX','XXXXXX','21605',13094,"Indemnités d'assurance APG militaire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13100,'PCG_SUISSE','XXXXXX','XXXXXX','21606',13094,"Indemnités d'assurance militaire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13101,'PCG_SUISSE','XXXXXX','XXXXXX','21607',13094,"Indemnités d'assurance chômage",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13102,'PCG_SUISSE','XXXXXX','XXXXXX','21608',13094,"Indemnités d'assurance AI",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13103,'PCG_SUISSE','XXXXXX','XXXXXX','21609',13094,"Autres",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13104,'PCG_SUISSE','XXXXXX','XXXXXX','220',13065,"Autres dettes à court terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13105,'PCG_SUISSE','XXXXXX','XXXXXX','2200',13104,"TVA due",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13106,'PCG_SUISSE','XXXXXX','XXXXXX','2201',13104,"Décompte TVA",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13107,'PCG_SUISSE','XXXXXX','XXXXXX','2206',13104,"Impôt anticipé dû",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13108,'PCG_SUISSE','XXXXXX','XXXXXX','2208',13104,"Impôts directs",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13109,'PCG_SUISSE','XXXXXX','XXXXXX','2210',13104,"Autres dettes à court terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13110,'PCG_SUISSE','XXXXXX','XXXXXX','2261',13104,"Dividendes",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13111,'PCG_SUISSE','XXXXXX','XXXXXX','2270',13104,"Assurances sociales et institutions de prévoyance",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13112,'PCG_SUISSE','XXXXXX','XXXXXX','2279',13104,"Impôt à la source",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13113,'PCG_SUISSE','XXXXXX','XXXXXX','230',13065,"Passifs de régularisation et provision à court terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13114,'PCG_SUISSE','XXXXXX','XXXXXX','2300',13113,"Charges à payer",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13115,'PCG_SUISSE','XXXXXX','XXXXXX','2301',13113,"Produits constatés d'avance",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13116,'PCG_SUISSE','XXXXXX','XXXXXX','2330',13113,"Provisions à court terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13117,'PCG_SUISSE','XXXXXX','XXXXXX','24',13064,"Dettes à long terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13118,'PCG_SUISSE','XXXXXX','XXXXXX','240',13117,"Dettes à long terme rémunérées",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13119,'PCG_SUISSE','XXXXXX','XXXXXX','2400',13118,"Dettes bancaires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13120,'PCG_SUISSE','XXXXXX','XXXXXX','2420',13118,"Engagements de financement par leasing",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13121,'PCG_SUISSE','XXXXXX','XXXXXX','2430',13118,"Emprunts obligataires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13122,'PCG_SUISSE','XXXXXX','XXXXXX','2450',13118,"Emprunts",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13123,'PCG_SUISSE','XXXXXX','XXXXXX','2451',13118,"Hypothèques",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13124,'PCG_SUISSE','XXXXXX','XXXXXX','250',13117,"Autres dettes à long terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13125,'PCG_SUISSE','XXXXXX','XXXXXX','2500',13124,"Autres dettes à long terme",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13126,'PCG_SUISSE','XXXXXX','XXXXXX','260',13117,"Provisions à long terme et provisions légales",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13127,'PCG_SUISSE','XXXXXX','XXXXXX','2600',13126,"Provisions",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13128,'PCG_SUISSE','XXXXXX','XXXXXX','28',13064,"Fonds propres (personnes morales)",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13129,'PCG_SUISSE','XXXXXX','XXXXXX','280',13128,"Capital social ou capital de fondation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13130,'PCG_SUISSE','XXXXXX','XXXXXX','2800',13129,"Capital-actions, capital social, capital de fondation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13131,'PCG_SUISSE','XXXXXX','XXXXXX','290',13064,"Réserves / bénéfices et pertes",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13132,'PCG_SUISSE','XXXXXX','XXXXXX','2900',13131,"Réserves légales issues du capital",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13133,'PCG_SUISSE','XXXXXX','XXXXXX','2930',13131,"Réserves sur participations propres au capital",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13134,'PCG_SUISSE','XXXXXX','XXXXXX','2940',13131,"Réserves d'évaluation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13135,'PCG_SUISSE','XXXXXX','XXXXXX','2950',13131,"Réserves légales issues du bénéfice",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13136,'PCG_SUISSE','XXXXXX','XXXXXX','2960',13131,"Réserves libres",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13137,'PCG_SUISSE','XXXXXX','XXXXXX','2970',13131,"Bénéfice / perte reporté",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13138,'PCG_SUISSE','XXXXXX','XXXXXX','2979',13131,"Bénéfice / perte de l'exercice",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13139,'PCG_SUISSE','XXXXXX','XXXXXX','2980',13131,"Propres actions, parts sociales, droits de participations (poste négatif)",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13140,'PCG_SUISSE','XXXXXX','XXXXXX','3',0,"Chiffre d'affaires résultant des ventes et des prestations de services",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13141,'PCG_SUISSE','XXXXXX','XXXXXX','3000',13140,"Ventes de produits fabriqués",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13142,'PCG_SUISSE','XXXXXX','XXXXXX','3200',13140,"Ventes de marchandises",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13143,'PCG_SUISSE','XXXXXX','XXXXXX','3400',13140,"Ventes de prestations",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13144,'PCG_SUISSE','XXXXXX','XXXXXX','3600',13140,"Autres ventes et prestations de services",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13145,'PCG_SUISSE','XXXXXX','XXXXXX','3700',13140,"Prestations propres",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13146,'PCG_SUISSE','XXXXXX','XXXXXX','3710',13140,"Consommations propres",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13147,'PCG_SUISSE','XXXXXX','XXXXXX','3800',13140,"Déductions sur ventes",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13148,'PCG_SUISSE','XXXXXX','XXXXXX','3805',13140,"Pertes sur clients, variations du ducroire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13149,'PCG_SUISSE','XXXXXX','XXXXXX','3900',13140,"Variation des stocks de produits semis-finis",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13150,'PCG_SUISSE','XXXXXX','XXXXXX','3901',13140,"Variation des stocks de produits finis",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13151,'PCG_SUISSE','XXXXXX','XXXXXX','3904',13140,"Variation de la valeur des prestations non facturées",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13152,'PCG_SUISSE','XXXXXX','XXXXXX','4',0,"Charges de matériel, de marchandises et de prestations de tiers",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13153,'PCG_SUISSE','XXXXXX','XXXXXX','4000',13152,"Charges de matériel de l'atelier",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13154,'PCG_SUISSE','XXXXXX','XXXXXX','4200',13152,"Achats de marchandises destinées à la revente",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13155,'PCG_SUISSE','XXXXXX','XXXXXX','4400',13152,"Prestations / travaux de tiers",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13156,'PCG_SUISSE','XXXXXX','XXXXXX','4500',13152,"Charges d'énergie pour l'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13157,'PCG_SUISSE','XXXXXX','XXXXXX','4900',13152,"Déductions sur les charges",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13158,'PCG_SUISSE','XXXXXX','XXXXXX','5',0,"Charges de personnel",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13159,'PCG_SUISSE','XXXXXX','XXXXXX','5000',13158,"Salaires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13160,'PCG_SUISSE','XXXXXX','XXXXXX','5200',13158,"Charges de personnel",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13161,'PCG_SUISSE','XXXXXX','XXXXXX','5201',13158,"Salaires variables, commissions et primes régulières",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13162,'PCG_SUISSE','XXXXXX','XXXXXX','5202',13158,"Primes occasionnelles et participations au bénéfice",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13163,'PCG_SUISSE','XXXXXX','XXXXXX','5203',13158,"Divers soumis",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13164,'PCG_SUISSE','XXXXXX','XXXXXX','5204',13158,"Divers non soumis",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13165,'PCG_SUISSE','XXXXXX','XXXXXX','5210',13158,"Honoraires et indemnités CA",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13166,'PCG_SUISSE','XXXXXX','XXXXXX','5270',13158,"AVS, AI, APG, assurance-chômage",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13167,'PCG_SUISSE','XXXXXX','XXXXXX','5271',13158,"Caisse d'allocations familiales",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13168,'PCG_SUISSE','XXXXXX','XXXXXX','52721',13167,"Prévoyance professionnelle",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13169,'PCG_SUISSE','XXXXXX','XXXXXX','52722',13167,"Prévoyance professionnelle complémentaire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13170,'PCG_SUISSE','XXXXXX','XXXXXX','52731',13167,"Assurance-accidents",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13171,'PCG_SUISSE','XXXXXX','XXXXXX','52732',13167,"Assurance-accidents complémentaire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13172,'PCG_SUISSE','XXXXXX','XXXXXX','52741',13167,"Assurance IJM",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13173,'PCG_SUISSE','XXXXXX','XXXXXX','52742',13167,"Assurance IJM complémentaire",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13174,'PCG_SUISSE','XXXXXX','XXXXXX','5275',13158,"Autres assurances",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13175,'PCG_SUISSE','XXXXXX','XXXXXX','5276',13158,"Impôts à la source payé par employeur",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13176,'PCG_SUISSE','XXXXXX','XXXXXX','5278',13158,"Caisse professionnelle",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13177,'PCG_SUISSE','XXXXXX','XXXXXX','5279',13158,"Arrondis sur charges sociales",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13178,'PCG_SUISSE','XXXXXX','XXXXXX','5280',13158,"Autres charges de personnel",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13179,'PCG_SUISSE','XXXXXX','XXXXXX','5281',13158,"Frais de voyages/transport",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13180,'PCG_SUISSE','XXXXXX','XXXXXX','5282',13158,"Frais de repas/hébergement",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13181,'PCG_SUISSE','XXXXXX','XXXXXX','5283',13158,"Frais forfaitaires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13182,'PCG_SUISSE','XXXXXX','XXXXXX','5284',13158,"Frais de représentation, téléphones, divers",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13183,'PCG_SUISSE','XXXXXX','XXXXXX','5288',13158,"Frais de formation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13184,'PCG_SUISSE','XXXXXX','XXXXXX','5289',13158,"Autres frais de personnel",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13185,'PCG_SUISSE','XXXXXX','XXXXXX','5290',13158,"Prestations de travail de tiers",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13186,'PCG_SUISSE','XXXXXX','XXXXXX','5700',13158,"Charges sociales",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13187,'PCG_SUISSE','XXXXXX','XXXXXX','5800',13158,"Autres charges du personnel",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13188,'PCG_SUISSE','XXXXXX','XXXXXX','5900',13158,"Charges de personnels temporaires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13189,'PCG_SUISSE','XXXXXX','XXXXXX','6',0,"Autres charges d'exploitation, amortissements et ajustement de valeur, résultat financier",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13190,'PCG_SUISSE','XXXXXX','XXXXXX','6000',13189,"Charges de locaux",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13191,'PCG_SUISSE','XXXXXX','XXXXXX','6100',13189,"Entretien, réparations et remplacement des inst. servant à l'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13192,'PCG_SUISSE','XXXXXX','XXXXXX','6105',13189,"Leasing immobilisations corporelles meubles",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13193,'PCG_SUISSE','XXXXXX','XXXXXX','6200',13189,"Charges de véhicules et de transport",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13194,'PCG_SUISSE','XXXXXX','XXXXXX','6260',13189,"Leasing et location de véhicule",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13195,'PCG_SUISSE','XXXXXX','XXXXXX','6300',13189,"Assurances-choses, droits, taxes, autorisations",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13196,'PCG_SUISSE','XXXXXX','XXXXXX','6400',13189,"Charges d'énergie et évacuation des déchets",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13197,'PCG_SUISSE','XXXXXX','XXXXXX','6500',13189,"Charges d'administration",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13198,'PCG_SUISSE','XXXXXX','XXXXXX','6510',13189,"Téléphone",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13199,'PCG_SUISSE','XXXXXX','XXXXXX','6511',13189,"Internet",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13200,'PCG_SUISSE','XXXXXX','XXXXXX','6512',13189,"Frais de port",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13201,'PCG_SUISSE','XXXXXX','XXXXXX','6560',13189,"Informatique",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13202,'PCG_SUISSE','XXXXXX','XXXXXX','6570',13189,"Charges et leasing d'informatique",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13203,'PCG_SUISSE','XXXXXX','XXXXXX','6571',13189,"Entretien/Hotline Hardware",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13204,'PCG_SUISSE','XXXXXX','XXXXXX','6573',13189,"Disquettes, CD-Rom, etc. Fourniture d'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13205,'PCG_SUISSE','XXXXXX','XXXXXX','6600',13189,"Publicité",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13206,'PCG_SUISSE','XXXXXX','XXXXXX','6610',13189,"Imprimés publicitaires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13207,'PCG_SUISSE','XXXXXX','XXXXXX','6640',13189,"Frais de voyage et conseils à la clientèle",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13208,'PCG_SUISSE','XXXXXX','XXXXXX','6641',13189,"Frais de représentation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13209,'PCG_SUISSE','XXXXXX','XXXXXX','6700',13189,"Autres charges d'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13210,'PCG_SUISSE','XXXXXX','XXXXXX','6800',13189,"Amortissement et ajustement de valeur des postes sur immobilisations corporelles",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13211,'PCG_SUISSE','XXXXXX','XXXXXX','6801',13189,"Intérêts pour emprunts",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13212,'PCG_SUISSE','XXXXXX','XXXXXX','6840',13189,"Frais de banque et des chèques postaux",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13213,'PCG_SUISSE','XXXXXX','XXXXXX','6850',13189,"Produits financiers",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13214,'PCG_SUISSE','XXXXXX','XXXXXX','6900',13189,"Charges financières",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13215,'PCG_SUISSE','XXXXXX','XXXXXX','6920',13189,"Amortissement s/immobilisé. corporelles meubles",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13216,'PCG_SUISSE','XXXXXX','XXXXXX','6930',13189,"Amortissement s/immobilisé. corporelles immeubles",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13217,'PCG_SUISSE','XXXXXX','XXXXXX','6940',13189,"Amortissement s/immobilisé. incorporelles",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13218,'PCG_SUISSE','XXXXXX','XXXXXX','6950',13189,"Produits financiers",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13219,'PCG_SUISSE','XXXXXX','XXXXXX','7',0,"Résultat des activités annexes d'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13220,'PCG_SUISSE','XXXXXX','XXXXXX','7000',13219,"Produits accessoires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13221,'PCG_SUISSE','XXXXXX','XXXXXX','7010',13219,"Charges accessoires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13222,'PCG_SUISSE','XXXXXX','XXXXXX','7400',13219,"Produits sur placements financiers",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13223,'PCG_SUISSE','XXXXXX','XXXXXX','7410',13219,"Charges sur placements financiers",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13224,'PCG_SUISSE','XXXXXX','XXXXXX','7500',13219,"Produits des immeubles d'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13225,'PCG_SUISSE','XXXXXX','XXXXXX','7510',13219,"Charges des immeubles d'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13226,'PCG_SUISSE','XXXXXX','XXXXXX','8',0,"Charges hors exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13227,'PCG_SUISSE','XXXXXX','XXXXXX','8000',13226,"Charges hors exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13228,'PCG_SUISSE','XXXXXX','XXXXXX','8100',13226,"Produits hors exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13229,'PCG_SUISSE','XXXXXX','XXXXXX','8500',13226,"Charges extraordinaires, exceptionnelles ou hors période",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13230,'PCG_SUISSE','XXXXXX','XXXXXX','8510',13226,"Produits extraordinaires, exceptionnels ou hors période",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13231,'PCG_SUISSE','XXXXXX','XXXXXX','8900',13226,"Impôts directs",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13232,'PCG_SUISSE','XXXXXX','XXXXXX','9',0,"Produits de vente et de services",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13233,'PCG_SUISSE','XXXXXX','XXXXXX','9001',13232,"Charges de vente et de services",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13234,'PCG_SUISSE','XXXXXX','XXXXXX','9002',13232,"Résultat brut 1",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13235,'PCG_SUISSE','XXXXXX','XXXXXX','9006',13232,"Charges de personnel de production",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13236,'PCG_SUISSE','XXXXXX','XXXXXX','9007',13232,"Résultat brut 2",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13237,'PCG_SUISSE','XXXXXX','XXXXXX','9008',13232,"Autres charges de personnel",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13238,'PCG_SUISSE','XXXXXX','XXXXXX','9009',13232,"Résultat brut 3",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13239,'PCG_SUISSE','XXXXXX','XXXXXX','9010',13232,"Autres charges d'exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13240,'PCG_SUISSE','XXXXXX','XXXXXX','9011',13232,"Résultat d'exploitation 1",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13241,'PCG_SUISSE','XXXXXX','XXXXXX','9012',13232,"Résultat financier",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13242,'PCG_SUISSE','XXXXXX','XXXXXX','9013',13232,"Résultat d'exploitation 2",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13243,'PCG_SUISSE','XXXXXX','XXXXXX','9014',13232,"Amortissements",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13244,'PCG_SUISSE','XXXXXX','XXXXXX','9015',13232,"Résultat d'exploitation 3",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13245,'PCG_SUISSE','XXXXXX','XXXXXX','9016',13232,"Résultat activités annexes exploitation",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13246,'PCG_SUISSE','XXXXXX','XXXXXX','9017',13232,"Résultat d'exploitation 4",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13247,'PCG_SUISSE','XXXXXX','XXXXXX','9018',13232,"Résultats extraordinaires",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13248,'PCG_SUISSE','XXXXXX','XXXXXX','9019',13232,"Résultat d'entreprise avant impôts",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13249,'PCG_SUISSE','XXXXXX','XXXXXX','9020',13232,"Charges d'impôts",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13250,'PCG_SUISSE','XXXXXX','XXXXXX','9090',13232,"Résultat d'entreprise",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13251,'PCG_SUISSE','XXXXXX','XXXXXX','9100',13232,"Bilan d'ouverture",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13252,'PCG_SUISSE','XXXXXX','XXXXXX','9101',13232,"Bilan de clôture",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13253,'PCG_SUISSE','XXXXXX','XXXXXX','9200',13232,"Bénéfice / perte de l'exercice",'1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13000,'PCG_SUISSE','XXXXXX','XXXXXX','1',0,'Actifs','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13001,'PCG_SUISSE','XXXXXX','XXXXXX','10',13000,'Actifs circulants','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13002,'PCG_SUISSE','XXXXXX','XXXXXX','100',13001,'Liquidités','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13003,'PCG_SUISSE','XXXXXX','XXXXXX','1000',13002,'Caisse','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13004,'PCG_SUISSE','XXXXXX','XXXXXX','1020',13002,'Banque (Avoir)','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13005,'PCG_SUISSE','XXXXXX','XXXXXX','106',13001,'Avoirs à courts terme côtés en bourse','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13006,'PCG_SUISSE','XXXXXX','XXXXXX','1060',13005,'Titres','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13007,'PCG_SUISSE','XXXXXX','XXXXXX','1069',13005,'Ajustement de la valeur des titres','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13008,'PCG_SUISSE','XXXXXX','XXXXXX','110',13001,'Créances résultant de livraisons et prestations','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13009,'PCG_SUISSE','XXXXXX','XXXXXX','1100',13008,'Créances provenant de livraisons et de prestations (Débiteurs)','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13010,'PCG_SUISSE','XXXXXX','XXXXXX','1109',13008,'Ducroire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13011,'PCG_SUISSE','XXXXXX','XXXXXX','1110',13008,'Créances résultant de livr. et prest. envers les sociétés du groupe','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13012,'PCG_SUISSE','XXXXXX','XXXXXX','114',13001,'Autres créances à court terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13013,'PCG_SUISSE','XXXXXX','XXXXXX','1140',13012,'Avances et prêts','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13014,'PCG_SUISSE','XXXXXX','XXXXXX','1149',13012,'Ajustement de la valeur des avances et des prêts','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13015,'PCG_SUISSE','XXXXXX','XXXXXX','1170',13008,'Impôt préalable: TVA s/matériel, marchandises, prestations et énergie','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13016,'PCG_SUISSE','XXXXXX','XXXXXX','1171',13008,'Impôt préalable: TVA s/investissements et autres charges d''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13017,'PCG_SUISSE','XXXXXX','XXXXXX','1176',13008,'Impôt anticipé','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13018,'PCG_SUISSE','XXXXXX','XXXXXX','1180',13008,'Créance envers les assurances sociales et institutions de prévoyance','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13019,'PCG_SUISSE','XXXXXX','XXXXXX','1189',13008,'Impôt à la source','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13020,'PCG_SUISSE','XXXXXX','XXXXXX','1190',13008,'Autres créances à court terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13021,'PCG_SUISSE','XXXXXX','XXXXXX','1199',13008,'Ajustement de la valeur des créances à court terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13022,'PCG_SUISSE','XXXXXX','XXXXXX','120',13001,'Stocks et prestations non facturées','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13023,'PCG_SUISSE','XXXXXX','XXXXXX','1200',13022,'Marchandises commerciales','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13024,'PCG_SUISSE','XXXXXX','XXXXXX','1210',13022,'Matières premières','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13025,'PCG_SUISSE','XXXXXX','XXXXXX','1220',13022,'Matières auxiliaires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13026,'PCG_SUISSE','XXXXXX','XXXXXX','1230',13022,'Matières consommables','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13027,'PCG_SUISSE','XXXXXX','XXXXXX','1250',13022,'Marchandises en consignation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13028,'PCG_SUISSE','XXXXXX','XXXXXX','1260',13022,'Stocks de produits fnis','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13029,'PCG_SUISSE','XXXXXX','XXXXXX','1280',13022,'Travaux en cours','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13030,'PCG_SUISSE','XXXXXX','XXXXXX','130',13001,'Compte de régularisation de l''actif','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13031,'PCG_SUISSE','XXXXXX','XXXXXX','1300',13030,'Charges payées d''avance','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13032,'PCG_SUISSE','XXXXXX','XXXXXX','1301',13030,'Produits à recevoir','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13033,'PCG_SUISSE','XXXXXX','XXXXXX','14',13000,'Actifs immobilisés','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13034,'PCG_SUISSE','XXXXXX','XXXXXX','140',13033,'Immobilisations financières','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13035,'PCG_SUISSE','XXXXXX','XXXXXX','1400',13034,'Titres à long terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13036,'PCG_SUISSE','XXXXXX','XXXXXX','1409',13034,'Ajustement de la valeur des titres','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13037,'PCG_SUISSE','XXXXXX','XXXXXX','1440',13034,'Prêts','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13038,'PCG_SUISSE','XXXXXX','XXXXXX','1441',13034,'Hypothèques','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13039,'PCG_SUISSE','XXXXXX','XXXXXX','1449',13034,'Ajustement de la valeur des créances à long terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13040,'PCG_SUISSE','XXXXXX','XXXXXX','148',13033,'Participations','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13041,'PCG_SUISSE','XXXXXX','XXXXXX','1480',13040,'Participations','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13042,'PCG_SUISSE','XXXXXX','XXXXXX','1489',13040,'Ajustement de la valeur des participations','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13043,'PCG_SUISSE','XXXXXX','XXXXXX','150',13000,'Immobilisations corporelles meublés','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13044,'PCG_SUISSE','XXXXXX','XXXXXX','1500',13043,'Machines et appareils','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13045,'PCG_SUISSE','XXXXXX','XXXXXX','1509',13043,'Ajustement de la valeur des machines et appareils','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13046,'PCG_SUISSE','XXXXXX','XXXXXX','1510',13043,'Mobilier et installations','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13047,'PCG_SUISSE','XXXXXX','XXXXXX','1519',13043,'Ajustement de la valeur du mobilier et des installations','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13048,'PCG_SUISSE','XXXXXX','XXXXXX','1520',13043,'Machines de bureau, informatique, système de communication','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13049,'PCG_SUISSE','XXXXXX','XXXXXX','1529',13043,'Ajustement de la valeur des machines de bureau, inf. et syst. comm.','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13050,'PCG_SUISSE','XXXXXX','XXXXXX','1530',13043,'Véhicules','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13051,'PCG_SUISSE','XXXXXX','XXXXXX','1539',13043,'Ajustement de la valeur des véhicules','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13052,'PCG_SUISSE','XXXXXX','XXXXXX','1540',13043,'Outillages et appareils','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13053,'PCG_SUISSE','XXXXXX','XXXXXX','1549',13043,'Ajustement de la valeur des outillages et appareils','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13054,'PCG_SUISSE','XXXXXX','XXXXXX','160',13000,'Immobilisations corporelles Immeubles','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13055,'PCG_SUISSE','XXXXXX','XXXXXX','1600',13054,'Immeubles d''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13056,'PCG_SUISSE','XXXXXX','XXXXXX','1609',13054,'Ajustements de la valeur des immeubles d''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13057,'PCG_SUISSE','XXXXXX','XXXXXX','170',13000,'Immobilisations incorporelles','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13058,'PCG_SUISSE','XXXXXX','XXXXXX','1700',13057,'Brevets, know-how, licences, droits, dév.','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13059,'PCG_SUISSE','XXXXXX','XXXXXX','1709',13057,'Ajustement de la valeur des brevets, know-how, licences, droits, dév.','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13060,'PCG_SUISSE','XXXXXX','XXXXXX','1770',13057,'Goodwill','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13061,'PCG_SUISSE','XXXXXX','XXXXXX','1779',13057,'Ajustement de la valeur du goodwill','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13062,'PCG_SUISSE','XXXXXX','XXXXXX','180',13000,'Capital non versé : capital social, capital de fondation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13063,'PCG_SUISSE','XXXXXX','XXXXXX','1850',13062,'Capital actions, capital social, droits de participations ou capital de fondation non versés','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13064,'PCG_SUISSE','XXXXXX','XXXXXX','2',0,'Passif','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13065,'PCG_SUISSE','XXXXXX','XXXXXX','20',13064,'Dettes à court terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13066,'PCG_SUISSE','XXXXXX','XXXXXX','200',13065,'Dettes à court terme résultant d''achats et de prestations de services','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13067,'PCG_SUISSE','XXXXXX','XXXXXX','2000',13066,'Dettes résultant d''achats et des prestations de services (créanciers)','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13068,'PCG_SUISSE','XXXXXX','XXXXXX','2030',13066,'Acomptes de clients','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13069,'PCG_SUISSE','XXXXXX','XXXXXX','2050',13066,'Dettes résultant d''achats et de prestations de services envers des sociétés du groupe','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13070,'PCG_SUISSE','XXXXXX','XXXXXX','210',13065,'Dettes à court terme rémunérés','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13071,'PCG_SUISSE','XXXXXX','XXXXXX','2100',13070,'Dettes bancaires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13072,'PCG_SUISSE','XXXXXX','XXXXXX','2120',13070,'Engagements de financement par leasing','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13073,'PCG_SUISSE','XXXXXX','XXXXXX','2140',13070,'Autres dettes à court terme rémunérées','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13074,'PCG_SUISSE','XXXXXX','XXXXXX','2151',13070,'Salaires à payer','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13075,'PCG_SUISSE','XXXXXX','XXXXXX','2152',13070,'Charges sociales à payer (AVS/AC/ALFA)','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13076,'PCG_SUISSE','XXXXXX','XXXXXX','21521',13075,'Créancier AVS/AI/APG/AC','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13077,'PCG_SUISSE','XXXXXX','XXXXXX','21522',13075,'Créancier Allocations Familiales','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13078,'PCG_SUISSE','XXXXXX','XXXXXX','2153',13070,'Assurances sociales à payer (LAA, IJM, FT, LPP)','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13079,'PCG_SUISSE','XXXXXX','XXXXXX','21531',13078,'Créancier Assurance Accidents','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13080,'PCG_SUISSE','XXXXXX','XXXXXX','21532',13078,'Créancier Assurance Accidents complémentaire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13081,'PCG_SUISSE','XXXXXX','XXXXXX','21533',13078,'Créancier Prévoyance Professionnelle','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13082,'PCG_SUISSE','XXXXXX','XXXXXX','21534',13078,'Créancier Prévoyance Professionnelle complémentaire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13083,'PCG_SUISSE','XXXXXX','XXXXXX','21535',13078,'Créancier Assurance Indemnités Journalières Maladie','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13084,'PCG_SUISSE','XXXXXX','XXXXXX','21536',13078,'Créancier Assurance Indemnités Journalières Maladie complémentaire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13085,'PCG_SUISSE','XXXXXX','XXXXXX','21539',13078,'Créancier autres caisses et assurances','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13086,'PCG_SUISSE','XXXXXX','XXXXXX','2154',13070,'Impôt source','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13087,'PCG_SUISSE','XXXXXX','XXXXXX','2155',13070,'Autres charges','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13088,'PCG_SUISSE','XXXXXX','XXXXXX','21551',13087,'Taxe réfugiés','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13089,'PCG_SUISSE','XXXXXX','XXXXXX','21552',13087,'Office des Poursuites','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13090,'PCG_SUISSE','XXXXXX','XXXXXX','21553',13087,'Retraite anticipée','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13091,'PCG_SUISSE','XXXXXX','XXXXXX','21554',13087,'Caisse professionnelle','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13092,'PCG_SUISSE','XXXXXX','XXXXXX','21559',13087,'Autres retenues employé à payer','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13093,'PCG_SUISSE','XXXXXX','XXXXXX','2158',13070,'Provisions 13ème et vacances à payer','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13094,'PCG_SUISSE','XXXXXX','XXXXXX','2160',13070,'Indemnités d''assurances','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13095,'PCG_SUISSE','XXXXXX','XXXXXX','21601',13094,'Indemnités d''assurance accidents','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13096,'PCG_SUISSE','XXXXXX','XXXXXX','21602',13094,'Indemnités d''assurance maladie','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13097,'PCG_SUISSE','XXXXXX','XXXXXX','21603',13094,'Indemnités d''assurance maternité','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13098,'PCG_SUISSE','XXXXXX','XXXXXX','21604',13094,'Indemnités d''assurance maternité complémentaire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13099,'PCG_SUISSE','XXXXXX','XXXXXX','21605',13094,'Indemnités d''assurance APG militaire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13100,'PCG_SUISSE','XXXXXX','XXXXXX','21606',13094,'Indemnités d''assurance militaire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13101,'PCG_SUISSE','XXXXXX','XXXXXX','21607',13094,'Indemnités d''assurance chômage','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13102,'PCG_SUISSE','XXXXXX','XXXXXX','21608',13094,'Indemnités d''assurance AI','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13103,'PCG_SUISSE','XXXXXX','XXXXXX','21609',13094,'Autres','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13104,'PCG_SUISSE','XXXXXX','XXXXXX','220',13065,'Autres dettes à court terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13105,'PCG_SUISSE','XXXXXX','XXXXXX','2200',13104,'TVA due','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13106,'PCG_SUISSE','XXXXXX','XXXXXX','2201',13104,'Décompte TVA','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13107,'PCG_SUISSE','XXXXXX','XXXXXX','2206',13104,'Impôt anticipé dû','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13108,'PCG_SUISSE','XXXXXX','XXXXXX','2208',13104,'Impôts directs','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13109,'PCG_SUISSE','XXXXXX','XXXXXX','2210',13104,'Autres dettes à court terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13110,'PCG_SUISSE','XXXXXX','XXXXXX','2261',13104,'Dividendes','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13111,'PCG_SUISSE','XXXXXX','XXXXXX','2270',13104,'Assurances sociales et institutions de prévoyance','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13112,'PCG_SUISSE','XXXXXX','XXXXXX','2279',13104,'Impôt à la source','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13113,'PCG_SUISSE','XXXXXX','XXXXXX','230',13065,'Passifs de régularisation et provision à court terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13114,'PCG_SUISSE','XXXXXX','XXXXXX','2300',13113,'Charges à payer','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13115,'PCG_SUISSE','XXXXXX','XXXXXX','2301',13113,'Produits constatés d''avance','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13116,'PCG_SUISSE','XXXXXX','XXXXXX','2330',13113,'Provisions à court terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13117,'PCG_SUISSE','XXXXXX','XXXXXX','24',13064,'Dettes à long terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13118,'PCG_SUISSE','XXXXXX','XXXXXX','240',13117,'Dettes à long terme rémunérées','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13119,'PCG_SUISSE','XXXXXX','XXXXXX','2400',13118,'Dettes bancaires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13120,'PCG_SUISSE','XXXXXX','XXXXXX','2420',13118,'Engagements de financement par leasing','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13121,'PCG_SUISSE','XXXXXX','XXXXXX','2430',13118,'Emprunts obligataires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13122,'PCG_SUISSE','XXXXXX','XXXXXX','2450',13118,'Emprunts','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13123,'PCG_SUISSE','XXXXXX','XXXXXX','2451',13118,'Hypothèques','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13124,'PCG_SUISSE','XXXXXX','XXXXXX','250',13117,'Autres dettes à long terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13125,'PCG_SUISSE','XXXXXX','XXXXXX','2500',13124,'Autres dettes à long terme','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13126,'PCG_SUISSE','XXXXXX','XXXXXX','260',13117,'Provisions à long terme et provisions légales','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13127,'PCG_SUISSE','XXXXXX','XXXXXX','2600',13126,'Provisions','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13128,'PCG_SUISSE','XXXXXX','XXXXXX','28',13064,'Fonds propres (personnes morales)','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13129,'PCG_SUISSE','XXXXXX','XXXXXX','280',13128,'Capital social ou capital de fondation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13130,'PCG_SUISSE','XXXXXX','XXXXXX','2800',13129,'Capital-actions, capital social, capital de fondation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13131,'PCG_SUISSE','XXXXXX','XXXXXX','290',13064,'Réserves / bénéfices et pertes','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13132,'PCG_SUISSE','XXXXXX','XXXXXX','2900',13131,'Réserves légales issues du capital','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13133,'PCG_SUISSE','XXXXXX','XXXXXX','2930',13131,'Réserves sur participations propres au capital','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13134,'PCG_SUISSE','XXXXXX','XXXXXX','2940',13131,'Réserves d''évaluation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13135,'PCG_SUISSE','XXXXXX','XXXXXX','2950',13131,'Réserves légales issues du bénéfice','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13136,'PCG_SUISSE','XXXXXX','XXXXXX','2960',13131,'Réserves libres','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13137,'PCG_SUISSE','XXXXXX','XXXXXX','2970',13131,'Bénéfice / perte reporté','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13138,'PCG_SUISSE','XXXXXX','XXXXXX','2979',13131,'Bénéfice / perte de l''exercice','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13139,'PCG_SUISSE','XXXXXX','XXXXXX','2980',13131,'Propres actions, parts sociales, droits de participations (poste négatif)','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13140,'PCG_SUISSE','XXXXXX','XXXXXX','3',0,'Chiffre d''affaires résultant des ventes et des prestations de services','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13141,'PCG_SUISSE','XXXXXX','XXXXXX','3000',13140,'Ventes de produits fabriqués','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13142,'PCG_SUISSE','XXXXXX','XXXXXX','3200',13140,'Ventes de marchandises','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13143,'PCG_SUISSE','XXXXXX','XXXXXX','3400',13140,'Ventes de prestations','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13144,'PCG_SUISSE','XXXXXX','XXXXXX','3600',13140,'Autres ventes et prestations de services','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13145,'PCG_SUISSE','XXXXXX','XXXXXX','3700',13140,'Prestations propres','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13146,'PCG_SUISSE','XXXXXX','XXXXXX','3710',13140,'Consommations propres','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13147,'PCG_SUISSE','XXXXXX','XXXXXX','3800',13140,'Déductions sur ventes','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13148,'PCG_SUISSE','XXXXXX','XXXXXX','3805',13140,'Pertes sur clients, variations du ducroire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13149,'PCG_SUISSE','XXXXXX','XXXXXX','3900',13140,'Variation des stocks de produits semis-finis','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13150,'PCG_SUISSE','XXXXXX','XXXXXX','3901',13140,'Variation des stocks de produits finis','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13151,'PCG_SUISSE','XXXXXX','XXXXXX','3904',13140,'Variation de la valeur des prestations non facturées','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13152,'PCG_SUISSE','XXXXXX','XXXXXX','4',0,'Charges de matériel, de marchandises et de prestations de tiers','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13153,'PCG_SUISSE','XXXXXX','XXXXXX','4000',13152,'Charges de matériel de l''atelier','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13154,'PCG_SUISSE','XXXXXX','XXXXXX','4200',13152,'Achats de marchandises destinées à la revente','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13155,'PCG_SUISSE','XXXXXX','XXXXXX','4400',13152,'Prestations / travaux de tiers','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13156,'PCG_SUISSE','XXXXXX','XXXXXX','4500',13152,'Charges d''énergie pour l''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13157,'PCG_SUISSE','XXXXXX','XXXXXX','4900',13152,'Déductions sur les charges','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13158,'PCG_SUISSE','XXXXXX','XXXXXX','5',0,'Charges de personnel','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13159,'PCG_SUISSE','XXXXXX','XXXXXX','5000',13158,'Salaires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13160,'PCG_SUISSE','XXXXXX','XXXXXX','5200',13158,'Charges de personnel','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13161,'PCG_SUISSE','XXXXXX','XXXXXX','5201',13158,'Salaires variables, commissions et primes régulières','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13162,'PCG_SUISSE','XXXXXX','XXXXXX','5202',13158,'Primes occasionnelles et participations au bénéfice','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13163,'PCG_SUISSE','XXXXXX','XXXXXX','5203',13158,'Divers soumis','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13164,'PCG_SUISSE','XXXXXX','XXXXXX','5204',13158,'Divers non soumis','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13165,'PCG_SUISSE','XXXXXX','XXXXXX','5210',13158,'Honoraires et indemnités CA','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13166,'PCG_SUISSE','XXXXXX','XXXXXX','5270',13158,'AVS, AI, APG, assurance-chômage','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13167,'PCG_SUISSE','XXXXXX','XXXXXX','5271',13158,'Caisse d''allocations familiales','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13168,'PCG_SUISSE','XXXXXX','XXXXXX','52721',13167,'Prévoyance professionnelle','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13169,'PCG_SUISSE','XXXXXX','XXXXXX','52722',13167,'Prévoyance professionnelle complémentaire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13170,'PCG_SUISSE','XXXXXX','XXXXXX','52731',13167,'Assurance-accidents','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13171,'PCG_SUISSE','XXXXXX','XXXXXX','52732',13167,'Assurance-accidents complémentaire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13172,'PCG_SUISSE','XXXXXX','XXXXXX','52741',13167,'Assurance IJM','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13173,'PCG_SUISSE','XXXXXX','XXXXXX','52742',13167,'Assurance IJM complémentaire','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13174,'PCG_SUISSE','XXXXXX','XXXXXX','5275',13158,'Autres assurances','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13175,'PCG_SUISSE','XXXXXX','XXXXXX','5276',13158,'Impôts à la source payé par employeur','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13176,'PCG_SUISSE','XXXXXX','XXXXXX','5278',13158,'Caisse professionnelle','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13177,'PCG_SUISSE','XXXXXX','XXXXXX','5279',13158,'Arrondis sur charges sociales','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13178,'PCG_SUISSE','XXXXXX','XXXXXX','5280',13158,'Autres charges de personnel','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13179,'PCG_SUISSE','XXXXXX','XXXXXX','5281',13158,'Frais de voyages/transport','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13180,'PCG_SUISSE','XXXXXX','XXXXXX','5282',13158,'Frais de repas/hébergement','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13181,'PCG_SUISSE','XXXXXX','XXXXXX','5283',13158,'Frais forfaitaires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13182,'PCG_SUISSE','XXXXXX','XXXXXX','5284',13158,'Frais de représentation, téléphones, divers','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13183,'PCG_SUISSE','XXXXXX','XXXXXX','5288',13158,'Frais de formation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13184,'PCG_SUISSE','XXXXXX','XXXXXX','5289',13158,'Autres frais de personnel','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13185,'PCG_SUISSE','XXXXXX','XXXXXX','5290',13158,'Prestations de travail de tiers','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13186,'PCG_SUISSE','XXXXXX','XXXXXX','5700',13158,'Charges sociales','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13187,'PCG_SUISSE','XXXXXX','XXXXXX','5800',13158,'Autres charges du personnel','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13188,'PCG_SUISSE','XXXXXX','XXXXXX','5900',13158,'Charges de personnels temporaires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13189,'PCG_SUISSE','XXXXXX','XXXXXX','6',0,'Autres charges d''exploitation, amortissements et ajustement de valeur, résultat financier','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13190,'PCG_SUISSE','XXXXXX','XXXXXX','6000',13189,'Charges de locaux','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13191,'PCG_SUISSE','XXXXXX','XXXXXX','6100',13189,'Entretien, réparations et remplacement des inst. servant à l''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13192,'PCG_SUISSE','XXXXXX','XXXXXX','6105',13189,'Leasing immobilisations corporelles meubles','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13193,'PCG_SUISSE','XXXXXX','XXXXXX','6200',13189,'Charges de véhicules et de transport','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13194,'PCG_SUISSE','XXXXXX','XXXXXX','6260',13189,'Leasing et location de véhicule','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13195,'PCG_SUISSE','XXXXXX','XXXXXX','6300',13189,'Assurances-choses, droits, taxes, autorisations','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13196,'PCG_SUISSE','XXXXXX','XXXXXX','6400',13189,'Charges d''énergie et évacuation des déchets','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13197,'PCG_SUISSE','XXXXXX','XXXXXX','6500',13189,'Charges d''administration','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13198,'PCG_SUISSE','XXXXXX','XXXXXX','6510',13189,'Téléphone','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13199,'PCG_SUISSE','XXXXXX','XXXXXX','6511',13189,'Internet','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13200,'PCG_SUISSE','XXXXXX','XXXXXX','6512',13189,'Frais de port','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13201,'PCG_SUISSE','XXXXXX','XXXXXX','6560',13189,'Informatique','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13202,'PCG_SUISSE','XXXXXX','XXXXXX','6570',13189,'Charges et leasing d''informatique','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13203,'PCG_SUISSE','XXXXXX','XXXXXX','6571',13189,'Entretien/Hotline Hardware','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13204,'PCG_SUISSE','XXXXXX','XXXXXX','6573',13189,'Disquettes, CD-Rom, etc. Fourniture d''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13205,'PCG_SUISSE','XXXXXX','XXXXXX','6600',13189,'Publicité','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13206,'PCG_SUISSE','XXXXXX','XXXXXX','6610',13189,'Imprimés publicitaires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13207,'PCG_SUISSE','XXXXXX','XXXXXX','6640',13189,'Frais de voyage et conseils à la clientèle','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13208,'PCG_SUISSE','XXXXXX','XXXXXX','6641',13189,'Frais de représentation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13209,'PCG_SUISSE','XXXXXX','XXXXXX','6700',13189,'Autres charges d''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13210,'PCG_SUISSE','XXXXXX','XXXXXX','6800',13189,'Amortissement et ajustement de valeur des postes sur immobilisations corporelles','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13211,'PCG_SUISSE','XXXXXX','XXXXXX','6801',13189,'Intérêts pour emprunts','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13212,'PCG_SUISSE','XXXXXX','XXXXXX','6840',13189,'Frais de banque et des chèques postaux','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13213,'PCG_SUISSE','XXXXXX','XXXXXX','6850',13189,'Produits financiers','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13214,'PCG_SUISSE','XXXXXX','XXXXXX','6900',13189,'Charges financières','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13215,'PCG_SUISSE','XXXXXX','XXXXXX','6920',13189,'Amortissement s/immobilisé. corporelles meubles','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13216,'PCG_SUISSE','XXXXXX','XXXXXX','6930',13189,'Amortissement s/immobilisé. corporelles immeubles','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13217,'PCG_SUISSE','XXXXXX','XXXXXX','6940',13189,'Amortissement s/immobilisé. incorporelles','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13218,'PCG_SUISSE','XXXXXX','XXXXXX','6950',13189,'Produits financiers','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13219,'PCG_SUISSE','XXXXXX','XXXXXX','7',0,'Résultat des activités annexes d''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13220,'PCG_SUISSE','XXXXXX','XXXXXX','7000',13219,'Produits accessoires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13221,'PCG_SUISSE','XXXXXX','XXXXXX','7010',13219,'Charges accessoires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13222,'PCG_SUISSE','XXXXXX','XXXXXX','7400',13219,'Produits sur placements financiers','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13223,'PCG_SUISSE','XXXXXX','XXXXXX','7410',13219,'Charges sur placements financiers','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13224,'PCG_SUISSE','XXXXXX','XXXXXX','7500',13219,'Produits des immeubles d''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13225,'PCG_SUISSE','XXXXXX','XXXXXX','7510',13219,'Charges des immeubles d''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13226,'PCG_SUISSE','XXXXXX','XXXXXX','8',0,'Charges hors exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13227,'PCG_SUISSE','XXXXXX','XXXXXX','8000',13226,'Charges hors exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13228,'PCG_SUISSE','XXXXXX','XXXXXX','8100',13226,'Produits hors exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13229,'PCG_SUISSE','XXXXXX','XXXXXX','8500',13226,'Charges extraordinaires, exceptionnelles ou hors période','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13230,'PCG_SUISSE','XXXXXX','XXXXXX','8510',13226,'Produits extraordinaires, exceptionnels ou hors période','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13231,'PCG_SUISSE','XXXXXX','XXXXXX','8900',13226,'Impôts directs','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13232,'PCG_SUISSE','XXXXXX','XXXXXX','9',0,'Produits de vente et de services','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13233,'PCG_SUISSE','XXXXXX','XXXXXX','9001',13232,'Charges de vente et de services','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13234,'PCG_SUISSE','XXXXXX','XXXXXX','9002',13232,'Résultat brut 1','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13235,'PCG_SUISSE','XXXXXX','XXXXXX','9006',13232,'Charges de personnel de production','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13236,'PCG_SUISSE','XXXXXX','XXXXXX','9007',13232,'Résultat brut 2','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13237,'PCG_SUISSE','XXXXXX','XXXXXX','9008',13232,'Autres charges de personnel','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13238,'PCG_SUISSE','XXXXXX','XXXXXX','9009',13232,'Résultat brut 3','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13239,'PCG_SUISSE','XXXXXX','XXXXXX','9010',13232,'Autres charges d''exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13240,'PCG_SUISSE','XXXXXX','XXXXXX','9011',13232,'Résultat d''exploitation 1','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13241,'PCG_SUISSE','XXXXXX','XXXXXX','9012',13232,'Résultat financier','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13242,'PCG_SUISSE','XXXXXX','XXXXXX','9013',13232,'Résultat d''exploitation 2','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13243,'PCG_SUISSE','XXXXXX','XXXXXX','9014',13232,'Amortissements','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13244,'PCG_SUISSE','XXXXXX','XXXXXX','9015',13232,'Résultat d''exploitation 3','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13245,'PCG_SUISSE','XXXXXX','XXXXXX','9016',13232,'Résultat activités annexes exploitation','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13246,'PCG_SUISSE','XXXXXX','XXXXXX','9017',13232,'Résultat d''exploitation 4','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13247,'PCG_SUISSE','XXXXXX','XXXXXX','9018',13232,'Résultats extraordinaires','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13248,'PCG_SUISSE','XXXXXX','XXXXXX','9019',13232,'Résultat d''entreprise avant impôts','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13249,'PCG_SUISSE','XXXXXX','XXXXXX','9020',13232,'Charges d''impôts','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13250,'PCG_SUISSE','XXXXXX','XXXXXX','9090',13232,'Résultat d''entreprise','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13251,'PCG_SUISSE','XXXXXX','XXXXXX','9100',13232,'Bilan d''ouverture','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13252,'PCG_SUISSE','XXXXXX','XXXXXX','9101',13232,'Bilan de clôture','1');
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (13253,'PCG_SUISSE','XXXXXX','XXXXXX','9200',13232,'Bénéfice / perte de l''exercice','1');

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -178,6 +178,8 @@ CREATE TABLE llx_websiteaccount(
login varchar(64) NOT NULL,
pass_crypted varchar(128),
pass_temp varchar(128), -- temporary password when asked for forget password
fk_soc integer,
fk_website integer,
date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
@ -185,8 +187,7 @@ CREATE TABLE llx_websiteaccount(
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
status integer,
fk_soc integer
status integer
) ENGINE=innodb;

View File

@ -17,10 +17,12 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_rowid (rowid);
ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_login (login);
ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_import_key (import_key);
ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_status (status);
ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_fk_website (fk_website);
ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_fk_soc (fk_soc);
-- END MODULEBUILDER INDEXES
ALTER TABLE llx_websiteaccount ADD UNIQUE INDEX uk_websiteaccount_login_website_soc(login, fk_website, fk_soc);
--ALTER TABLE llx_websiteaccount ADD CONSTRAINT llx_websiteaccount_field_id FOREIGN KEY (fk_field) REFERENCES llx_myotherobject(rowid);

View File

@ -20,6 +20,8 @@ CREATE TABLE llx_websiteaccount(
login varchar(64) NOT NULL,
pass_crypted varchar(128),
pass_temp varchar(128), -- temporary password when asked for forget password
fk_soc integer,
fk_website integer,
date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
@ -27,7 +29,6 @@ CREATE TABLE llx_websiteaccount(
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
status integer,
fk_soc integer
status integer
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;

View File

@ -99,7 +99,6 @@ NbOfCompaniesContacts=Unique contacts/addresses
MailNoChangePossible=Recipients for validated emailing can't be changed
SearchAMailing=Search mailing
SendMailing=Send emailing
SendMail=Send email
SentBy=Sent by
MailingNeedCommand=Sending an emailing can be performed from command line. Ask your server administrator to launch the following command to send the emailing to all recipients:
MailingNeedCommand2=You can however send them online by adding parameter MAILING_LIMIT_SENDBYWEB with value of max number of emails you want to send by session. For this, go on Home - Setup - Other.

View File

@ -610,6 +610,7 @@ SendByMail=Send by EMail
MailSentBy=Email sent by
TextUsedInTheMessageBody=Email body
SendAcknowledgementByMail=Send confirmation email
SendMail=Send email
EMail=E-mail
NoEMail=No email
Email=Email

View File

@ -71,7 +71,7 @@ NoWidget=No widget
GoToApiExplorer=Go to API explorer
ListOfPermissionsDefined=List of defined permissions
EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION)
VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
IsAMeasureDesc=Can the value of field be cumulated to get a total into list ? (Examples: 1 or 0)
SearchAllDesc=Is the field used to make a search from the quick search tool ? (Examples: 1 or 0)
SpecDefDesc=Enter here all documentation you want to provide with your module that is not already defined by other tabs. You can use .md or better, the rich .asciidoc syntax.

View File

@ -51,5 +51,6 @@ OrEnterPageInfoManually=Or create empty page from scratch...
FetchAndCreate=Fetch and Create
ExportSite=Export site
IDOfPage=Id of page
WebsiteAccount=Web site account
WebsiteAccounts=Web site accounts
AddWebsiteAccount=Create web site account

View File

@ -43,30 +43,31 @@ class MyObject extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'myobject';
/**
* @var array Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
protected $ismultientitymanaged = 0;
public $ismultientitymanaged = 0;
/**
* @var string String with name of icon for myobject
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'myobject@mymodule';
/**
* 'type' if the field format.
* 'label' the translation key.
* 'enabled' is a condition when the field must be managed.
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'index' if we want an index in database.
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
* 'position' is the sort order of field.
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
* 'help' is a string visible as a tooltip on field
* 'comment' is not used. You can store here any text of your choice.
* 'type' if the field format.
* 'label' the translation key.
* 'enabled' is a condition when the field must be managed.
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'index' if we want an index in database.
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
* 'position' is the sort order of field.
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
* 'help' is a string visible as a tooltip on field
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
* 'default' is a default value for creation (can still be replaced by the global setup of default values)
* 'showoncombobox' if field must be shown into the label of combobox
*/
// BEGIN MODULEBUILDER PROPERTIES
@ -75,7 +76,7 @@ class MyObject extends CommonObject
*/
public $fields=array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text'),
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text'),
@ -88,8 +89,8 @@ class MyObject extends CommonObject
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>1, 'position'=>1000),
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>-1, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
);
public $rowid;
@ -314,7 +315,7 @@ class MyObject extends CommonObject
if ($withpicto)
{
$result.=($linkstart.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend);
$result.=($linkstart.img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?'':'class="classfortooltip"')).$linkend);
if ($withpicto != 2) $result.=' ';
}
$result.= $linkstart . $this->ref . $linkend;

View File

@ -172,40 +172,9 @@ if ($action == 'create')
dol_fiche_head(array(), '');
print '<table class="border centpercent">'."\n";
foreach($object->fields as $key => $val)
{
if (abs($val['visible']) != 1) continue; // Discard such field from form
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
print '<tr id="field_'.$key.'">';
print '<td';
print ' class="titlefieldcreate';
if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text') print ' tdtop';
print '"';
print '>';
print $langs->trans($val['label']);
print '</td>';
print '<td>';
$defaultcss='minwidth100';
if ($val['type'] == 'text')
{
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
print GETPOST($key,'none');
print '</textarea>';
}
elseif (is_array($val['arrayofkeyval']))
{
print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int'));
}
else
{
$cssforinput = empty($val['css'])?$defaultcss:$val['css'];
print '<input class="flat'.($cssforinput?' '.$cssforinput:'').'" class="'.$cssforinput.'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):'').'">';
}
print '</td>';
print '</tr>';
}
// Common attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
@ -217,7 +186,7 @@ if ($action == 'create')
print '<div class="center">';
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
print '&nbsp; ';
print '<input type="button" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" onclick="javascript:history.go(-1)">'; // Cancel for create doe not post form
print '<input type="'.($backtopage?"submit":"button").'" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage?'':' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
print '</div>';
print '</form>';
@ -236,37 +205,9 @@ if (($id || $ref) && $action == 'edit')
dol_fiche_head();
print '<table class="border centpercent">'."\n";
foreach($object->fields as $key => $val)
{
if (abs($val['visible']) != 1) continue; // Discard such field from form
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
print '<tr><td';
print ' class="titlefieldcreate';
if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text') print ' tdtop';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
$defaultcss='minwidth100';
if ($val['type'] == 'text')
{
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
print GETPOST($key,'none')?GETPOST($key,'none'):$object->$key;
print '</textarea>';
}
elseif (is_array($val['arrayofkeyval']))
{
print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')!=''?GETPOST($key, 'int'):$object->$key);
}
else
{
$cssforinput = empty($val['css'])?$defaultcss:$val['css'];
print '<input class="flat'.($cssforinput?' '.$cssforinput:'').'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):$object->$key).'">';
}
print '</td>';
print '</tr>';
}
// Common attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
@ -379,52 +320,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'."\n";
foreach($object->fields as $key => $val)
{
if (abs($val['visible']) != 1) continue; // Discard such field from form
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
print '<tr><td';
print ' class="titlefield';
if ($val['notnull'] > 0) print ' fieldrequired';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
print dol_escape_htmltag($object->$key, 1, 1);
print '</td>';
print '</tr>';
//if ($key == 'targetsrcfile3') break; // key used for break on second column
}
print '</table>';
print '</div>';
print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
$alreadyoutput = 1;
foreach($object->fields as $key => $val)
{
if ($alreadyoutput)
{
//if ($key == 'targetsrcfile3') $alreadyoutput = 0; // key used for break on second column
continue;
}
if (in_array($key, array('rowid', 'ref', 'entity', 'note_public', 'note_private', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue;
print '<tr><td';
print ' class="titlefield';
if ($val['notnull'] > 0) print ' fieldrequired';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
print dol_escape_htmltag($object->$key, 1, 1);
print '</td>';
print '</tr>';
}
// Common attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
@ -449,7 +346,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook))
{
// Send
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendByMail') . '</a></div>'."\n";
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a></div>'."\n";
if ($user->rights->mymodule->write)
{
@ -488,15 +385,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre
// Documents
$comref = dol_sanitizeFileName($object->ref);
/*$comref = dol_sanitizeFileName($object->ref);
$relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->mymodule->dir_output . '/' . $comref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content
$delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('mymodule', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
*/
// Show links to link elements
$linktoelem = $form->showLinkToObjectBlock($object, null, array('myobject'));

View File

@ -15,8 +15,10 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_myobject ADD UNIQUE INDEX idx_fieldobject (fieldobject);
ALTER TABLE llx_myobject ADD INDEX idx_fieldobject (fieldobject);
-- END MODULEBUILDER INDEXES
--ALTER TABLE llx_myobject ADD UNIQUE INDEX uk_myobject_fieldxyz(fieldx, fieldy);
--ALTER TABLE llx_myobject ADD CONSTRAINT llx_myobject_field_id FOREIGN KEY (fk_field) REFERENCES llx_myotherobject(rowid);

View File

@ -47,7 +47,7 @@ class Product extends CommonObject
public $table_element='product';
public $fk_element='fk_product';
protected $childtables=array('supplier_proposaldet', 'propaldet','commandedet','facturedet','contratdet','facture_fourn_det','commande_fournisseurdet'); // To test if we can delete object
protected $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
/**
* {@inheritdoc}

View File

@ -47,7 +47,7 @@ class Inventory extends CommonObject
/**
* @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
protected $ismultientitymanaged = 1;
public $ismultientitymanaged = 1;
/**
* @var string String with name of icon for inventory
*/

View File

@ -37,7 +37,7 @@ class Project extends CommonObject
public $table_element = 'projet'; //!< Name of table without prefix where object is stored
public $table_element_line = 'projet_task';
public $fk_element = 'fk_projet';
protected $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
public $picto = 'projectpub';
/**

View File

@ -28,7 +28,6 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
if (empty($_GET['keysearch']) && ! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
require '../../main.inc.php';
@ -74,7 +73,6 @@ else
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$langs->load("companies");
$langs->load("main");
top_httphead();

View File

@ -43,15 +43,37 @@ class Societe extends CommonObject
public $element='societe';
public $table_element = 'societe';
public $fk_element='fk_soc';
public $fieldsforcombobox='nom,name_alias';
protected $childtables=array("supplier_proposal"=>'SupplierProposal',"propal"=>'Proposal',"commande"=>'Order',"facture"=>'Invoice',"facture_rec"=>'RecurringInvoiceTemplate',"contrat"=>'Contract',"fichinter"=>'Fichinter',"facture_fourn"=>'SupplierInvoice',"commande_fournisseur"=>'SupplierOrder',"projet"=>'Project',"expedition"=>'Shipment',"prelevement_lignes"=>'DirectDebitRecord'); // To test if we can delete object
protected $childtablesoncascade=array("societe_prices", "societe_log", "societe_address", "product_fournisseur_price", "product_customer_price_log", "product_customer_price", "socpeople", "adherent", "societe_rib", "societe_remise", "societe_remise_except", "societe_commerciaux", "categorie", "notify", "notify_def", "actioncomm");
/**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int
*/
protected $ismultientitymanaged = 1;
public $ismultientitymanaged = 1;
// BEGIN MODULEBUILDER PROPERTIES
/**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields=array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
'nom' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
'name_alias' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>60),
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>61),
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>1, 'position'=>1000),
);
public $entity;
@ -368,6 +390,10 @@ class Societe extends CommonObject
var $fk_multicurrency;
var $multicurrency_code;
// END MODULEBUILDER PROPERTIES
/**
* To contains a clone of this when we need to save old properties of object
* @var Societe

View File

@ -39,7 +39,7 @@ $langs->loadLangs(array("companies","website"));
$search_status=GETPOST('search_status');
// Security check
$id = GETPOST('id','int');
$id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe', $socid, '&societe');
@ -91,6 +91,7 @@ foreach($objectwebsiteaccount->fields as $key => $val)
// If $val['visible']==0, then we never show the field
if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']);
}
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
@ -230,7 +231,7 @@ dol_fiche_end();
$morehtmlcenter = '';
if (! empty($conf->website->enabled)) {
if (! empty($user->rights->societe->lire)) {
$morehtmlcenter .= '<a class="butAction" href="' . DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&thirdpartyid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'id='.$object->id).'">' . $langs->trans("AddWebsiteAccount") . '</a>';
$morehtmlcenter .= '<a class="butAction" href="' . DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">' . $langs->trans("AddWebsiteAccount") . '</a>';
} else {
$morehtmlcenter .= '<a class="butActionRefused" href="#">' . $langs->trans("AddAction") . '</a>';
}
@ -258,6 +259,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."websiteaccount as t";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."websiteaccount_extrafields as ef on (t.rowid = ef.fk_object)";
if ($objectwebsiteaccount->getIsmultientitymanaged() == 1) $sql.= " WHERE t.entity IN (".getEntity('websiteaccount').")";
else $sql.=" WHERE 1 = 1";
$sql.=" AND fk_soc = ".$object->id;
foreach($search as $key => $val)
{
$mode_search=(($objectwebsiteaccount->isInt($objectwebsiteaccount->fields[$key]) || $objectwebsiteaccount->isFloat($objectwebsiteaccount->fields[$key]))?1:0);
@ -489,7 +491,7 @@ while ($i < min($num, $limit))
print '<td'.($align?' class="'.$align.'"':'').'>';
if (in_array($val['type'], array('date'))) print dol_print_date($db->jdate($obj->$key), 'day', 'tzuser');
elseif (in_array($val['type'], array('datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser');
elseif ($key == 'ref') print $objectwebsiteaccount->getNomUrl(1, '', 0, '', 1);
elseif ($key == 'ref' || $key == 'login') print $objectwebsiteaccount->getNomUrl(1, '', 0, '', 1);
elseif ($key == 'status') print $objectwebsiteaccount->getLibStatut(3);
else print $obj->$key;
print '</td>';

View File

@ -48,7 +48,7 @@ class SupplierProposal extends CommonObject
public $table_element='supplier_proposal';
public $table_element_line='supplier_proposaldet';
public $fk_element='fk_supplier_proposal';
protected $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
public $picto='propal';
/**

View File

@ -4178,6 +4178,9 @@ div.dataTables_length select {
/* Select2 */
/* ============================================================================== */
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: unset;
}
.select2-default {
color: #999 !important;
/*opacity: 0.2;*/

View File

@ -4198,6 +4198,9 @@ div.dataTables_length select {
/* Select2 */
/* ============================================================================== */
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: unset;
}
.select2-container .select2-choice {
border-bottom: 1px solid #ccc;
}

View File

@ -40,7 +40,7 @@ class User extends CommonObject
{
public $element='user';
public $table_element='user';
protected $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
public $id=0;
public $ldap_sid;

View File

@ -36,7 +36,7 @@ class UserGroup extends CommonObject
{
public $element='usergroup';
public $table_element='usergroup';
protected $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
public $picto='group';
public $entity; // Entity of group

View File

@ -43,6 +43,10 @@ class Website extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'website';
/**
* @var string String with name of icon for websiteaccount. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'globe';
/**
* @var int
@ -648,21 +652,23 @@ class Website extends CommonObject
$result = '';
$companylink = '';
$label = '<u>' . $langs->trans("MyModule") . '</u>';
$label = '<u>' . $langs->trans("WebSite") . '</u>';
$label.= '<div width="100%">';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
$label.= '<b>' . $langs->trans('Nom') . ':</b> ' . $this->ref;
$link = '<a href="'.DOL_URL_ROOT.'/website/card.php?id='.$this->id.'"';
$link.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip'.($morecss?' '.$morecss:'').'"');
$link.= '>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/website/card.php?id='.$this->id.'"';
$linkstart.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip'.($morecss?' '.$morecss:'').'"');
$linkstart.= '>';
$linkend='</a>';
$linkstart = $linkend = '';
if ($withpicto)
{
$result.=($link.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend);
$result.=($linkstart.img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?'':'class="classfortooltip"')).$linkend);
if ($withpicto != 2) $result.=' ';
}
$result.= $link . $this->ref . $linkend;
$result.= $linkstart . $this->ref . $linkend;
return $result;
}

View File

@ -43,31 +43,31 @@ class WebsiteAccount extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'websiteaccount';
/**
* @var array Does websiteaccount support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
protected $ismultientitymanaged = 0;
public $ismultientitymanaged = 0;
/**
* @var string String with name of icon for websiteaccount
* @var string String with name of icon for websiteaccount. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'object_globe';
public $picto = 'globe';
/**
* 'type' if the field format.
* 'label' the translation key.
* 'enabled' is a condition when the field must be managed.
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'index' if we want an index in database.
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
* 'position' is the sort order of field.
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
* 'help' is a string visible as a tooltip on field
* 'comment' is not used. You can store here any text of your choice.
* 'type' if the field format.
* 'label' the translation key.
* 'enabled' is a condition when the field must be managed.
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'index' if we want an index in database.
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
* 'position' is the sort order of field.
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
* 'help' is a string visible as a tooltip on field
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
* 'default' is a default value for creation (can still be replaced by the global setup of default values)
* 'showoncombobox' if field must be shown into the label of combobox
*/
// BEGIN MODULEBUILDER PROPERTIES
@ -77,8 +77,10 @@ class WebsiteAccount extends CommonObject
public $fields=array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',),
'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Login',),
'pass_crypted' => array('type'=>'varchar(128)', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1,),
'pass_crypted' => array('type'=>'varchar(128)', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1),
'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>30, 'notnull'=>-1,),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'index'=>1),
'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>1, 'enabled'=>1, 'position'=>41, 'notnull'=>1, 'index'=>1),
'date_last_login' => array('type'=>'datetime', 'label'=>'LastConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>50, 'notnull'=>0,),
'date_previous_login' => array('type'=>'datetime', 'label'=>'PreviousConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>51, 'notnull'=>0,),
//'note_public' => array('type'=>'text', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>45, 'notnull'=>-1,),
@ -88,8 +90,7 @@ class WebsiteAccount extends CommonObject
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>-1,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1,),
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1, 'default'=>1, 'arrayofkeyval'=>array('1'=>'Active','0'=>'Disabled')),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1,),
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'default'=>1, 'arrayofkeyval'=>array('1'=>'Active','0'=>'Disabled')),
);
public $rowid;
public $login;
@ -107,6 +108,7 @@ class WebsiteAccount extends CommonObject
// If this object has a subtable with lines
/**
@ -280,9 +282,12 @@ class WebsiteAccount extends CommonObject
$result = '';
$companylink = '';
$this->ref = $this->login;
$label = '<u>' . $langs->trans("WebsiteAccount") . '</u>';
$label.= '<br>';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
$label.= '<b>' . $langs->trans('Login') . ':</b> ' . $this->ref;
//$label.= '<b>' . $langs->trans('WebSite') . ':</b> ' . $this->ref;
$url = dol_buildpath('/website/websiteaccount_card.php',1).'?id='.$this->id;
@ -313,7 +318,7 @@ class WebsiteAccount extends CommonObject
if ($withpicto)
{
$result.=($linkstart.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend);
$result.=($linkstart.img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?'':'class="classfortooltip"')).$linkend);
if ($withpicto != 2) $result.=' ';
}
$result.= $linkstart . $this->ref . $linkend;

View File

@ -43,6 +43,10 @@ class WebsitePage extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'website_page';
/**
* @var string String with name of icon for websiteaccount. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'label';
/**
*/
@ -408,17 +412,19 @@ class WebsitePage extends CommonObject
$label.= '<div width="100%">';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
$link = '<a href="'.DOL_URL_ROOT.'/website/card.php?id='.$this->id.'"';
$link.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip'.($morecss?' '.$morecss:'').'"');
$link.= '>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/website/card.php?id='.$this->id.'"';
$linkstart.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip'.($morecss?' '.$morecss:'').'"');
$linkstart.= '>';
$linkend='</a>';
$linkstart = $linkend = '';
if ($withpicto)
{
$result.=($link.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend);
if ($withpicto != 2) $result.=' ';
$result.=($linkstart.img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?'':'class="classfortooltip"')).$linkend);
if ($withpicto != 2) $result.=' ';
}
$result.= $link . $this->ref . $linkend;
$result.= $linkstart . $this->ref . $linkend;
return $result;
}

View File

@ -0,0 +1,85 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/website/lib/websiteaccount.lib.php
* \ingroup website
* \brief Library files with common functions for WebsiteAccount
*/
/**
* Prepare array of tabs for WebsiteAccount
*
* @param WebsiteAccount $object WebsiteAccount
* @return array Array of tabs
*/
function websiteaccountPrepareHead($object)
{
global $db, $langs, $conf;
$langs->load("monmodule@monmodule");
$h = 0;
$head = array();
$head[$h][0] = dol_buildpath("/website/websiteaccount_card.php", 1).'?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
if (isset($object->fields['note_public']) || isset($object->fields['note_private']))
{
$nbNote = 0;
if(!empty($object->fields['note_private'])) $nbNote++;
if(!empty($object->fields['note_public'])) $nbNote++;
$head[$h][0] = dol_buildpath('/monmodule/websiteaccount_note.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$h][2] = 'note';
$h++;
}
/*
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->monmodule->dir_output . "/websiteaccount/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = dol_buildpath("/monmodule/websiteaccount_document.php", 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
$head[$h][2] = 'document';
$h++;
$head[$h][0] = dol_buildpath("/monmodule/websiteaccount_agenda.php", 1).'?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
$head[$h][2] = 'agenda';
$h++;
*/
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
//$this->tabs = array(
// 'entity:+tabname:Title:@monmodule:/monmodule/mypage.php?id=__ID__'
//); // to add new tab
//$this->tabs = array(
// 'entity:-tabname:Title:@monmodule:/monmodule/mypage.php?id=__ID__'
//); // to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website');
return $head;
}

View File

@ -1,7 +1,6 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) ---Put here your own copyright and developer email---
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
@ -53,8 +52,8 @@ if (! $res) die("Include of main fails");
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
dol_include_once('/website/class/websiteaccount.class.php');
//dol_include_once('/website/lib/websiteaccount.lib.php');
include_once(DOL_DOCUMENT_ROOT.'/website/class/websiteaccount.class.php');
include_once(DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php');
// Load traductions files requiredby by page
$langs->loadLangs(array("website","other"));
@ -65,7 +64,6 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$thirdpartyid = GETPOST('thirdpartyid', 'int');
// Initialize technical objects
$object=new WebsiteAccount($db);
@ -163,34 +161,13 @@ if ($action == 'create')
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="thirdpartyid" value="'.$thirdpartyid.'">';
dol_fiche_head(array(), '');
dol_fiche_head();
print '<table class="border centpercent">'."\n";
foreach($object->fields as $key => $val)
{
if (abs($val['visible']) != 1) continue; // Discard such field from form
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
print '<tr id="field_'.$key.'">';
print '<td';
print ' class="titlefieldcreate';
if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text') print ' tdtop';
print '"';
print '>';
print $langs->trans($val['label']);
print '</td>';
print '<td>';
if (in_array($val['type'], array('int', 'integer'))) $value = GETPOST($key, 'int');
elseif ($val['type'] == 'text') $value = GETPOST($key, 'none');
else $value = GETPOST($key, 'alpha');
print $object->showInputField($val, $key, $value, '', '', '', 0, 0);
print '</td>';
print '</tr>';
}
// Common attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
@ -202,7 +179,7 @@ if ($action == 'create')
print '<div class="center">';
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
print '&nbsp; ';
print '<input type="button" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" onclick="javascript:history.go(-1)">'; // Cancel for create doe not post form
print '<input type="'.($backtopage?"submit":"button").'" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage?'':' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
print '</div>';
print '</form>';
@ -221,37 +198,9 @@ if (($id || $ref) && $action == 'edit')
dol_fiche_head();
print '<table class="border centpercent">'."\n";
foreach($object->fields as $key => $val)
{
if (abs($val['visible']) != 1) continue; // Discard such field from form
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
print '<tr><td';
print ' class="titlefieldcreate';
if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text') print ' tdtop';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
$defaultcss='minwidth100';
if ($val['type'] == 'text')
{
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
print GETPOST($key,'none')?GETPOST($key,'none'):$object->$key;
print '</textarea>';
}
elseif (is_array($val['arrayofkeyval']))
{
print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')!=''?GETPOST($key, 'int'):$object->$key);
}
else
{
$cssforinput = empty($val['css'])?$defaultcss:$val['css'];
print '<input class="flat'.($cssforinput?' '.$cssforinput:'').'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):$object->$key).'">';
}
print '</td>';
print '</tr>';
}
// Common attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
@ -309,7 +258,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Object card
// ------------------------------------------------------------
$linkback = '<a href="' .dol_buildpath('/website/websiteaccount_list.php',1) . '?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$linkback='';
if ($socid) $linkback = '<a href="' .DOL_URL_ROOT.'/societe/website.php?socid='.$socid.'&restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
if ($fk_website) $linkback = '<a href="' .DOL_URL_ROOT.'/website/website_card.php?fk_website='.$fk_website.'&restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">';
/*
@ -364,52 +315,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'."\n";
foreach($object->fields as $key => $val)
{
if (abs($val['visible']) != 1) continue; // Discard such field from form
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
print '<tr><td';
print ' class="titlefield';
if ($val['notnull'] > 0) print ' fieldrequired';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
print dol_escape_htmltag($object->$key, 1, 1);
print '</td>';
print '</tr>';
//if ($key == 'targetsrcfile3') break; // key used for break on second column
}
print '</table>';
print '</div>';
print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
$alreadyoutput = 1;
foreach($object->fields as $key => $val)
{
if ($alreadyoutput)
{
//if ($key == 'targetsrcfile3') $alreadyoutput = 0; // key used for break on second column
continue;
}
if (in_array($key, array('rowid', 'ref', 'entity', 'note_public', 'note_private', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue;
print '<tr><td';
print ' class="titlefield';
if ($val['notnull'] > 0) print ' fieldrequired';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
print dol_escape_htmltag($object->$key, 1, 1);
print '</td>';
print '</tr>';
}
// Common attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
@ -434,7 +341,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook))
{
// Send
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendByMail') . '</a></div>'."\n";
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a></div>'."\n";
if ($user->rights->website->write)
{
@ -473,29 +380,32 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre
// Documents
$comref = dol_sanitizeFileName($object->ref);
/*$comref = dol_sanitizeFileName($object->ref);
$relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->website->dir_output . '/' . $comref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->website->read; // If you can read, you can build the PDF to read content
$delallowed = $user->rights->website->create; // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('website', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
*/
// Show links to link elements
$linktoelem = $form->showLinkToObjectBlock($object, null, array('websiteaccount'));
/*$linktoelem = $form->showLinkToObjectBlock($object, null, array('websiteaccount'));
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
*/
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
$MAXEVENT = 10;
// List of actions on element
/*
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'websiteaccount', $socid, 1, '', $MAXEVENT);
*/
print '</div></div></div>';
}