Merge branch 'develop' into develop#2

This commit is contained in:
Hystepik 2020-12-03 11:05:00 +01:00 committed by GitHub
commit 4830f4a3b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
77 changed files with 1151 additions and 664 deletions

View File

@ -18,6 +18,7 @@ NEW: Accountancy - change menu disposition
NEW: Accountancy - on transfers, select the periodicity by default
NEW: Accountancy - Add export for Gestinum (v3 & v5)
NEW: new currency rate editor
NEW: add a widget to show the customers with outstanding limits reached
NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr
NEW: add a counter of number of words for pages in website module
NEW: add alert before changing thirdparty in TakePOS
@ -167,7 +168,8 @@ NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding am
NEW: ticket classification on create from email collector
NEW: Ticket message notifications when edited from public interface
NEW: translate classification labels in ticket
NEW: Add VAT and juridical status for Algeria
NEW: VAT rate for Angola #15606
NEW: VAT and juridical status for Algeria
NEW: VAT report - Invert constant to show by default zero VAT in reports
NEW: website page fields selection
NEW: Weighing Scale compatibility with TakePOS connector
@ -211,7 +213,6 @@ NEW: Triggers Attributes and Attributes values
NEW: added incoterms data into the substitution array
NEW: add send context for ticket
NEW: add a message in error_log after detection of SQL or script injection
NEW: add two hooks printFieldListFrom and printFieldSearchParam
NEW: add __TYPE__ substitution key
NEW: add validation of MX domain for emails
NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
@ -221,6 +222,7 @@ NEW: Hook on propal card
NEW: add hooks on newpayment page to allow external payment modules
NEW: add hooks on stats pages
NEW: add formConfirm hook on product page
NEW: add two hooks printFieldListFrom and printFieldSearchParam
WARNING:
@ -269,7 +271,7 @@ FIX: Look and feel v12: First tab must be name of object
FIX: missing entity check
FIX: missing param for hook
FIX: Missing transaction on PO actions
FIX: MySql Strict mode
FIX: MySQL Strict mode
FIX: param entity in html form file
FIX: Problems on FEC format
FIX: round stock value on product list

View File

@ -111,6 +111,71 @@ class Setup extends DolibarrApi
return $list;
}
/**
* Get the list of ordering origins.
*
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param int $limit Number of items per page
* @param int $page Page number {@min 0}
* @param int $active Payment type is active or not {@min 0} {@max 1}
* @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')"
*
* @url GET dictionary/ordering_origins
*
* @return array [List of ordering reasons]
*
* @throws RestException 400
*/
public function getOrderingOrigins($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
if (!DolibarrApiAccess::$user->rights->commande->lire) {
throw new RestException(401);
}
$sql = "SELECT rowid, code, label, module";
$sql .= " FROM ".MAIN_DB_PREFIX."c_input_reason as t";
$sql .= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
$sql .= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0) {
$page = 0;
}
$offset = $limit * $page;
$sql .= $this->db->plimit($limit, $offset);
}
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
for ($i = 0; $i < $min; $i++) {
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(400, $this->db->lasterror());
}
return $list;
}
/**
* Get the list of payments types.
*

View File

@ -383,21 +383,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
llxHeader('', $title, $help_url);
// Example : Adding jquery code
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
function init_myfunc()
{
jQuery("#myid").removeAttr(\'disabled\');
jQuery("#myid").attr(\'disabled\',\'disabled\');
}
init_myfunc();
jQuery("#mybutton").click(function() {
init_myfunc();
});
});
</script>';
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
@ -469,7 +454,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<div class="div-table-responsive">';
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";

View File

@ -771,11 +771,11 @@ print '<table class="notopnoleftnoright" width="100%">';
print '<tr><td class="right">'.$morehtml.' &nbsp; &nbsp; ';
if ($mode == 'showalltime')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$account.'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$account.(GETPOST("option") != 'all' ? '' : '&option=all').'">';
print $langs->trans("GoBack");
print '</a>';
} else {
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=showalltime&account='.$account.'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=showalltime&account='.$account.(GETPOST("option") != 'all' ? '' : '&option=all').'">';
print $langs->trans("ShowAllTimeBalance");
print '</a>';
}
@ -793,7 +793,7 @@ if ($mode == 'standard')
if ($nextmonth > 12) { $nextmonth = 1; $nextyear++; }
// For month
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
print '<div class="right clearboth">'.$link.'</div>';
print '<div class="center clearboth margintoponly">';
@ -807,7 +807,7 @@ if ($mode == 'standard')
// For year
$prevyear = $year - 1; $nextyear = $year + 1;
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
print '<div class="right clearboth margintoponly">'.$link.'</div>';

View File

@ -117,6 +117,8 @@ $usercancreatewithdrarequest = $user->rights->prelevement->bons->creer;
$now = dol_now();
$error = 0;
/*
* Actions
@ -287,13 +289,21 @@ if (empty($reshook))
elseif ($action == 'setref' && $user->rights->facture->creer)
{
//var_dump(GETPOST('ref', 'alpha'));exit;
$result = $object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY');
$result = $object->setValueFrom('titre', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY');
if ($result > 0)
{
$object->titre = GETPOST('ref', 'alpha'); // deprecated
$object->title = GETPOST('ref', 'alpha');
$object->ref = $object->title;
} else dol_print_error($db, $object->error, $object->errors);
} else {
$error++;
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
setEventMessages($langs->trans('ErrorRefAlreadyExists', $ref), null, 'errors');
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
} // Set bank account
elseif ($action == 'setbankaccount' && $user->rights->facture->creer)
{

View File

@ -4074,7 +4074,7 @@ if ($action == 'create')
print $object->getLibType();
print '</span>';
if ($object->module_source) {
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.')</span>';
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->trans("POS").' '.ucfirst($object->module_source).' - '.$langs->trans("Terminal").' '.$object->pos_source.')</span>';
}
if ($object->type == Facture::TYPE_REPLACEMENT) {
$facreplaced = new Facture($db);

View File

@ -0,0 +1,193 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* 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 <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/boxes/box_clients.php
* \ingroup Facture
* \brief Module d'affichage pour les encours dépassés
*/
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
/**
* Class to manage the box to show last thirdparties
*/
class box_customers_outstanding_bill_reached extends ModeleBoxes
{
public $boxcode = "customersoutstandingbillreached";
public $boximg = "object_company";
public $boxlabel = "BoxCustomersOutstandingBillReached";
public $depends = array("facture","societe");
/**
* @var DoliDB Database handler.
*/
public $db;
public $enabled = 1;
public $info_box_head = array();
public $info_box_contents = array();
/**
* Constructor
*
* @param DoliDB $db Database handler
* @param string $param More parameters
*/
public function __construct($db, $param = '')
{
global $conf, $user;
$this->db = $db;
// disable box for such cases
if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled = 0; // disabled by this option
$this->hidden = !($user->rights->societe->lire && empty($user->socid));
}
/**
* Load data for box to show them later
*
* @param int $max Maximum number of records to load
* @return void
*/
public function loadBox($max = 5)
{
global $user, $langs, $conf;
$langs->load("boxes");
$this->max = $max;
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$thirdpartystatic = new Societe($this->db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastOutstandingBillReached", $max));
if ($user->rights->societe->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid";
$sql .= ", s.code_client";
$sql .= ", s.client";
$sql .= ", s.code_fournisseur";
$sql .= ", s.fournisseur";
$sql .= ", s.code_compta";
$sql .= ", s.code_compta_fournisseur";
$sql .= ", s.logo";
$sql .= ", s.email";
$sql .= ", s.outstanding_limit";
$sql .= ", s.datec, s.tms, s.status, s.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE s.client IN (1, 3)";
$sql .= " AND s.entity IN (".getEntity('societe').")";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($user->socid) $sql .= " AND s.rowid = $user->socid";
$sql .= " AND s.outstanding_limit > 0";
$sql .= " AND s.rowid IN (SELECT fk_soc from ".MAIN_DB_PREFIX."facture as f WHERE f.fk_statut = 1 and f.fk_soc = s.rowid)";
$sql .= " ORDER BY s.tms DESC";
//$sql .= $this->db->plimit($max, 0);
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
$num = $this->db->num_rows($result);
$nboutstandingbillreachedcustomers = 0;
$line = 0;
while ($line < $num)
{
$objp = $this->db->fetch_object($result);
$datec = $this->db->jdate($objp->datec);
$datem = $this->db->jdate($objp->tms);
$thirdpartystatic->id = $objp->socid;
$thirdpartystatic->name = $objp->name;
$thirdpartystatic->code_client = $objp->code_client;
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
$thirdpartystatic->code_compta = $objp->code_compta;
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
$thirdpartystatic->client = $objp->client;
$thirdpartystatic->fournisseur = $objp->fournisseur;
$thirdpartystatic->logo = $objp->logo;
$thirdpartystatic->email = $objp->email;
$thirdpartystatic->entity = $objp->entity;
$thirdpartystatic->outstanding_limit = $objp->outstanding_limit;
$outstandingtotal = $thirdpartystatic->getOutstandingBills()['opened'];
$outstandinglimit = $thirdpartystatic->outstanding_limit;
if ($outstandingtotal >= $outstandinglimit)
{
$this->info_box_contents[$nboutstandingbillreachedcustomers][] = array(
'td' => '',
'text' => $thirdpartystatic->getNomUrl(1, 'customer'),
'asis' => 1,
);
$this->info_box_contents[$nboutstandingbillreachedcustomers][] = array(
'td' => 'class="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status, 3)
);
$nboutstandingbillreachedcustomers++;
}
$line++;
}
if ($num == 0 || $nboutstandingbillreachedcustomers == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedCustomers")
);
$this->db->free($result);
} else {
$this->info_box_contents[0][0] = array(
'td' => '',
'maxlength'=>500,
'text' => ($this->db->error().' sql='.$sql)
);
}
} else {
$this->info_box_contents[0][0] = array(
'td' => 'class="nohover opacitymedium left"',
'text' => $langs->trans("ReadPermissionNotAllowed")
);
}
}
/**
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return string
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -204,6 +204,6 @@ class box_last_modified_ticket extends ModeleBoxes
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -202,6 +202,6 @@ class box_last_ticket extends ModeleBoxes
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -111,6 +111,6 @@ class box_lastlogin extends ModeleBoxes
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -1817,7 +1817,11 @@ abstract class CommonObject
return -2;
}
} else {
$this->error = $this->db->lasterror();
if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$this->error = 'DB_ERROR_RECORD_ALREADY_EXISTS';
} else {
$this->error = $this->db->lasterror();
}
$this->db->rollback();
return -1;
}
@ -5417,26 +5421,20 @@ abstract class CommonObject
$sql .= ",".$attributeKey;
}
// We must insert a default value for fields for other entities that are mandatory to avoid not null error
if (is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']))
{
foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval)
{
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
{
if (!empty($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']) && is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'])) {
foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval) {
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) { // If field not already added previously
$sql .= ",".$tmpkey;
}
}
}
$sql .= ") VALUES (".$this->id;
foreach ($new_array_options as $key => $value)
{
foreach ($new_array_options as $key => $value) {
$attributeKey = substr($key, 8); // Remove 'options_' prefix
// Add field of attribute
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') // Only for other type than separator)
{
if ($new_array_options[$key] != '' || $new_array_options[$key] == '0')
{
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') { // Only for other type than separator)
if ($new_array_options[$key] != '' || $new_array_options[$key] == '0') {
$sql .= ",'".$this->db->escape($new_array_options[$key])."'";
} else {
$sql .= ",null";
@ -5444,12 +5442,9 @@ abstract class CommonObject
}
}
// We must insert a default value for fields for other entities that are mandatory to avoid not null error
if (is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']))
{
foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval)
{
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
{
if (!empty($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']) && is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'])) {
foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval) {
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) { // If field not already added previously
if (in_array($tmpval, array('int', 'double', 'price'))) $sql .= ", 0";
else $sql .= ", ''";
}
@ -6894,7 +6889,7 @@ abstract class CommonObject
$helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]);
$out .= '<tr '.($html_id ? 'id="'.$html_id.'" ' : '').$csstyle.' class="'.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$extrafields_collapse_num.'" '.$domData.' >';
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && $action == 'view') {
$out .= '<td></td>';
}
$out .= '<td class="wordbreak';

View File

@ -623,8 +623,8 @@ class Translate
// We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities because
// we want to keep '"' '<b>' '</b>' '<strong' '</strong>' '<a ' '</a>' '<br>' '< ' '<span' '</span>' that are reliable HTML tags inside translation strings.
$str = str_replace(
array('"', '<b>', '</b>', '<strong>', '</strong>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>'
array('__quot__', '__tagbold__', '__tagboldend__', '__tagbold__', '__tagboldend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'),
array('"', '<b>', '</b>', '<u>', '</u>', '<i>', '</i>', '<center>', '</center>', '<strong>', '</strong>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>'
array('__quot__', '__tagb__', '__tagbend__', '__tagu__', '__taguend__', '__tagi__', '__tagiend__', '__tagcenter__', '__tagcenterend__', '__tagb__', '__tagbend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'),
$str
);
@ -638,8 +638,8 @@ class Translate
// Restore reliable HTML tags into original translation string
$str = str_replace(
array('__quot__', '__tagbold__', '__tagboldend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'),
array('"', '<b>', '</b>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '> '),
array('__quot__', '__tagb__', '__tagbend__', '__tagu__', '__taguend__', '__tagi__', '__tagiend__', '__tagcenter__', '__tagcenterend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'),
array('"', '<b>', '</b>', '<u>', '</u>', '<i>', '</i>', '<center>', '</center>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '> '),
$str
);

View File

@ -717,7 +717,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$langs->loadLangs(array("admin", "help"));
$warnpicto = '';
if (!empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY))
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY))
{
$langs->load("errors");
$warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"));
@ -725,7 +725,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/admin/company.php?mainmenu=home", $langs->trans("MenuCompanySetup").$warnpicto, 1);
$warnpicto = '';
if (1 || count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled
{
$langs->load("errors");
$warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"));

View File

@ -294,10 +294,11 @@ class doc_generic_bom_odt extends ModelePDFBom
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -305,11 +305,11 @@ class doc_generic_order_odt extends ModelePDFCommandes
$contactobject = null;
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -1446,9 +1446,8 @@ class pdf_einstein extends ModelePDFCommandes
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -1628,8 +1628,7 @@ class pdf_eratosthene extends ModelePDFCommandes
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -291,12 +291,11 @@ class doc_generic_contract_odt extends ModelePDFContract
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -711,9 +711,8 @@ class pdf_strato extends ModelePDFContract
$this->recipient = $object->thirdparty;
//Recipient name
// You can use the name of the contact company
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -860,9 +860,8 @@ class pdf_storm extends ModelePDFDeliveryOrder
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -850,9 +850,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -304,12 +304,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
else {
} else {
$socobject = $object->thirdparty;
// if we have a SHIIPPING contact and we dont use it as recipient we store the contact object for later use
// if we have a SHIPPING contact and we dont use as recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -1020,9 +1020,8 @@ class pdf_espadon extends ModelePdfExpedition
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// You can use the name of the contact company
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -678,8 +678,7 @@ class pdf_merou extends ModelePdfExpedition
}
// Recipient name
// You can use the name of the contact company
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -1054,9 +1054,8 @@ class pdf_rouget extends ModelePdfExpedition
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -305,10 +305,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
else {
} else {
$socobject = $object->thirdparty;
// if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;

View File

@ -1842,9 +1842,8 @@ class pdf_crabe extends ModelePDFFactures
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -2108,9 +2108,8 @@ class pdf_sponge extends ModelePDFFactures
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -665,9 +665,8 @@ class pdf_soleil extends ModelePDFFicheinter
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -280,8 +280,7 @@ class doc_generic_member_odt extends ModelePDFMember
// Recipient name
if (!empty($usecontact)) {
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;

View File

@ -111,7 +111,8 @@ class modFacture extends DolibarrModules
$this->boxes = array(
0=>array('file'=>'box_factures_imp.php', 'enabledbydefaulton'=>'Home'),
1=>array('file'=>'box_factures.php', 'enabledbydefaulton'=>'Home'),
2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home')
2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home'),
3=>array('file'=>'box_customers_outstanding_bill_reached.php', 'enabledbydefaulton'=>'Home')
);
// Cronjobs

View File

@ -298,11 +298,10 @@ class doc_generic_mo_odt extends ModelePDFMo
// Recipient name
$contactobject = null;
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;

View File

@ -315,10 +315,8 @@ class doc_generic_product_odt extends ModelePDFProduct
// Recipient name
$contactobject = null;
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;

View File

@ -334,9 +334,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$contactobject = null;
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;

View File

@ -1618,9 +1618,8 @@ class pdf_azur extends ModelePDFPropales
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -1729,9 +1729,8 @@ class pdf_cyan extends ModelePDFPropales
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -294,11 +294,14 @@ class doc_generic_reception_odt extends ModelePdfReception
}
// Recipient name
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else $socobject = $object->thirdparty;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
$socobject = $object->thirdparty;
}

View File

@ -944,9 +944,8 @@ class pdf_squille extends ModelePdfReception
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -306,8 +306,7 @@ class doc_generic_stock_odt extends ModelePDFStock
$contactobject = null;
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;

View File

@ -1209,9 +1209,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// We can use the name of the contact's company
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $mysoc;

View File

@ -295,9 +295,9 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
$contactobject = null;
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;

View File

@ -1371,9 +1371,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -1283,9 +1283,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$result = $object->fetch_contact($arrayidcontact[0]);
}
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -330,15 +330,12 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
// Recipient name
$contactobject = null;
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))
{
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -1417,14 +1417,17 @@ class pdf_aurore extends ModelePDFSupplierProposal
// Recipient name
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->thirdparty->name;
$carac_client_name = $outputlangs->convToOutputCharset($socname);
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socname = $object->contact->socname;
} else {
$socname = $object->thirdparty->name;
}
} else {
$carac_client_name = $outputlangs->convToOutputCharset($object->thirdparty->name);
$socname = $object->thirdparty->name;
}
$carac_client_name = pdfBuildThirdpartyName($socname, $outputlangs);
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object);
// Show recipient

View File

@ -323,9 +323,9 @@ class doc_generic_user_odt extends ModelePDFUser
// Recipient name
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;

View File

@ -314,9 +314,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
// Recipient name
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;

View File

@ -239,8 +239,8 @@ foreach (array('internal', 'external') as $source)
}
$sortfield = GETPOST("sortfield", "alpha");
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield", "aZ09comma");
$sortorder = GETPOST("sortorder", 'aZ09comma');
if (!$sortfield) $sortfield = "nature";
if (!$sortorder) $sortorder = "asc";

View File

@ -675,7 +675,7 @@ print '<div class="fichecenter fichecenterbis">';
/*
* Show boxes
* Show widgets (boxes)
*/
$boxlist .= '<div class="twocolumns">';

View File

@ -380,3 +380,7 @@ insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,931,
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,932, '',0,'新疆维吾尔自治区');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,933, '',0,'香港特别行政区');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,934, '',0,'澳门特别行政区');
-- Regions Angola (rowid country=35)
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (35, 35001, 'AO', NULL, 'Angola');

View File

@ -1606,3 +1606,23 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI038', NULL, NULL, 'UPPER CARNIOLA', 'Upper Carniola');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI043', NULL, NULL, 'GORIZIA', 'Gorizia');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI044', NULL, NULL, 'COASTALKARST', 'CoastalKarst');
-- Provinces (postal districts) Angola (rowid country=35)
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-ABO', NULL, NULL, 'BENGO', 'Bengo');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-BGU', NULL, NULL, 'BENGUELA', 'Benguela');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-BIE', NULL, NULL, 'BIÉ', 'Bié');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CAB', NULL, NULL, 'CABINDA', 'Cabinda');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CCU', NULL, NULL, 'KUANDO KUBANGO', 'Kuando Kubango');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CNO', NULL, NULL, 'KWANZA NORTE', 'Kwanza Norte');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CUS', NULL, NULL, 'KWANZA SUL', 'Kwanza Sul');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CNN', NULL, NULL, 'CUNENE', 'Cunene');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-HUA', NULL, NULL, 'HUAMBO', 'Huambo');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-HUI', NULL, NULL, 'HUÍLA', 'Huila');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-LUA', NULL, NULL, 'LUANDA', 'Luanda');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-LNO', NULL, NULL, 'LUNDA-NORTE', 'Lunda-Norte');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-LSU',NULL, NULL, 'LUNDA-SUL', 'Lunda-Sul');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-MAL', NULL, NULL, 'MALANGE', 'Malange');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-MOX', NULL, NULL, 'MOXICO', 'Moxico');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-NAM', NULL, NULL, 'NAMÍBE', 'Namíbe');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-UIG', NULL, NULL, 'UÍGE', 'Uíge');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-ZAI', NULL, NULL, 'ZAÍRE', 'Zaíre');

View File

@ -8,7 +8,12 @@
-- Copyright (C) 2011-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
-- Copyright (C) 2015-2017 Juanjo Menent <jmenent@2byte.es>
-- Copyright (C) 2018 Abbes bahfir <dolipar@dolipar.org>
-- Copyright (C) 2020 Udo Tamm <dev@dolibit.de>
--
--
--------------------------------------------------------------------------------------
-- License
-- #######
-- 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
@ -22,14 +27,25 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
--
--------------------------------------------------------------------------------------
-- Comment
-- #######
-- (EN)
-- Do not place a comment at the end of the line, this file is parsed at the end of the line.
-- from the install and all '--' are removed.
--
-- (FR)
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
-- de l'install et tous les sigles '--' sont supprimés.
--
--------------------------------------------------------------------------------------
-- PCG = Plan Comptable Général (FR) - General Accounting Plan (EN)
--------------------------------------------------------------------------------------
-- Accounting Journals
INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('VT', 'ACCOUNTING_SELL_JOURNAL', 2, 1, 1);
INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('AC', 'ACCOUNTING_PURCHASE_JOURNAL', 3, 1, 1);
INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('BQ', 'FinanceJournal', 4, 1, 1);
@ -39,6 +55,9 @@ INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES
INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('INV', 'InventoryJournal', 8, 1, 1);
-- Accounting Charts / Plans (Templates) for Countries
-- Description of chart of account FR PCG99-ABREGE
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG99-ABREGE', 'The simple accountancy french plan', 1);
-- Description of chart of account FR PCG99-BASE
@ -56,8 +75,9 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
-- Description of chart of account ES PCG08-PYME
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 4, 'PCG08-PYME', 'The PYME accountancy spanish plan', 1);
-- Description of chart of account DE SKR03
-- Description of chart of account DE SKR-03
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 5, 'SKR03', 'Standardkontenrahmen SKR 03', 1);
-- Description of chart of account DE SKR-04
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 5, 'SKR04', 'Standardkontenrahmen SKR 04', 1);
-- Description of chart of account CH PCG_SUISSE
@ -69,6 +89,18 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
-- Description of chart of account TN PCT
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 10, 'PCT', 'The Tunisia plan', 1);
-- Description of chart of account MA PCG
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 12, 'PCG', 'The Moroccan chart of accounts', 1);
-- Description of chart of account DZ NSCF
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 13, 'NSCF', 'Nouveau système comptable financier', 1);
-- Description of chart of account NL NL-VERKORT
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 17, 'NL-VERKORT', 'Verkort rekeningschema', 1);
-- Description of chart of account SE BAS-K1-MINI
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 20, 'BAS-K1-MINI', 'The Swedish mini chart of accounts', 1);
-- Description of chart of account AT AT-BASE
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 41, 'AT-BASE', 'Plan Austria', 1);
@ -78,54 +110,60 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
-- Description of chart of account DK DK-STD
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 80, 'DK-STD', 'Standardkontoplan fra SKAT', 1);
-- Description of chart of account EC EC-SUPERCIAS
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 84, 'EC-SUPERCIAS', 'Plan de cuentas Ecuador', 1);
-- Description of chart of account LU PCN-LUXEMBURG
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (140, 'PCN-LUXEMBURG', 'Plan comptable normalisé Luxembourgeois', 1);
-- Description of chart of account MA PCG
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 12, 'PCG', 'The Moroccan chart of accounts', 1);
-- Description of chart of account SE BAS-K1-MINI
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 20, 'BAS-K1-MINI', 'The Swedish mini chart of accounts', 1);
-- Description of chart of account RO RO-BASE
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (188, 'RO-BASE', 'Plan de conturi romanesc', 1);
--DELETE FROM llx_accounting_system WHERE pcg_version = 'SYSCOHADA';
-- Plans SYSCOAHA Western Africa -- sorted alphabetical by countries abbreviations
-- Description of chart of account BJ SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 49,'SYSCOHADA-BJ', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account BF SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 60,'SYSCOHADA-BF', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account CM SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA-CM', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account CD SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA-CD', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account CF SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 65,'SYSCOHADA-CF', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account KM SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA-KM', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account CG SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 72,'SYSCOHADA-CG', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account CI SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 21,'SYSCOHADA-CI', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account CM SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA-CM', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account GA SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 16,'SYSCOHADA-GA', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account GQ SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 87,'SYSCOHADA-GQ', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account KM SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA-KM', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account ML SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (147,'SYSCOHADA-ML', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account NE SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (168,'SYSCOHADA-NE', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account CD SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA-CD', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account SN SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 22,'SYSCOHADA-SN', 'Plan comptable Ouest-Africain', 1);
@ -135,14 +173,3 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
-- Description of chart of account TG SYSCOHADA
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA-TG', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account RO RO-BASE
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 188, 'RO-BASE', 'Plan de conturi romanesc', 1);
-- Description of chart of account DZ NSCF
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 13, 'NSCF', 'Nouveau système comptable financier', 1);
-- Description of chart of account NL NL-VERKORT
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 17, 'NL-VERKORT', 'Verkort rekeningschema', 1);
-- Description of chart of account EC EC-SUPERCIAS
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 84, 'EC-SUPERCIAS', 'Plan de cuentas Ecuador', 1);

View File

@ -32,157 +32,157 @@
-- ID 1000 - 9999
-- ADD 1400000 to rowid # Do no remove this comment --
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1000,'CA-ENG-BASE','ASSETS', 'XXXXXX', '1', '0', 'Assets', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 2000,'CA-ENG-BASE','LIABILITIES', 'XXXXXX', '2', '0', 'Liabilities', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 3000,'CA-ENG-BASE','CAPITAL', 'XXXXXX', '3', '0', 'Equity', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 4000,'CA-ENG-BASE','INCOME', 'XXXXXX', '4', '0', 'Revenue', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 5000,'CA-ENG-BASE','COGS', 'XXXXXX', '5', '0', 'Cost of Goods Sold', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 6000,'CA-ENG-BASE','EXPENSE', 'XXXXXX', '6', '0', 'Expenses', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1000,'CA-ENG-BASE','ASSETS', '1', '0', 'Assets', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 2000,'CA-ENG-BASE','LIABILITIES', '2', '0', 'Liabilities', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 3000,'CA-ENG-BASE','CAPITAL', '3', '0', 'Equity', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4000,'CA-ENG-BASE','INCOME', '4', '0', 'Revenue', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5000,'CA-ENG-BASE','COGS', '5', '0', 'Cost of Goods Sold', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 6000,'CA-ENG-BASE','EXPENSE', '6', '0', 'Expenses', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1010, 'CA-ENG-BASE', 'ASSETS', 'CASH', '1010', '1000', 'Cash', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1011, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1030', '1000', 'Investments and Securities', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1012, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1100', '1000', 'Accounts Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1013, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1120', '1000', 'Other Receivables', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1014, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1140', '1000', 'Allowance for Doubtful Accounts', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1015, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1160', '1000', 'Customers Account Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1016, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1200', '1000', 'Raw Materials Inventory', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1017, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1220', '1000', 'Supplies Inventory', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1018, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1240', '1000', 'Work in Progress Inventory', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1019, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1260', '1000', 'Finished Goods Inventory', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1020, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1300', '1000', 'Prepaid Expenses', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1021, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1350', '1000', 'Employee Advances', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1022, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1400', '1000', 'Notes Receivable - Current', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1023, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1430', '1000', 'Prepaid Interest', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1024, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1450', '1000', 'Other Current Assets', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1025, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1500', '1000', 'Furniture and Fixtures', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1026, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1520', '1000', 'Equipment', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1027, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1540', '1000', 'Vehicles', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1028, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1560', '1000', 'Other Depreciable Property', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1029, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1580', '1000', 'Buildings', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1030, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1600', '1000', 'Building Improvements', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1031, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1620', '1000', 'Land', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1032, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1640', '1000', 'Accumulated Depreciation, Furniture and Fixtures', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1033, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1660', '1000', 'Accumulated Depreciation, Equipment', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1034, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1680', '1000', 'Accumulated Depreciation, Vehicles', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1035, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1700', '1000', 'Accumulated Depreciation, Buildings', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1036, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1720', '1000', 'Accumulated Depreciation, Building Improvements', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1037, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1740', '1000', 'Accumulated Depreciation, Other', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1038, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1760', '1000', 'Goods and Services Tax (GST) Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1039, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1800', '1000', 'Harmonized Sales Tax (HST) Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1040, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1820', '1000', 'Provincial Sales Tax (PST) Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1041, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1840', '1000', 'Québec Sales Tax (QST) Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1042, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1860', '1000', 'Deposits', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1043, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1880', '1000', 'Accumulated Amortization', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1044, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1900', '1000', 'Notes Receivable - Non-current', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1045, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1940', '1000', 'Other Non-current Assets', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1046, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2100', '2000', 'Accounts Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1047, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2200', '2000', 'Accrued Expenses', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1048, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2300', '2000', 'Current Financial Debts', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1049, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2320', '2000', 'Employment Insurance Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1050, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2321', '2000', 'Employment insurance (EI) Employees Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1051, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2322', '2000', 'Employment insurance (EI) Employer Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1052, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2340', '2000', 'Federal Income Tax', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1053, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2350', '2000', 'Annuities Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1054, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2351', '2000', 'Annuities - Employee Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1055, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2352', '2000', 'Annuities - Employer Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1056, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2360', '2000', 'Health Services Fund Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1057, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2370', '2000', 'Labour Health and Safety Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1058, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2380', '2000', 'Labour Standards to Pay', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1059, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2390', '2000', 'Parental Insurance Plan Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1060, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2391', '2000', 'Parental Insurance Plan Payable - Employee Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1061, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2392', '2000', 'Parental Insurance Plan Payable - Employer Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1062, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2400', '2000', 'Provincial Income Tax', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1063, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2410', '2000', 'Other Accounts Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1064, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2420', '2000', 'Goods and Services Tax (GST) Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2430', '2000', 'Harmonized Sales Tax (HST) Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2440', '2000', 'Provincial Sales Tax (PST) Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2450', '2000', 'Québec Sales Tax (QST) Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1068, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2460', '2000', 'Other Taxes Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2470', '2000', 'Employee Benefits Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1070, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2480', '2000', 'Deposits from Customers', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1071, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2490', '2000', 'Other Current Liabilities', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1072, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2500', '2000', 'Notes Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1073, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2600', '2000', 'Land Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1074, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2630', '2000', 'Equipment Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1075, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2660', '2000', 'Vehicles Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1076, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2700', '2000', 'Bank Loans Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1077, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2730', '2000', 'Non-current Financial Debts', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1078, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2760', '2000', 'Other Non-current Liabilities', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1079, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2800', '2000', 'Deferred Revenue', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1080, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2900', '2000', 'Deferred Fees', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1081, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3100', '3000', 'Common Shares', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1082, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3200', '3000', 'Preferred Shares (Voting)', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1083, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3300', '3000', 'Preferred Shares (Non-voting)', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1084, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3400', '3000', 'Contributed Surplus', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1085, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3500', '3000', 'Retained Earnings', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1086, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3600', '3000', 'Dividends', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1087, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4100', '4000', 'Harmonized Provinces Sales', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1088, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4200', '4000', 'Non-Harmonized Provinces Sales', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1089, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4300', '4000', 'Inside Sales', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1090, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4400', '4000', 'International Sales', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1091, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4500', '4000', 'Reimbursible Expenses', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1092, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4600', '4000', 'Shipping Charges Reimbursed', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1093, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4700', '4000', 'Other Operating Revenues', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1094, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4800', '4000', 'Interests', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1095, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4900', '4000', 'Other Non-operating Revenues', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1096, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5010', '5000', 'Inside Purchases', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1097, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5050', '5000', 'International Purchases', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1098, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5100', '5000', 'Purchases in Harmonized Provinces', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1099, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5150', '5000', 'Purchases in Non-harmonized Provinces', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1100, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5200', '5000', 'Direct Labor Costs', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1101, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5250', '5000', 'Indirect Labor Costs', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1102, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5270', '5000', 'Heat and Power', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1103, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5300', '5000', 'Commissions', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1104, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5350', '5000', 'Miscellaneous Factory Costs', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1105, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5400', '5000', 'Cost of Goods Sold, Salaries and Wages', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1106, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5450', '5000', 'Cost of Goods Sold, Contract Labor', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1107, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5500', '5000', 'Cost of Goods Sold, Freight', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1108, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5550', '5000', 'Cost of Goods Sold, Other', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1109, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5600', '5000', 'Inventory Adjustments', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1110, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5700', '5000', 'Purchase Returns and Allowances', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1111, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6010', '6000', 'Federal Income Tax', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1112, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6020', '6000', 'Health Services Fund', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1113, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6030', '6000', 'Holidays', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1114, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6040', '6000', 'Labour Health and Safety', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1115, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6050', '6000', 'Labour Standards', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1116, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6060', '6000', 'Parental Insurance', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1117, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6080', '6000', 'Provincial Income Tax', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1118, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6100', '6000', 'Salaries, wages', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1119, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6130', '6000', 'Employee Benefit Expense, Pension Plans', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1120, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6160', '6000', 'Employee Benefit Expense, Profit Sharing Plan', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1121, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6180', '6000', 'Employee Benefit Expense, Other', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1122, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6200', '6000', 'Commissions and Fees Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1123, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6230', '6000', 'Annuities', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1124, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6250', '6000', 'Employment Insurance', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1125, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6280', '6000', 'Insurance Expense, Product Liability', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1126, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6300', '6000', 'Insurance Expense, Vehicle', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1127, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6340', '6000', 'Payroll Tax Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1128, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6360', '6000', 'Penalties and Fines Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1129, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6380', '6000', 'Other Taxes', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1130, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6400', '6000', 'Advertising Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1131, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6420', '6000', 'Amortization Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1132, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6460', '6000', 'Auto Expenses', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1133, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6480', '6000', 'Legal and Professional Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1134, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6500', '6000', 'Licenses Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1135, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6520', '6000', 'Maintenance Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1136, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6540', '6000', 'Repair and Maintenance Expense, Office', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1137, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6560', '6000', 'Repair and Maintenance Expense, Vehicle', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1138, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6580', '6000', 'Office Supplies Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1139, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6600', '6000', 'Telephone Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1140, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6610', '6000', 'Training Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1141, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6630', '6000', 'Travel Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1142, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6650', '6000', 'Utilities Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1143, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6670', '6000', 'Postage Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1144, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6690', '6000', 'Freight Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1145, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6700', '6000', 'Rent or Lease Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1146, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6720', '6000', 'Meals and Entertainment Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1147, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6730', '6000', 'Gain/Loss on Sale of Assets', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1148, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6740', '6000', 'Depreciation Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1149, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6750', '6000', 'Bad Debt Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1150, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6760', '6000', 'Bank Fees', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1151, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6790', '6000', 'Loss on Non-sufficient Funds Checks', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1152, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6800', '6000', 'Gifts Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1153, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6820', '6000', 'Charitable Contributions Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1154, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6840', '6000', 'Other Operating Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1155, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6860', '6000', 'Interests Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1156, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6900', '6000', 'Other Non-operating Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1010, 'CA-ENG-BASE', 'ASSETS', '1010', '1000', 'Cash', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1011, 'CA-ENG-BASE', 'ASSETS', '1030', '1000', 'Investments and Securities', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1012, 'CA-ENG-BASE', 'ASSETS', '1100', '1000', 'Accounts Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1013, 'CA-ENG-BASE', 'ASSETS', '1120', '1000', 'Other Receivables', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1014, 'CA-ENG-BASE', 'ASSETS', '1140', '1000', 'Allowance for Doubtful Accounts', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1015, 'CA-ENG-BASE', 'ASSETS', '1160', '1000', 'Customers Account Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1016, 'CA-ENG-BASE', 'ASSETS', '1200', '1000', 'Raw Materials Inventory', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1017, 'CA-ENG-BASE', 'ASSETS', '1220', '1000', 'Supplies Inventory', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1018, 'CA-ENG-BASE', 'ASSETS', '1240', '1000', 'Work in Progress Inventory', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1019, 'CA-ENG-BASE', 'ASSETS', '1260', '1000', 'Finished Goods Inventory', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1020, 'CA-ENG-BASE', 'ASSETS', '1300', '1000', 'Prepaid Expenses', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1021, 'CA-ENG-BASE', 'ASSETS', '1350', '1000', 'Employee Advances', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1022, 'CA-ENG-BASE', 'ASSETS', '1400', '1000', 'Notes Receivable - Current', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1023, 'CA-ENG-BASE', 'ASSETS', '1430', '1000', 'Prepaid Interest', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1024, 'CA-ENG-BASE', 'ASSETS', '1450', '1000', 'Other Current Assets', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1025, 'CA-ENG-BASE', 'ASSETS', '1500', '1000', 'Furniture and Fixtures', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1026, 'CA-ENG-BASE', 'ASSETS', '1520', '1000', 'Equipment', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1027, 'CA-ENG-BASE', 'ASSETS', '1540', '1000', 'Vehicles', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1028, 'CA-ENG-BASE', 'ASSETS', '1560', '1000', 'Other Depreciable Property', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1029, 'CA-ENG-BASE', 'ASSETS', '1580', '1000', 'Buildings', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1030, 'CA-ENG-BASE', 'ASSETS', '1600', '1000', 'Building Improvements', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1031, 'CA-ENG-BASE', 'ASSETS', '1620', '1000', 'Land', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1032, 'CA-ENG-BASE', 'ASSETS', '1640', '1000', 'Accumulated Depreciation, Furniture and Fixtures', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1033, 'CA-ENG-BASE', 'ASSETS', '1660', '1000', 'Accumulated Depreciation, Equipment', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1034, 'CA-ENG-BASE', 'ASSETS', '1680', '1000', 'Accumulated Depreciation, Vehicles', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1035, 'CA-ENG-BASE', 'ASSETS', '1700', '1000', 'Accumulated Depreciation, Buildings', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1036, 'CA-ENG-BASE', 'ASSETS', '1720', '1000', 'Accumulated Depreciation, Building Improvements', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1037, 'CA-ENG-BASE', 'ASSETS', '1740', '1000', 'Accumulated Depreciation, Other', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1038, 'CA-ENG-BASE', 'ASSETS', '1760', '1000', 'Goods and Services Tax (GST) Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1039, 'CA-ENG-BASE', 'ASSETS', '1800', '1000', 'Harmonized Sales Tax (HST) Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1040, 'CA-ENG-BASE', 'ASSETS', '1820', '1000', 'Provincial Sales Tax (PST) Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1041, 'CA-ENG-BASE', 'ASSETS', '1840', '1000', 'Québec Sales Tax (QST) Receivable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1042, 'CA-ENG-BASE', 'ASSETS', '1860', '1000', 'Deposits', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1043, 'CA-ENG-BASE', 'ASSETS', '1880', '1000', 'Accumulated Amortization', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1044, 'CA-ENG-BASE', 'ASSETS', '1900', '1000', 'Notes Receivable - Non-current', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1045, 'CA-ENG-BASE', 'ASSETS', '1940', '1000', 'Other Non-current Assets', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1046, 'CA-ENG-BASE', 'LIABILITIES', '2100', '2000', 'Accounts Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1047, 'CA-ENG-BASE', 'LIABILITIES', '2200', '2000', 'Accrued Expenses', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1048, 'CA-ENG-BASE', 'LIABILITIES', '2300', '2000', 'Current Financial Debts', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1049, 'CA-ENG-BASE', 'LIABILITIES', '2320', '2000', 'Employment Insurance Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1050, 'CA-ENG-BASE', 'LIABILITIES', '2321', '2000', 'Employment insurance (EI) Employees Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1051, 'CA-ENG-BASE', 'LIABILITIES', '2322', '2000', 'Employment insurance (EI) Employer Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1052, 'CA-ENG-BASE', 'LIABILITIES', '2340', '2000', 'Federal Income Tax', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1053, 'CA-ENG-BASE', 'LIABILITIES', '2350', '2000', 'Annuities Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1054, 'CA-ENG-BASE', 'LIABILITIES', '2351', '2000', 'Annuities - Employee Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1055, 'CA-ENG-BASE', 'LIABILITIES', '2352', '2000', 'Annuities - Employer Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1056, 'CA-ENG-BASE', 'LIABILITIES', '2360', '2000', 'Health Services Fund Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1057, 'CA-ENG-BASE', 'LIABILITIES', '2370', '2000', 'Labour Health and Safety Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1058, 'CA-ENG-BASE', 'LIABILITIES', '2380', '2000', 'Labour Standards to Pay', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1059, 'CA-ENG-BASE', 'LIABILITIES', '2390', '2000', 'Parental Insurance Plan Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1060, 'CA-ENG-BASE', 'LIABILITIES', '2391', '2000', 'Parental Insurance Plan Payable - Employee Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1061, 'CA-ENG-BASE', 'LIABILITIES', '2392', '2000', 'Parental Insurance Plan Payable - Employer Contribution', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1062, 'CA-ENG-BASE', 'LIABILITIES', '2400', '2000', 'Provincial Income Tax', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1063, 'CA-ENG-BASE', 'LIABILITIES', '2410', '2000', 'Other Accounts Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1064, 'CA-ENG-BASE', 'LIABILITIES', '2420', '2000', 'Goods and Services Tax (GST) Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'CA-ENG-BASE', 'LIABILITIES', '2430', '2000', 'Harmonized Sales Tax (HST) Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'CA-ENG-BASE', 'LIABILITIES', '2440', '2000', 'Provincial Sales Tax (PST) Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'CA-ENG-BASE', 'LIABILITIES', '2450', '2000', 'Québec Sales Tax (QST) Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1068, 'CA-ENG-BASE', 'LIABILITIES', '2460', '2000', 'Other Taxes Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'CA-ENG-BASE', 'LIABILITIES', '2470', '2000', 'Employee Benefits Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1070, 'CA-ENG-BASE', 'LIABILITIES', '2480', '2000', 'Deposits from Customers', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1071, 'CA-ENG-BASE', 'LIABILITIES', '2490', '2000', 'Other Current Liabilities', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1072, 'CA-ENG-BASE', 'LIABILITIES', '2500', '2000', 'Notes Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1073, 'CA-ENG-BASE', 'LIABILITIES', '2600', '2000', 'Land Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1074, 'CA-ENG-BASE', 'LIABILITIES', '2630', '2000', 'Equipment Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1075, 'CA-ENG-BASE', 'LIABILITIES', '2660', '2000', 'Vehicles Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1076, 'CA-ENG-BASE', 'LIABILITIES', '2700', '2000', 'Bank Loans Payable', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1077, 'CA-ENG-BASE', 'LIABILITIES', '2730', '2000', 'Non-current Financial Debts', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1078, 'CA-ENG-BASE', 'LIABILITIES', '2760', '2000', 'Other Non-current Liabilities', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1079, 'CA-ENG-BASE', 'LIABILITIES', '2800', '2000', 'Deferred Revenue', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1080, 'CA-ENG-BASE', 'LIABILITIES', '2900', '2000', 'Deferred Fees', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1081, 'CA-ENG-BASE', 'CAPITAL', '3100', '3000', 'Common Shares', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1082, 'CA-ENG-BASE', 'CAPITAL', '3200', '3000', 'Preferred Shares (Voting)', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1083, 'CA-ENG-BASE', 'CAPITAL', '3300', '3000', 'Preferred Shares (Non-voting)', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1084, 'CA-ENG-BASE', 'CAPITAL', '3400', '3000', 'Contributed Surplus', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1085, 'CA-ENG-BASE', 'CAPITAL', '3500', '3000', 'Retained Earnings', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1086, 'CA-ENG-BASE', 'CAPITAL', '3600', '3000', 'Dividends', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1087, 'CA-ENG-BASE', 'INCOME', '4100', '4000', 'Harmonized Provinces Sales', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1088, 'CA-ENG-BASE', 'INCOME', '4200', '4000', 'Non-Harmonized Provinces Sales', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1089, 'CA-ENG-BASE', 'INCOME', '4300', '4000', 'Inside Sales', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1090, 'CA-ENG-BASE', 'INCOME', '4400', '4000', 'International Sales', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1091, 'CA-ENG-BASE', 'INCOME', '4500', '4000', 'Reimbursible Expenses', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1092, 'CA-ENG-BASE', 'INCOME', '4600', '4000', 'Shipping Charges Reimbursed', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1093, 'CA-ENG-BASE', 'INCOME', '4700', '4000', 'Other Operating Revenues', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1094, 'CA-ENG-BASE', 'INCOME', '4800', '4000', 'Interests', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1095, 'CA-ENG-BASE', 'INCOME', '4900', '4000', 'Other Non-operating Revenues', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1096, 'CA-ENG-BASE', 'COGS', '5010', '5000', 'Inside Purchases', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1097, 'CA-ENG-BASE', 'COGS', '5050', '5000', 'International Purchases', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1098, 'CA-ENG-BASE', 'COGS', '5100', '5000', 'Purchases in Harmonized Provinces', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1099, 'CA-ENG-BASE', 'COGS', '5150', '5000', 'Purchases in Non-harmonized Provinces', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1100, 'CA-ENG-BASE', 'COGS', '5200', '5000', 'Direct Labor Costs', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1101, 'CA-ENG-BASE', 'COGS', '5250', '5000', 'Indirect Labor Costs', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1102, 'CA-ENG-BASE', 'COGS', '5270', '5000', 'Heat and Power', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1103, 'CA-ENG-BASE', 'COGS', '5300', '5000', 'Commissions', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1104, 'CA-ENG-BASE', 'COGS', '5350', '5000', 'Miscellaneous Factory Costs', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1105, 'CA-ENG-BASE', 'COGS', '5400', '5000', 'Cost of Goods Sold, Salaries and Wages', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1106, 'CA-ENG-BASE', 'COGS', '5450', '5000', 'Cost of Goods Sold, Contract Labor', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1107, 'CA-ENG-BASE', 'COGS', '5500', '5000', 'Cost of Goods Sold, Freight', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1108, 'CA-ENG-BASE', 'COGS', '5550', '5000', 'Cost of Goods Sold, Other', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1109, 'CA-ENG-BASE', 'COGS', '5600', '5000', 'Inventory Adjustments', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1110, 'CA-ENG-BASE', 'COGS', '5700', '5000', 'Purchase Returns and Allowances', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1111, 'CA-ENG-BASE', 'EXPENSE', '6010', '6000', 'Federal Income Tax', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1112, 'CA-ENG-BASE', 'EXPENSE', '6020', '6000', 'Health Services Fund', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1113, 'CA-ENG-BASE', 'EXPENSE', '6030', '6000', 'Holidays', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1114, 'CA-ENG-BASE', 'EXPENSE', '6040', '6000', 'Labour Health and Safety', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1115, 'CA-ENG-BASE', 'EXPENSE', '6050', '6000', 'Labour Standards', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1116, 'CA-ENG-BASE', 'EXPENSE', '6060', '6000', 'Parental Insurance', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1117, 'CA-ENG-BASE', 'EXPENSE', '6080', '6000', 'Provincial Income Tax', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1118, 'CA-ENG-BASE', 'EXPENSE', '6100', '6000', 'Salaries, wages', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1119, 'CA-ENG-BASE', 'EXPENSE', '6130', '6000', 'Employee Benefit Expense, Pension Plans', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1120, 'CA-ENG-BASE', 'EXPENSE', '6160', '6000', 'Employee Benefit Expense, Profit Sharing Plan', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1121, 'CA-ENG-BASE', 'EXPENSE', '6180', '6000', 'Employee Benefit Expense, Other', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1122, 'CA-ENG-BASE', 'EXPENSE', '6200', '6000', 'Commissions and Fees Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1123, 'CA-ENG-BASE', 'EXPENSE', '6230', '6000', 'Annuities', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1124, 'CA-ENG-BASE', 'EXPENSE', '6250', '6000', 'Employment Insurance', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1125, 'CA-ENG-BASE', 'EXPENSE', '6280', '6000', 'Insurance Expense, Product Liability', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1126, 'CA-ENG-BASE', 'EXPENSE', '6300', '6000', 'Insurance Expense, Vehicle', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1127, 'CA-ENG-BASE', 'EXPENSE', '6340', '6000', 'Payroll Tax Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1128, 'CA-ENG-BASE', 'EXPENSE', '6360', '6000', 'Penalties and Fines Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1129, 'CA-ENG-BASE', 'EXPENSE', '6380', '6000', 'Other Taxes', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1130, 'CA-ENG-BASE', 'EXPENSE', '6400', '6000', 'Advertising Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1131, 'CA-ENG-BASE', 'EXPENSE', '6420', '6000', 'Amortization Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1132, 'CA-ENG-BASE', 'EXPENSE', '6460', '6000', 'Auto Expenses', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1133, 'CA-ENG-BASE', 'EXPENSE', '6480', '6000', 'Legal and Professional Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1134, 'CA-ENG-BASE', 'EXPENSE', '6500', '6000', 'Licenses Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1135, 'CA-ENG-BASE', 'EXPENSE', '6520', '6000', 'Maintenance Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1136, 'CA-ENG-BASE', 'EXPENSE', '6540', '6000', 'Repair and Maintenance Expense, Office', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1137, 'CA-ENG-BASE', 'EXPENSE', '6560', '6000', 'Repair and Maintenance Expense, Vehicle', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1138, 'CA-ENG-BASE', 'EXPENSE', '6580', '6000', 'Office Supplies Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1139, 'CA-ENG-BASE', 'EXPENSE', '6600', '6000', 'Telephone Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1140, 'CA-ENG-BASE', 'EXPENSE', '6610', '6000', 'Training Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1141, 'CA-ENG-BASE', 'EXPENSE', '6630', '6000', 'Travel Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1142, 'CA-ENG-BASE', 'EXPENSE', '6650', '6000', 'Utilities Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1143, 'CA-ENG-BASE', 'EXPENSE', '6670', '6000', 'Postage Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1144, 'CA-ENG-BASE', 'EXPENSE', '6690', '6000', 'Freight Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1145, 'CA-ENG-BASE', 'EXPENSE', '6700', '6000', 'Rent or Lease Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1146, 'CA-ENG-BASE', 'EXPENSE', '6720', '6000', 'Meals and Entertainment Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1147, 'CA-ENG-BASE', 'EXPENSE', '6730', '6000', 'Gain/Loss on Sale of Assets', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1148, 'CA-ENG-BASE', 'EXPENSE', '6740', '6000', 'Depreciation Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1149, 'CA-ENG-BASE', 'EXPENSE', '6750', '6000', 'Bad Debt Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1150, 'CA-ENG-BASE', 'EXPENSE', '6760', '6000', 'Bank Fees', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1151, 'CA-ENG-BASE', 'EXPENSE', '6790', '6000', 'Loss on Non-sufficient Funds Checks', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1152, 'CA-ENG-BASE', 'EXPENSE', '6800', '6000', 'Gifts Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1153, 'CA-ENG-BASE', 'EXPENSE', '6820', '6000', 'Charitable Contributions Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1154, 'CA-ENG-BASE', 'EXPENSE', '6840', '6000', 'Other Operating Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1155, 'CA-ENG-BASE', 'EXPENSE', '6860', '6000', 'Interests Expense', 1);
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1156, 'CA-ENG-BASE', 'EXPENSE', '6900', '6000', 'Other Non-operating Expense', 1);

View File

@ -37,6 +37,7 @@
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ALL', '[76,101,107]', 1, 'Albania Lek');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DZD', NULL, 1, 'Algeria Dinar');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AOA', NULL, 1, 'Angola Kwanza');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AFN', '[1547]', 1, 'Afghanistan Afghani');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ARS', '[36]', 1, 'Argentino Peso');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AWG', '[402]', 1, 'Aruba Guilder');

View File

@ -366,6 +366,10 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 1
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 132, 13, '9','0','TVA 9%',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 133, 13, '19','0','TVA 19%', 1);
-- ANGOLA (id country=35)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 351, 35, '0','0','VAT Rate 0', 1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 352, 35, '7','0','VAT reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 353, 35, '14','0','VAT standard rate',1);
-- Example of code to insert a vat rate 0 for each country
--delete from llx_c_tva where rowid = 1181; -- to delete a record that does not follow rules for rowid (fk_pays+'1')

View File

@ -47,17 +47,17 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_U
-- Hidden but specific to one entity
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_OVERWRITE_TRANSLATION','1','chaine','Enable translation overwrite',0,1);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_DEFAULT_VALUES','1','chaine','Enable default value overwrite',0,1);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MONNAIE','EUR','chaine','Monnaie',0,1);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MONNAIE','EUR','chaine','Currency',0,1);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_SMTP_SERVER','','chaine','Host or ip address for SMTP server',0,1);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_SMTP_PORT','','chaine','Port for SMTP server',0,1);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_EMAIL_FROM','robot@domain.com','chaine','EMail emetteur pour les emails automatiques Dolibarr',0,1);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_EMAIL_FROM','robot@domain.com','chaine','email emitter for Dolibarr automatic emails',0,1);
--
-- IHM
--
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Longueur maximum des listes courtes (fiche client)',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Maximum length of lists',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Maximum length of short lists',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MENU_STANDARD','eldy_menu.php','chaine','Menu manager for internal users',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MENUFRONT_STANDARD','eldy_menu.php','chaine','Menu manager for external users',0,0);

View File

@ -541,4 +541,8 @@ CREATE TABLE llx_session(
user_agent varchar(128) NULL
)ENGINE=innodb;
INSERT INTO llx_boxes_def (file) VALUES ('box_dolibarr_state_board.php');
INSERT INTO llx_boxes_def(file, entity) VALUES ('box_customers_outstanding_bill_reached.php', 1);

View File

@ -17,6 +17,8 @@
--
-- ========================================================================
-- This is the dictionary of sales orders origin
create table llx_c_input_reason
(
rowid integer AUTO_INCREMENT PRIMARY KEY,

View File

@ -46,6 +46,7 @@ BoxTitleLastModifiedDonations=Latest %s modified donations
BoxTitleLastModifiedExpenses=Latest %s modified expense reports
BoxTitleLatestModifiedBoms=Latest %s modified BOMs
BoxTitleLatestModifiedMos=Latest %s modified Manufacturing Orders
BoxTitleLastOutstandingBillReached=Customers with maximum outstanding exceeded
BoxGlobalActivity=Global activity (invoices, proposals, orders)
BoxGoodCustomers=Good customers
BoxTitleGoodCustomers=%s Good customers

View File

@ -8,6 +8,7 @@ ErrorBadEMail=Email %s is wrong
ErrorBadMXDomain=Email %s seems wrong (domain has no valid MX record)
ErrorBadUrl=Url %s is wrong
ErrorBadValueForParamNotAString=Bad value for your parameter. It appends generally when translation is missing.
ErrorRefAlreadyExists=Reference <b>%s</b> already exists.
ErrorLoginAlreadyExists=Login %s already exists.
ErrorGroupAlreadyExists=Group %s already exists.
ErrorRecordNotFound=Record not found.

View File

@ -7,6 +7,7 @@ ErrorButCommitIsDone=Erreurs trouvées mais on valide malgré tout
ErrorBadEMail=email %s invalide
ErrorBadUrl=Url %s invalide
ErrorBadValueForParamNotAString=Mauvaise valeur de paramètre. Ceci arrive lors d'une tentative de traduction d'une clé non renseignée.
ErrorRefAlreadyExists=La référence %s existe déjà.
ErrorLoginAlreadyExists=L'identifiant %s existe déjà.
ErrorGroupAlreadyExists=Le groupe %s existe déjà.
ErrorRecordNotFound=Enregistrement non trouvé.

View File

@ -299,9 +299,9 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
$contactobject = null;
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;

View File

@ -1091,7 +1091,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
}
// Recipient name
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -672,7 +672,7 @@ if ($action == 'create' && $user->rights->projet->creer)
print $hookmanager->resPrint;
if (empty($reshook))
{
print $object->showOptionals($extrafields, 'edit');
print $object->showOptionals($extrafields, 'create');
}
print '</table>';

View File

@ -37,8 +37,8 @@ $socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", "alpha");
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield", "aZ09comma");
$sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;

View File

@ -67,8 +67,8 @@ if (!$user->rights->projet->lire) accessforbidden();
$diroutputmassaction = $conf->projet->dir_output.'/temp/massgeneration/'.$user->id;
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", "alpha");
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield", "aZ09comma");
$sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;
@ -144,15 +144,7 @@ $fieldstosearchall['s.nom'] = "ThirdPartyName";
$arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (empty($val['visible'])) {
continue;
}
$arrayfields['p.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($val['visible'] < 0) ? 0 : 1),
'enabled'=>($val['enabled'] && ($val['visible'] != 3)),
'position'=>$val['position']);
if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']);
}
// Add none object fields to fields for list
@ -165,8 +157,14 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
{
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val)
{
if (!empty($extrafields->attributes[$object->table_element]['list'][$key]))
$arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]));
if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) {
$arrayfields["ef.".$key] = array(
'label'=>$extrafields->attributes[$object->table_element]['label'][$key],
'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1),
'position'=>$extrafields->attributes[$object->table_element]['pos'][$key],
'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])
);
}
}
}

View File

@ -299,9 +299,9 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
$contactobject = null;
if (!empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;

View File

@ -1002,7 +1002,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
}
// Recipient name
/*if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
/*if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
@ -265,7 +265,7 @@ if ($action == 'create')
// Date payment
print '<tr><td>';
print $form->editfieldkey('DatePayment', 'datep', '', $object, 0, 'string', '', 1).'</td><td>';
print $form->selectDate((empty($datep) ?-1 : $datep), "datep", '', '', '', 'add', 1, 1);
print $form->selectDate((empty($datep) ? '' : $datep), "datep", 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Date value for bank
@ -305,16 +305,6 @@ if ($action == 'create')
print '<input name="amount" id="amount" class="minwidth100" value="'.GETPOST("amount").'">';
print '</td></tr>';
// Project
if (!empty($conf->projet->enabled))
{
$formproject = new FormProjets($db);
print '<tr><td>'.$langs->trans("Project").'</td><td>';
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
print '</td></tr>';
}
// Bank
if (!empty($conf->banque->enabled))
{
@ -340,6 +330,16 @@ if ($action == 'create')
print '<td><input name="num_payment" id="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
}
// Project
if (!empty($conf->projet->enabled))
{
$formproject = new FormProjets($db);
print '<tr><td>'.$langs->trans("Project").'</td><td>';
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
print '</td></tr>';
}
// Other attributes
$parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
@ -476,9 +476,8 @@ if ($id)
print dol_get_fiche_end();
/*
* Action buttons
*/
// Action buttons
print '<div class="tabsAction">'."\n";
if ($object->rappro == 0)
{

View File

@ -31,7 +31,42 @@ if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/account
// Load translation files required by the page
$langs->loadLangs(array("compta", "salaries", "bills", "hrm"));
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomlist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortfield) $sortfield = "s.datep,s.rowid";
if (!$sortorder) $sortorder = "DESC,DESC";
// Initialize technical objects
$object = new PaymentSalary($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->user->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('salarieslist')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
if (!$sortfield) $sortfield = "s.datep,s.rowid";
if (!$sortorder) $sortorder = "DESC,DESC";
$search_ref = GETPOST('search_ref', 'int');
$search_user = GETPOST('search_user', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
@ -40,30 +75,19 @@ $search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int')
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'int');
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortfield) $sortfield = "s.datep,s.rowid";
if (!$sortorder) $sortorder = "DESC,DESC";
$optioncss = GETPOST('optioncss', 'alpha');
$filtre = GETPOST("filtre", 'restricthtml');
if (!GETPOST('typeid', 'int'))
if (!GETPOST('search_type_id', 'int'))
{
$newfiltre = str_replace('filtre=', '', $filtre);
$filterarray = explode('-', $newfiltre);
foreach ($filterarray as $val)
{
$part = explode(':', $val);
if ($part[0] == 's.fk_typepayment') $typeid = $part[1];
if ($part[0] == 's.fk_typepayment') $search_type_id = $part[1];
}
} else {
$typeid = GETPOST('typeid', 'int');
$search_type_id = GETPOST('search_type_id', 'int');
}
$childids = $user->getAllChildIds(1);
@ -73,36 +97,92 @@ $socid = GETPOST("socid", "int");
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'salaries', '', '', '');
// Initialize array of search criterias
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{
if (GETPOST('search_'.$key, 'alpha') !== '') $search[$key] = GETPOST('search_'.$key, 'alpha');
}
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array();
foreach ($object->fields as $key => $val)
{
if ($val['searchall']) $fieldstosearchall['t.'.$key] = $val['label'];
}
$permissiontoread = $user->rights->salaries->read;
$permissiontoadd = $user->rights->salaries->write;
$permissiontodelete = $user->rights->salaries->delete;
/*
* Actions
*/
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
{
$search_ref = "";
$search_user = "";
$search_label = "";
$search_date_start = '';
$search_date_end = '';
$search_amount = "";
$search_account = '';
$typeid = "";
}
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
// Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
{
$search_ref = "";
$search_user = "";
$search_label = "";
$search_date_start = '';
$search_date_end = '';
$search_amount = "";
$search_account = '';
$search_type_id = "";
}
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha'))
{
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
}
// Mass actions
$objectclass = 'PaymentSalary';
$objectlabel = 'SalariesPayments';
$permissiontoread = $user->rights->salaries->read;
$permissiontodelete = $user->rights->salaries->delete;
$uploaddir = $conf->bom->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
// Validate records
if (!$error && $massaction == 'buildsepa' && $permissiontoadd)
{
$objecttmp = new $objectclass($db);
// TODO
}
}
/*
* View
*/
llxHeader('', $langs->trans("Salaries"));
$form = new Form($db);
$salstatic = new PaymentSalary($db);
$userstatic = new User($db);
$accountstatic = new Account($db);
$now = dol_now();
//$help_url="EN:Module_BillOfMaterials|FR:Module_BillOfMaterials_FR|ES:Módulo_BillOfMaterials";
$help_url = '';
$title = $langs->trans('SalariesPayments');
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,";
$sql .= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel,";
@ -113,210 +193,319 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid,";
$sql .= " ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = s.fk_user";
$sql .= " AND s.entity = ".$conf->entity;
$sql .= " AND s.entity IN (".getEntity('payment_salaries').")";
if (empty($user->rights->salaries->readall)) $sql .= " AND s.fk_user IN (".join(',', $childids).")";
// Search criteria
if ($search_ref) $sql .= " AND s.rowid=".$search_ref;
if ($search_ref) $sql .= " AND s.rowid=".((int) $search_ref);
if ($search_user) $sql .= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email'), $search_user);
if ($search_label) $sql .= natural_search(array('s.label'), $search_label);
if ($search_date_start) $sql .= " AND s.datep >= '".$db->idate($search_date_start)."'";
if ($search_date_end) $sql .= " AND s.datep <= '".$db->idate($search_date_end)."'";
if ($search_amount) $sql .= natural_search("s.amount", $search_amount, 1);
if ($search_account > 0) $sql .= " AND b.fk_account=".$search_account;
if ($search_account > 0) $sql .= " AND b.fk_account=".((int) $search_account);
if ($filtre) {
$filtre = str_replace(":", "=", $filtre);
$sql .= " AND ".$filtre;
}
if ($typeid) {
$sql .= " AND s.fk_typepayment=".$typeid;
if ($search_type_id) {
$sql .= " AND s.fk_typepayment=".$search_type_id;
}
$sql .= $db->order($sortfield, $sortorder);
//$sql.= " GROUP BY u.rowid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev, s.fk_typepayment, s.num_payment, pst.code";
$totalnboflines = 0;
$result = $db->query($sql);
if ($result)
// Count total nb of records
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$totalnboflines = $db->num_rows($result);
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0
{
$page = 0;
$offset = 0;
}
}
$sql .= $db->plimit($limit + 1, $offset);
$result = $db->query($sql);
if ($result)
// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit)))
{
$num = $db->num_rows($result);
$i = 0;
$total = 0;
$num = $nbtotalofrecords;
} else {
if ($limit) $sql .= $db->plimit($limit + 1, $offset);
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
if ($typeid) $param .= '&amp;typeid='.$typeid;
if ($optioncss != '') $param .= '&amp;optioncss='.$optioncss;
$resql = $db->query($sql);
if (!$resql)
{
dol_print_error($db);
exit;
}
$url = DOL_URL_ROOT.'/salaries/card.php?action=create';
if (!empty($socid)) $url .= '&socid='.$socid;
$newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write);
$num = $db->num_rows($resql);
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
// Output page
// --------------------------------------------------------------------
print_barre_liste($langs->trans("SalariesPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1);
llxHeader('', $title, $help_url);
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
$arrayofselected = is_array($toselect) ? $toselect : array();
print '<tr class="liste_titre_filter">';
// Ref
print '<td class="liste_titre left">';
print '<input class="flat" type="text" size="3" name="search_ref" value="'.$db->escape($search_ref).'">';
print '</td>';
// Employee
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($search_type_id) $param .= '&search_type_id='.urlencode($search_type_id);
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
if ($search_user > 0) $param .= '&search_user='.urlencode($search_user);
if ($search_label) $param .= '&search_label='.urlencode($search_label);
if ($search_account) $param .= '&search_account='.urlencode($search_account);
if ($search_date_start) $param .= '&search_date_startday='.urlencode(GETPOST('search_date_startday', 'int')).'&search_date_startmonth='.urlencode(GETPOST('search_date_startmonth', 'int')).'&search_date_startyear='.urlencode(GETPOST('search_date_startyear', 'int'));
if ($search_date_end) $param .= '&search_date_endday='.urlencode(GETPOST('search_date_endday', 'int')).'&search_date_endmonth='.urlencode(GETPOST('search_date_endmonth', 'int')).'&search_date_endyear='.urlencode(GETPOST('search_date_endyear', 'int'));
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array(
//'presend'=>$langs->trans("SendByMail"),
'buildsepa'=>$langs->trans("BuildSepa"),
);
//if ($permissiontodelete) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$url = DOL_URL_ROOT.'/salaries/card.php?action=create';
if (!empty($socid)) $url .= '&socid='.$socid;
$newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1);
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
//$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields = '';
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">';
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
// Fields title search
// --------------------------------------------------------------------
print '<tr class="liste_titre_filter">';
// Ref
print '<td class="liste_titre left">';
print '<input class="flat" type="text" size="3" name="search_ref" value="'.$db->escape($search_ref).'">';
print '</td>';
// Employee
print '<td class="liste_titre">';
print '<input class="flat" type="text" size="6" name="search_user" value="'.$db->escape($search_user).'">';
print '</td>';
// Label
print '<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$db->escape($search_label).'"></td>';
// Date
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
print '</div>';
print '</td>';
// Type
print '<td class="liste_titre left">';
$form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16);
print '</td>';
// Account
if (!empty($conf->banque->enabled))
{
print '<td class="liste_titre">';
print '<input class="flat" type="text" size="6" name="search_user" value="'.$db->escape($search_user).'">';
print '</td>';
// Label
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.$db->escape($search_label).'"></td>';
// Date
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
print '</div>';
$form->select_comptes($search_account, 'search_account', 0, '', 1);
print '</td>';
}
// Amount
print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).'"></td>';
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>'."\n";
// Fields title label
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "s.label", "", $param, 'class="left"', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "s.datep,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder);
if (!empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "s.amount", "", $param, 'class="right"', $sortfield, $sortorder);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print '</tr>'."\n";
// Detect if we need a fetch on each output line
$needToFetchEachLine = 0;
if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0)
{
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val)
{
if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object
}
}
// Loop on record
// --------------------------------------------------------------------
$i = 0;
$total = 0;
$totalarray = array();
while ($i < ($limit ? min($num, $limit) : $num))
{
$obj = $db->fetch_object($resql);
if (empty($obj)) break; // Should not happen
// Store properties in $object
$object->setVarsFromFetchObj($obj);
// Show here line of result
print '<tr class="oddeven">';
$userstatic->id = $obj->uid;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
$userstatic->admin = $obj->admin;
$userstatic->login = $obj->login;
$userstatic->email = $obj->email;
$userstatic->socid = $obj->fk_soc;
$userstatic->statut = $obj->status;
$salstatic->id = $obj->rowid;
$salstatic->ref = $obj->rowid;
// Ref
print "<td>".$salstatic->getNomUrl(1)."</td>\n";
if (!$i) $totalarray['nbfield']++;
// Employee
print "<td>".$userstatic->getNomUrl(1)."</td>\n";
if (!$i) $totalarray['nbfield']++;
// Label payment
print "<td>".dol_trunc($obj->label, 40)."</td>\n";
if (!$i) $totalarray['nbfield']++;
// Date payment
print '<td class="center">'.dol_print_date($db->jdate($obj->datep), 'day')."</td>\n";
if (!$i) $totalarray['nbfield']++;
// Type
print '<td class="liste_titre left">';
$form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16);
print '</td>';
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
if (!$i) $totalarray['nbfield']++;
// Account
if (!empty($conf->banque->enabled))
{
print '<td class="liste_titre">';
$form->select_comptes($search_account, 'search_account', 0, '', 1);
print '</td>';
}
// Amount
print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).'"></td>';
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterAndCheckAddButtons(0);
print $searchpicto;
print '</td>';
print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "s.label", "", $param, 'class="left"', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "s.datep,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder);
if (!empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "s.amount", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n";
print "</tr>\n";
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
print '<tr class="oddeven">';
$userstatic->id = $obj->uid;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
$userstatic->admin = $obj->admin;
$userstatic->login = $obj->login;
$userstatic->email = $obj->email;
$userstatic->socid = $obj->fk_soc;
$userstatic->statut = $obj->status;
$salstatic->id = $obj->rowid;
$salstatic->ref = $obj->rowid;
// Ref
print "<td>".$salstatic->getNomUrl(1)."</td>\n";
if (!$i) $totalarray['nbfield']++;
// Employee
print "<td>".$userstatic->getNomUrl(1)."</td>\n";
if (!$i) $totalarray['nbfield']++;
// Label payment
print "<td>".dol_trunc($obj->label, 40)."</td>\n";
if (!$i) $totalarray['nbfield']++;
// Date payment
print '<td class="center">'.dol_print_date($db->jdate($obj->datep), 'day')."</td>\n";
if (!$i) $totalarray['nbfield']++;
// Type
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
if (!$i) $totalarray['nbfield']++;
// Account
if (!empty($conf->banque->enabled))
print '<td>';
if ($obj->fk_bank > 0)
{
print '<td>';
if ($obj->fk_bank > 0)
//$accountstatic->fetch($obj->fk_bank);
$accountstatic->id = $obj->bid;
$accountstatic->ref = $obj->bref;
$accountstatic->number = $obj->bnumber;
if (!empty($conf->accounting->enabled))
{
//$accountstatic->fetch($obj->fk_bank);
$accountstatic->id = $obj->bid;
$accountstatic->ref = $obj->bref;
$accountstatic->number = $obj->bnumber;
$accountstatic->account_number = $obj->account_number;
if (!empty($conf->accounting->enabled))
{
$accountstatic->account_number = $obj->account_number;
$accountingjournal = new AccountingJournal($db);
$accountingjournal->fetch($obj->fk_accountancy_journal);
$accountingjournal = new AccountingJournal($db);
$accountingjournal->fetch($obj->fk_accountancy_journal);
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
}
$accountstatic->label = $obj->blabel;
print $accountstatic->getNomUrl(1);
} else print '&nbsp;';
print '</td>';
if (!$i) $totalarray['nbfield']++;
}
// Amount
print '<td class="nowrap right">'.price($obj->amount).'</td>';
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
}
$accountstatic->label = $obj->blabel;
print $accountstatic->getNomUrl(1);
} else print '&nbsp;';
print '</td>';
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield';
$totalarray['val']['totalttcfield'] += $obj->amount;
print '<td></td>';
if (!$i) $totalarray['nbfield']++;
print "</tr>\n";
$i++;
}
// Show total line
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
// Amount
print '<td class="nowrap right">'.price($obj->amount).'</td>';
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield';
$totalarray['val']['totalttcfield'] += $obj->amount;
print "</table>";
print '</div>';
print '</form>';
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected = 0;
if (in_array($object->id, $arrayofselected)) $selected = 1;
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
if (!$i) $totalarray['nbfield']++;
$db->free($result);
} else {
dol_print_error($db);
print '</tr>'."\n";
$i++;
}
// Show total line
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
// If no record found
if ($num == 0)
{
$colspan = 1;
foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
}
$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</table>'."\n";
print '</div>'."\n";
print '</form>'."\n";
// End of page
llxFooter();
$db->close();

View File

@ -3241,7 +3241,7 @@ class Societe extends CommonObject
// si son index (position dans la chaîne en commence à 0 au premier caractère) est impair
// on double sa valeur et si cette dernière est supérieure à 9, on lui retranche 9
// on ajoute cette valeur à la somme totale
$sum = 0;
for ($index = 0; $index < 9; $index++)
{
$number = (int) $chaine[$index];
@ -3266,7 +3266,7 @@ class Societe extends CommonObject
// si son index (position dans la chaîne en commence à 0 au premier caractère) est pair
// on double sa valeur et si cette dernière est supérieure à 9, on lui retranche 9
// on ajoute cette valeur à la somme totale
$sum = 0;
for ($index = 0; $index < 14; $index++)
{
$number = (int) $chaine[$index];
@ -3343,10 +3343,6 @@ class Societe extends CommonObject
$string = trim($this->idprof1);
$string = preg_replace('/(\s)/', '', $string);
for ($i = 0; $i < 9; $i++) {
$num[$i] = substr($string, $i, 1);
}
//Check NIF
if (preg_match('/(^[0-9]{9}$)/', $string)) {
return 1;

View File

@ -41,8 +41,8 @@ $socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", "alpha");
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield", "aZ09comma");
$sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;

View File

@ -41,8 +41,8 @@ $socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", "alpha");
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield", "aZ09comma");
$sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;

View File

@ -342,8 +342,8 @@ class User extends CommonObject
public $fields = array(
'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'),
'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1),
'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
);

View File

@ -109,45 +109,32 @@ if (!empty($conf->api->enabled))
// Definition of fields for list
$arrayfields = array(
'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1),
'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
'u.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0),
'u.employee'=>array('label'=>$langs->trans("Employee"), 'checked'=>($mode == 'employee' ? 1 : 0)),
'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0),
'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1),
'u.api_key'=>array('label'=>$langs->trans("ApiKey"), 'checked'=>0, "enabled"=>($conf->api->enabled && $user->admin)),
'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))),
'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1),
'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100),
'u.datepreviouslogin'=>array('label'=>$langs->trans("PreviousConnexion"), 'checked'=>0, 'position'=>110),
'u.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'u.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
'u.login'=>array('label'=>"Login", 'checked'=>1, 'position'=>10),
'u.lastname'=>array('label'=>"Lastname", 'checked'=>1, 'position'=>15),
'u.firstname'=>array('label'=>"Firstname", 'checked'=>1, 'position'=>20),
'u.entity'=>array('label'=>"Entity", 'checked'=>1, 'position'=>50, 'enabled'=>(!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))),
'u.gender'=>array('label'=>"Gender", 'checked'=>0, 'position'=>22),
'u.employee'=>array('label'=>"Employee", 'checked'=>($mode == 'employee' ? 1 : 0), 'position'=>25),
'u.fk_user'=>array('label'=>"HierarchicalResponsible", 'checked'=>1, 'position'=>27),
'u.accountancy_code'=>array('label'=>"AccountancyCode", 'checked'=>0, 'position'=>30),
'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35),
'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>($conf->api->enabled && $user->admin)),
'u.fk_soc'=>array('label'=>"Company", 'checked'=>1, 'position'=>45),
'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>($conf->salaries->enabled && !empty($user->rights->salaries->readall))),
'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100),
'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110),
'u.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'u.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'u.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
);
// Extra fields
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
{
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val)
{
if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) {
$arrayfields["ef.".$key] = array(
'label'=>$extrafields->attributes[$object->table_element]['label'][$key],
'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1),
'position'=>$extrafields->attributes[$object->table_element]['pos'][$key],
'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]),
'langfile'=>$extrafields->attributes[$object->table_element]['langfile'][$key],
'help'=>$extrafields->attributes[$object->table_element]['help'][$key]
);
}
}
}
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
// Init search fields
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_user = GETPOST('search_user', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
$search_lastname = GETPOST('search_lastname', 'alpha');
@ -183,6 +170,8 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
$error = 0;
$childids = $user->getAllChildIds(1);
/*
* Actions
@ -308,7 +297,7 @@ if ($contextpage == 'employeelist' && $search_employee == 1) {
$user2 = new User($db);
$sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.api_key, u.accountancy_code, u.gender, u.employee, u.photo,";
$sql .= " u.datelastlogin, u.datepreviouslogin,";
$sql .= " u.salary, u.datelastlogin, u.datepreviouslogin,";
$sql .= " u.ldap_sid, u.statut, u.entity,";
$sql .= " u.tms as date_update, u.datec as date_creation,";
$sql .= " u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2, u2.admin as admin2, u2.fk_soc as fk_soc2, u2.email as email2, u2.gender as gender2, u2.photo as photo2, u2.entity as entity2, u2.statut as statut2,";
@ -356,6 +345,7 @@ if ($catid > 0) $sql .= " AND cu.fk_categorie = ".((int) $catid);
if ($catid == -2) $sql .= " AND cu.fk_categorie IS NULL";
if ($search_categ > 0) $sql .= " AND cu.fk_categorie = ".$db->escape($search_categ);
if ($search_categ == -2) $sql .= " AND cu.fk_categorie IS NULL";
if ($mode == 'employee' && empty($user->rights->salaries->readall)) $sql .= " AND s.fk_user IN (".join(',', $childids).")";
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
// Add where from hooks
@ -541,6 +531,13 @@ if (!empty($arrayfields['u.employee']['checked']))
print $form->selectyesno('search_employee', $search_employee, 1, false, 1);
print '</td>';
}
// Supervisor
if (!empty($arrayfields['u.fk_user']['checked']))
{
print '<td class="liste_titre">';
print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, array(), 0, '', 0, 0, 0, 0, '', 0, '', 'maxwidth200');
print '</td>';
}
if (!empty($arrayfields['u.accountancy_code']['checked']))
{
print '<td class="liste_titre"><input type="text" name="search_accountancy_code" class="maxwidth50" value="'.$search_accountancy_code.'"></td>';
@ -561,12 +558,9 @@ if (!empty($arrayfields['u.entity']['checked']))
{
print '<td class="liste_titre"></td>';
}
// Supervisor
if (!empty($arrayfields['u.fk_user']['checked']))
if (!empty($arrayfields['u.salary']['checked']))
{
print '<td class="liste_titre">';
print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, array(), 0, '', 0, 0, 0, 0, '', 0, '', 'maxwidth200');
print '</td>';
print '<td class="liste_titre"></td>';
}
if (!empty($arrayfields['u.datelastlogin']['checked']))
{
@ -615,12 +609,13 @@ if (!empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre
if (!empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre("FirstName", $_SERVER['PHP_SELF'], "u.firstname", $param, "", "", $sortfield, $sortorder);
if (!empty($arrayfields['u.gender']['checked'])) print_liste_field_titre("Gender", $_SERVER['PHP_SELF'], "u.gender", $param, "", "", $sortfield, $sortorder);
if (!empty($arrayfields['u.employee']['checked'])) print_liste_field_titre("Employee", $_SERVER['PHP_SELF'], "u.employee", $param, "", "", $sortfield, $sortorder);
if (!empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre("HierarchicalResponsible", $_SERVER['PHP_SELF'], "u.fk_user", $param, "", "", $sortfield, $sortorder);
if (!empty($arrayfields['u.accountancy_code']['checked'])) print_liste_field_titre("AccountancyCode", $_SERVER['PHP_SELF'], "u.accountancy_code", $param, "", "", $sortfield, $sortorder);
if (!empty($arrayfields['u.email']['checked'])) print_liste_field_titre("EMail", $_SERVER['PHP_SELF'], "u.email", $param, "", "", $sortfield, $sortorder);
if (!empty($arrayfields['u.api_key']['checked'])) print_liste_field_titre("ApiKey", $_SERVER['PHP_SELF'], "u.api_key", $param, "", "", $sortfield, $sortorder);
if (!empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "u.fk_soc", $param, "", "", $sortfield, $sortorder);
if (!empty($arrayfields['u.entity']['checked'])) print_liste_field_titre("Entity", $_SERVER['PHP_SELF'], "u.entity", $param, "", "", $sortfield, $sortorder);
if (!empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre("HierarchicalResponsible", $_SERVER['PHP_SELF'], "u.fk_user", $param, "", "", $sortfield, $sortorder);
if (!empty($arrayfields['u.salary']['checked'])) print_liste_field_titre("Salary", $_SERVER['PHP_SELF'], "u.salary", $param, "", "", $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['u.datelastlogin']['checked'])) print_liste_field_titre("LastConnexion", $_SERVER['PHP_SELF'], "u.datelastlogin", $param, "", '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_titre("PreviousConnexion", $_SERVER['PHP_SELF'], "u.datepreviouslogin", $param, "", '', $sortfield, $sortorder, 'center ');
// Extra fields
@ -713,6 +708,37 @@ while ($i < ($limit ? min($num, $limit) : $num))
print '<td>'.yn($obj->employee).'</td>';
if (!$i) $totalarray['nbfield']++;
}
// Supervisor
if (!empty($arrayfields['u.fk_user']['checked']))
{
// Resp
print '<td class="nowrap">';
if ($obj->login2)
{
$user2->id = $obj->id2;
$user2->login = $obj->login2;
$user2->lastname = $obj->lastname2;
$user2->firstname = $obj->firstname2;
$user2->gender = $obj->gender2;
$user2->photo = $obj->photo2;
$user2->admin = $obj->admin2;
$user2->email = $obj->email2;
$user2->socid = $obj->fk_soc2;
$user2->statut = $obj->statut2;
print $user2->getNomUrl(-1, '', 0, 0, 24, 0, '', '', 1);
if (!empty($conf->multicompany->enabled) && $obj->admin2 && !$obj->entity2)
{
print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"');
} elseif ($obj->admin2)
{
print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"');
}
}
print '</td>';
if (!$i) $totalarray['nbfield']++;
}
if (!empty($arrayfields['u.accountancy_code']['checked']))
{
print '<td>'.$obj->accountancy_code.'</td>';
@ -763,34 +789,12 @@ while ($i < ($limit ? min($num, $limit) : $num))
if (!$i) $totalarray['nbfield']++;
}
}
// Supervisor
if (!empty($arrayfields['u.fk_user']['checked']))
// Salary
if (!empty($arrayfields['u.salary']['checked']))
{
// Resp
print '<td class="nowrap">';
if ($obj->login2)
{
$user2->id = $obj->id2;
$user2->login = $obj->login2;
$user2->lastname = $obj->lastname2;
$user2->firstname = $obj->firstname2;
$user2->gender = $obj->gender2;
$user2->photo = $obj->photo2;
$user2->admin = $obj->admin2;
$user2->email = $obj->email2;
$user2->socid = $obj->fk_soc2;
$user2->statut = $obj->statut2;
print $user2->getNomUrl(-1, '', 0, 0, 24, 0, '', '', 1);
if (!empty($conf->multicompany->enabled) && $obj->admin2 && !$obj->entity2)
{
print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"');
} elseif ($obj->admin2)
{
print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"');
}
}
print '</td>';
if (!$i) $totalarray['nbfield']++;
print '<td class="nowraponall right">'.($obj->salary ? price($obj->salary) : '').'</td>';
if (!$i) $totalarray['nbfield']++;
}
// Date last login

View File

@ -3009,7 +3009,7 @@ if ($action == 'editcss')
print dol_get_fiche_head();
print '<!-- Edit CSS -->'."\n";
print '<!-- Edit Website properties -->'."\n";
print '<table class="border centpercent">';
// Website
@ -3039,8 +3039,8 @@ if ($action == 'editcss')
// Other languages
print '<tr><td class="tdtop">';
$htmltext = '';
print $form->textwithpicto($langs->trans('OtherLanguages'), $htmltext, 1, 'help', '', 0, 2, 'WEBSITE_OTHERLANG');
$htmltext = $langs->trans("Example").': fr,de,sv,it,pt';
print $form->textwithpicto($langs->trans('OtherLanguages'), $htmltext, 1, 'help', '', 0, 2);
print '</td><td>';
print '<input type="text" class="flat" value="'.(GETPOSTISSET('WEBSITE_OTHERLANG') ? GETPOST('WEBSITE_OTHERLANG', 'alpha') : $object->otherlang).'" name="WEBSITE_OTHERLANG">';
print '</td>';
@ -3049,10 +3049,11 @@ if ($action == 'editcss')
// VirtualHost
print '<tr><td class="tdtop">';
$htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/<i>'.$websitekey.'</i>');
$htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/{s1}'.$websitekey.'{s2}');
$htmltext = str_replace(array('{s1}', '{s2}'), array('<i>', '</i>'), $htmltext);
$htmltext .= '<br>';
$htmltext .= '<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
$htmltext .= '<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website<br>'.DOL_DATA_ROOT.'/medias');
$htmltext .= '<br>'.$langs->transnoentitiesnoconv("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
$htmltext .= '<br>'.$langs->transnoentitiesnoconv("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website<br>'.DOL_DATA_ROOT.'/medias');
print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'virtualhosttooltip');
print '</td><td>';

View File

@ -212,9 +212,14 @@ class Hook extends CommonObject
public $label;
/**
* @var string amount
* @var string url of webhook
*/
public $amount;
public $url;
/**
* @var int ID of user owner webhook
*/
public $fk_user;
/**
* @var int Status