diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b57ceda24aa..d17347a0ad7 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -4,15 +4,17 @@ How to contribute to Dolibarr Bug reports and feature requests -------------------------------- -*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](https://www.dolibarr.org/forum.php). Forums exist in different languages. +*Note*: **GitHub Issues is not a support forum.** If you have questions about Dolibarr / need help using the software, please use [the forums](https://www.dolibarr.org/forum.php). Forums exist in different languages. Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues). -Default language here is english. So please prepare your contributions in english. +Default **language here is english**. So please prepare your contributions in english. 1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem. 2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request. -4. Tell us the version you are using! (look at /htdocs/admin/system/dolibarr.php? and check if you are using the latest version) -3. Write a report with as much detail as possible (Use [screenshots](https://help.github.com/articles/issue-attachments) or even screencasts and provide logging and debugging informations whenever possible). +3. Tell us the version you are using! (look at /htdocs/admin/system/dolibarr.php? and check if you are using the latest version) +4. Write a report with as much detail as possible (Use [screenshots](https://help.github.com/articles/issue-attachments) or even screencasts and provide logging and debugging informations whenever possible). +5. Delete unnecessary submissions. +6. **Check your Message at Preview before sending.** diff --git a/dev/examples/git/pre-commit b/dev/examples/git/pre-commit index f89d662ae65..273fa9f620b 100644 --- a/dev/examples/git/pre-commit +++ b/dev/examples/git/pre-commit @@ -1,4 +1,10 @@ #!/bin/sh +# To install this precommit file: put this file in your local repo in .git/hooks directory and make it executable +# you need to adapt the path to your phpcs install +# if phpcs check fail, then it run phpcbf to fix automaticaly the syntax, and git commit is canceled +# if you have a multiprocessor computer, you can add to the option --parallel=xx +# when running git commit, it first execute this file checking only modified files, so it is faster than running on all files +# To run the fix manually: cd ~/git/dolibarr; phpcbf -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true fileordir PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"` STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php` diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 4b7d4d029b5..341fddf113c 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -118,9 +118,10 @@ if (empty($reshook)) { $form = new Form($db); +$help_url = ''; $title = $langs->trans('ChartOfIndividualAccountsOfSubsidiaryLedger'); -llxHeader('', $title); +llxHeader('', $title, $help_url); // Customer $sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity"; @@ -314,7 +315,7 @@ if ($resql) { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1); - print '
'.$langs->trans("WarningCreateSubAccounts").'
'; + print '
'.$langs->trans("WarningCreateSubAccounts").'
'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 71839ecf08a..b79b8433c03 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -10,6 +10,7 @@ * Copyright (C) 2017-2020 Frédéric France * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Eric Seigne + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -945,7 +946,7 @@ if (empty($action) || $action == 'view') { $vatstatic = new Tva($db); $donationstatic = new Don($db); $loanstatic = new Loan($db); - $salarystatic = new PaymentSalary($db); + $salarystatic = new Salary($db); $variousstatic = new PaymentVarious($db); llxHeader('', $langs->trans("FinanceJournal")); diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 1e98a1f8736..177a38e382b 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -266,16 +266,16 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; print ''; // Note print ''; - print ''; + print ''; print ''; // Date last change - print ''; + print ''; print dol_print_date($db->jdate($obj->tms), 'dayhour'); print ''; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 0cd05a53a74..13532474681 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -57,7 +57,9 @@ if ($action == 'setvalue' && $user->admin) { if (!dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS', GETPOST("objectclass", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) { $error++; } - + if (!dolibarr_set_const($db, 'LDAP_GROUP_FILTER', GETPOST("filter"), 'chaine', 0, '', $conf->entity)) { + $error++; + } if (!dolibarr_set_const($db, 'LDAP_GROUP_FIELD_FULLNAME', GETPOST("fieldfullname", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) { $error++; } @@ -141,6 +143,13 @@ print ''.$langs->trans("LDAPGroupObjectClassListExample").''; print ' '; print ''; +// Filter, used to filter search +print ''.$langs->trans("LDAPFilterConnection").''; +print ''; +print ''.$langs->trans("LDAPGroupFilterExample").''; +print ''; +print ''; + print ''; print '
'; print ''; @@ -211,11 +220,18 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $dn = $conf->global->LDAP_GROUP_DN; $objectclass = $conf->global->LDAP_GROUP_OBJECT_CLASS; + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); +} elseif ($conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') { + $butlabel = $langs->trans("LDAPTestSearch"); + $testlabel = 'testsearchgroup'; + $key = $conf->global->LDAP_KEY_GROUPS; + $dn = $conf->global->LDAP_GROUP_DN; + $objectclass = $conf->global->LDAP_GROUP_OBJECT_CLASS; show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } if (function_exists("ldap_connect")) { - if ($_GET["action"] == 'testgroup') { + if ($action == 'testgroup') { // Creation objet $object = new UserGroup($db); $object->initAsSpecimen(); @@ -260,6 +276,62 @@ if (function_exists("ldap_connect")) { print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } + + if ($action == 'testsearchgroup') { + // TODO Mutualize code following with other ldap_xxxx.php pages + + // Test synchro + $ldap = new Ldap(); + $result = $ldap->connect_bind(); + + if ($result > 0) { + $required_fields = array( + $conf->global->LDAP_KEY_GROUPS, + // $conf->global->LDAP_GROUP_FIELD_NAME, + $conf->global->LDAP_GROUP_FIELD_DESCRIPTION, + $conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS, + $conf->global->LDAP_GROUP_FIELD_GROUPID + ); + + // Remove from required_fields all entries not configured in LDAP (empty) and duplicated + $required_fields = array_unique(array_values(array_filter($required_fields, "dol_validElement"))); + + // Get from LDAP database an array of results + $ldapgroups = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_GROUPS, $required_fields, 'group'); + //$ldapgroups = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_GROUPS, '', 'group'); + + if (is_array($ldapgroups)) { + $liste = array(); + foreach ($ldapgroups as $key => $ldapgroup) { + // Define the label string for this group + $label = ''; + foreach ($required_fields as $value) { + if ($value) { + $label .= $value."=".$ldapgroup[$value]." "; + } + } + $liste[$key] = $label; + } + } else { + setEventMessages($ldap->error, $ldap->errors, 'errors'); + } + + print "
\n"; + print "LDAP search for group:
\n"; + print "search: *
\n"; + print "userDN: ".$conf->global->LDAP_GROUP_DN."
\n"; + print "useridentifier: ".$conf->global->LDAP_KEY_GROUPS."
\n"; + print "required_fields: ".implode(',', $required_fields)."
\n"; + print "=> ".count($liste)." records
\n"; + print "\n
"; + } else { + print img_picto('', 'error').' '; + print ''.$langs->trans("LDAPSynchroKO"); + print ': '.$ldap->error; + print '
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; + } + } } // End of page diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index 1f8b7680563..ac51ce33dc3 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -309,8 +309,9 @@ function getResultColumn($name, array $activated, array $loaded, array $function } if (strtolower($name) == 'xdebug') { $html .= ' '.$langs->trans("ModuleActivated", "xdebug"); + $html .= ' - '.$langs->trans("ModuleActivatedMayExposeInformation"); } else { - $html .= ' '.$langs->trans("PHPSupport", $name); + $html .= ' '.$langs->trans("PHPSupport", $name).''; } } else { if (strtolower($name) == 'xdebug') { diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index f69e520bb9b..745b732b6e1 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -76,7 +76,7 @@ if ($test) { print '
'; print '
'; -print load_fiche_titre($langs->trans("ConfigurationFile"), '', 'folder'); +print load_fiche_titre($langs->trans("ConfigurationFile").' ('.$conffile.')', '', 'folder'); print ''.$langs->trans("dolibarr_main_prod").': '.$dolibarr_main_prod; if (empty($dolibarr_main_prod)) { @@ -98,7 +98,7 @@ print '
'; print '
'; print '
'; -print load_fiche_titre($langs->trans("Permissions"), '', 'folder'); +print load_fiche_titre($langs->trans("PermissionsOnFiles"), '', 'folder'); print ''.$langs->trans("PermissionsOnFilesInWebRoot").': '; // TODO Check permission are read only except for custom dir @@ -151,9 +151,18 @@ print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), //print ''.$langs->trans("PasswordEncryption").': '; print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? $langs->trans("Undefined") : '')."   "; -print '   If unset: \'md5\' '; -print ' - Recommanded value: \'password_hash\'
'; -print 'MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? $langs->trans("Undefined") : '').'
'; +print '     If unset: \'md5\'
'; +if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { + print 'MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? $langs->trans("Undefined") : $conf->global->MAIN_SECURITY_SALT).'
'; +} +if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { + print 'The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.
'; + print 'If you really want to switch, you must:
'; + print '- Go on home - setup - other and add constant MAIN_SECURITY_HASH_ALGO to value \'password_hash\'
'; + print '- In same session, WITHOUT LOGGING OUT, go into your admin user record and set a new password
'; + print '- You can now logout and login with this new password. You must now reset password of all other users.
'; + print '

'; +} print '
'; // TODO diff --git a/htdocs/admin/system/xdebug.php b/htdocs/admin/system/xdebug.php index 186edc02dbd..fd10aad05e8 100644 --- a/htdocs/admin/system/xdebug.php +++ b/htdocs/admin/system/xdebug.php @@ -37,15 +37,18 @@ llxHeader(); print load_fiche_titre("XDebug", '', 'title_setup'); -print "
\n"; - - if (!function_exists('xdebug_is_enabled')) { + print "
\n"; print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.'; llxFooter(); exit; } +print ''; +print $langs->trans("ModuleActivatedMayExposeInformation", $langs->transnoentities("XDebug")); +print ''; + +print '

'; if (function_exists('socket_create')) { $address = ini_get('xdebug.remote_host') ?ini_get('xdebug.remote_host') : '127.0.0.1'; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index f49886594a7..5b0991afdf6 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -69,13 +69,20 @@ $search_desc = GETPOST("search_desc", "alpha"); $search_ua = GETPOST("search_ua", "restricthtml"); $search_prefix_session = GETPOST("search_prefix_session", "restricthtml"); -if (GETPOST("date_startmonth") == '' || GETPOST("date_startmonth") > 0) { - $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); +$now = dol_now(); +$nowarray = dol_getdate($now); + +if (!GETPOSTISSET("date_startmonth")) { + $date_start = dol_get_first_day($nowarray['year'], $nowarray['mon'], 'tzuserrel'); +} else if (GETPOST("date_startmonth") > 0) { + $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth", 'int'), GETPOST("date_startday", 'int'), GETPOST("date_startyear", 'int'), 'tzuserrel'); } else { $date_start = -1; } -if (GETPOST("date_endmonth") == '' || GETPOST("date_endmonth") > 0) { - $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); +if (!GETPOSTISSET("date_endmonth")) { + $date_end = dol_get_last_hour(dol_now('gmt'), 'tzuserrel'); +} elseif (GETPOST("date_endmonth") > 0) { + $date_end = dol_get_last_hour(dol_mktime(23, 59, 59, GETPOST("date_endmonth", 'int'), GETPOST("date_endday", 'int'), GETPOST("date_endyear", 'int'), 'tzuserrel'), 'tzuserrel'); } else { $date_end = -1; } @@ -85,8 +92,6 @@ if ($date_start > 0 && $date_end > 0 && $date_start > $date_end) { $date_end = $date_start + 86400; } -$now = dol_now(); -$nowarray = dol_getdate($now); if (empty($date_start)) { // We define date_start and date_end $date_start = dol_get_first_day($nowarray['year'], $nowarray['mon'], false); @@ -114,7 +119,6 @@ $arrayfields = array( ) ); - /* * Actions */ @@ -316,19 +320,22 @@ if ($result) { // Fields title search print ''; - print ''; + print ''; print ''; // IP print ''; print ''; print ''; } if (!empty($arrayfields['e.prefix_session']['checked'])) { print ''; } @@ -376,7 +383,7 @@ if ($result) { print ''; // Date - print ''; + print ''; // Code print ''; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index e71ec49da38..db1abb28c42 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -92,8 +92,8 @@ class BOM extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'autofocusoncreate'=>1), - //'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassembly')), - 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')), + 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble')), + //'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500'), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'), diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f381351f818..4470310e4d0 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -349,6 +349,21 @@ class ActionComm extends CommonObject */ public $errors_to; + /** + * @var int number of vote for an event + */ + public $num_vote; + + /** + * @var int if event is paid + */ + public $event_paid; + + /** + * @var int status use but Event organisation module + */ + public $status; + /** * Typical value for a event that is in a todo state */ @@ -481,7 +496,8 @@ class ActionComm extends CommonObject $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm"; - $sql .= "(datec,"; + $sql .= "(ref,"; + $sql .= "datec,"; $sql .= "datep,"; $sql .= "datep2,"; $sql .= "durationp,"; // deprecated @@ -509,8 +525,12 @@ class ActionComm extends CommonObject $sql .= "email_tocc,"; $sql .= "email_tobcc,"; $sql .= "email_subject,"; - $sql .= "errors_to"; + $sql .= "errors_to,"; + $sql .= "num_vote,"; + $sql .= "event_paid,"; + $sql .= "status"; $sql .= ") VALUES ("; + $sql .= "'(PROV)', "; $sql .= "'".$this->db->idate($now)."', "; $sql .= (strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : "null").", "; $sql .= (strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : "null").", "; @@ -539,14 +559,23 @@ class ActionComm extends CommonObject $sql .= (!empty($this->email_tocc) ? "'".$this->db->escape($this->email_tocc)."'" : "null").", "; $sql .= (!empty($this->email_tobcc) ? "'".$this->db->escape($this->email_tobcc)."'" : "null").", "; $sql .= (!empty($this->email_subject) ? "'".$this->db->escape($this->email_subject)."'" : "null").", "; - $sql .= (!empty($this->errors_to) ? "'".$this->db->escape($this->errors_to)."'" : "null"); + $sql .= (!empty($this->errors_to) ? "'".$this->db->escape($this->errors_to)."'" : "null").", "; + $sql .= (!empty($this->num_vote) ? (int) $this->num_vote : "null").", "; + $sql .= (!empty($this->event_paid) ? (int) $this->event_paid : 0).", "; + $sql .= (!empty($this->status) ? (int) $this->status : "0"); $sql .= ")"; dol_syslog(get_class($this)."::add", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $this->ref = $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm", "id"); - + $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm SET ref='".$this->db->escape($this->ref)."' WHERE id=".$this->id; + $resql = $this->db->query($sql); + if (!$resql) { + $error++; + dol_syslog('Error to process ref: '.$this->db->lasterror(), LOG_ERR); + $this->errors[] = $this->db->lasterror(); + } // Now insert assigned users if (!$error) { //dol_syslog(var_export($this->userassigned, true)); @@ -697,7 +726,7 @@ class ActionComm extends CommonObject global $langs; $sql = "SELECT a.id,"; - $sql .= " a.id as ref,"; + $sql .= " a.ref as ref,"; $sql .= " a.entity,"; $sql .= " a.ref_ext,"; $sql .= " a.datep,"; @@ -716,14 +745,15 @@ class ActionComm extends CommonObject $sql .= " a.email_msgid, a.email_subject, a.email_from, a.email_to, a.email_tocc, a.email_tobcc, a.errors_to,"; $sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,"; $sql .= " s.nom as socname,"; - $sql .= " u.firstname, u.lastname as lastname"; + $sql .= " u.firstname, u.lastname as lastname,"; + $sql .= " num_vote, event_paid, a.status"; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a "; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action=c.id "; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; $sql .= " WHERE "; if ($ref) { - $sql .= " a.id = ".((int) $ref); // No field ref, we use id + $sql .= " a.ref = '".$this->db->escape($ref)."'"; } elseif ($ref_ext) { $sql .= " a.ref_ext = '".$this->db->escape($ref_ext)."'"; } elseif ($email_msgid) { @@ -798,6 +828,10 @@ class ActionComm extends CommonObject $this->elementid = $obj->elementid; $this->elementtype = $obj->elementtype; + $this->num_vote = $obj->num_vote; + $this->event_paid = $obj->event_paid; + $this->status = $obj->status; + $this->fetchResources(); } $this->db->free($resql); @@ -1080,6 +1114,15 @@ class ActionComm extends CommonObject if (!empty($this->elementtype)) { $sql .= ", elementtype=".($this->elementtype ? "'".$this->db->escape($this->elementtype)."'" : "null"); } + if (!empty($this->num_vote)) { + $sql .= ", num_vote=".($this->num_vote ? (int) $this->num_vote : null); + } + if (!empty($this->event_paid)) { + $sql .= ", event_paid=".($this->event_paid ? (int) $this->event_paid : 0); + } + if (!empty($this->status)) { + $sql .= ", status=".($this->status ? (int) $this->status : 0); + } $sql .= " WHERE id=".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); @@ -1759,7 +1802,8 @@ class ActionComm extends CommonObject $sql .= " a.priority, a.fulldayevent, a.location, a.transparency,"; $sql .= " u.firstname, u.lastname, u.email,"; $sql .= " s.nom as socname,"; - $sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label"; + $sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label,"; + $sql .= " num_vote, event_paid, a.status"; $sql .= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; // Link to get author of event for export $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; @@ -1889,6 +1933,9 @@ class ActionComm extends CommonObject $event['url'] = $url; $event['created'] = $this->db->jdate($obj->datec) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600)); $event['modified'] = $this->db->jdate($obj->datem) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600)); + $event['num_vote'] = $this->num_vote; + $event['event_paid'] = $this->event_paid; + $event['status'] = $this->status; // TODO: find a way to call "$this->fetch_userassigned();" without override "$this" properties $this->id = $obj->id; @@ -2079,6 +2126,7 @@ class ActionComm extends CommonObject $this->datef = $now; $this->fulldayevent = 0; $this->percentage = 0; + $this->status = 0; $this->location = 'Location'; $this->transparency = 1; // 1 means opaque $this->priority = 1; diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index a2961b97974..d2e1fa9a645 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -66,7 +66,7 @@ class AgendaEvents extends DolibarrApi if (!DolibarrApiAccess::$user->rights->agenda->myactions->read) { throw new RestException(401, "Insufficient rights to read an event"); } - if ($id == 0) { + if ($id === 0) { $result = $this->actioncomm->initAsSpecimen(); } else { $result = $this->actioncomm->fetch($id); diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 3b759db4098..8483839b944 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -153,7 +153,7 @@ class CActionComm public function liste_array($active = '', $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0) { // phpcs:enable - global $langs, $conf; + global $langs, $conf, $user; $langs->load("commercial"); $repid = array(); @@ -191,23 +191,29 @@ class CActionComm $qualified = 0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) } - if ($qualified && $obj->module) { - if ($obj->module == 'invoice' && !$conf->facture->enabled) { + if ($qualified && !empty($obj->module)) { + if ($obj->module == 'invoice' && empty($conf->facture->enabled) && empty($user->facture->lire)) { $qualified = 0; } - if ($obj->module == 'order' && !$conf->commande->enabled) { + if ($obj->module == 'order' && empty($conf->commande->enabled) && empty($user->commande->lire)) { $qualified = 0; } - if ($obj->module == 'propal' && !$conf->propal->enabled) { + if ($obj->module == 'propal' && empty($conf->propal->enabled) && empty($user->propale->lire)) { $qualified = 0; } - if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !$conf->supplier_invoice->enabled)) { + if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled)) && empty($user->fournisseur->facture->lire)) { $qualified = 0; } - if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !$conf->supplier_order->enabled)) { + if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled)) && empty($user->fournisseur->commande->lire)) { $qualified = 0; } - if ($obj->module == 'shipping' && !$conf->expedition->enabled) { + if ($obj->module == 'shipping' && empty($conf->expedition->enabled) && empty($user->expedition->lire)) { + $qualified = 0; + } + if (preg_match('/@eventorganization/', $obj->module) && empty($conf->eventorganization->enabled) && empty($user->eventorganization->read)) { + $qualified = 0; + } + if (!preg_match('/^system/', $obj->type) && isset($conf->{$obj->module}) && empty($conf->{$obj->module}->enabled)) { $qualified = 0; } } @@ -247,12 +253,18 @@ class CActionComm $repcode['AC_ALL_AUTO'] = '-- '.$langs->trans("ActionAC_AUTO"); } if ($typecalendar == 'module') { + //TODO check if possible to push it between system and systemauto + if (preg_match('/@/', $obj->module)) { + $module = explode('@', $obj->module)[1]; + } else { + $module = $obj->module; + } $label = '   '.$label; - if (!isset($repcode['AC_ALL_'.strtoupper($obj->module)])) { // If first time for this module + if (!isset($repcode['AC_ALL_'.strtoupper($module)])) { // If first time for this module $idforallfornewmodule--; } - $repid[$idforallfornewmodule] = $langs->trans("ActionAC_ALL_".strtoupper($obj->module)); - $repcode['AC_ALL_'.strtoupper($obj->module)] = '-- '.$langs->trans("Module").' '.ucfirst($obj->module); + $repid[$idforallfornewmodule] = $langs->trans("ActionAC_ALL_".strtoupper($module)); + $repcode['AC_ALL_'.strtoupper($module)] = '-- '.$langs->trans("Module").' '.ucfirst($module); } } $repid[$obj->id] = $label; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index bd427115a57..e0a9138244d 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -207,8 +207,8 @@ if (empty($reshook)) { $substitutionarray['__OTHER4__'] = $other4; $substitutionarray['__OTHER5__'] = $other5; $substitutionarray['__USER_SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter) - $substitutionarray['__CHECK_READ__'] = ''; - $substitutionarray['__UNSUBSCRIBE__'] = ''.$langs->trans("MailUnsubcribe").''; + $substitutionarray['__CHECK_READ__'] = ''; + $substitutionarray['__UNSUBSCRIBE__'] = ''.$langs->trans("MailUnsubcribe").''; $onlinepaymentenabled = 0; if (!empty($conf->paypal->enabled)) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 30d436df9e4..a206e61064f 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -795,8 +795,8 @@ if (empty($reshook)) { // Set if we used free entry or predefined product $predef = ''; $product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); - $price_ht = price2num(GETPOST('price_ht')); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht')); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { $idprod = 0; @@ -1175,7 +1175,7 @@ if (empty($reshook)) { $info_bits |= 0x01; } - // Clean parameters + // Clean parameters $description = dol_htmlcleanlastbr(GETPOST('product_desc', 'restricthtml')); // Define vat_rate @@ -1183,13 +1183,13 @@ if (empty($reshook)) { $vat_rate = str_replace('*', '', $vat_rate); $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); - $pu_ht = GETPOST('price_ht'); + $pu_ht = price2num(GETPOST('price_ht'), '', 2); // Add buying price $fournprice = price2num(GETPOST('fournprice') ? GETPOST('fournprice') : ''); $buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value - $pu_ht_devise = GETPOST('multicurrency_subprice'); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 29d6d46a9f9..74de84b861a 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -616,8 +616,8 @@ if (empty($reshook)) { // Set if we used free entry or predefined product $predef = ''; $product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { $idprod = 0; @@ -984,9 +984,9 @@ if (empty($reshook)) { $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $description = dol_htmlcleanlastbr(GETPOST('product_desc', 'restricthtml')); - $pu_ht = GETPOST('price_ht'); + $pu_ht = price2num(GETPOST('price_ht'), '', 2); $vat_rate = (GETPOST('tva_tx') ?GETPOST('tva_tx') : 0); - $pu_ht_devise = GETPOST('multicurrency_subprice'); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); // Define info_bits $info_bits = 0; diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 67faa375d04..29f1fb5ca3e 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2017 Pierre-Henry Favre * Copyright (C) 2020 Maxime DEMAREST + * Copyright (C) 2021 Gauthier VERDOL * * 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 diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 6ec8fed517f..217b735a299 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1116,7 +1116,7 @@ if ($resql) { print_liste_field_titre($arrayfields['b.num_chq']['label'], $_SERVER['PHP_SELF'], 'b.num_chq', '', $param, '', $sortfield, $sortorder, "center "); } if (!empty($arrayfields['bu.label']['checked'])) { - print_liste_field_titre($arrayfields['bu.label']['label'], $_SERVER['PHP_SELF'], 'bu.label', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['bu.label']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder); } if (!empty($arrayfields['ba.ref']['checked'])) { print_liste_field_titre($arrayfields['ba.ref']['label'], $_SERVER['PHP_SELF'], 'ba.ref', '', $param, '', $sortfield, $sortorder); @@ -1420,6 +1420,7 @@ if ($resql) { } elseif ($links[$key]['type'] == 'member') { } elseif ($links[$key]['type'] == 'sc') { } elseif ($links[$key]['type'] == 'vat') { + } elseif ($links[$key]['type'] == 'salary') { } else { // Show link with label $links[$key]['label'] if (!empty($objp->label) && !empty($links[$key]['label'])) { diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index caca78033d6..419a0a41cdf 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -315,10 +315,11 @@ if ($result) { $i++; // Bank account - print ''; + print ''; print '"; } diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 4963a24d43d..2661678d411 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -6,6 +6,7 @@ * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -31,7 +32,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; -require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -84,7 +85,7 @@ if (!$sortorder) { $tva_static = new Tva($db); $socialcontrib = new ChargeSociales($db); $payment_sc_static = new PaymentSocialContribution($db); -$sal_static = new PaymentSalary($db); +$sal_static = new Salary($db); $accountstatic = new Account($db); llxHeader('', $langs->trans("SpecialExpensesArea")); @@ -414,6 +415,8 @@ while ($j < $numlt) { $num = $db->num_rows($result); $i = 0; $total = 0; + + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print '
'.$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0).''; + print $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel'); + print $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel'); + print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; @@ -337,13 +344,13 @@ if ($result) { if (!empty($arrayfields['e.user_agent']['checked'])) { print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
'.dol_print_date($db->jdate($obj->dateevent), '%Y-%m-%d %H:%M:%S').''.dol_print_date($db->jdate($obj->dateevent), '%Y-%m-%d %H:%M:%S', 'tzuserrel').''.$obj->type.'
'.$langs->trans("Account").'
'.$langs->trans("Account").''; if (!$objp->rappro && !$bankline->getVentilExportCompta()) { - $form->select_comptes($acct->id, 'accountid', 0, '', 0); + print img_picto('', 'bank_account', 'class="paddingright"'); + print $form->select_comptes($acct->id, 'accountid', 0, '', 0, '', 0, '', 1); } else { print $acct->getNomUrl(1, 'transactions', 'reflabel'); } @@ -367,6 +368,11 @@ if ($result) { print img_object($langs->trans('VATDeclaration'), 'bill').' '; print $langs->trans("VATDeclaration").($links[$key]['label'] ? ' '.$links[$key]['label'] : ''); print ''; + } elseif ($links[$key]['type'] == 'salary') { + print ''; + print img_object($langs->trans('Salary'), 'bill').' '; + print $langs->trans("Salary").($links[$key]['label'] ? ' - '.$links[$key]['label'] : ''); + print ''; } elseif ($links[$key]['type'] == 'payment_sc') { print ''; print img_object($langs->trans('Payment'), 'payment').' '; @@ -378,7 +384,7 @@ if ($result) { print $langs->trans("VATPayment"); print ''; } elseif ($links[$key]['type'] == 'payment_salary') { - print ''; + print ''; print img_object($langs->trans('PaymentSalary'), 'payment').' '; print $langs->trans("SalaryPayment"); print ''; @@ -561,7 +567,7 @@ if ($result) { // Bank line print '
'.$form->editfieldkey('RubriquesTransactions', 'custcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1); - print $form->multiselectarray('custcats', $cate_arbo, $arrayselected, null, null, null, null, "90%"); + print img_picto('', 'category', 'class="paddingright"').$form->multiselectarray('custcats', $cate_arbo, $arrayselected, null, null, null, null, "90%"); print "
'; print ''; print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder); @@ -455,6 +458,8 @@ while ($j < $numlt) { print ""; print "
"; + print ''; + $db->free($result); } else { dol_print_error($db); @@ -463,115 +468,6 @@ while ($j < $numlt) { $j++; } - -// Payment Salary -/* -if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) -{ - $sal = new PaymentSalary($db); - - print "
"; - - print load_fiche_titre($langs->trans("SalariesPayments").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); - - $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,"; - $sql .= " pct.code as payment_code,"; - $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel"; - $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; - $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 .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON s.fk_typepayment = pct.id"; - $sql .= " , ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE s.entity IN (".getEntity('user').")"; - $sql .= " AND u.rowid = s.fk_user"; - if ($year > 0) - { - $sql .= " AND (s.datesp between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; - $sql .= " OR s.dateep between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."')"; - } - if (preg_match('/^s\./', $sortfield)) $sql .= $db->order($sortfield, $sortorder); - - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; - $total = 0; - print ''; - print ''; - print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "s.dateep", "", $param, 'width="140px"', $sortfield, $sortorder); - print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "s.label", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "s.rowid", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "s.datep", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); - if (!empty($conf->banque->enabled)) print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "s.amount", "", $param, 'class="right"', $sortfield, $sortorder); - print "\n"; - - while ($i < $num) - { - $obj = $db->fetch_object($result); - - $total = $total + $obj->amount; - - - print ''; - - print ''."\n"; - - print "\n"; - - // Ref payment - $sal_static->id = $obj->rowid; - $sal_static->ref = $obj->rowid; - print '\n"; - - // Date - print '\n"; - - // Type payment - print ''; - - // Account - if (!empty($conf->banque->enabled)) - { - print ''; - } - - // Paid - print '"; - print "\n"; - - $i++; - } - print ''; - print '"; - print ""; - - print "
'.dol_print_date($db->jdate($obj->dateep), 'day').'".$obj->label."'.$sal_static->getNomUrl(1)."'.dol_print_date($db->jdate($obj->datep), 'day')."'; - if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; - print $obj->num_payment.''; - if ($obj->fk_bank > 0) - { - //$accountstatic->fetch($obj->fk_bank); - $accountstatic->id = $obj->bid; - $accountstatic->ref = $obj->bref; - $accountstatic->number = $obj->bnumber; - $accountstatic->accountancy_number = $obj->account_number; - $accountstatic->accountancy_journal = $obj->accountancy_journal; - $accountstatic->label = $obj->blabel; - print $accountstatic->getNomUrl(1); - } else print ' '; - print ''.price($obj->amount)."
'.$langs->trans("Total").''.price($total)."
"; - $db->free($result); - - print "
"; - } else { - dol_print_error($db); - } -} -*/ - print ''; $parameters = array('user' => $user); diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index ee5cd3e00f9..1978a6115b5 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -421,8 +421,8 @@ if (empty($reshook)) { // Set if we used free entry or predefined product $predef = ''; $product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); $prod_entry_mode = GETPOST('prod_entry_mode', 'alpha'); if ($prod_entry_mode == 'free') { $idprod = 0; @@ -719,10 +719,10 @@ if (empty($reshook)) { //$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); //$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $description = dol_htmlcleanlastbr(GETPOST('product_desc', 'restricthtml') ? GETPOST('product_desc', 'restricthtml') : GETPOST('desc', 'restricthtml')); - $pu_ht = GETPOST('price_ht'); + $pu_ht = price2num(GETPOST('price_ht'), '', 2); $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $qty = GETPOST('qty'); - $pu_ht_devise = GETPOST('multicurrency_subprice'); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); // Define info_bits $info_bits = 0; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 36071b20d44..8c291a0839b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1955,8 +1955,8 @@ if (empty($reshook)) { // Set if we used free entry or predefined product $predef = ''; $product_desc =(GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); - $price_ht = price2num(GETPOST('price_ht')); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht')); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); $prod_entry_mode = GETPOST('prod_entry_mode', 'alpha'); if ($prod_entry_mode == 'free') { $idprod = 0; @@ -2299,10 +2299,10 @@ if (empty($reshook)) { $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $description = dol_htmlcleanlastbr(GETPOST('product_desc', 'restricthtml') ? GETPOST('product_desc', 'restricthtml') : GETPOST('desc', 'restricthtml')); - $pu_ht = GETPOST('price_ht'); + $pu_ht = price2num(GETPOST('price_ht'), '', 2); $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $qty = GETPOST('qty'); - $pu_ht_devise = GETPOST('multicurrency_subprice'); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); // Define info_bits $info_bits = 0; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index ad880470b50..09efdb60f29 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -79,19 +79,22 @@ class FactureRec extends CommonInvoice */ public $title; + public $socid; public $number; public $date; public $remise; + public $remise_absolue; + public $remise_percent; public $tva; public $total; - public $db_table; - public $propalid; public $date_last_gen; public $date_when; public $nb_gen_done; public $nb_gen_max; + public $user_author; + /** * @var int Frequency */ @@ -107,8 +110,22 @@ class FactureRec extends CommonInvoice public $usenewprice = 0; + public $date_lim_reglement; + public $cond_reglement_code; // Code in llx_c_paiement + public $mode_reglement_code; // Code in llx_c_paiement + public $suspended; // status + public $auto_validate; // 0 to create in draft, 1 to create and validate the new invoice + public $generate_pdf; // 1 to generate PDF on invoice generation (default) + + /** + * @var int 1 if status is draft + * @deprecated + */ + public $brouillon; + + /** * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" @@ -335,14 +352,20 @@ class FactureRec extends CommonInvoice $facsrc->lines[$i]->special_code, $facsrc->lines[$i]->label, $facsrc->lines[$i]->fk_unit, - $facsrc->lines[$i]->multicurrency_subprice + $facsrc->lines[$i]->multicurrency_subprice, + 0, + 0, + null, + $facsrc->lines[$i]->pa_ht ); if ($result_insert < 0) { $error++; } else { $objectline = new FactureLigneRec($this->db); - if ($objectline->fetch($result_insert)) { + + $result2 = $objectline->fetch($result_insert); + if ($result2 > 0) { // Extrafields if (method_exists($facsrc->lines[$i], 'fetch_optionals')) { $facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->id); @@ -353,6 +376,9 @@ class FactureRec extends CommonInvoice if ($result < 0) { $error++; } + } elseif ($result2 < 0) { + $this->errors[] = $objectline->error; + $error++; } } } @@ -403,6 +429,7 @@ class FactureRec extends CommonInvoice if ($error) { $this->db->rollback(); + return -3; } else { $this->db->commit(); return $this->id; @@ -494,14 +521,15 @@ class FactureRec extends CommonInvoice //$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = f.rowid AND el.targettype = 'facture'"; $sql .= ' WHERE f.entity IN ('.getEntity('invoice').')'; if ($rowid) { - $sql .= ' AND f.rowid='.$rowid; + $sql .= ' AND f.rowid='.((int) $rowid); } elseif ($ref) { $sql .= " AND f.titre='".$this->db->escape($ref)."'"; + } else { + $sql .= ' AND f.rowid = 0'; } /* This field are not used for template invoice - if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; - if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'"; - */ + if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; + */ $result = $this->db->query($sql); if ($result) { @@ -513,11 +541,7 @@ class FactureRec extends CommonInvoice $this->titre = $obj->title; // deprecated $this->title = $obj->title; $this->ref = $obj->title; - $this->ref_client = $obj->ref_client; $this->suspended = $obj->suspended; - $this->type = $obj->type; - $this->datep = $obj->dp; - $this->date = $obj->df; $this->remise_percent = $obj->remise_percent; $this->remise_absolue = $obj->remise_absolue; $this->remise = $obj->remise; @@ -526,9 +550,6 @@ class FactureRec extends CommonInvoice $this->total_localtax1 = $obj->localtax1; $this->total_localtax2 = $obj->localtax2; $this->total_ttc = $obj->total_ttc; - $this->paye = $obj->paye; - $this->close_code = $obj->close_code; - $this->close_note = $obj->close_note; $this->socid = $obj->fk_soc; $this->date_lim_reglement = $this->db->jdate($obj->dlr); $this->mode_reglement_id = $obj->fk_mode_reglement; @@ -540,14 +561,12 @@ class FactureRec extends CommonInvoice $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; $this->fk_project = $obj->fk_project; $this->fk_account = $obj->fk_account; - $this->fk_facture_source = $obj->fk_facture_source; $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->user_author = $obj->fk_user_author; $this->modelpdf = $obj->model_pdf; // deprecated $this->model_pdf = $obj->model_pdf; - $this->rang = $obj->rang; - $this->special_code = $obj->special_code; + //$this->special_code = $obj->special_code; $this->frequency = $obj->frequency; $this->unit_frequency = $obj->unit_frequency; $this->date_when = $this->db->jdate($obj->date_when); @@ -629,11 +648,8 @@ class FactureRec extends CommonInvoice $sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx, '; $sql .= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,'; - $sql .= ' l.info_bits, l.date_start_fill, l.date_end_fill, l.total_ht, l.total_tva, l.total_ttc, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; - //$sql.= ' l.situation_percent, l.fk_prev_id,'; - //$sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,'; + $sql .= ' l.info_bits, l.date_start_fill, l.date_end_fill, l.total_ht, l.total_tva, l.total_ttc, l.fk_product_fournisseur_price, l.buy_price_ht as pa_ht,'; $sql .= ' l.rang, l.special_code,'; - //$sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; $sql .= ' l.fk_unit, l.fk_contract_line,'; $sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,'; $sql .= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; @@ -655,12 +671,12 @@ class FactureRec extends CommonInvoice $line->rowid = $objp->rowid; $line->desc = $objp->description; // Description line $line->description = $objp->description; // Description line - $line->product_type = $objp->product_type; // Type of line $line->ref = $objp->product_ref; // Ref product $line->product_ref = $objp->product_ref; // Ref product $line->libelle = $objp->product_label; // deprecated $line->product_label = $objp->product_label; // Label product $line->product_desc = $objp->product_desc; // Description product + $line->product_type = $objp->product_type; // Type of line $line->fk_product_type = $objp->fk_product_type; // Type of product $line->qty = $objp->qty; $line->subprice = $objp->subprice; @@ -674,7 +690,7 @@ class FactureRec extends CommonInvoice $line->localtax1_type = $objp->localtax1_type; $line->localtax2_type = $objp->localtax2_type; $line->remise_percent = $objp->remise_percent; - $line->fk_remise_except = $objp->fk_remise_except; + //$line->fk_remise_except = $objp->fk_remise_except; $line->fk_product = $objp->fk_product; $line->date_start_fill = $objp->date_start_fill; $line->date_end_fill = $objp->date_end_fill; @@ -682,10 +698,16 @@ class FactureRec extends CommonInvoice $line->total_ht = $objp->total_ht; $line->total_tva = $objp->total_tva; $line->total_ttc = $objp->total_ttc; + //$line->code_ventilation = $objp->fk_code_ventilation; - $line->fk_fournprice = $objp->fk_fournprice; - $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); - $line->pa_ht = $marginInfos[0]; + + $line->fk_product_fournisseur_price = $objp->fk_product_fournisseur_price; + $line->fk_fournprice = $objp->fk_product_fournisseur_price; // For backward compatibility + + $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $objp->fk_product_fournisseur_price, $objp->pa_ht); + + $line->buyprice = $marginInfos[0]; + $line->pa_ht = $marginInfos[0]; // For backward compatibility $line->marge_tx = $marginInfos[1]; $line->marque_tx = $marginInfos[2]; $line->rang = $objp->rang; @@ -821,6 +843,7 @@ class FactureRec extends CommonInvoice $localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc); // Clean vat code + $reg = array(); $vat_src_code = ''; if (preg_match('/\((.*)\)/', $txtva, $reg)) { $vat_src_code = $reg[1]; @@ -1261,6 +1284,8 @@ class FactureRec extends CommonInvoice $facture->type = self::TYPE_STANDARD; $facture->brouillon = 1; + $facture->statut = self::STATUS_DRAFT; + $facture->status = self::STATUS_DRAFT; $facture->date = (empty($facturerec->date_when) ? $now : $facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. $facture->socid = $facturerec->socid; @@ -1586,6 +1611,7 @@ class FactureRec extends CommonInvoice // Initialize parameters $this->id = 0; $this->ref = 'SPECIMEN'; + $this->title = 'SPECIMEN'; $this->specimen = 1; $this->socid = 1; $this->date = $nownotime; @@ -1896,6 +1922,18 @@ class FactureLigneRec extends CommonInvoiceLine public $table_element = 'facturedet_rec'; + public $fk_product_fournisseur_price; + public $fk_fournprice; // For backward compatibility + + public $rang; + + public $desc; + public $description; + + public $fk_product_type; // Use instead product_type + + public $fk_contract_line; + /** * Delete line in database @@ -1962,6 +2000,10 @@ class FactureLigneRec extends CommonInvoiceLine $sql .= ' l.date_start_fill, l.date_end_fill, l.info_bits, l.total_ht, l.total_tva, l.total_ttc,'; $sql .= ' l.rang, l.special_code,'; $sql .= ' l.fk_unit, l.fk_contract_line,'; + $sql .= ' l.import_key, l.fk_multicurrency,'; + $sql .= ' l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,'; + $sql .= ' l.buy_price_ht, l.fk_product_fournisseur_price,'; + $sql .= ' l.fk_user_author, l.fk_user_modif,'; $sql .= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; $sql .= ' FROM '.MAIN_DB_PREFIX.'facturedet_rec as l'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; @@ -2008,7 +2050,19 @@ class FactureLigneRec extends CommonInvoiceLine $this->special_code = $objp->special_code; $this->fk_unit = $objp->fk_unit; $this->fk_contract_line = $objp->fk_contract_line; + $this->import_key = $objp->import_key; + $this->fk_multicurrency = $objp->fk_multicurrency; + $this->multicurrency_code = $objp->multicurrency_code; + $this->multicurrency_subprice = $objp->multicurrency_subprice; + $this->multicurrency_total_ht = $objp->multicurrency_total_ht; + $this->multicurrency_total_tva = $objp->multicurrency_total_tva; + $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $this->buy_price_ht = $objp->buy_price_ht; + + $this->fk_product_fournisseur_price = $objp->fk_product_fournisseur_price; + $this->fk_user_author = $objp->fk_user_author; + $this->fk_user_modif = $objp->fk_user_modif; $this->db->free($result); return 1; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index bd14a778f78..dfd50147109 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -99,6 +99,12 @@ class Facture extends CommonInvoice */ protected $table_ref_field = 'ref'; + /** + * @var int 1 if status is draft + * @deprecated + */ + public $brouillon; + /** * @var int thirdparty ID */ @@ -171,6 +177,7 @@ class Facture extends CommonInvoice //! id of source invoice if replacement invoice or credit note public $fk_facture_source; public $linked_objects = array(); + public $date_lim_reglement; public $cond_reglement_code; // Code in llx_c_paiement public $mode_reglement_code; // Code in llx_c_paiement @@ -446,6 +453,8 @@ class Facture extends CommonInvoice $this->mode_reglement_id = 0; } $this->brouillon = 1; + $this->status = self::STATUS_DRAFT; + $this->statut = self::STATUS_DRAFT; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) { @@ -537,6 +546,8 @@ class Facture extends CommonInvoice $this->mode_reglement_id = 0; } $this->brouillon = 1; + $this->status = self::STATUS_DRAFT; + $this->statut = self::STATUS_DRAFT; $this->linked_objects = $_facrec->linkedObjectsIds; // We do not add link to template invoice or next invoice will be linked to all generated invoices @@ -917,8 +928,9 @@ class Facture extends CommonInvoice $localtax1_tx = $_facrec->lines[$i]->localtax1_tx; $localtax2_tx = $_facrec->lines[$i]->localtax2_tx; - $fk_product_fournisseur_price = empty($_facrec->lines[$i]->fk_product_fournisseur_price) ?null:$_facrec->lines[$i]->fk_product_fournisseur_price; + $fk_product_fournisseur_price = empty($_facrec->lines[$i]->fk_product_fournisseur_price) ? null : $_facrec->lines[$i]->fk_product_fournisseur_price; $buyprice = empty($_facrec->lines[$i]->buyprice) ? 0 : $_facrec->lines[$i]->buyprice; + // If buyprice not defined from template invoice, we try to guess the best value if (!$buyprice && $_facrec->lines[$i]->fk_product > 0) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; @@ -1682,7 +1694,7 @@ class Facture extends CommonInvoice $this->fetchPreviousNextSituationInvoice(); } - if ($this->statut == self::STATUS_DRAFT) { + if ($this->status == self::STATUS_DRAFT) { $this->brouillon = 1; } @@ -2583,8 +2595,8 @@ class Facture extends CommonInvoice $this->fetch_lines(); // Check parameters - if (!$this->brouillon) { - dol_syslog(get_class($this)."::validate no draft status", LOG_WARNING); + if ($this->statut != self::STATUS_DRAFT) { + dol_syslog(get_class($this)."::validate status is not draft. operation canceled.", LOG_WARNING); return 0; } if (count($this->lines) <= 0) { @@ -2848,6 +2860,7 @@ class Facture extends CommonInvoice $this->ref = $num; $this->ref = $num; $this->statut = self::STATUS_VALIDATED; + $this->status = self::STATUS_VALIDATED; $this->brouillon = 0; $this->date_validation = $now; $i = 0; @@ -2886,7 +2899,7 @@ class Facture extends CommonInvoice * Update price of next invoice * * @param Translate $langs Translate object - * @return bool false if KO, true if OK + * @return bool false if KO, true if OK */ public function updatePriceNextInvoice(&$langs) { @@ -2899,6 +2912,7 @@ class Facture extends CommonInvoice } $next_invoice->brouillon = 1; + foreach ($next_invoice->lines as $line) { $result = $next_invoice->updateline( $line->id, @@ -2994,12 +3008,14 @@ class Facture extends CommonInvoice $old_statut = $this->statut; $this->brouillon = 1; $this->statut = self::STATUS_DRAFT; + $this->status = self::STATUS_DRAFT; // Call trigger $result = $this->call_trigger('BILL_UNVALIDATE', $user); if ($result < 0) { $error++; $this->statut = $old_statut; + $this->status = $old_statut; $this->brouillon = 0; } // End call triggers @@ -3361,7 +3377,7 @@ class Facture extends CommonInvoice dol_syslog(get_class($this)."::updateline rowid=$rowid, desc=$desc, pu=$pu, qty=$qty, remise_percent=$remise_percent, date_start=$date_start, date_end=$date_end, txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, price_base_type=$price_base_type, info_bits=$info_bits, type=$type, fk_parent_line=$fk_parent_line pa_ht=$pa_ht, special_code=$special_code, fk_unit=$fk_unit, pu_ht_devise=$pu_ht_devise", LOG_DEBUG); - if ($this->brouillon) { + if ($this->statut == self::STATUS_DRAFT) { if (!$this->is_last_in_cycle() && empty($this->error)) { if (!$this->checkProgressLine($rowid, $situation_percent)) { if (!$this->error) { @@ -3630,7 +3646,7 @@ class Facture extends CommonInvoice dol_syslog(get_class($this)."::deleteline rowid=".$rowid, LOG_DEBUG); - if (!$this->brouillon) { + if ($this->statut != self::STATUS_DRAFT) { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; return -1; } diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index e941f532efa..847dae1bc29 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -364,8 +364,9 @@ if ($action == 'new') { print ''; print '
'; - $sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as transactionid, "; - $sql .= " b.amount, ba.label, b.emetteur, b.num_chq, b.banque,"; + $sql = "SELECT ba.rowid as bid, ba.label,"; + $sql .= " b.rowid as transactionid, b.label as transactionlabel, b.datec as datec, b.dateo as date, "; + $sql .= " b.amount, b.emetteur, b.num_chq, b.banque,"; $sql .= " p.rowid as paymentid, p.ref as paymentref"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.fk_bank = b.rowid"; @@ -393,6 +394,8 @@ if ($action == 'new') { $lines[$obj->bid][$i]["numero"] = $obj->num_chq; $lines[$obj->bid][$i]["banque"] = $obj->banque; $lines[$obj->bid][$i]["id"] = $obj->transactionid; + $lines[$obj->bid][$i]["ref"] = $obj->transactionid; + $lines[$obj->bid][$i]["label"] = $obj->transactionlabel; $lines[$obj->bid][$i]["paymentid"] = $obj->paymentid; $lines[$obj->bid][$i]["paymentref"] = $obj->paymentref; $i++; @@ -473,8 +476,9 @@ if ($action == 'new') { print ''; // Link to bank transaction print ''; - $accountlinestatic->rowid = $value["id"]; - if ($accountlinestatic->rowid) { + $accountlinestatic->id = $value["id"]; + $accountlinestatic->ref = $value["ref"]; + if ($accountlinestatic->id > 0) { print $accountlinestatic->getNomUrl(1); } else { print ' '; @@ -594,7 +598,7 @@ if ($action == 'new') { // List of bank checks - $sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,"; + $sql = "SELECT b.rowid, b.rowid as ref, b.label, b.amount, b.num_chq, b.emetteur,"; $sql .= " b.dateo as date, b.datec as datec, b.banque,"; $sql .= " p.rowid as pid, p.ref as pref, ba.rowid as bid, p.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; @@ -648,8 +652,9 @@ if ($action == 'new') { print ''; // Link to bank transaction print ''; - $accountlinestatic->rowid = $objp->rowid; - if ($accountlinestatic->rowid) { + $accountlinestatic->id = $objp->rowid; + $accountlinestatic->ref = $objp->ref; + if ($accountlinestatic->id > 0) { print $accountlinestatic->getNomUrl(1); } else { print ' '; diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 6a573ea4621..21f599f42dc 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -6,6 +6,7 @@ * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -31,7 +32,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; -require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; @@ -95,7 +96,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $tva_static = new Tva($db); $socialcontrib = new ChargeSociales($db); $payment_sc_static = new PaymentSocialContribution($db); -$sal_static = new PaymentSalary($db); +$sal_static = new Salary($db); $accountstatic = new Account($db); $formsocialcontrib = new FormSocialContrib($db); diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php old mode 100644 new mode 100755 index 4421178a507..40261cb7f05 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -549,7 +549,7 @@ if ($id) { print ''; if ($action == 'edit') { - print '' . $langs->trans("Amount") . ''; + print '' . $langs->trans("Amount") . ''; } else { print '' . $langs->trans("Amount") . '' . price($object->amount) . ''; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 0c7f3ac73aa..ede8e6698dd 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1469,9 +1469,13 @@ class Contact extends CommonObject $result .= $linkstart; if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto == -2) { + $result .= ''.Form::showphoto('contact', $this, 0, 0, 0, 'userphoto'.($withpicto == -3 ? 'small' : ''), 'mini', 0, 1).''; + } else { + $result .= img_object(($notooltip ? '' : $label), ( $this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + } } - if ($withpicto != 2) { + if ($withpicto != 2 && $withpicto != -2) { $result .= ($maxlen ?dol_trunc($this->getFullName($langs), $maxlen) : $this->getFullName($langs)); } $result .= $linkend; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 8a8f91f2a93..51661cc5b82 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -367,8 +367,8 @@ if (empty($reshook)) { // Set if we used free entry or predefined product $predef = ''; $product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht', 'CU')); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); if (GETPOST('prod_entry_mode', 'alpha') == 'free') { $idprod = 0; $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); @@ -651,9 +651,8 @@ if (empty($reshook)) { } // ajout prix d'achat - $fk_fournprice = $_POST['fournprice']; - if (!empty($_POST['buying_price'])) { - $pa_ht = $_POST['buying_price']; + if (GETPOST('buying_price')) { + $pa_ht = price2num(GETPOST('buying_price'), '', 2); } else { $pa_ht = null; } diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index d7dcbf699c8..f871ed73de8 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -74,9 +74,9 @@ if ($action == 'add' && !empty($permissiontoadd)) { if (in_array($object->fields[$key]['type'], array('text', 'html'))) { $value = GETPOST($key, 'restricthtml'); } elseif ($object->fields[$key]['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); + $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt } elseif ($object->fields[$key]['type'] == 'datetime') { - $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); + $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); } elseif ($object->fields[$key]['type'] == 'duration') { $value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int'); } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { @@ -174,9 +174,9 @@ if ($action == 'update' && !empty($permissiontoadd)) { $value = GETPOST($key, 'restricthtml'); } } elseif ($object->fields[$key]['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year')); + $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt } elseif ($object->fields[$key]['type'] == 'datetime') { - $value = dol_mktime(GETPOST($key.'hour'), GETPOST($key.'min'), 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year')); + $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); } elseif ($object->fields[$key]['type'] == 'duration') { if (GETPOST($key.'hour', 'int') != '' || GETPOST($key.'min', 'int') != '') { $value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int'); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index d951807976f..6366cf52756 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -875,6 +875,13 @@ abstract class CommonInvoiceLine extends CommonObjectLine */ public $subprice; + /** + * Unit price before taxes + * @var float + * @deprecated + */ + public $price; + /** * Id of corresponding product * @var int @@ -905,12 +912,31 @@ abstract class CommonInvoiceLine extends CommonObjectLine */ public $localtax2_tx; + /** + * Local tax 1 type + * @var string + */ + public $localtax1_type; + + /** + * Local tax 2 type + * @var string + */ + public $localtax2_type; + /** * Percent of discount * @var float */ public $remise_percent; + /** + * Fixed discount + * @var float + * @deprecated + */ + public $remise; + /** * Total amount before taxes * @var float @@ -944,6 +970,13 @@ abstract class CommonInvoiceLine extends CommonObjectLine public $date_start_fill; // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_start at creation public $date_end_fill; // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_end at creation + public $buy_price_ht; + public $buyprice; // For backward compatibility + public $pa_ht; // For backward compatibility + + public $marge_tx; + public $marque_tx; + /** * List of cumulative options: * Bit 0: 0 for common VAT - 1 if VAT french NPR @@ -960,4 +993,7 @@ abstract class CommonInvoiceLine extends CommonObjectLine public $multicurrency_total_ht; public $multicurrency_total_tva; public $multicurrency_total_ttc; + + public $fk_user_author; + public $fk_user_modif; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e09ea7d96a9..f80fcbce957 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2237,6 +2237,9 @@ abstract class CommonObject if (get_class($this) == 'Tva') { $fieldname = 'fk_typepayment'; } + if (get_class($this) == 'Salary') { + $fieldname = 'fk_typepayment'; + } $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql .= ' SET '.$fieldname.' = '.(($id > 0 || $id == '0') ? $id : 'NULL'); @@ -6452,11 +6455,10 @@ abstract class CommonObject } } - if (in_array($type, array('date', 'datetime'))) { + if (in_array($type, array('date'))) { $tmp = explode(',', $size); $newsize = $tmp[0]; - - $showtime = in_array($type, array('datetime')) ? 1 : 0; + $showtime = 0; // Do not show current date when field not required (see selectDate() method) if (!$required && $value == '') { @@ -6465,6 +6467,16 @@ abstract class CommonObject // TODO Must also support $moreparam $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1); + } elseif (in_array($type, array('datetime'))) { + $tmp = explode(',', $size); + $newsize = $tmp[0]; + $showtime = 1; + + // Do not show current date when field not required (see selectDate() method) + if (!$required && $value == '') $value = '-1'; + + // TODO Must also support $moreparam + $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1, '', '', '', 1, '', '', 'tzuserrel'); } elseif (in_array($type, array('duration'))) { $out = $form->select_duration($keyprefix.$key.$keysuffix, $value, 0, 'text', 0, 1); } elseif (in_array($type, array('int', 'integer'))) { @@ -7022,13 +7034,13 @@ abstract class CommonObject $value = $this->getLibStatut(3); } elseif ($type == 'date') { if (!empty($value)) { - $value = dol_print_date($value, 'day'); + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) } else { $value = ''; } } elseif ($type == 'datetime' || $type == 'timestamp') { if (!empty($value)) { - $value = dol_print_date($value, 'dayhour'); + $value = dol_print_date($value, 'dayhour', 'tzuserrel'); } else { $value = ''; } @@ -7407,12 +7419,19 @@ abstract class CommonObject } // Convert date into timestamp format (value in memory must be a timestamp) - if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('date', 'datetime'))) { + if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('date'))) { $datenotinstring = $this->array_options['options_'.$key]; if (!is_numeric($this->array_options['options_'.$key])) { // For backward compatibility $datenotinstring = $this->db->jdate($datenotinstring); } - $value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)) ? dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min", 'int', 3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year", 'int', 3)) : $datenotinstring; + $value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)) ? dol_mktime(12, 0, 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year", 'int', 3)) : $datenotinstring; + } + if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('datetime'))) { + $datenotinstring = $this->array_options['options_'.$key]; + if (!is_numeric($this->array_options['options_'.$key])) { // For backward compatibility + $datenotinstring = $this->db->jdate($datenotinstring); + } + $value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)) ? dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."sec", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."month", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year", 'int', 3), 'tzuserrel') : $datenotinstring; } // Convert float submited string into real php numeric (value in memory must be a php numeric) if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('price', 'double'))) { @@ -7519,7 +7538,7 @@ abstract class CommonObject */ public function getJSListDependancies($type = '_extra') { - $out .= ' + $out = ' '; @@ -1252,7 +1243,7 @@ if ($action == 'create') { $deliverableQty = min($quantityToBeDelivered, $batchStock); print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -1284,7 +1275,7 @@ if ($action == 'create') { } else { print ''; print ''; - print ' '; + print ' '; print ''; print ''; @@ -1395,7 +1386,7 @@ if ($action == 'create') { $deliverableQty = 0; } print ''; - print ''; + print ''; print ''; print ''; @@ -1439,7 +1430,7 @@ if ($action == 'create') { if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty. $disabled = 'disabled="disabled"'; } - print ' '; + print ' '; } else { print $langs->trans("NA"); } @@ -2141,7 +2132,7 @@ if ($action == 'create') { foreach ($lines[$i]->detail_batch as $detail_batch) { print ''; // Qty to ship or shipped - print ''; + print ''; // Batch number managment if ($lines[$i]->entrepot_id == 0) { // only show lot numbers from src warehouse when shipping from multiple warehouses @@ -2153,7 +2144,7 @@ if ($action == 'create') { // add a 0 qty lot row to be able to add a lot print ''; // Qty to ship or shipped - print ''; + print ''; // Batch number managment print ''.$formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product).''; print ''; @@ -2163,7 +2154,7 @@ if ($action == 'create') { print ''; print ''; // Qty to ship or shipped - print ''; + print ''; // Warehouse source print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -2174,7 +2165,7 @@ if ($action == 'create') { foreach ($lines[$i]->details_entrepot as $detail_entrepot) { print ''; // Qty to ship or shipped - print ''; + print ''; // Warehouse source print ''.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -2189,7 +2180,7 @@ if ($action == 'create') { print ''; print ''; // Qty to ship or shipped - print ''; + print ''; // Warehouse source print ''; // Batch number managment diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index db2b6dd749a..23a05ea0844 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -952,7 +952,9 @@ class ProductFournisseur extends Product } $out .= ''; } else { - $out = ($showunitprice ?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent / 100) + $this->fourn_remise).' '.$langs->trans("HT").'   (' : '').($showsuptitle ? ''.$langs->trans("Supplier").': ' : '').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice ? ')' : ''); + $out = ($showunitprice ? price($this->fourn_unitprice * (1 - $this->fourn_remise_percent / 100) + $this->fourn_remise).' '.$langs->trans("HT").'   (' : ''); + $out .= ($showsuptitle ? ''.$langs->trans("Supplier").': ' : '').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->ref_supplier; + $out .= ($showunitprice ? ')' : ''); } return $out; } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index a110bcd7e2c..05a4a78e4dc 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -379,17 +379,17 @@ if (empty($reshook)) { $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { $idprod = 0; - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod = GETPOST('idprod', 'int'); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = ''; } $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); $remise_percent = price2num(GETPOST('remise_percent'.$predef), 2); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU'); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); @@ -711,7 +711,7 @@ if (empty($reshook)) { if (GETPOST('price_ht') != '') { $price_base_type = 'HT'; - $ht = price2num(GETPOST('price_ht')); + $ht = price2num(GETPOST('price_ht'), '', 2); } else { $vatratecleaned = $vat_rate; if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) { // If vat is "xx (yy)" @@ -719,12 +719,12 @@ if (empty($reshook)) { $vatratecode = $reg[2]; } - $ttc = price2num(GETPOST('price_ttc')); + $ttc = price2num(GETPOST('price_ttc'), '', 2); $ht = $ttc / (1 + ($vatratecleaned / 100)); $price_base_type = 'HT'; } - $pu_ht_devise = GETPOST('multicurrency_subprice'); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); // Extrafields Lines $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index ee8c86aa0b8..78e3884e9c4 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -441,13 +441,13 @@ if ($action == 'updateline' && $user->rights->fournisseur->commande->receptionne $qty = $supplierorderdispatch->qty; $entrepot = $supplierorderdispatch->fk_entrepot; $product = $supplierorderdispatch->fk_product; - $price = GETPOST('price'); + $price = price2num(GETPOST('price'), '', 2); $comment = $supplierorderdispatch->comment; $eatby = $supplierorderdispatch->fk_product; $sellby = $supplierorderdispatch->sellby; $batch = $supplierorderdispatch->batch; - $supplierorderdispatch->qty = GETPOST('qty', 'int'); + $supplierorderdispatch->qty = price2num(GETPOST('qty', 'alpha'), 'MS', 2); $supplierorderdispatch->fk_entrepot = GETPOST('fk_entrepot'); $result = $supplierorderdispatch->update($user); } @@ -855,7 +855,7 @@ if ($id > 0 || !empty($ref)) { // Already dispatched print ''.$products_dispatched[$objp->rowid].''; - if (!empty($conf->productbatch->enabled) && $objp->tobatch == 1) { + if (!empty($conf->productbatch->enabled) && $objp->tobatch > 0) { $type = 'batch'; print ''; print ''; // Qty to dispatch @@ -967,7 +967,7 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; - if (!empty($conf->productbatch->enabled) && $objp->tobatch == 1) { + if (!empty($conf->productbatch->enabled) && $objp->tobatch > 0) { $type = 'batch'; print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.$i.', \''.$type.'\')"'); } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 1565f0b313d..1f647309bda 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1064,10 +1064,10 @@ if (empty($reshook)) { $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); if (GETPOST('price_ht') != '' || GETPOST('multicurrency_subprice') != '') { - $up = price2num(GETPOST('price_ht')); + $up = price2num(GETPOST('price_ht'), '', 2); $price_base_type = 'HT'; } else { - $up = price2num(GETPOST('price_ttc')); + $up = price2num(GETPOST('price_ttc'), '', 2); $price_base_type = 'TTC'; } @@ -1163,17 +1163,17 @@ if (empty($reshook)) { $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { $idprod = 0; - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod = GETPOST('idprod', 'int'); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = ''; } $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); $remise_percent = price2num(GETPOST('remise_percent'.$predef), 2); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU'); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index b5e94449988..3c178f7c70d 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -178,3 +178,6 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account Canada CA-ENG-BASE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1); + +-- Description of chart of account Mexico SAT/24-2019 +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1); diff --git a/htdocs/install/mysql/data/llx_accounting_account_mx.sql b/htdocs/install/mysql/data/llx_accounting_account_mx.sql new file mode 100644 index 00000000000..000a81022c7 --- /dev/null +++ b/htdocs/install/mysql/data/llx_accounting_account_mx.sql @@ -0,0 +1,1085 @@ +-- + +-- Description of chart of account Mexico SAT/24-2019 +-- + +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526100000, 'SAT/24-2019', 'ACTIVO', '100', 0, 'Activo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526100010, 'SAT/24-2019', 'ACTIVO', '100.01', 526100000, 'Activo a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526100990, 'SAT/24-2019', 'ACTIVO', '100.99', 526100010, 'Efectivo y Equivalentes de Efectivo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526101000, 'SAT/24-2019', 'ACTIVO', '101', 526100990, 'Caja', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526101010, 'SAT/24-2019', 'ACTIVO', '101.01', 526101000, 'Caja y efectivo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526102000, 'SAT/24-2019', 'ACTIVO', '102', 526100990, 'Bancos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526102010, 'SAT/24-2019', 'ACTIVO', '102.01', 526102000, 'Bancos nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526102020, 'SAT/24-2019', 'ACTIVO', '102.02', 526102000, 'Bancos extranjeros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526103000, 'SAT/24-2019', 'ACTIVO', '103', 526100990, 'Inversiones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526103010, 'SAT/24-2019', 'ACTIVO', '103.01', 526103000, 'Inversiones temporales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526103020, 'SAT/24-2019', 'ACTIVO', '103.02', 526103000, 'Inversiones en fideicomisos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526103030, 'SAT/24-2019', 'ACTIVO', '103.03', 526103000, 'Otras inversiones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526104000, 'SAT/24-2019', 'ACTIVO', '104', 526100990, 'Otros instrumentos financieros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526104010, 'SAT/24-2019', 'ACTIVO', '104.01', 526104000, 'Otros instrumentos financieros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526105000, 'SAT/24-2019', 'ACTIVO', '105', 526100010, 'Clientes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526105010, 'SAT/24-2019', 'ACTIVO', '105.01', 526105000, 'Clientes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526105020, 'SAT/24-2019', 'ACTIVO', '105.02', 526105000, 'Clientes extranjeros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526105030, 'SAT/24-2019', 'ACTIVO', '105.03', 526105000, 'Clientes nacionales parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526105040, 'SAT/24-2019', 'ACTIVO', '105.04', 526105000, 'Clientes extranjeros parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106000, 'SAT/24-2019', 'ACTIVO', '106', 526100010, 'Cuentas y documentos por cobrar a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106010, 'SAT/24-2019', 'ACTIVO', '106.01', 526106000, 'Cuentas y documentos por cobrar a corto plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106020, 'SAT/24-2019', 'ACTIVO', '106.02', 526106000, 'Cuentas y documentos por cobrar a corto plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106030, 'SAT/24-2019', 'ACTIVO', '106.03', 526106000, 'Cuentas y documentos por cobrar a corto plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106040, 'SAT/24-2019', 'ACTIVO', '106.04', 526106000, 'Cuentas y documentos por cobrar a corto plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106050, 'SAT/24-2019', 'ACTIVO', '106.05', 526106000, 'Intereses por cobrar a corto plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106060, 'SAT/24-2019', 'ACTIVO', '106.06', 526106000, 'Intereses por cobrar a corto plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106070, 'SAT/24-2019', 'ACTIVO', '106.07', 526106000, 'Intereses por cobrar a corto plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106080, 'SAT/24-2019', 'ACTIVO', '106.08', 526106000, 'Intereses por cobrar a corto plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106090, 'SAT/24-2019', 'ACTIVO', '106.09', 526106000, 'Otras cuentas y documentos por cobrar a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526106100, 'SAT/24-2019', 'ACTIVO', '106.1', 526106000, 'Otras cuentas y documentos por cobrar a corto plazo parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526107000, 'SAT/24-2019', 'ACTIVO', '107', 526100010, 'Deudores diversos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526107010, 'SAT/24-2019', 'ACTIVO', '107.01', 526107000, 'Funcionarios y empleados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526107020, 'SAT/24-2019', 'ACTIVO', '107.02', 526107000, 'Socios y accionistas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526107030, 'SAT/24-2019', 'ACTIVO', '107.03', 526107000, 'Partes relacionadas nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526107040, 'SAT/24-2019', 'ACTIVO', '107.04', 526107000, 'Partes relacionadas extranjeros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526107050, 'SAT/24-2019', 'ACTIVO', '107.05', 526107000, 'Otros deudores diversos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526108000, 'SAT/24-2019', 'ACTIVO', '108', 526100010, 'Estimación de cuentas incobrables', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526108010, 'SAT/24-2019', 'ACTIVO', '108.01', 526108000, 'Estimación de cuentas incobrables nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526108020, 'SAT/24-2019', 'ACTIVO', '108.02', 526108000, 'Estimación de cuentas incobrables extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526108030, 'SAT/24-2019', 'ACTIVO', '108.03', 526108000, 'Estimación de cuentas incobrables nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526108040, 'SAT/24-2019', 'ACTIVO', '108.04', 526108000, 'Estimación de cuentas incobrables extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109000, 'SAT/24-2019', 'ACTIVO', '109', 526100990, 'Pagos anticipados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109010, 'SAT/24-2019', 'ACTIVO', '109.01', 526109000, 'Seguros y fianzas pagados por anticipado nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109020, 'SAT/24-2019', 'ACTIVO', '109.02', 526109000, 'Seguros y fianzas pagados por anticipado extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109030, 'SAT/24-2019', 'ACTIVO', '109.03', 526109000, 'Seguros y fianzas pagados por anticipado nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109040, 'SAT/24-2019', 'ACTIVO', '109.04', 526109000, 'Seguros y fianzas pagados por anticipado extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109050, 'SAT/24-2019', 'ACTIVO', '109.05', 526109000, 'Rentas pagados por anticipado nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109060, 'SAT/24-2019', 'ACTIVO', '109.06', 526109000, 'Rentas pagados por anticipado extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109070, 'SAT/24-2019', 'ACTIVO', '109.07', 526109000, 'Rentas pagados por anticipado nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109080, 'SAT/24-2019', 'ACTIVO', '109.08', 526109000, 'Rentas pagados por anticipado extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109090, 'SAT/24-2019', 'ACTIVO', '109.09', 526109000, 'Intereses pagados por anticipado nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109100, 'SAT/24-2019', 'ACTIVO', '109.1', 526109000, 'Intereses pagados por anticipado extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109110, 'SAT/24-2019', 'ACTIVO', '109.11', 526109000, 'Intereses pagados por anticipado nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109120, 'SAT/24-2019', 'ACTIVO', '109.12', 526109000, 'Intereses pagados por anticipado extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109130, 'SAT/24-2019', 'ACTIVO', '109.13', 526109000, 'Factoraje financiero pagados por anticipado nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109140, 'SAT/24-2019', 'ACTIVO', '109.14', 526109000, 'Factoraje financiero pagados por anticipado extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109150, 'SAT/24-2019', 'ACTIVO', '109.15', 526109000, 'Factoraje financiero pagados por anticipado nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109160, 'SAT/24-2019', 'ACTIVO', '109.16', 526109000, 'Factoraje financiero pagados por anticipado extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109170, 'SAT/24-2019', 'ACTIVO', '109.17', 526109000, 'Arrendamiento financiero pagados por anticipado nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109180, 'SAT/24-2019', 'ACTIVO', '109.18', 526109000, 'Arrendamiento financiero pagados por anticipado extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109190, 'SAT/24-2019', 'ACTIVO', '109.19', 526109000, 'Arrendamiento financiero pagados por anticipado nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109200, 'SAT/24-2019', 'ACTIVO', '109.2', 526109000, 'Arrendamiento financiero pagados por anticipado extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109210, 'SAT/24-2019', 'ACTIVO', '109.21', 526109000, 'Pérdida por deterioro de pagos anticipados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109220, 'SAT/24-2019', 'ACTIVO', '109.22', 526109000, 'Derechos fiduciarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526109230, 'SAT/24-2019', 'ACTIVO', '109.23', 526109000, 'Otros pagos anticipados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526110000, 'SAT/24-2019', 'ACTIVO', '110', 526100010, 'Subsidio al empleo por aplicar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526110010, 'SAT/24-2019', 'ACTIVO', '110.01', 526110000, 'Subsidio al empleo por aplicar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526111000, 'SAT/24-2019', 'ACTIVO', '111', 526100010, 'Crédito al diésel por acreditar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526111010, 'SAT/24-2019', 'ACTIVO', '111.01', 526111000, 'Crédito al diésel por acreditar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526112000, 'SAT/24-2019', 'ACTIVO', '112', 526100010, 'Otros estímulos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526112010, 'SAT/24-2019', 'ACTIVO', '112.01', 526112000, 'Otros estímulos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526113000, 'SAT/24-2019', 'ACTIVO', '113', 526100010, 'Impuestos a favor', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526113010, 'SAT/24-2019', 'ACTIVO', '113.01', 526113000, 'IVA a favor', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526113020, 'SAT/24-2019', 'ACTIVO', '113.02', 526113000, 'ISR a favor', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526113030, 'SAT/24-2019', 'ACTIVO', '113.03', 526113000, 'IETU a favor', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526113040, 'SAT/24-2019', 'ACTIVO', '113.04', 526113000, 'IDE a favor', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526113050, 'SAT/24-2019', 'ACTIVO', '113.05', 526113000, 'IA a favor', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526113060, 'SAT/24-2019', 'ACTIVO', '113.06', 526113000, 'Subsidio al empleo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526113070, 'SAT/24-2019', 'ACTIVO', '113.07', 526113000, 'Pago de lo indebido', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526113080, 'SAT/24-2019', 'ACTIVO', '113.08', 526113000, 'Otros impuestos a favor', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526114000, 'SAT/24-2019', 'ACTIVO', '114', 526100010, 'Pagos provisionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526114010, 'SAT/24-2019', 'ACTIVO', '114.01', 526114000, 'Pagos provisionales de ISR', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526115000, 'SAT/24-2019', 'ACTIVO', '115', 526100010, 'Inventario', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526115010, 'SAT/24-2019', 'ACTIVO', '115.01', 526115000, 'Inventario', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526115020, 'SAT/24-2019', 'ACTIVO', '115.02', 526115000, 'Materia prima y materiales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526115030, 'SAT/24-2019', 'ACTIVO', '115.03', 526115000, 'Producción en proceso', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526115040, 'SAT/24-2019', 'ACTIVO', '115.04', 526115000, 'Productos terminados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526115050, 'SAT/24-2019', 'ACTIVO', '115.05', 526115000, 'Mercancías en tránsito', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526115060, 'SAT/24-2019', 'ACTIVO', '115.06', 526115000, 'Mercancías en poder de terceros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526115070, 'SAT/24-2019', 'ACTIVO', '115.07', 526115000, 'Otros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526116000, 'SAT/24-2019', 'ACTIVO', '116', 526100010, 'Estimación de inventarios obsoletos y de lento movimiento', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526116010, 'SAT/24-2019', 'ACTIVO', '116.01', 526116000, 'Estimación de inventarios obsoletos y de lento movimiento', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526117000, 'SAT/24-2019', 'ACTIVO', '117', 526100010, 'Obras en proceso de inmuebles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526117010, 'SAT/24-2019', 'ACTIVO', '117.01', 526117000, 'Obras en proceso de inmuebles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526118000, 'SAT/24-2019', 'ACTIVO', '118', 526100010, 'Impuestos acreditables pagados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526118010, 'SAT/24-2019', 'ACTIVO', '118.01', 526118000, 'IVA acreditable pagado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526118020, 'SAT/24-2019', 'ACTIVO', '118.02', 526118000, 'IVA acreditable de importación pagado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526118030, 'SAT/24-2019', 'ACTIVO', '118.03', 526118000, 'IEPS acreditable pagado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526118040, 'SAT/24-2019', 'ACTIVO', '118.04', 526118000, 'IEPS pagado en importación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526119000, 'SAT/24-2019', 'ACTIVO', '119', 526100010, 'Impuestos acreditables por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526119010, 'SAT/24-2019', 'ACTIVO', '119.01', 526119000, 'IVA pendiente de pago', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526119020, 'SAT/24-2019', 'ACTIVO', '119.02', 526119000, 'IVA de importación pendiente de pago', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526119030, 'SAT/24-2019', 'ACTIVO', '119.03', 526119000, 'IEPS pendiente de pago', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526119040, 'SAT/24-2019', 'ACTIVO', '119.04', 526119000, 'IEPS pendiente de pago en importación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526120000, 'SAT/24-2019', 'ACTIVO', '120', 526100010, 'Anticipo a proveedores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526120010, 'SAT/24-2019', 'ACTIVO', '120.01', 526120000, 'Anticipo a proveedores nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526120020, 'SAT/24-2019', 'ACTIVO', '120.02', 526120000, 'Anticipo a proveedores extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526120030, 'SAT/24-2019', 'ACTIVO', '120.03', 526120000, 'Anticipo a proveedores nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526120040, 'SAT/24-2019', 'ACTIVO', '120.04', 526120000, 'Anticipo a proveedores extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526121000, 'SAT/24-2019', 'ACTIVO', '121', 526100010, 'Otros activos a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526121010, 'SAT/24-2019', 'ACTIVO', '121.01', 526121000, 'Otros activos a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526100020, 'SAT/24-2019', 'ACTIVO', '100.02', 526100000, 'Activo a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526151000, 'SAT/24-2019', 'ACTIVO', '151', 526100020, 'Terrenos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526151010, 'SAT/24-2019', 'ACTIVO', '151.01', 526151000, 'Terrenos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526152600, 'SAT/24-2019', 'ACTIVO', '152', 526100020, 'Edificios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526152610, 'SAT/24-2019', 'ACTIVO', '152.01', 526152600, 'Edificios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526153000, 'SAT/24-2019', 'ACTIVO', '153', 526100020, 'Maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526153010, 'SAT/24-2019', 'ACTIVO', '153.01', 526153000, 'Maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526154000, 'SAT/24-2019', 'ACTIVO', '154', 526100020, 'Automóviles, autobuses, camiones de carga, tractocamiones, montacargas y remolques', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526154010, 'SAT/24-2019', 'ACTIVO', '154.01', 526154000, 'Automóviles, autobuses, camiones de carga, tractocamiones, montacargas y remolques', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526155000, 'SAT/24-2019', 'ACTIVO', '155', 526100020, 'Mobiliario y equipo de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526155010, 'SAT/24-2019', 'ACTIVO', '155.01', 526155000, 'Mobiliario y equipo de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526156000, 'SAT/24-2019', 'ACTIVO', '156', 526100020, 'Equipo de cómputo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526156010, 'SAT/24-2019', 'ACTIVO', '156.01', 526156000, 'Equipo de cómputo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526157000, 'SAT/24-2019', 'ACTIVO', '157', 526100020, 'Equipo de comunicación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526157010, 'SAT/24-2019', 'ACTIVO', '157.01', 526157000, 'Equipo de comunicación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526158000, 'SAT/24-2019', 'ACTIVO', '158', 526100020, 'Activos biológicos, vegetales y semovientes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526158010, 'SAT/24-2019', 'ACTIVO', '158.01', 526158000, 'Activos biológicos, vegetales y semovientes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526159000, 'SAT/24-2019', 'ACTIVO', '159', 526100020, 'Obras en proceso de activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526159010, 'SAT/24-2019', 'ACTIVO', '159.01', 526159000, 'Obras en proceso de activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526160000, 'SAT/24-2019', 'ACTIVO', '160', 526100020, 'Otros activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526160010, 'SAT/24-2019', 'ACTIVO', '160.01', 526160000, 'Otros activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526161000, 'SAT/24-2019', 'ACTIVO', '161', 526100020, 'Ferrocarriles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526161010, 'SAT/24-2019', 'ACTIVO', '161.01', 526161000, 'Ferrocarriles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526162000, 'SAT/24-2019', 'ACTIVO', '162', 526100020, 'Embarcaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526162010, 'SAT/24-2019', 'ACTIVO', '162.01', 526162000, 'Embarcaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526163000, 'SAT/24-2019', 'ACTIVO', '163', 526100020, 'Aviones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526163010, 'SAT/24-2019', 'ACTIVO', '163.01', 526163000, 'Aviones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526164000, 'SAT/24-2019', 'ACTIVO', '164', 526100020, 'Troqueles, moldes, matrices y herramental', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526164010, 'SAT/24-2019', 'ACTIVO', '164.01', 526164000, 'Troqueles, moldes, matrices y herramental', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526165000, 'SAT/24-2019', 'ACTIVO', '165', 526100020, 'Equipo de comunicaciones telefónicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526165010, 'SAT/24-2019', 'ACTIVO', '165.01', 526165000, 'Equipo de comunicaciones telefónicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526166000, 'SAT/24-2019', 'ACTIVO', '166', 526100020, 'Equipo de comunicación satelital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526166010, 'SAT/24-2019', 'ACTIVO', '166.01', 526166000, 'Equipo de comunicación satelital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526167000, 'SAT/24-2019', 'ACTIVO', '167', 526100020, 'Equipo de adaptaciones para personas con capacidades diferentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526167010, 'SAT/24-2019', 'ACTIVO', '167.01', 526167000, 'Equipo de adaptaciones para personas con capacidades diferentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526168000, 'SAT/24-2019', 'ACTIVO', '168', 526100020, 'Maquinaria y equipo de generación de energía de fuentes renovables o de sistemas de cogeneración de electricidad eficiente', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526168010, 'SAT/24-2019', 'ACTIVO', '168.01', 526168000, 'Maquinaria y equipo de generación de energía de fuentes renovables o de sistemas de cogeneración de electricidad eficiente', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526169000, 'SAT/24-2019', 'ACTIVO', '169', 526100020, 'Otra maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526169010, 'SAT/24-2019', 'ACTIVO', '169.01', 526169000, 'Otra maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526170000, 'SAT/24-2019', 'ACTIVO', '170', 526100020, 'Adaptaciones y mejoras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526170010, 'SAT/24-2019', 'ACTIVO', '170.01', 526170000, 'Adaptaciones y mejoras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171000, 'SAT/24-2019', 'ACTIVO', '171', 526100020, 'Depreciación acumulada de activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171010, 'SAT/24-2019', 'ACTIVO', '171.01', 526171000, 'Depreciación acumulada de edificios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171020, 'SAT/24-2019', 'ACTIVO', '171.02', 526171000, 'Depreciación acumulada de maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171030, 'SAT/24-2019', 'ACTIVO', '171.03', 526171000, 'Depreciación acumulada de automóviles, autobuses, camiones de carga, tractocamiones, montacargas y remolques', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171040, 'SAT/24-2019', 'ACTIVO', '171.04', 526171000, 'Depreciación acumulada de mobiliario y equipo de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171050, 'SAT/24-2019', 'ACTIVO', '171.05', 526171000, 'Depreciación acumulada de equipo de cómputo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171060, 'SAT/24-2019', 'ACTIVO', '171.06', 526171000, 'Depreciación acumulada de equipo de comunicación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171070, 'SAT/24-2019', 'ACTIVO', '171.07', 526171000, 'Depreciación acumulada de activos biológicos, vegetales y semovientes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171080, 'SAT/24-2019', 'ACTIVO', '171.08', 526171000, 'Depreciación acumulada de otros activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171090, 'SAT/24-2019', 'ACTIVO', '171.09', 526171000, 'Depreciación acumulada de ferrocarriles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171100, 'SAT/24-2019', 'ACTIVO', '171.1', 526171000, 'Depreciación acumulada de embarcaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171110, 'SAT/24-2019', 'ACTIVO', '171.11', 526171000, 'Depreciación acumulada de aviones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171120, 'SAT/24-2019', 'ACTIVO', '171.12', 526171000, 'Depreciación acumulada de troqueles, moldes, matrices y herramental', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171130, 'SAT/24-2019', 'ACTIVO', '171.13', 526171000, 'Depreciación acumulada de equipo de comunicaciones telefónicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171140, 'SAT/24-2019', 'ACTIVO', '171.14', 526171000, 'Depreciación acumulada de equipo de comunicación satelital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171150, 'SAT/24-2019', 'ACTIVO', '171.15', 526171000, 'Depreciación acumulada de equipo de adaptaciones para personas con capacidades diferentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171160, 'SAT/24-2019', 'ACTIVO', '171.16', 526171000, 'Depreciación acumulada de maquinaria y equipo de generación de energía de fuentes renovables o de sistemas de cogeneración de electricidad eficiente', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171170, 'SAT/24-2019', 'ACTIVO', '171.17', 526171000, 'Depreciación acumulada de adaptaciones y mejoras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526171180, 'SAT/24-2019', 'ACTIVO', '171.18', 526171000, 'Depreciación acumulada de otra maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172000, 'SAT/24-2019', 'ACTIVO', '172', 526100020, 'Pérdida por deterioro acumulado de activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172010, 'SAT/24-2019', 'ACTIVO', '172.01', 526172000, 'Pérdida por deterioro acumulado de edificios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172020, 'SAT/24-2019', 'ACTIVO', '172.02', 526172000, 'Pérdida por deterioro acumulado de maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172030, 'SAT/24-2019', 'ACTIVO', '172.03', 526172000, 'Pérdida por deterioro acumulado de automóviles, autobuses, camiones de carga, tractocamiones, montacargas y remolques', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172040, 'SAT/24-2019', 'ACTIVO', '172.04', 526172000, 'Pérdida por deterioro acumulado de mobiliario y equipo de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172050, 'SAT/24-2019', 'ACTIVO', '172.05', 526172000, 'Pérdida por deterioro acumulado de equipo de cómputo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172060, 'SAT/24-2019', 'ACTIVO', '172.06', 526172000, 'Pérdida por deterioro acumulado de equipo de comunicación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172070, 'SAT/24-2019', 'ACTIVO', '172.07', 526172000, 'Pérdida por deterioro acumulado de activos biológicos, vegetales y semovientes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172080, 'SAT/24-2019', 'ACTIVO', '172.08', 526172000, 'Pérdida por deterioro acumulado de otros activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172090, 'SAT/24-2019', 'ACTIVO', '172.09', 526172000, 'Pérdida por deterioro acumulado de ferrocarriles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172100, 'SAT/24-2019', 'ACTIVO', '172.1', 526172000, 'Pérdida por deterioro acumulado de embarcaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172110, 'SAT/24-2019', 'ACTIVO', '172.11', 526172000, 'Pérdida por deterioro acumulado de aviones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172120, 'SAT/24-2019', 'ACTIVO', '172.12', 526172000, 'Pérdida por deterioro acumulado de troqueles, moldes, matrices y herramental', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172130, 'SAT/24-2019', 'ACTIVO', '172.13', 526172000, 'Pérdida por deterioro acumulado de equipo de comunicaciones telefónicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172140, 'SAT/24-2019', 'ACTIVO', '172.14', 526172000, 'Pérdida por deterioro acumulado de equipo de comunicación satelital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172150, 'SAT/24-2019', 'ACTIVO', '172.15', 526172000, 'Pérdida por deterioro acumulado de equipo de adaptaciones para personas con capacidades diferentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172160, 'SAT/24-2019', 'ACTIVO', '172.16', 526172000, 'Pérdida por deterioro acumulado de maquinaria y equipo de generación de energía de fuentes renovables o de sistemas de cogeneración de electricidad eficiente', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172170, 'SAT/24-2019', 'ACTIVO', '172.17', 526172000, 'Pérdida por deterioro acumulado de adaptaciones y mejoras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526172180, 'SAT/24-2019', 'ACTIVO', '172.18', 526172000, 'Pérdida por deterioro acumulado de otra maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526173000, 'SAT/24-2019', 'ACTIVO', '173', 526100020, 'Gastos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526173010, 'SAT/24-2019', 'ACTIVO', '173.01', 526173000, 'Gastos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526174000, 'SAT/24-2019', 'ACTIVO', '174', 526100020, 'Gastos pre operativos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526174010, 'SAT/24-2019', 'ACTIVO', '174.01', 526174000, 'Gastos pre operativos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526175000, 'SAT/24-2019', 'ACTIVO', '175', 526100020, 'Regalías, asistencia técnica y otros gastos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526175010, 'SAT/24-2019', 'ACTIVO', '175.01', 526175000, 'Regalías, asistencia técnica y otros gastos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526176000, 'SAT/24-2019', 'ACTIVO', '176', 526100020, 'Activos intangibles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526176010, 'SAT/24-2019', 'ACTIVO', '176.01', 526176000, 'Activos intangibles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526177000, 'SAT/24-2019', 'ACTIVO', '177', 526100020, 'Gastos de organización', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526177010, 'SAT/24-2019', 'ACTIVO', '177.01', 526177000, 'Gastos de organización', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526178000, 'SAT/24-2019', 'ACTIVO', '178', 526100020, 'Investigación y desarrollo de mercado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526178010, 'SAT/24-2019', 'ACTIVO', '178.01', 526178000, 'Investigación y desarrollo de mercado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526179000, 'SAT/24-2019', 'ACTIVO', '179', 526100020, 'Marcas y patentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526179010, 'SAT/24-2019', 'ACTIVO', '179.01', 526179000, 'Marcas y patentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526180000, 'SAT/24-2019', 'ACTIVO', '180', 526100020, 'Crédito mercantil', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526180010, 'SAT/24-2019', 'ACTIVO', '180.01', 526180000, 'Crédito mercantil', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526181000, 'SAT/24-2019', 'ACTIVO', '181', 526100020, 'Gastos de instalación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526181010, 'SAT/24-2019', 'ACTIVO', '181.01', 526181000, 'Gastos de instalación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526182000, 'SAT/24-2019', 'ACTIVO', '182', 526100020, 'Otros activos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526182010, 'SAT/24-2019', 'ACTIVO', '182.01', 526182000, 'Otros activos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183000, 'SAT/24-2019', 'ACTIVO', '183', 526100020, 'Amortización acumulada de activos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183010, 'SAT/24-2019', 'ACTIVO', '183.01', 526183000, 'Amortización acumulada de gastos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183020, 'SAT/24-2019', 'ACTIVO', '183.02', 526183000, 'Amortización acumulada de gastos pre operativos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183030, 'SAT/24-2019', 'ACTIVO', '183.03', 526183000, 'Amortización acumulada de regalías, asistencia técnica y otros gastos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183040, 'SAT/24-2019', 'ACTIVO', '183.04', 526183000, 'Amortización acumulada de activos intangibles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183050, 'SAT/24-2019', 'ACTIVO', '183.05', 526183000, 'Amortización acumulada de gastos de organización', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183060, 'SAT/24-2019', 'ACTIVO', '183.06', 526183000, 'Amortización acumulada de investigación y desarrollo de mercado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183070, 'SAT/24-2019', 'ACTIVO', '183.07', 526183000, 'Amortización acumulada de marcas y patentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183080, 'SAT/24-2019', 'ACTIVO', '183.08', 526183000, 'Amortización acumulada de crédito mercantil', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183090, 'SAT/24-2019', 'ACTIVO', '183.09', 526183000, 'Amortización acumulada de gastos de instalación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526183100, 'SAT/24-2019', 'ACTIVO', '183.1', 526183000, 'Amortización acumulada de otros activos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526184000, 'SAT/24-2019', 'ACTIVO', '184', 526100020, 'Depósitos en garantía', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526184010, 'SAT/24-2019', 'ACTIVO', '184.01', 526184000, 'Depósitos de fianzas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526184020, 'SAT/24-2019', 'ACTIVO', '184.02', 526184000, 'Depósitos de arrendamiento de bienes inmuebles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526184030, 'SAT/24-2019', 'ACTIVO', '184.03', 526184000, 'Otros depósitos en garantía', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526185000, 'SAT/24-2019', 'ACTIVO', '185', 526100020, 'Impuestos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526185010, 'SAT/24-2019', 'ACTIVO', '185.01', 526185000, 'Impuestos diferidos ISR', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186000, 'SAT/24-2019', 'ACTIVO', '186', 526100020, 'Cuentas y documentos por cobrar a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186010, 'SAT/24-2019', 'ACTIVO', '186.01', 526186000, 'Cuentas y documentos por cobrar a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186020, 'SAT/24-2019', 'ACTIVO', '186.02', 526186000, 'Cuentas y documentos por cobrar a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186030, 'SAT/24-2019', 'ACTIVO', '186.03', 526186000, 'Cuentas y documentos por cobrar a largo plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186040, 'SAT/24-2019', 'ACTIVO', '186.04', 526186000, 'Cuentas y documentos por cobrar a largo plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186050, 'SAT/24-2019', 'ACTIVO', '186.05', 526186000, 'Intereses por cobrar a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186060, 'SAT/24-2019', 'ACTIVO', '186.06', 526186000, 'Intereses por cobrar a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186070, 'SAT/24-2019', 'ACTIVO', '186.07', 526186000, 'Intereses por cobrar a largo plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186080, 'SAT/24-2019', 'ACTIVO', '186.08', 526186000, 'Intereses por cobrar a largo plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186090, 'SAT/24-2019', 'ACTIVO', '186.09', 526186000, 'Otras cuentas y documentos por cobrar a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526186100, 'SAT/24-2019', 'ACTIVO', '186.1', 526186000, 'Otras cuentas y documentos por cobrar a largo plazo parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526187000, 'SAT/24-2019', 'ACTIVO', '187', 526100020, 'Participación de los trabajadores en las utilidades diferidas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526187010, 'SAT/24-2019', 'ACTIVO', '187.01', 526187000, 'Participación de los trabajadores en las utilidades diferidas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526188000, 'SAT/24-2019', 'ACTIVO', '188', 526100020, 'Inversiones permanentes en acciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526188010, 'SAT/24-2019', 'ACTIVO', '188.01', 526188000, 'Inversiones a largo plazo en subsidiarias', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526188020, 'SAT/24-2019', 'ACTIVO', '188.02', 526188000, 'Inversiones a largo plazo en asociadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526188030, 'SAT/24-2019', 'ACTIVO', '188.03', 526188000, 'Otras inversiones permanentes en acciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526189000, 'SAT/24-2019', 'ACTIVO', '189', 526100020, 'Estimación por deterioro de inversiones permanentes en acciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526189010, 'SAT/24-2019', 'ACTIVO', '189.01', 526189000, 'Estimación por deterioro de inversiones permanentes en acciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526190000, 'SAT/24-2019', 'ACTIVO', '190', 526100020, 'Otros instrumentos financieros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526190010, 'SAT/24-2019', 'ACTIVO', '190.01', 526190000, 'Otros instrumentos financieros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526191000, 'SAT/24-2019', 'ACTIVO', '191', 526100020, 'Otros activos a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526191010, 'SAT/24-2019', 'ACTIVO', '191.01', 526191000, 'Otros activos a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526200000, 'SAT/24-2019', 'PASIVO', '200', 0, 'Pasivo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526200010, 'SAT/24-2019', 'PASIVO', '200.01', 526200000, 'Pasivo a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526201000, 'SAT/24-2019', 'PASIVO', '201', 526200010, 'Proveedores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526201010, 'SAT/24-2019', 'PASIVO', '201.01', 526201000, 'Proveedores nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526201020, 'SAT/24-2019', 'PASIVO', '201.02', 526201000, 'Proveedores extranjeros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526201030, 'SAT/24-2019', 'PASIVO', '201.03', 526201000, 'Proveedores nacionales parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526201040, 'SAT/24-2019', 'PASIVO', '201.04', 526201000, 'Proveedores extranjeros parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202000, 'SAT/24-2019', 'PASIVO', '202', 526200010, 'Cuentas por pagar a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202010, 'SAT/24-2019', 'PASIVO', '202.01', 526202000, 'Documentos por pagar bancario y financiero nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202020, 'SAT/24-2019', 'PASIVO', '202.02', 526202000, 'Documentos por pagar bancario y financiero extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202030, 'SAT/24-2019', 'PASIVO', '202.03', 526202000, 'Documentos y cuentas por pagar a corto plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202040, 'SAT/24-2019', 'PASIVO', '202.04', 526202000, 'Documentos y cuentas por pagar a corto plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202050, 'SAT/24-2019', 'PASIVO', '202.05', 526202000, 'Documentos y cuentas por pagar a corto plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202060, 'SAT/24-2019', 'PASIVO', '202.06', 526202000, 'Documentos y cuentas por pagar a corto plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202070, 'SAT/24-2019', 'PASIVO', '202.07', 526202000, 'Intereses por pagar a corto plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202080, 'SAT/24-2019', 'PASIVO', '202.08', 526202000, 'Intereses por pagar a corto plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202090, 'SAT/24-2019', 'PASIVO', '202.09', 526202000, 'Intereses por pagar a corto plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202100, 'SAT/24-2019', 'PASIVO', '202.1', 526202000, 'Intereses por pagar a corto plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202110, 'SAT/24-2019', 'PASIVO', '202.11', 526202000, 'Dividendo por pagar nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526202120, 'SAT/24-2019', 'PASIVO', '202.12', 526202000, 'Dividendo por pagar extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203000, 'SAT/24-2019', 'PASIVO', '203', 526200010, 'Cobros anticipados a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203010, 'SAT/24-2019', 'PASIVO', '203.01', 526203000, 'Rentas cobradas por anticipado a corto plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203020, 'SAT/24-2019', 'PASIVO', '203.02', 526203000, 'Rentas cobradas por anticipado a corto plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203030, 'SAT/24-2019', 'PASIVO', '203.03', 526203000, 'Rentas cobradas por anticipado a corto plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203040, 'SAT/24-2019', 'PASIVO', '203.04', 526203000, 'Rentas cobradas por anticipado a corto plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203050, 'SAT/24-2019', 'PASIVO', '203.05', 526203000, 'Intereses cobrados por anticipado a corto plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203060, 'SAT/24-2019', 'PASIVO', '203.06', 526203000, 'Intereses cobrados por anticipado a corto plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203070, 'SAT/24-2019', 'PASIVO', '203.07', 526203000, 'Intereses cobrados por anticipado a corto plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203080, 'SAT/24-2019', 'PASIVO', '203.08', 526203000, 'Intereses cobrados por anticipado a corto plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203090, 'SAT/24-2019', 'PASIVO', '203.09', 526203000, 'Factoraje financiero cobrados por anticipado a corto plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203100, 'SAT/24-2019', 'PASIVO', '203.1', 526203000, 'Factoraje financiero cobrados por anticipado a corto plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203110, 'SAT/24-2019', 'PASIVO', '203.11', 526203000, 'Factoraje financiero cobrados por anticipado a corto plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203120, 'SAT/24-2019', 'PASIVO', '203.12', 526203000, 'Factoraje financiero cobrados por anticipado a corto plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203130, 'SAT/24-2019', 'PASIVO', '203.13', 526203000, 'Arrendamiento financiero cobrados por anticipado a corto plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203140, 'SAT/24-2019', 'PASIVO', '203.14', 526203000, 'Arrendamiento financiero cobrados por anticipado a corto plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203150, 'SAT/24-2019', 'PASIVO', '203.15', 526203000, 'Arrendamiento financiero cobrados por anticipado a corto plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203160, 'SAT/24-2019', 'PASIVO', '203.16', 526203000, 'Arrendamiento financiero cobrados por anticipado a corto plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203170, 'SAT/24-2019', 'PASIVO', '203.17', 526203000, 'Derechos fiduciarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526203180, 'SAT/24-2019', 'PASIVO', '203.18', 526203000, 'Otros cobros anticipados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526204000, 'SAT/24-2019', 'PASIVO', '204', 526200010, 'Instrumentos financieros a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526204010, 'SAT/24-2019', 'PASIVO', '204.01', 526204000, 'Instrumentos financieros a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526205000, 'SAT/24-2019', 'PASIVO', '205', 526200010, 'Acreedores diversos a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526205010, 'SAT/24-2019', 'PASIVO', '205.01', 526205000, 'Socios, accionistas o representante legal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526205020, 'SAT/24-2019', 'PASIVO', '205.02', 526205000, 'Acreedores diversos a corto plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526205030, 'SAT/24-2019', 'PASIVO', '205.03', 526205000, 'Acreedores diversos a corto plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526205040, 'SAT/24-2019', 'PASIVO', '205.04', 526205000, 'Acreedores diversos a corto plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526205050, 'SAT/24-2019', 'PASIVO', '205.05', 526205000, 'Acreedores diversos a corto plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526205060, 'SAT/24-2019', 'PASIVO', '205.06', 526205000, 'Otros acreedores diversos a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526206000, 'SAT/24-2019', 'PASIVO', '206', 526200010, 'Anticipo de cliente', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526206010, 'SAT/24-2019', 'PASIVO', '206.01', 526206000, 'Anticipo de cliente nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526206020, 'SAT/24-2019', 'PASIVO', '206.02', 526206000, 'Anticipo de cliente extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526206030, 'SAT/24-2019', 'PASIVO', '206.03', 526206000, 'Anticipo de cliente nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526206040, 'SAT/24-2019', 'PASIVO', '206.04', 526206000, 'Anticipo de cliente extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526206050, 'SAT/24-2019', 'PASIVO', '206.05', 526206000, 'Otros anticipos de clientes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526207000, 'SAT/24-2019', 'PASIVO', '207', 526200010, 'Impuestos trasladados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526207010, 'SAT/24-2019', 'PASIVO', '207.01', 526207000, 'IVA trasladado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526207020, 'SAT/24-2019', 'PASIVO', '207.02', 526207000, 'IEPS trasladado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526208000, 'SAT/24-2019', 'PASIVO', '208', 526200010, 'Impuestos trasladados cobrados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526208010, 'SAT/24-2019', 'PASIVO', '208.01', 526208000, 'IVA trasladado cobrado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526208020, 'SAT/24-2019', 'PASIVO', '208.02', 526208000, 'IEPS trasladado cobrado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526209000, 'SAT/24-2019', 'PASIVO', '209', 526200010, 'Impuestos trasladados no cobrados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526209010, 'SAT/24-2019', 'PASIVO', '209.01', 526209000, 'IVA trasladado no cobrado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526209020, 'SAT/24-2019', 'PASIVO', '209.02', 526209000, 'IEPS trasladado no cobrado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526210000, 'SAT/24-2019', 'PASIVO', '210', 526200010, 'Provisión de sueldos y salarios por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526210010, 'SAT/24-2019', 'PASIVO', '210.01', 526210000, 'Provisión de sueldos y salarios por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526210020, 'SAT/24-2019', 'PASIVO', '210.02', 526210000, 'Provisión de vacaciones por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526210030, 'SAT/24-2019', 'PASIVO', '210.03', 526210000, 'Provisión de aguinaldo por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526210040, 'SAT/24-2019', 'PASIVO', '210.04', 526210000, 'Provisión de fondo de ahorro por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526210050, 'SAT/24-2019', 'PASIVO', '210.05', 526210000, 'Provisión de asimilados a salarios por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526210060, 'SAT/24-2019', 'PASIVO', '210.06', 526210000, 'Provisión de anticipos o remanentes por distribuir', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526210070, 'SAT/24-2019', 'PASIVO', '210.07', 526210000, 'Provisión de otros sueldos y salarios por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526211000, 'SAT/24-2019', 'PASIVO', '211', 526200010, 'Provisión de contribuciones de seguridad social por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526211010, 'SAT/24-2019', 'PASIVO', '211.01', 526211000, 'Provisión de IMSS patronal por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526211020, 'SAT/24-2019', 'PASIVO', '211.02', 526211000, 'Provisión de SAR por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526211030, 'SAT/24-2019', 'PASIVO', '211.03', 526211000, 'Provisión de infonavit por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526212000, 'SAT/24-2019', 'PASIVO', '212', 526200010, 'Provisión de impuesto estatal sobre nómina por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526212010, 'SAT/24-2019', 'PASIVO', '212.01', 526212000, 'Provisión de impuesto estatal sobre nómina por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526213000, 'SAT/24-2019', 'PASIVO', '213', 526200010, 'Impuestos y derechos por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526213010, 'SAT/24-2019', 'PASIVO', '213.01', 526213000, 'IVA por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526213020, 'SAT/24-2019', 'PASIVO', '213.02', 526213000, 'IEPS por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526213030, 'SAT/24-2019', 'PASIVO', '213.03', 526213000, 'ISR por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526213040, 'SAT/24-2019', 'PASIVO', '213.04', 526213000, 'Impuesto estatal sobre nómina por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526213050, 'SAT/24-2019', 'PASIVO', '213.05', 526213000, 'Impuesto estatal y municipal por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526213060, 'SAT/24-2019', 'PASIVO', '213.06', 526213000, 'Derechos por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526213070, 'SAT/24-2019', 'PASIVO', '213.07', 526213000, 'Otros impuestos por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526214000, 'SAT/24-2019', 'PASIVO', '214', 526200010, 'Dividendos por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526214010, 'SAT/24-2019', 'PASIVO', '214.01', 526214000, 'Dividendos por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526215000, 'SAT/24-2019', 'PASIVO', '215', 526200010, 'PTU por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526215010, 'SAT/24-2019', 'PASIVO', '215.01', 526215000, 'PTU por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526215020, 'SAT/24-2019', 'PASIVO', '215.02', 526215000, 'PTU por pagar de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526215030, 'SAT/24-2019', 'PASIVO', '215.03', 526215000, 'Provisión de PTU por pagar', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216000, 'SAT/24-2019', 'PASIVO', '216', 526200010, 'Impuestos retenidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216010, 'SAT/24-2019', 'PASIVO', '216.01', 526216000, 'Impuestos retenidos de ISR por sueldos y salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216020, 'SAT/24-2019', 'PASIVO', '216.02', 526216000, 'Impuestos retenidos de ISR por asimilados a salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216030, 'SAT/24-2019', 'PASIVO', '216.03', 526216000, 'Impuestos retenidos de ISR por arrendamiento', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216040, 'SAT/24-2019', 'PASIVO', '216.04', 526216000, 'Impuestos retenidos de ISR por servicios profesionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216050, 'SAT/24-2019', 'PASIVO', '216.05', 526216000, 'Impuestos retenidos de ISR por dividendos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216060, 'SAT/24-2019', 'PASIVO', '216.06', 526216000, 'Impuestos retenidos de ISR por intereses', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216070, 'SAT/24-2019', 'PASIVO', '216.07', 526216000, 'Impuestos retenidos de ISR por pagos al extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216080, 'SAT/24-2019', 'PASIVO', '216.08', 526216000, 'Impuestos retenidos de ISR por venta de acciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216090, 'SAT/24-2019', 'PASIVO', '216.09', 526216000, 'Impuestos retenidos de ISR por venta de partes sociales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216100, 'SAT/24-2019', 'PASIVO', '216.1', 526216000, 'Impuestos retenidos de IVA', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216110, 'SAT/24-2019', 'PASIVO', '216.11', 526216000, 'Retenciones de IMSS a los trabajadores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526216120, 'SAT/24-2019', 'PASIVO', '216.12', 526216000, 'Otras impuestos retenidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526217000, 'SAT/24-2019', 'PASIVO', '217', 526200010, 'Pagos realizados por cuenta de terceros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526217010, 'SAT/24-2019', 'PASIVO', '217.01', 526217000, 'Pagos realizados por cuenta de terceros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526218000, 'SAT/24-2019', 'PASIVO', '218', 526200010, 'Otros pasivos a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526218010, 'SAT/24-2019', 'PASIVO', '218.01', 526218000, 'Otros pasivos a corto plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526200020, 'SAT/24-2019', 'PASIVO', '200.02', 526200000, 'Pasivo a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526251000, 'SAT/24-2019', 'PASIVO', '251', 526200020, 'Acreedores diversos a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526251010, 'SAT/24-2019', 'PASIVO', '251.01', 526251000, 'Socios, accionistas o representante legal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526251020, 'SAT/24-2019', 'PASIVO', '251.02', 526251000, 'Acreedores diversos a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526251030, 'SAT/24-2019', 'PASIVO', '251.03', 526251000, 'Acreedores diversos a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526251040, 'SAT/24-2019', 'PASIVO', '251.04', 526251000, 'Acreedores diversos a largo plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526251050, 'SAT/24-2019', 'PASIVO', '251.05', 526251000, 'Acreedores diversos a largo plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526251060, 'SAT/24-2019', 'PASIVO', '251.06', 526251000, 'Otros acreedores diversos a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252600, 'SAT/24-2019', 'PASIVO', '252', 526200020, 'Cuentas por pagar a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252610, 'SAT/24-2019', 'PASIVO', '252.01', 526252600, 'Documentos bancarios y financieros por pagar a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252620, 'SAT/24-2019', 'PASIVO', '252.02', 526252600, 'Documentos bancarios y financieros por pagar a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252630, 'SAT/24-2019', 'PASIVO', '252.03', 526252600, 'Documentos y cuentas por pagar a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252640, 'SAT/24-2019', 'PASIVO', '252.04', 526252600, 'Documentos y cuentas por pagar a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252650, 'SAT/24-2019', 'PASIVO', '252.05', 526252600, 'Documentos y cuentas por pagar a largo plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252660, 'SAT/24-2019', 'PASIVO', '252.06', 526252600, 'Documentos y cuentas por pagar a largo plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252670, 'SAT/24-2019', 'PASIVO', '252.07', 526252600, 'Hipotecas por pagar a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252680, 'SAT/24-2019', 'PASIVO', '252.08', 526252600, 'Hipotecas por pagar a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252690, 'SAT/24-2019', 'PASIVO', '252.09', 526252600, 'Hipotecas por pagar a largo plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252100, 'SAT/24-2019', 'PASIVO', '252.1', 526252600, 'Hipotecas por pagar a largo plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252110, 'SAT/24-2019', 'PASIVO', '252.11', 526252600, 'Intereses por pagar a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252120, 'SAT/24-2019', 'PASIVO', '252.12', 526252600, 'Intereses por pagar a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252130, 'SAT/24-2019', 'PASIVO', '252.13', 526252600, 'Intereses por pagar a largo plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252140, 'SAT/24-2019', 'PASIVO', '252.14', 526252600, 'Intereses por pagar a largo plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252150, 'SAT/24-2019', 'PASIVO', '252.15', 526252600, 'Dividendos por pagar nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252160, 'SAT/24-2019', 'PASIVO', '252.16', 526252600, 'Dividendos por pagar extranjeros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526252170, 'SAT/24-2019', 'PASIVO', '252.17', 526252600, 'Otras cuentas y documentos por pagar a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253000, 'SAT/24-2019', 'PASIVO', '253', 526200020, 'Cobros anticipados a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253010, 'SAT/24-2019', 'PASIVO', '253.01', 526253000, 'Rentas cobradas por anticipado a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253020, 'SAT/24-2019', 'PASIVO', '253.02', 526253000, 'Rentas cobradas por anticipado a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253030, 'SAT/24-2019', 'PASIVO', '253.03', 526253000, 'Rentas cobradas por anticipado a largo plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253040, 'SAT/24-2019', 'PASIVO', '253.04', 526253000, 'Rentas cobradas por anticipado a largo plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253050, 'SAT/24-2019', 'PASIVO', '253.05', 526253000, 'Intereses cobrados por anticipado a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253060, 'SAT/24-2019', 'PASIVO', '253.06', 526253000, 'Intereses cobrados por anticipado a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253070, 'SAT/24-2019', 'PASIVO', '253.07', 526253000, 'Intereses cobrados por anticipado a largo plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253080, 'SAT/24-2019', 'PASIVO', '253.08', 526253000, 'Intereses cobrados por anticipado a largo plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253090, 'SAT/24-2019', 'PASIVO', '253.09', 526253000, 'Factoraje financiero cobrados por anticipado a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253100, 'SAT/24-2019', 'PASIVO', '253.1', 526253000, 'Factoraje financiero cobrados por anticipado a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253110, 'SAT/24-2019', 'PASIVO', '253.11', 526253000, 'Factoraje financiero cobrados por anticipado a largo plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253120, 'SAT/24-2019', 'PASIVO', '253.12', 526253000, 'Factoraje financiero cobrados por anticipado a largo plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253130, 'SAT/24-2019', 'PASIVO', '253.13', 526253000, 'Arrendamiento financiero cobrados por anticipado a largo plazo nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253140, 'SAT/24-2019', 'PASIVO', '253.14', 526253000, 'Arrendamiento financiero cobrados por anticipado a largo plazo extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253150, 'SAT/24-2019', 'PASIVO', '253.15', 526253000, 'Arrendamiento financiero cobrados por anticipado a largo plazo nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253160, 'SAT/24-2019', 'PASIVO', '253.16', 526253000, 'Arrendamiento financiero cobrados por anticipado a largo plazo extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253170, 'SAT/24-2019', 'PASIVO', '253.17', 526253000, 'Derechos fiduciarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526253180, 'SAT/24-2019', 'PASIVO', '253.18', 526253000, 'Otros cobros anticipados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526254000, 'SAT/24-2019', 'PASIVO', '254', 526200020, 'Instrumentos financieros a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526254010, 'SAT/24-2019', 'PASIVO', '254.01', 526254000, 'Instrumentos financieros a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526255000, 'SAT/24-2019', 'PASIVO', '255', 526200020, 'Pasivos por beneficios a los empleados a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526255010, 'SAT/24-2019', 'PASIVO', '255.01', 526255000, 'Pasivos por beneficios a los empleados a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526256000, 'SAT/24-2019', 'PASIVO', '256', 526200020, 'Otros pasivos a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526256010, 'SAT/24-2019', 'PASIVO', '256.01', 526256000, 'Otros pasivos a largo plazo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526257000, 'SAT/24-2019', 'PASIVO', '257', 526200020, 'Participación de los trabajadores en las utilidades diferida', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526257010, 'SAT/24-2019', 'PASIVO', '257.01', 526257000, 'Participación de los trabajadores en las utilidades diferida', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526258000, 'SAT/24-2019', 'PASIVO', '258', 526200020, 'Obligaciones contraídas de fideicomisos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526258010, 'SAT/24-2019', 'PASIVO', '258.01', 526258000, 'Obligaciones contraídas de fideicomisos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526259000, 'SAT/24-2019', 'PASIVO', '259', 526200020, 'Impuestos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526259010, 'SAT/24-2019', 'PASIVO', '259.01', 526259000, 'ISR diferido', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526259020, 'SAT/24-2019', 'PASIVO', '259.02', 526259000, 'ISR por dividendo diferido', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526259030, 'SAT/24-2019', 'PASIVO', '259.03', 526259000, 'Otros impuestos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526260000, 'SAT/24-2019', 'PASIVO', '260', 526200020, 'Pasivos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526260010, 'SAT/24-2019', 'PASIVO', '260.01', 526260000, 'Pasivos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526300000, 'SAT/24-2019', 'CAPITAL', '300', 0, 'Capital contable', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526301000, 'SAT/24-2019', 'CAPITAL', '301', 526300000, 'Capital social', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526301010, 'SAT/24-2019', 'CAPITAL', '301.01', 526301000, 'Capital fijo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526301020, 'SAT/24-2019', 'CAPITAL', '301.02', 526301000, 'Capital variable', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526301030, 'SAT/24-2019', 'CAPITAL', '301.03', 526301000, 'Aportaciones para futuros aumentos de capital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526301040, 'SAT/24-2019', 'CAPITAL', '301.04', 526301000, 'Prima en suscripción de acciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526301050, 'SAT/24-2019', 'CAPITAL', '301.05', 526301000, 'Prima en suscripción de partes sociales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526302000, 'SAT/24-2019', 'CAPITAL', '302', 526300000, 'Patrimonio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526302010, 'SAT/24-2019', 'CAPITAL', '302.01', 526302000, 'Patrimonio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526302020, 'SAT/24-2019', 'CAPITAL', '302.02', 526302000, 'Aportación patrimonial', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526302030, 'SAT/24-2019', 'CAPITAL', '302.03', 526302000, 'Déficit o remanente del ejercicio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526303000, 'SAT/24-2019', 'CAPITAL', '303', 526300000, 'Reserva legal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526303010, 'SAT/24-2019', 'CAPITAL', '303.01', 526303000, 'Reserva legal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526304000, 'SAT/24-2019', 'CAPITAL', '304', 526300000, 'Resultado de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526304010, 'SAT/24-2019', 'CAPITAL', '304.01', 526304000, 'Utilidad de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526304020, 'SAT/24-2019', 'CAPITAL', '304.02', 526304000, 'Pérdida de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526304030, 'SAT/24-2019', 'CAPITAL', '304.03', 526304000, 'Resultado integral de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526304040, 'SAT/24-2019', 'CAPITAL', '304.04', 526304000, 'Déficit o remanente de ejercicio anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526305000, 'SAT/24-2019', 'CAPITAL', '305', 526300000, 'Resultado del ejercicio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526305010, 'SAT/24-2019', 'CAPITAL', '305.01', 526305000, 'Utilidad del ejercicio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526305020, 'SAT/24-2019', 'CAPITAL', '305.02', 526305000, 'Pérdida del ejercicio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526305030, 'SAT/24-2019', 'CAPITAL', '305.03', 526305000, 'Resultado integral', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526306000, 'SAT/24-2019', 'CAPITAL', '306', 526300000, 'Otras cuentas de capital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526306010, 'SAT/24-2019', 'CAPITAL', '306.01', 526306000, 'Otras cuentas de capital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526400000, 'SAT/24-2019', 'INGRESOS', '400', 0, 'Ingresos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401000, 'SAT/24-2019', 'INGRESOS', '401', 526400000, 'Ingresos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401010, 'SAT/24-2019', 'INGRESOS', '401.01', 526401000, 'Ventas y/o servicios gravados a la tasa general', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401020, 'SAT/24-2019', 'INGRESOS', '401.02', 526401000, 'Ventas y/o servicios gravados a la tasa general de contado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401030, 'SAT/24-2019', 'INGRESOS', '401.03', 526401000, 'Ventas y/o servicios gravados a la tasa general a crédito', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401040, 'SAT/24-2019', 'INGRESOS', '401.04', 526401000, 'Ventas y/o servicios gravados realizados en zona fronteriza norte', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401050, 'SAT/24-2019', 'INGRESOS', '401.05', 526401000, 'Ventas y/o servicios gravados realizados en zona fronteriza norte de contado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401060, 'SAT/24-2019', 'INGRESOS', '401.06', 526401000, 'Ventas y/o servicios gravados realizados en zona fronteriza norte a crédito', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401070, 'SAT/24-2019', 'INGRESOS', '401.07', 526401000, 'Ventas y/o servicios gravados al 0%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401080, 'SAT/24-2019', 'INGRESOS', '401.08', 526401000, 'Ventas y/o servicios gravados al 0% de contado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401090, 'SAT/24-2019', 'INGRESOS', '401.09', 526401000, 'Ventas y/o servicios gravados al 0% a crédito', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401100, 'SAT/24-2019', 'INGRESOS', '401.1', 526401000, 'Ventas y/o servicios exentos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401110, 'SAT/24-2019', 'INGRESOS', '401.11', 526401000, 'Ventas y/o servicios exentos de contado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401120, 'SAT/24-2019', 'INGRESOS', '401.12', 526401000, 'Ventas y/o servicios exentos a crédito', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401130, 'SAT/24-2019', 'INGRESOS', '401.13', 526401000, 'Ventas y/o servicios gravados a la tasa general nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401140, 'SAT/24-2019', 'INGRESOS', '401.14', 526401000, 'Ventas y/o servicios gravados a la tasa general extranjeros partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401150, 'SAT/24-2019', 'INGRESOS', '401.15', 526401000, 'Ventas y/o servicios gravados al 0% nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401160, 'SAT/24-2019', 'INGRESOS', '401.16', 526401000, 'Ventas y/o servicios gravados al 0% extranjeros partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401170, 'SAT/24-2019', 'INGRESOS', '401.17', 526401000, 'Ventas y/o servicios exentos nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401180, 'SAT/24-2019', 'INGRESOS', '401.18', 526401000, 'Ventas y/o servicios exentos extranjeros partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401190, 'SAT/24-2019', 'INGRESOS', '401.19', 526401000, 'Ingresos por servicios administrativos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401200, 'SAT/24-2019', 'INGRESOS', '401.2', 526401000, 'Ingresos por servicios administrativos nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401210, 'SAT/24-2019', 'INGRESOS', '401.21', 526401000, 'Ingresos por servicios administrativos extranjeros partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401220, 'SAT/24-2019', 'INGRESOS', '401.22', 526401000, 'Ingresos por servicios profesionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401230, 'SAT/24-2019', 'INGRESOS', '401.23', 526401000, 'Ingresos por servicios profesionales nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401240, 'SAT/24-2019', 'INGRESOS', '401.24', 526401000, 'Ingresos por servicios profesionales extranjeros partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401250, 'SAT/24-2019', 'INGRESOS', '401.25', 526401000, 'Ingresos por arrendamiento', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401260, 'SAT/24-2019', 'INGRESOS', '401.26', 526401000, 'Ingresos por arrendamiento nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401270, 'SAT/24-2019', 'INGRESOS', '401.27', 526401000, 'Ingresos por arrendamiento extranjeros partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401280, 'SAT/24-2019', 'INGRESOS', '401.28', 526401000, 'Ingresos por exportación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401290, 'SAT/24-2019', 'INGRESOS', '401.29', 526401000, 'Ingresos por comisiones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401300, 'SAT/24-2019', 'INGRESOS', '401.3', 526401000, 'Ingresos por maquila', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401310, 'SAT/24-2019', 'INGRESOS', '401.31', 526401000, 'Ingresos por coordinados', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401320, 'SAT/24-2019', 'INGRESOS', '401.32', 526401000, 'Ingresos por regalías', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401330, 'SAT/24-2019', 'INGRESOS', '401.33', 526401000, 'Ingresos por asistencia técnica', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401340, 'SAT/24-2019', 'INGRESOS', '401.34', 526401000, 'Ingresos por donativos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401350, 'SAT/24-2019', 'INGRESOS', '401.35', 526401000, 'Ingresos por intereses (actividad propia)', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401360, 'SAT/24-2019', 'INGRESOS', '401.36', 526401000, 'Ingresos de copropiedad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401370, 'SAT/24-2019', 'INGRESOS', '401.37', 526401000, 'Ingresos por fideicomisos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401380, 'SAT/24-2019', 'INGRESOS', '401.38', 526401000, 'Ingresos por factoraje financiero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401390, 'SAT/24-2019', 'INGRESOS', '401.39', 526401000, 'Ingresos por arrendamiento financiero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401400, 'SAT/24-2019', 'INGRESOS', '401.4', 526401000, 'Ingresos de extranjeros con establecimiento en el país', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526401410, 'SAT/24-2019', 'INGRESOS', '401.41', 526401000, 'Otros ingresos propios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526402000, 'SAT/24-2019', 'INGRESOS', '402', 526400000, 'Devoluciones, descuentos o bonificaciones sobre ingresos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526402010, 'SAT/24-2019', 'INGRESOS', '402.01', 526402000, 'Devoluciones, descuentos o bonificaciones sobre ventas y/o servicios a la tasa general', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526402020, 'SAT/24-2019', 'INGRESOS', '402.02', 526402000, 'Devoluciones, descuentos o bonificaciones sobre ventas y/o servicios en zona fronteriza norte', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526402030, 'SAT/24-2019', 'INGRESOS', '402.03', 526402000, 'Devoluciones, descuentos o bonificaciones sobre ventas y/o servicios al 0%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526402040, 'SAT/24-2019', 'INGRESOS', '402.04', 526402000, 'Devoluciones, descuentos o bonificaciones sobre ventas y/o servicios exentos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526402050, 'SAT/24-2019', 'INGRESOS', '402.05', 526402000, 'Devoluciones, descuentos o bonificaciones de otros ingresos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526403000, 'SAT/24-2019', 'INGRESOS', '403', 526400000, 'Otros ingresos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526403010, 'SAT/24-2019', 'INGRESOS', '403.01', 526403000, 'Otros Ingresos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526403020, 'SAT/24-2019', 'INGRESOS', '403.02', 526403000, 'Otros ingresos nacionales parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526403030, 'SAT/24-2019', 'INGRESOS', '403.03', 526403000, 'Otros ingresos extranjeros parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526403040, 'SAT/24-2019', 'INGRESOS', '403.04', 526403000, 'Ingresos por operaciones discontinuas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526403050, 'SAT/24-2019', 'INGRESOS', '403.05', 526403000, 'Ingresos por condonación de adeudo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526500000, 'SAT/24-2019', 'COSTOS', '500', 0, 'Costos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526501000, 'SAT/24-2019', 'COSTOS', '501', 526500000, 'Costo de venta y/o servicio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526501010, 'SAT/24-2019', 'COSTOS', '501.01', 526501000, 'Costo de venta', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526501020, 'SAT/24-2019', 'COSTOS', '501.02', 526501000, 'Costo de servicios (Mano de obra)', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526501030, 'SAT/24-2019', 'COSTOS', '501.03', 526501000, 'Materia prima directa utilizada para la producción', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526501040, 'SAT/24-2019', 'COSTOS', '501.04', 526501000, 'Materia prima consumida en el proceso productivo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526501050, 'SAT/24-2019', 'COSTOS', '501.05', 526501000, 'Mano de obra directa consumida', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526501060, 'SAT/24-2019', 'COSTOS', '501.06', 526501000, 'Mano de obra directa', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526501070, 'SAT/24-2019', 'COSTOS', '501.07', 526501000, 'Cargos indirectos de producción', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526501080, 'SAT/24-2019', 'COSTOS', '501.08', 526501000, 'Otros conceptos de costo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526502000, 'SAT/24-2019', 'COSTOS', '502', 526500000, 'Compras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526502010, 'SAT/24-2019', 'COSTOS', '502.01', 526502000, 'Compras nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526502020, 'SAT/24-2019', 'COSTOS', '502.02', 526502000, 'Compras nacionales parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526502030, 'SAT/24-2019', 'COSTOS', '502.03', 526502000, 'Compras de Importación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526502040, 'SAT/24-2019', 'COSTOS', '502.04', 526502000, 'Compras de Importación partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526503000, 'SAT/24-2019', 'COSTOS', '503', 526500000, 'Devoluciones, descuentos o bonificaciones sobre compras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526503010, 'SAT/24-2019', 'COSTOS', '503.01', 526503000, 'Devoluciones, descuentos o bonificaciones sobre compras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504000, 'SAT/24-2019', 'COSTOS', '504', 526500000, 'Otras cuentas de costos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504010, 'SAT/24-2019', 'COSTOS', '504.01', 526504000, 'Gastos indirectos de fabricación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504020, 'SAT/24-2019', 'COSTOS', '504.02', 526504000, 'Gastos indirectos de fabricación de partes relacionadas nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504030, 'SAT/24-2019', 'COSTOS', '504.03', 526504000, 'Gastos indirectos de fabricación de partes relacionadas extranjeras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504040, 'SAT/24-2019', 'COSTOS', '504.04', 526504000, 'Otras cuentas de costos incurridos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504050, 'SAT/24-2019', 'COSTOS', '504.05', 526504000, 'Otras cuentas de costos incurridos con partes relacionadas nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504060, 'SAT/24-2019', 'COSTOS', '504.06', 526504000, 'Otras cuentas de costos incurridos con partes relacionadas extranjeras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504070, 'SAT/24-2019', 'COSTOS', '504.07', 526504000, 'Depreciación de edificios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504080, 'SAT/24-2019', 'COSTOS', '504.08', 526504000, 'Depreciación de maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504090, 'SAT/24-2019', 'COSTOS', '504.09', 526504000, 'Depreciación de automóviles, autobuses, camiones de carga, tractocamiones, montacargas y remolques', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504100, 'SAT/24-2019', 'COSTOS', '504.1', 526504000, 'Depreciación de mobiliario y equipo de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504110, 'SAT/24-2019', 'COSTOS', '504.11', 526504000, 'Depreciación de equipo de cómputo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504120, 'SAT/24-2019', 'COSTOS', '504.12', 526504000, 'Depreciación de equipo de comunicación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504130, 'SAT/24-2019', 'COSTOS', '504.13', 526504000, 'Depreciación de activos biológicos, vegetales y semovientes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504140, 'SAT/24-2019', 'COSTOS', '504.14', 526504000, 'Depreciación de otros activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504150, 'SAT/24-2019', 'COSTOS', '504.15', 526504000, 'Depreciación de ferrocarriles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504160, 'SAT/24-2019', 'COSTOS', '504.16', 526504000, 'Depreciación de embarcaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504170, 'SAT/24-2019', 'COSTOS', '504.17', 526504000, 'Depreciación de aviones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504180, 'SAT/24-2019', 'COSTOS', '504.18', 526504000, 'Depreciación de troqueles, moldes, matrices y herramental', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504190, 'SAT/24-2019', 'COSTOS', '504.19', 526504000, 'Depreciación de equipo de comunicaciones telefónicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504200, 'SAT/24-2019', 'COSTOS', '504.2', 526504000, 'Depreciación de equipo de comunicación satelital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504210, 'SAT/24-2019', 'COSTOS', '504.21', 526504000, 'Depreciación de equipo de adaptaciones para personas con capacidades diferentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504220, 'SAT/24-2019', 'COSTOS', '504.22', 526504000, 'Depreciación de maquinaria y equipo de generación de energía de fuentes renovables o de sistemas de cogeneración de electricidad eficiente', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504230, 'SAT/24-2019', 'COSTOS', '504.23', 526504000, 'Depreciación de adaptaciones y mejoras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504240, 'SAT/24-2019', 'COSTOS', '504.24', 526504000, 'Depreciación de otra maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526504250, 'SAT/24-2019', 'COSTOS', '504.25', 526504000, 'Otras cuentas de costos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526505000, 'SAT/24-2019', 'COSTOS', '505', 526500000, 'Costo de activo fijo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526505010, 'SAT/24-2019', 'COSTOS', '505.01', 526505000, 'Costo por venta de activo fijo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526505020, 'SAT/24-2019', 'COSTOS', '505.02', 526505000, 'Costo por baja de activo fijo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526600000, 'SAT/24-2019', 'GASTOS', '600', 0, 'Gastos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601000, 'SAT/24-2019', 'GASTOS', '601', 526600000, 'Gastos generales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601010, 'SAT/24-2019', 'GASTOS', '601.01', 526601000, 'Sueldos y salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601020, 'SAT/24-2019', 'GASTOS', '601.02', 526601000, 'Compensaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601030, 'SAT/24-2019', 'GASTOS', '601.03', 526601000, 'Tiempos extras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601040, 'SAT/24-2019', 'GASTOS', '601.04', 526601000, 'Premios de asistencia', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601050, 'SAT/24-2019', 'GASTOS', '601.05', 526601000, 'Premios de puntualidad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601060, 'SAT/24-2019', 'GASTOS', '601.06', 526601000, 'Vacaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601070, 'SAT/24-2019', 'GASTOS', '601.07', 526601000, 'Prima vacacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601080, 'SAT/24-2019', 'GASTOS', '601.08', 526601000, 'Prima dominical', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601090, 'SAT/24-2019', 'GASTOS', '601.09', 526601000, 'Días festivos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601100, 'SAT/24-2019', 'GASTOS', '601.1', 526601000, 'Gratificaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601110, 'SAT/24-2019', 'GASTOS', '601.11', 526601000, 'Primas de antigüedad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601120, 'SAT/24-2019', 'GASTOS', '601.12', 526601000, 'Aguinaldo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601130, 'SAT/24-2019', 'GASTOS', '601.13', 526601000, 'Indemnizaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601140, 'SAT/24-2019', 'GASTOS', '601.14', 526601000, 'Destajo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601150, 'SAT/24-2019', 'GASTOS', '601.15', 526601000, 'Despensa', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601160, 'SAT/24-2019', 'GASTOS', '601.16', 526601000, 'Transporte', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601170, 'SAT/24-2019', 'GASTOS', '601.17', 526601000, 'Servicio médico', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601180, 'SAT/24-2019', 'GASTOS', '601.18', 526601000, 'Ayuda en gastos funerarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601190, 'SAT/24-2019', 'GASTOS', '601.19', 526601000, 'Fondo de ahorro', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601200, 'SAT/24-2019', 'GASTOS', '601.2', 526601000, 'Cuotas sindicales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601210, 'SAT/24-2019', 'GASTOS', '601.21', 526601000, 'PTU', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601220, 'SAT/24-2019', 'GASTOS', '601.22', 526601000, 'Estímulo al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601230, 'SAT/24-2019', 'GASTOS', '601.23', 526601000, 'Previsión social', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601240, 'SAT/24-2019', 'GASTOS', '601.24', 526601000, 'Aportaciones para el plan de jubilación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601250, 'SAT/24-2019', 'GASTOS', '601.25', 526601000, 'Otras prestaciones al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601260, 'SAT/24-2019', 'GASTOS', '601.26', 526601000, 'Cuotas al IMSS', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601270, 'SAT/24-2019', 'GASTOS', '601.27', 526601000, 'Aportaciones al infonavit', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601280, 'SAT/24-2019', 'GASTOS', '601.28', 526601000, 'Aportaciones al SAR', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601290, 'SAT/24-2019', 'GASTOS', '601.29', 526601000, 'Impuesto estatal sobre nóminas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601300, 'SAT/24-2019', 'GASTOS', '601.3', 526601000, 'Otras aportaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601310, 'SAT/24-2019', 'GASTOS', '601.31', 526601000, 'Asimilados a salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601320, 'SAT/24-2019', 'GASTOS', '601.32', 526601000, 'Servicios administrativos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601330, 'SAT/24-2019', 'GASTOS', '601.33', 526601000, 'Servicios administrativos partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601340, 'SAT/24-2019', 'GASTOS', '601.34', 526601000, 'Honorarios a personas físicas residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601350, 'SAT/24-2019', 'GASTOS', '601.35', 526601000, 'Honorarios a personas físicas residentes nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601360, 'SAT/24-2019', 'GASTOS', '601.36', 526601000, 'Honorarios a personas físicas residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601370, 'SAT/24-2019', 'GASTOS', '601.37', 526601000, 'Honorarios a personas físicas residentes del extranjero partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601380, 'SAT/24-2019', 'GASTOS', '601.38', 526601000, 'Honorarios a personas morales residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601390, 'SAT/24-2019', 'GASTOS', '601.39', 526601000, 'Honorarios a personas morales residentes nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601400, 'SAT/24-2019', 'GASTOS', '601.4', 526601000, 'Honorarios a personas morales residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601410, 'SAT/24-2019', 'GASTOS', '601.41', 526601000, 'Honorarios a personas morales residentes del extranjero partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601420, 'SAT/24-2019', 'GASTOS', '601.42', 526601000, 'Honorarios aduanales personas físicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601430, 'SAT/24-2019', 'GASTOS', '601.43', 526601000, 'Honorarios aduanales personas morales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601440, 'SAT/24-2019', 'GASTOS', '601.44', 526601000, 'Honorarios al consejo de administración', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601450, 'SAT/24-2019', 'GASTOS', '601.45', 526601000, 'Arrendamiento a personas físicas residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601460, 'SAT/24-2019', 'GASTOS', '601.46', 526601000, 'Arrendamiento a personas morales residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601470, 'SAT/24-2019', 'GASTOS', '601.47', 526601000, 'Arrendamiento a residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601480, 'SAT/24-2019', 'GASTOS', '601.48', 526601000, 'Combustibles y lubricantes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601490, 'SAT/24-2019', 'GASTOS', '601.49', 526601000, 'Viáticos y gastos de viaje', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601500, 'SAT/24-2019', 'GASTOS', '601.5', 526601000, 'Teléfono, internet', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601510, 'SAT/24-2019', 'GASTOS', '601.51', 526601000, 'Agua', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601526, 'SAT/24-2019', 'GASTOS', '601.52', 526601000, 'Energía eléctrica', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601530, 'SAT/24-2019', 'GASTOS', '601.53', 526601000, 'Vigilancia y seguridad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601540, 'SAT/24-2019', 'GASTOS', '601.54', 526601000, 'Limpieza', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601550, 'SAT/24-2019', 'GASTOS', '601.55', 526601000, 'Papelería y artículos de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601560, 'SAT/24-2019', 'GASTOS', '601.56', 526601000, 'Mantenimiento y conservación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601570, 'SAT/24-2019', 'GASTOS', '601.57', 526601000, 'Seguros y fianzas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601580, 'SAT/24-2019', 'GASTOS', '601.58', 526601000, 'Otros impuestos y derechos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601590, 'SAT/24-2019', 'GASTOS', '601.59', 526601000, 'Recargos fiscales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601600, 'SAT/24-2019', 'GASTOS', '601.6', 526601000, 'Cuotas y suscripciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601610, 'SAT/24-2019', 'GASTOS', '601.61', 526601000, 'Propaganda y publicidad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601620, 'SAT/24-2019', 'GASTOS', '601.62', 526601000, 'Capacitación al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601630, 'SAT/24-2019', 'GASTOS', '601.63', 526601000, 'Donativos y ayudas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601640, 'SAT/24-2019', 'GASTOS', '601.64', 526601000, 'Asistencia técnica', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601650, 'SAT/24-2019', 'GASTOS', '601.65', 526601000, 'Regalías sujetas a otros porcentajes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601660, 'SAT/24-2019', 'GASTOS', '601.66', 526601000, 'Regalías sujetas al 5%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601670, 'SAT/24-2019', 'GASTOS', '601.67', 526601000, 'Regalías sujetas al 10%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601680, 'SAT/24-2019', 'GASTOS', '601.68', 526601000, 'Regalías sujetas al 15%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601690, 'SAT/24-2019', 'GASTOS', '601.69', 526601000, 'Regalías sujetas al 25%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601700, 'SAT/24-2019', 'GASTOS', '601.7', 526601000, 'Regalías sujetas al 30%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601710, 'SAT/24-2019', 'GASTOS', '601.71', 526601000, 'Regalías sin retención', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601720, 'SAT/24-2019', 'GASTOS', '601.72', 526601000, 'Fletes y acarreos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601730, 'SAT/24-2019', 'GASTOS', '601.73', 526601000, 'Gastos de importación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601740, 'SAT/24-2019', 'GASTOS', '601.74', 526601000, 'Comisiones sobre ventas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601750, 'SAT/24-2019', 'GASTOS', '601.75', 526601000, 'Comisiones por tarjetas de crédito', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601760, 'SAT/24-2019', 'GASTOS', '601.76', 526601000, 'Patentes y marcas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601770, 'SAT/24-2019', 'GASTOS', '601.77', 526601000, 'Uniformes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601780, 'SAT/24-2019', 'GASTOS', '601.78', 526601000, 'Prediales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601790, 'SAT/24-2019', 'GASTOS', '601.79', 526601000, 'Gastos generales de urbanización', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601800, 'SAT/24-2019', 'GASTOS', '601.8', 526601000, 'Gastos generales de construcción', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601810, 'SAT/24-2019', 'GASTOS', '601.81', 526601000, 'Fletes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601820, 'SAT/24-2019', 'GASTOS', '601.82', 526601000, 'Recolección de bienes del sector agropecuario y/o ganadero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601830, 'SAT/24-2019', 'GASTOS', '601.83', 526601000, 'Gastos no deducibles (sin requisitos fiscales)', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526601840, 'SAT/24-2019', 'GASTOS', '601.84', 526601000, 'Otros gastos generales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602000, 'SAT/24-2019', 'GASTOS', '602', 526600000, 'Gastos de venta', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602010, 'SAT/24-2019', 'GASTOS', '602.01', 526602000, 'Sueldos y salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602020, 'SAT/24-2019', 'GASTOS', '602.02', 526602000, 'Compensaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602030, 'SAT/24-2019', 'GASTOS', '602.03', 526602000, 'Tiempos extras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602040, 'SAT/24-2019', 'GASTOS', '602.04', 526602000, 'Premios de asistencia', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602050, 'SAT/24-2019', 'GASTOS', '602.05', 526602000, 'Premios de puntualidad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602060, 'SAT/24-2019', 'GASTOS', '602.06', 526602000, 'Vacaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602070, 'SAT/24-2019', 'GASTOS', '602.07', 526602000, 'Prima vacacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602080, 'SAT/24-2019', 'GASTOS', '602.08', 526602000, 'Prima dominical', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602090, 'SAT/24-2019', 'GASTOS', '602.09', 526602000, 'Días festivos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602100, 'SAT/24-2019', 'GASTOS', '602.1', 526602000, 'Gratificaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602110, 'SAT/24-2019', 'GASTOS', '602.11', 526602000, 'Primas de antigüedad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602120, 'SAT/24-2019', 'GASTOS', '602.12', 526602000, 'Aguinaldo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602130, 'SAT/24-2019', 'GASTOS', '602.13', 526602000, 'Indemnizaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602140, 'SAT/24-2019', 'GASTOS', '602.14', 526602000, 'Destajo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602150, 'SAT/24-2019', 'GASTOS', '602.15', 526602000, 'Despensa', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602160, 'SAT/24-2019', 'GASTOS', '602.16', 526602000, 'Transporte', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602170, 'SAT/24-2019', 'GASTOS', '602.17', 526602000, 'Servicio médico', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602180, 'SAT/24-2019', 'GASTOS', '602.18', 526602000, 'Ayuda en gastos funerarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602190, 'SAT/24-2019', 'GASTOS', '602.19', 526602000, 'Fondo de ahorro', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602200, 'SAT/24-2019', 'GASTOS', '602.2', 526602000, 'Cuotas sindicales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602210, 'SAT/24-2019', 'GASTOS', '602.21', 526602000, 'PTU', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602220, 'SAT/24-2019', 'GASTOS', '602.22', 526602000, 'Estímulo al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602230, 'SAT/24-2019', 'GASTOS', '602.23', 526602000, 'Previsión social', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602240, 'SAT/24-2019', 'GASTOS', '602.24', 526602000, 'Aportaciones para el plan de jubilación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602250, 'SAT/24-2019', 'GASTOS', '602.25', 526602000, 'Otras prestaciones al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602260, 'SAT/24-2019', 'GASTOS', '602.26', 526602000, 'Cuotas al IMSS', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602270, 'SAT/24-2019', 'GASTOS', '602.27', 526602000, 'Aportaciones al infonavit', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602280, 'SAT/24-2019', 'GASTOS', '602.28', 526602000, 'Aportaciones al SAR', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602290, 'SAT/24-2019', 'GASTOS', '602.29', 526602000, 'Impuesto estatal sobre nóminas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602300, 'SAT/24-2019', 'GASTOS', '602.3', 526602000, 'Otras aportaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602310, 'SAT/24-2019', 'GASTOS', '602.31', 526602000, 'Asimilados a salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602320, 'SAT/24-2019', 'GASTOS', '602.32', 526602000, 'Servicios administrativos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602330, 'SAT/24-2019', 'GASTOS', '602.33', 526602000, 'Servicios administrativos partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602340, 'SAT/24-2019', 'GASTOS', '602.34', 526602000, 'Honorarios a personas físicas residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602350, 'SAT/24-2019', 'GASTOS', '602.35', 526602000, 'Honorarios a personas físicas residentes nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602360, 'SAT/24-2019', 'GASTOS', '602.36', 526602000, 'Honorarios a personas físicas residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602370, 'SAT/24-2019', 'GASTOS', '602.37', 526602000, 'Honorarios a personas físicas residentes del extranjero partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602380, 'SAT/24-2019', 'GASTOS', '602.38', 526602000, 'Honorarios a personas morales residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602390, 'SAT/24-2019', 'GASTOS', '602.39', 526602000, 'Honorarios a personas morales residentes nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602400, 'SAT/24-2019', 'GASTOS', '602.4', 526602000, 'Honorarios a personas morales residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602410, 'SAT/24-2019', 'GASTOS', '602.41', 526602000, 'Honorarios a personas morales residentes del extranjero partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602420, 'SAT/24-2019', 'GASTOS', '602.42', 526602000, 'Honorarios aduanales personas físicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602430, 'SAT/24-2019', 'GASTOS', '602.43', 526602000, 'Honorarios aduanales personas morales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602440, 'SAT/24-2019', 'GASTOS', '602.44', 526602000, 'Honorarios al consejo de administración', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602450, 'SAT/24-2019', 'GASTOS', '602.45', 526602000, 'Arrendamiento a personas físicas residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602460, 'SAT/24-2019', 'GASTOS', '602.46', 526602000, 'Arrendamiento a personas morales residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602470, 'SAT/24-2019', 'GASTOS', '602.47', 526602000, 'Arrendamiento a residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602480, 'SAT/24-2019', 'GASTOS', '602.48', 526602000, 'Combustibles y lubricantes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602490, 'SAT/24-2019', 'GASTOS', '602.49', 526602000, 'Viáticos y gastos de viaje', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602500, 'SAT/24-2019', 'GASTOS', '602.5', 526602000, 'Teléfono, internet', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602510, 'SAT/24-2019', 'GASTOS', '602.51', 526602000, 'Agua', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602526, 'SAT/24-2019', 'GASTOS', '602.52', 526602000, 'Energía eléctrica', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602530, 'SAT/24-2019', 'GASTOS', '602.53', 526602000, 'Vigilancia y seguridad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602540, 'SAT/24-2019', 'GASTOS', '602.54', 526602000, 'Limpieza', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602550, 'SAT/24-2019', 'GASTOS', '602.55', 526602000, 'Papelería y artículos de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602560, 'SAT/24-2019', 'GASTOS', '602.56', 526602000, 'Mantenimiento y conservación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602570, 'SAT/24-2019', 'GASTOS', '602.57', 526602000, 'Seguros y fianzas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602580, 'SAT/24-2019', 'GASTOS', '602.58', 526602000, 'Otros impuestos y derechos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602590, 'SAT/24-2019', 'GASTOS', '602.59', 526602000, 'Recargos fiscales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602600, 'SAT/24-2019', 'GASTOS', '602.6', 526602000, 'Cuotas y suscripciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602610, 'SAT/24-2019', 'GASTOS', '602.61', 526602000, 'Propaganda y publicidad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602620, 'SAT/24-2019', 'GASTOS', '602.62', 526602000, 'Capacitación al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602630, 'SAT/24-2019', 'GASTOS', '602.63', 526602000, 'Donativos y ayudas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602640, 'SAT/24-2019', 'GASTOS', '602.64', 526602000, 'Asistencia técnica', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602650, 'SAT/24-2019', 'GASTOS', '602.65', 526602000, 'Regalías sujetas a otros porcentajes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602660, 'SAT/24-2019', 'GASTOS', '602.66', 526602000, 'Regalías sujetas al 5%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602670, 'SAT/24-2019', 'GASTOS', '602.67', 526602000, 'Regalías sujetas al 10%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602680, 'SAT/24-2019', 'GASTOS', '602.68', 526602000, 'Regalías sujetas al 15%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602690, 'SAT/24-2019', 'GASTOS', '602.69', 526602000, 'Regalías sujetas al 25%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602700, 'SAT/24-2019', 'GASTOS', '602.7', 526602000, 'Regalías sujetas al 30%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602710, 'SAT/24-2019', 'GASTOS', '602.71', 526602000, 'Regalías sin retención', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602720, 'SAT/24-2019', 'GASTOS', '602.72', 526602000, 'Fletes y acarreos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602730, 'SAT/24-2019', 'GASTOS', '602.73', 526602000, 'Gastos de importación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602740, 'SAT/24-2019', 'GASTOS', '602.74', 526602000, 'Comisiones sobre ventas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602750, 'SAT/24-2019', 'GASTOS', '602.75', 526602000, 'Comisiones por tarjetas de crédito', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602760, 'SAT/24-2019', 'GASTOS', '602.76', 526602000, 'Patentes y marcas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602770, 'SAT/24-2019', 'GASTOS', '602.77', 526602000, 'Uniformes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602780, 'SAT/24-2019', 'GASTOS', '602.78', 526602000, 'Prediales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602790, 'SAT/24-2019', 'GASTOS', '602.79', 526602000, 'Gastos de venta de urbanización', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602800, 'SAT/24-2019', 'GASTOS', '602.8', 526602000, 'Gastos de venta de construcción', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602810, 'SAT/24-2019', 'GASTOS', '602.81', 526602000, 'Fletes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602820, 'SAT/24-2019', 'GASTOS', '602.82', 526602000, 'Recolección de bienes del sector agropecuario y/o ganadero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602830, 'SAT/24-2019', 'GASTOS', '602.83', 526602000, 'Gastos no deducibles (sin requisitos fiscales)', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526602840, 'SAT/24-2019', 'GASTOS', '602.84', 526602000, 'Otros gastos de venta', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603000, 'SAT/24-2019', 'GASTOS', '603', 526600000, 'Gastos de administración', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603010, 'SAT/24-2019', 'GASTOS', '603.01', 526603000, 'Sueldos y salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603020, 'SAT/24-2019', 'GASTOS', '603.02', 526603000, 'Compensaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603030, 'SAT/24-2019', 'GASTOS', '603.03', 526603000, 'Tiempos extras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603040, 'SAT/24-2019', 'GASTOS', '603.04', 526603000, 'Premios de asistencia', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603050, 'SAT/24-2019', 'GASTOS', '603.05', 526603000, 'Premios de puntualidad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603060, 'SAT/24-2019', 'GASTOS', '603.06', 526603000, 'Vacaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603070, 'SAT/24-2019', 'GASTOS', '603.07', 526603000, 'Prima vacacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603080, 'SAT/24-2019', 'GASTOS', '603.08', 526603000, 'Prima dominical', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603090, 'SAT/24-2019', 'GASTOS', '603.09', 526603000, 'Días festivos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603100, 'SAT/24-2019', 'GASTOS', '603.1', 526603000, 'Gratificaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603110, 'SAT/24-2019', 'GASTOS', '603.11', 526603000, 'Primas de antigüedad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603120, 'SAT/24-2019', 'GASTOS', '603.12', 526603000, 'Aguinaldo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603130, 'SAT/24-2019', 'GASTOS', '603.13', 526603000, 'Indemnizaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603140, 'SAT/24-2019', 'GASTOS', '603.14', 526603000, 'Destajo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603150, 'SAT/24-2019', 'GASTOS', '603.15', 526603000, 'Despensa', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603160, 'SAT/24-2019', 'GASTOS', '603.16', 526603000, 'Transporte', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603170, 'SAT/24-2019', 'GASTOS', '603.17', 526603000, 'Servicio médico', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603180, 'SAT/24-2019', 'GASTOS', '603.18', 526603000, 'Ayuda en gastos funerarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603190, 'SAT/24-2019', 'GASTOS', '603.19', 526603000, 'Fondo de ahorro', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603200, 'SAT/24-2019', 'GASTOS', '603.2', 526603000, 'Cuotas sindicales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603210, 'SAT/24-2019', 'GASTOS', '603.21', 526603000, 'PTU', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603220, 'SAT/24-2019', 'GASTOS', '603.22', 526603000, 'Estímulo al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603230, 'SAT/24-2019', 'GASTOS', '603.23', 526603000, 'Previsión social', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603240, 'SAT/24-2019', 'GASTOS', '603.24', 526603000, 'Aportaciones para el plan de jubilación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603250, 'SAT/24-2019', 'GASTOS', '603.25', 526603000, 'Otras prestaciones al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603260, 'SAT/24-2019', 'GASTOS', '603.26', 526603000, 'Cuotas al IMSS', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603270, 'SAT/24-2019', 'GASTOS', '603.27', 526603000, 'Aportaciones al infonavit', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603280, 'SAT/24-2019', 'GASTOS', '603.28', 526603000, 'Aportaciones al SAR', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603290, 'SAT/24-2019', 'GASTOS', '603.29', 526603000, 'Impuesto estatal sobre nóminas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603300, 'SAT/24-2019', 'GASTOS', '603.3', 526603000, 'Otras aportaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603310, 'SAT/24-2019', 'GASTOS', '603.31', 526603000, 'Asimilados a salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603320, 'SAT/24-2019', 'GASTOS', '603.32', 526603000, 'Servicios administrativos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603330, 'SAT/24-2019', 'GASTOS', '603.33', 526603000, 'Servicios administrativos partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603340, 'SAT/24-2019', 'GASTOS', '603.34', 526603000, 'Honorarios a personas físicas residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603350, 'SAT/24-2019', 'GASTOS', '603.35', 526603000, 'Honorarios a personas físicas residentes nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603360, 'SAT/24-2019', 'GASTOS', '603.36', 526603000, 'Honorarios a personas físicas residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603370, 'SAT/24-2019', 'GASTOS', '603.37', 526603000, 'Honorarios a personas físicas residentes del extranjero partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603380, 'SAT/24-2019', 'GASTOS', '603.38', 526603000, 'Honorarios a personas morales residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603390, 'SAT/24-2019', 'GASTOS', '603.39', 526603000, 'Honorarios a personas morales residentes nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603400, 'SAT/24-2019', 'GASTOS', '603.4', 526603000, 'Honorarios a personas morales residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603410, 'SAT/24-2019', 'GASTOS', '603.41', 526603000, 'Honorarios a personas morales residentes del extranjero partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603420, 'SAT/24-2019', 'GASTOS', '603.42', 526603000, 'Honorarios aduanales personas físicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603430, 'SAT/24-2019', 'GASTOS', '603.43', 526603000, 'Honorarios aduanales personas morales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603440, 'SAT/24-2019', 'GASTOS', '603.44', 526603000, 'Honorarios al consejo de administración', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603450, 'SAT/24-2019', 'GASTOS', '603.45', 526603000, 'Arrendamiento a personas físicas residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603460, 'SAT/24-2019', 'GASTOS', '603.46', 526603000, 'Arrendamiento a personas morales residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603470, 'SAT/24-2019', 'GASTOS', '603.47', 526603000, 'Arrendamiento a residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603480, 'SAT/24-2019', 'GASTOS', '603.48', 526603000, 'Combustibles y lubricantes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603490, 'SAT/24-2019', 'GASTOS', '603.49', 526603000, 'Viáticos y gastos de viaje', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603500, 'SAT/24-2019', 'GASTOS', '603.5', 526603000, 'Teléfono, internet', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603510, 'SAT/24-2019', 'GASTOS', '603.51', 526603000, 'Agua', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603526, 'SAT/24-2019', 'GASTOS', '603.52', 526603000, 'Energía eléctrica', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603530, 'SAT/24-2019', 'GASTOS', '603.53', 526603000, 'Vigilancia y seguridad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603540, 'SAT/24-2019', 'GASTOS', '603.54', 526603000, 'Limpieza', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603550, 'SAT/24-2019', 'GASTOS', '603.55', 526603000, 'Papelería y artículos de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603560, 'SAT/24-2019', 'GASTOS', '603.56', 526603000, 'Mantenimiento y conservación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603570, 'SAT/24-2019', 'GASTOS', '603.57', 526603000, 'Seguros y fianzas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603580, 'SAT/24-2019', 'GASTOS', '603.58', 526603000, 'Otros impuestos y derechos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603590, 'SAT/24-2019', 'GASTOS', '603.59', 526603000, 'Recargos fiscales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603600, 'SAT/24-2019', 'GASTOS', '603.6', 526603000, 'Cuotas y suscripciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603610, 'SAT/24-2019', 'GASTOS', '603.61', 526603000, 'Propaganda y publicidad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603620, 'SAT/24-2019', 'GASTOS', '603.62', 526603000, 'Capacitación al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603630, 'SAT/24-2019', 'GASTOS', '603.63', 526603000, 'Donativos y ayudas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603640, 'SAT/24-2019', 'GASTOS', '603.64', 526603000, 'Asistencia técnica', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603650, 'SAT/24-2019', 'GASTOS', '603.65', 526603000, 'Regalías sujetas a otros porcentajes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603660, 'SAT/24-2019', 'GASTOS', '603.66', 526603000, 'Regalías sujetas al 5%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603670, 'SAT/24-2019', 'GASTOS', '603.67', 526603000, 'Regalías sujetas al 10%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603680, 'SAT/24-2019', 'GASTOS', '603.68', 526603000, 'Regalías sujetas al 15%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603690, 'SAT/24-2019', 'GASTOS', '603.69', 526603000, 'Regalías sujetas al 25%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603700, 'SAT/24-2019', 'GASTOS', '603.7', 526603000, 'Regalías sujetas al 30%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603710, 'SAT/24-2019', 'GASTOS', '603.71', 526603000, 'Regalías sin retención', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603720, 'SAT/24-2019', 'GASTOS', '603.72', 526603000, 'Fletes y acarreos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603730, 'SAT/24-2019', 'GASTOS', '603.73', 526603000, 'Gastos de importación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603740, 'SAT/24-2019', 'GASTOS', '603.74', 526603000, 'Patentes y marcas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603750, 'SAT/24-2019', 'GASTOS', '603.75', 526603000, 'Uniformes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603760, 'SAT/24-2019', 'GASTOS', '603.76', 526603000, 'Prediales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603770, 'SAT/24-2019', 'GASTOS', '603.77', 526603000, 'Gastos de administración de urbanización', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603780, 'SAT/24-2019', 'GASTOS', '603.78', 526603000, 'Gastos de administración de construcción', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603790, 'SAT/24-2019', 'GASTOS', '603.79', 526603000, 'Fletes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603800, 'SAT/24-2019', 'GASTOS', '603.8', 526603000, 'Recolección de bienes del sector agropecuario y/o ganadero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603810, 'SAT/24-2019', 'GASTOS', '603.81', 526603000, 'Gastos no deducibles (sin requisitos fiscales)', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526603820, 'SAT/24-2019', 'GASTOS', '603.82', 526603000, 'Otros gastos de administración', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604000, 'SAT/24-2019', 'GASTOS', '604', 526600000, 'Gastos de fabricación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604010, 'SAT/24-2019', 'GASTOS', '604.01', 526604000, 'Sueldos y salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604020, 'SAT/24-2019', 'GASTOS', '604.02', 526604000, 'Compensaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604030, 'SAT/24-2019', 'GASTOS', '604.03', 526604000, 'Tiempos extras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604040, 'SAT/24-2019', 'GASTOS', '604.04', 526604000, 'Premios de asistencia', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604050, 'SAT/24-2019', 'GASTOS', '604.05', 526604000, 'Premios de puntualidad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604060, 'SAT/24-2019', 'GASTOS', '604.06', 526604000, 'Vacaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604070, 'SAT/24-2019', 'GASTOS', '604.07', 526604000, 'Prima vacacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604080, 'SAT/24-2019', 'GASTOS', '604.08', 526604000, 'Prima dominical', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604090, 'SAT/24-2019', 'GASTOS', '604.09', 526604000, 'Días festivos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604100, 'SAT/24-2019', 'GASTOS', '604.1', 526604000, 'Gratificaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604110, 'SAT/24-2019', 'GASTOS', '604.11', 526604000, 'Primas de antigüedad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604120, 'SAT/24-2019', 'GASTOS', '604.12', 526604000, 'Aguinaldo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604130, 'SAT/24-2019', 'GASTOS', '604.13', 526604000, 'Indemnizaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604140, 'SAT/24-2019', 'GASTOS', '604.14', 526604000, 'Destajo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604150, 'SAT/24-2019', 'GASTOS', '604.15', 526604000, 'Despensa', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604160, 'SAT/24-2019', 'GASTOS', '604.16', 526604000, 'Transporte', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604170, 'SAT/24-2019', 'GASTOS', '604.17', 526604000, 'Servicio médico', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604180, 'SAT/24-2019', 'GASTOS', '604.18', 526604000, 'Ayuda en gastos funerarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604190, 'SAT/24-2019', 'GASTOS', '604.19', 526604000, 'Fondo de ahorro', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604200, 'SAT/24-2019', 'GASTOS', '604.2', 526604000, 'Cuotas sindicales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604210, 'SAT/24-2019', 'GASTOS', '604.21', 526604000, 'PTU', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604220, 'SAT/24-2019', 'GASTOS', '604.22', 526604000, 'Estímulo al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604230, 'SAT/24-2019', 'GASTOS', '604.23', 526604000, 'Previsión social', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604240, 'SAT/24-2019', 'GASTOS', '604.24', 526604000, 'Aportaciones para el plan de jubilación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604250, 'SAT/24-2019', 'GASTOS', '604.25', 526604000, 'Otras prestaciones al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604260, 'SAT/24-2019', 'GASTOS', '604.26', 526604000, 'Cuotas al IMSS', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604270, 'SAT/24-2019', 'GASTOS', '604.27', 526604000, 'Aportaciones al infonavit', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604280, 'SAT/24-2019', 'GASTOS', '604.28', 526604000, 'Aportaciones al SAR', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604290, 'SAT/24-2019', 'GASTOS', '604.29', 526604000, 'Impuesto estatal sobre nóminas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604300, 'SAT/24-2019', 'GASTOS', '604.3', 526604000, 'Otras aportaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604310, 'SAT/24-2019', 'GASTOS', '604.31', 526604000, 'Asimilados a salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604320, 'SAT/24-2019', 'GASTOS', '604.32', 526604000, 'Servicios administrativos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604330, 'SAT/24-2019', 'GASTOS', '604.33', 526604000, 'Servicios administrativos partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604340, 'SAT/24-2019', 'GASTOS', '604.34', 526604000, 'Honorarios a personas físicas residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604350, 'SAT/24-2019', 'GASTOS', '604.35', 526604000, 'Honorarios a personas físicas residentes nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604360, 'SAT/24-2019', 'GASTOS', '604.36', 526604000, 'Honorarios a personas físicas residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604370, 'SAT/24-2019', 'GASTOS', '604.37', 526604000, 'Honorarios a personas físicas residentes del extranjero partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604380, 'SAT/24-2019', 'GASTOS', '604.38', 526604000, 'Honorarios a personas morales residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604390, 'SAT/24-2019', 'GASTOS', '604.39', 526604000, 'Honorarios a personas morales residentes nacionales partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604400, 'SAT/24-2019', 'GASTOS', '604.4', 526604000, 'Honorarios a personas morales residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604410, 'SAT/24-2019', 'GASTOS', '604.41', 526604000, 'Honorarios a personas morales residentes del extranjero partes relacionadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604420, 'SAT/24-2019', 'GASTOS', '604.42', 526604000, 'Honorarios aduanales personas físicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604430, 'SAT/24-2019', 'GASTOS', '604.43', 526604000, 'Honorarios aduanales personas morales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604440, 'SAT/24-2019', 'GASTOS', '604.44', 526604000, 'Honorarios al consejo de administración', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604450, 'SAT/24-2019', 'GASTOS', '604.45', 526604000, 'Arrendamiento a personas físicas residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604460, 'SAT/24-2019', 'GASTOS', '604.46', 526604000, 'Arrendamiento a personas morales residentes nacionales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604470, 'SAT/24-2019', 'GASTOS', '604.47', 526604000, 'Arrendamiento a residentes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604480, 'SAT/24-2019', 'GASTOS', '604.48', 526604000, 'Combustibles y lubricantes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604490, 'SAT/24-2019', 'GASTOS', '604.49', 526604000, 'Viáticos y gastos de viaje', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604500, 'SAT/24-2019', 'GASTOS', '604.5', 526604000, 'Teléfono, internet', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604510, 'SAT/24-2019', 'GASTOS', '604.51', 526604000, 'Agua', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604526, 'SAT/24-2019', 'GASTOS', '604.52', 526604000, 'Energía eléctrica', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604530, 'SAT/24-2019', 'GASTOS', '604.53', 526604000, 'Vigilancia y seguridad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604540, 'SAT/24-2019', 'GASTOS', '604.54', 526604000, 'Limpieza', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604550, 'SAT/24-2019', 'GASTOS', '604.55', 526604000, 'Papelería y artículos de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604560, 'SAT/24-2019', 'GASTOS', '604.56', 526604000, 'Mantenimiento y conservación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604570, 'SAT/24-2019', 'GASTOS', '604.57', 526604000, 'Seguros y fianzas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604580, 'SAT/24-2019', 'GASTOS', '604.58', 526604000, 'Otros impuestos y derechos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604590, 'SAT/24-2019', 'GASTOS', '604.59', 526604000, 'Recargos fiscales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604600, 'SAT/24-2019', 'GASTOS', '604.6', 526604000, 'Cuotas y suscripciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604610, 'SAT/24-2019', 'GASTOS', '604.61', 526604000, 'Propaganda y publicidad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604620, 'SAT/24-2019', 'GASTOS', '604.62', 526604000, 'Capacitación al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604630, 'SAT/24-2019', 'GASTOS', '604.63', 526604000, 'Donativos y ayudas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604640, 'SAT/24-2019', 'GASTOS', '604.64', 526604000, 'Asistencia técnica', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604650, 'SAT/24-2019', 'GASTOS', '604.65', 526604000, 'Regalías sujetas a otros porcentajes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604660, 'SAT/24-2019', 'GASTOS', '604.66', 526604000, 'Regalías sujetas al 5%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604670, 'SAT/24-2019', 'GASTOS', '604.67', 526604000, 'Regalías sujetas al 10%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604680, 'SAT/24-2019', 'GASTOS', '604.68', 526604000, 'Regalías sujetas al 15%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604690, 'SAT/24-2019', 'GASTOS', '604.69', 526604000, 'Regalías sujetas al 25%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604700, 'SAT/24-2019', 'GASTOS', '604.7', 526604000, 'Regalías sujetas al 30%', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604710, 'SAT/24-2019', 'GASTOS', '604.71', 526604000, 'Regalías sin retención', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604720, 'SAT/24-2019', 'GASTOS', '604.72', 526604000, 'Fletes y acarreos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604730, 'SAT/24-2019', 'GASTOS', '604.73', 526604000, 'Gastos de importación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604740, 'SAT/24-2019', 'GASTOS', '604.74', 526604000, 'Patentes y marcas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604750, 'SAT/24-2019', 'GASTOS', '604.75', 526604000, 'Uniformes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604760, 'SAT/24-2019', 'GASTOS', '604.76', 526604000, 'Prediales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604770, 'SAT/24-2019', 'GASTOS', '604.77', 526604000, 'Gastos de fabricación de urbanización', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604780, 'SAT/24-2019', 'GASTOS', '604.78', 526604000, 'Gastos de fabricación de construcción', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604790, 'SAT/24-2019', 'GASTOS', '604.79', 526604000, 'Fletes del extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604800, 'SAT/24-2019', 'GASTOS', '604.8', 526604000, 'Recolección de bienes del sector agropecuario y/o ganadero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604810, 'SAT/24-2019', 'GASTOS', '604.81', 526604000, 'Gastos no deducibles (sin requisitos fiscales)', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526604820, 'SAT/24-2019', 'GASTOS', '604.82', 526604000, 'Otros gastos de fabricación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605000, 'SAT/24-2019', 'GASTOS', '605', 526600000, 'Mano de obra directa', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605010, 'SAT/24-2019', 'GASTOS', '605.01', 526605000, 'Mano de obra', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605020, 'SAT/24-2019', 'GASTOS', '605.02', 526605000, 'Sueldos y Salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605030, 'SAT/24-2019', 'GASTOS', '605.03', 526605000, 'Compensaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605040, 'SAT/24-2019', 'GASTOS', '605.04', 526605000, 'Tiempos extras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605050, 'SAT/24-2019', 'GASTOS', '605.05', 526605000, 'Premios de asistencia', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605060, 'SAT/24-2019', 'GASTOS', '605.06', 526605000, 'Premios de puntualidad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605070, 'SAT/24-2019', 'GASTOS', '605.07', 526605000, 'Vacaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605080, 'SAT/24-2019', 'GASTOS', '605.08', 526605000, 'Prima vacacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605090, 'SAT/24-2019', 'GASTOS', '605.09', 526605000, 'Prima dominical', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605100, 'SAT/24-2019', 'GASTOS', '605.1', 526605000, 'Días festivos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605110, 'SAT/24-2019', 'GASTOS', '605.11', 526605000, 'Gratificaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605120, 'SAT/24-2019', 'GASTOS', '605.12', 526605000, 'Primas de antigüedad', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605130, 'SAT/24-2019', 'GASTOS', '605.13', 526605000, 'Aguinaldo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605140, 'SAT/24-2019', 'GASTOS', '605.14', 526605000, 'Indemnizaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605150, 'SAT/24-2019', 'GASTOS', '605.15', 526605000, 'Destajo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605160, 'SAT/24-2019', 'GASTOS', '605.16', 526605000, 'Despensa', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605170, 'SAT/24-2019', 'GASTOS', '605.17', 526605000, 'Transporte', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605180, 'SAT/24-2019', 'GASTOS', '605.18', 526605000, 'Servicio médico', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605190, 'SAT/24-2019', 'GASTOS', '605.19', 526605000, 'Ayuda en gastos funerarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605260, 'SAT/24-2019', 'GASTOS', '605.2', 526605000, 'Fondo de ahorro', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605210, 'SAT/24-2019', 'GASTOS', '605.21', 526605000, 'Cuotas sindicales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605220, 'SAT/24-2019', 'GASTOS', '605.22', 526605000, 'PTU', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605230, 'SAT/24-2019', 'GASTOS', '605.23', 526605000, 'Estímulo al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605240, 'SAT/24-2019', 'GASTOS', '605.24', 526605000, 'Previsión social', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605250, 'SAT/24-2019', 'GASTOS', '605.25', 526605000, 'Aportaciones para el plan de jubilación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605265, 'SAT/24-2019', 'GASTOS', '605.26', 526605000, 'Otras prestaciones al personal', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605270, 'SAT/24-2019', 'GASTOS', '605.27', 526605000, 'Asimilados a salarios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605280, 'SAT/24-2019', 'GASTOS', '605.28', 526605000, 'Cuotas al IMSS', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605290, 'SAT/24-2019', 'GASTOS', '605.29', 526605000, 'Aportaciones al infonavit', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605300, 'SAT/24-2019', 'GASTOS', '605.3', 526605000, 'Aportaciones al SAR', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526605310, 'SAT/24-2019', 'GASTOS', '605.31', 526605000, 'Otros costos de mano de obra directa', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526606000, 'SAT/24-2019', 'GASTOS', '606', 526600000, 'Facilidades administrativas fiscales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526606010, 'SAT/24-2019', 'GASTOS', '606.01', 526606000, 'Facilidades administrativas fiscales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526607000, 'SAT/24-2019', 'GASTOS', '607', 526600000, 'Participación de los trabajadores en las utilidades', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526607010, 'SAT/24-2019', 'GASTOS', '607.01', 526607000, 'Participación de los trabajadores en las utilidades', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526608000, 'SAT/24-2019', 'GASTOS', '608', 526600000, 'Participación en resultados de subsidiarias', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526608010, 'SAT/24-2019', 'GASTOS', '608.01', 526608000, 'Participación en resultados de subsidiarias', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526609000, 'SAT/24-2019', 'GASTOS', '609', 526600000, 'Participación en resultados de asociadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526609010, 'SAT/24-2019', 'GASTOS', '609.01', 526609000, 'Participación en resultados de asociadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526610000, 'SAT/24-2019', 'GASTOS', '610', 526600000, 'Participación de los trabajadores en las utilidades diferida', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526610010, 'SAT/24-2019', 'GASTOS', '610.01', 526610000, 'Participación de los trabajadores en las utilidades diferida', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526611000, 'SAT/24-2019', 'GASTOS', '611', 526600000, 'Impuesto Sobre la renta', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526611010, 'SAT/24-2019', 'GASTOS', '611.01', 526611000, 'Impuesto Sobre la renta', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526611020, 'SAT/24-2019', 'GASTOS', '611.02', 526611000, 'Impuesto Sobre la renta por remanente distribuible', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526612000, 'SAT/24-2019', 'GASTOS', '612', 526600000, 'Gastos no deducibles para CUFIN', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526612010, 'SAT/24-2019', 'GASTOS', '612.01', 526612000, 'Gastos no deducibles para CUFIN', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613000, 'SAT/24-2019', 'GASTOS', '613', 526600000, 'Depreciación contable', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613010, 'SAT/24-2019', 'GASTOS', '613.01', 526613000, 'Depreciación de edificios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613020, 'SAT/24-2019', 'GASTOS', '613.02', 526613000, 'Depreciación de maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613030, 'SAT/24-2019', 'GASTOS', '613.03', 526613000, 'Depreciación de automóviles, autobuses, camiones de carga, tractocamiones, montacargas y remolques', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613040, 'SAT/24-2019', 'GASTOS', '613.04', 526613000, 'Depreciación de mobiliario y equipo de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613050, 'SAT/24-2019', 'GASTOS', '613.05', 526613000, 'Depreciación de equipo de cómputo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613060, 'SAT/24-2019', 'GASTOS', '613.06', 526613000, 'Depreciación de equipo de comunicación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613070, 'SAT/24-2019', 'GASTOS', '613.07', 526613000, 'Depreciación de activos biológicos, vegetales y semovientes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613080, 'SAT/24-2019', 'GASTOS', '613.08', 526613000, 'Depreciación de otros activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613090, 'SAT/24-2019', 'GASTOS', '613.09', 526613000, 'Depreciación de ferrocarriles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613100, 'SAT/24-2019', 'GASTOS', '613.1', 526613000, 'Depreciación de embarcaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613110, 'SAT/24-2019', 'GASTOS', '613.11', 526613000, 'Depreciación de aviones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613120, 'SAT/24-2019', 'GASTOS', '613.12', 526613000, 'Depreciación de troqueles, moldes, matrices y herramental', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613130, 'SAT/24-2019', 'GASTOS', '613.13', 526613000, 'Depreciación de equipo de comunicaciones telefónicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613140, 'SAT/24-2019', 'GASTOS', '613.14', 526613000, 'Depreciación de equipo de comunicación satelital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613150, 'SAT/24-2019', 'GASTOS', '613.15', 526613000, 'Depreciación de equipo de adaptaciones para personas con capacidades diferentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613160, 'SAT/24-2019', 'GASTOS', '613.16', 526613000, 'Depreciación de maquinaria y equipo de generación de energía de fuentes renovables o de sistemas de cogeneración de electricidad eficiente', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613170, 'SAT/24-2019', 'GASTOS', '613.17', 526613000, 'Depreciación de adaptaciones y mejoras', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526613180, 'SAT/24-2019', 'GASTOS', '613.18', 526613000, 'Depreciación de otra maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614000, 'SAT/24-2019', 'GASTOS', '614', 526600000, 'Amortización contable', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614010, 'SAT/24-2019', 'GASTOS', '614.01', 526614000, 'Amortización de gastos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614020, 'SAT/24-2019', 'GASTOS', '614.02', 526614000, 'Amortización de gastos pre operativos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614030, 'SAT/24-2019', 'GASTOS', '614.03', 526614000, 'Amortización de regalías, asistencia técnica y otros gastos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614040, 'SAT/24-2019', 'GASTOS', '614.04', 526614000, 'Amortización de activos intangibles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614050, 'SAT/24-2019', 'GASTOS', '614.05', 526614000, 'Amortización de gastos de organización', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614060, 'SAT/24-2019', 'GASTOS', '614.06', 526614000, 'Amortización de investigación y desarrollo de mercado', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614070, 'SAT/24-2019', 'GASTOS', '614.07', 526614000, 'Amortización de marcas y patentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614080, 'SAT/24-2019', 'GASTOS', '614.08', 526614000, 'Amortización de crédito mercantil', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614090, 'SAT/24-2019', 'GASTOS', '614.09', 526614000, 'Amortización de gastos de instalación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526614100, 'SAT/24-2019', 'GASTOS', '614.1', 526614000, 'Amortización de otros activos diferidos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526700000, 'SAT/24-2019', 'RESULTADOS', '700', 0, 'Resultado integral de financiamiento', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701000, 'SAT/24-2019', 'RESULTADOS', '701', 526700000, 'Gastos financieros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701010, 'SAT/24-2019', 'RESULTADOS', '701.01', 526701000, 'Pérdida cambiaria', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701020, 'SAT/24-2019', 'RESULTADOS', '701.02', 526701000, 'Pérdida cambiaria nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701030, 'SAT/24-2019', 'RESULTADOS', '701.03', 526701000, 'Pérdida cambiaria extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701040, 'SAT/24-2019', 'RESULTADOS', '701.04', 526701000, 'Intereses a cargo bancario nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701050, 'SAT/24-2019', 'RESULTADOS', '701.05', 526701000, 'Intereses a cargo bancario extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701060, 'SAT/24-2019', 'RESULTADOS', '701.06', 526701000, 'Intereses a cargo de personas físicas nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701070, 'SAT/24-2019', 'RESULTADOS', '701.07', 526701000, 'Intereses a cargo de personas físicas extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701080, 'SAT/24-2019', 'RESULTADOS', '701.08', 526701000, 'Intereses a cargo de personas morales nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701090, 'SAT/24-2019', 'RESULTADOS', '701.09', 526701000, 'Intereses a cargo de personas morales extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701100, 'SAT/24-2019', 'RESULTADOS', '701.1', 526701000, 'Comisiones bancarias', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526701110, 'SAT/24-2019', 'RESULTADOS', '701.11', 526701000, 'Otros gastos financieros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702000, 'SAT/24-2019', 'RESULTADOS', '702', 526700000, 'Productos financieros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702010, 'SAT/24-2019', 'RESULTADOS', '702.01', 526702000, 'Utilidad cambiaria', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702020, 'SAT/24-2019', 'RESULTADOS', '702.02', 526702000, 'Utilidad cambiaria nacional parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702030, 'SAT/24-2019', 'RESULTADOS', '702.03', 526702000, 'Utilidad cambiaria extranjero parte relacionada', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702040, 'SAT/24-2019', 'RESULTADOS', '702.04', 526702000, 'Intereses a favor bancarios nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702050, 'SAT/24-2019', 'RESULTADOS', '702.05', 526702000, 'Intereses a favor bancarios extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702060, 'SAT/24-2019', 'RESULTADOS', '702.06', 526702000, 'Intereses a favor de personas físicas nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702070, 'SAT/24-2019', 'RESULTADOS', '702.07', 526702000, 'Intereses a favor de personas físicas extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702080, 'SAT/24-2019', 'RESULTADOS', '702.08', 526702000, 'Intereses a favor de personas morales nacional', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702090, 'SAT/24-2019', 'RESULTADOS', '702.09', 526702000, 'Intereses a favor de personas morales extranjero', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526702100, 'SAT/24-2019', 'RESULTADOS', '702.1', 526702000, 'Otros productos financieros', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703000, 'SAT/24-2019', 'RESULTADOS', '703', 526700000, 'Otros gastos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703010, 'SAT/24-2019', 'RESULTADOS', '703.01', 526703000, 'Pérdida en venta y/o baja de terrenos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703020, 'SAT/24-2019', 'RESULTADOS', '703.02', 526703000, 'Pérdida en venta y/o baja de edificios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703030, 'SAT/24-2019', 'RESULTADOS', '703.03', 526703000, 'Pérdida en venta y/o baja de maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703040, 'SAT/24-2019', 'RESULTADOS', '703.04', 526703000, 'Pérdida en venta y/o baja de automóviles, autobuses, camiones de carga, tractocamiones, montacargas y remolques', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703050, 'SAT/24-2019', 'RESULTADOS', '703.05', 526703000, 'Pérdida en venta y/o baja de mobiliario y equipo de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703060, 'SAT/24-2019', 'RESULTADOS', '703.06', 526703000, 'Pérdida en venta y/o baja de equipo de cómputo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703070, 'SAT/24-2019', 'RESULTADOS', '703.07', 526703000, 'Pérdida en venta y/o baja de equipo de comunicación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703080, 'SAT/24-2019', 'RESULTADOS', '703.08', 526703000, 'Pérdida en venta y/o baja de activos biológicos, vegetales y semovientes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703090, 'SAT/24-2019', 'RESULTADOS', '703.09', 526703000, 'Pérdida en venta y/o baja de otros activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703100, 'SAT/24-2019', 'RESULTADOS', '703.1', 526703000, 'Pérdida en venta y/o baja de ferrocarriles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703110, 'SAT/24-2019', 'RESULTADOS', '703.11', 526703000, 'Pérdida en venta y/o baja de embarcaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703120, 'SAT/24-2019', 'RESULTADOS', '703.12', 526703000, 'Pérdida en venta y/o baja de aviones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703130, 'SAT/24-2019', 'RESULTADOS', '703.13', 526703000, 'Pérdida en venta y/o baja de troqueles, moldes, matrices y herramental', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703140, 'SAT/24-2019', 'RESULTADOS', '703.14', 526703000, 'Pérdida en venta y/o baja de equipo de comunicaciones telefónicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703150, 'SAT/24-2019', 'RESULTADOS', '703.15', 526703000, 'Pérdida en venta y/o baja de equipo de comunicación satelital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703160, 'SAT/24-2019', 'RESULTADOS', '703.16', 526703000, 'Pérdida en venta y/o baja de equipo de adaptaciones para personas con capacidades diferentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703170, 'SAT/24-2019', 'RESULTADOS', '703.17', 526703000, 'Pérdida en venta y/o baja de maquinaria y equipo de generación de energía de fuentes renovables o de sistemas de cogeneración de electricidad eficiente', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703180, 'SAT/24-2019', 'RESULTADOS', '703.18', 526703000, 'Pérdida en venta y/o baja de otra maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703190, 'SAT/24-2019', 'RESULTADOS', '703.19', 526703000, 'Pérdida por enajenación de acciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703200, 'SAT/24-2019', 'RESULTADOS', '703.2', 526703000, 'Pérdida por enajenación de partes sociales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526703210, 'SAT/24-2019', 'RESULTADOS', '703.21', 526703000, 'Otros gastos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704000, 'SAT/24-2019', 'RESULTADOS', '704', 526700000, 'Otros productos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704010, 'SAT/24-2019', 'RESULTADOS', '704.01', 526704000, 'Ganancia en venta y/o baja de terrenos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704020, 'SAT/24-2019', 'RESULTADOS', '704.02', 526704000, 'Ganancia en venta y/o baja de edificios', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704030, 'SAT/24-2019', 'RESULTADOS', '704.03', 526704000, 'Ganancia en venta y/o baja de maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704040, 'SAT/24-2019', 'RESULTADOS', '704.04', 526704000, 'Ganancia en venta y/o baja de automóviles, autobuses, camiones de carga, tractocamiones, montacargas y remolques', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704050, 'SAT/24-2019', 'RESULTADOS', '704.05', 526704000, 'Ganancia en venta y/o baja de mobiliario y equipo de oficina', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704060, 'SAT/24-2019', 'RESULTADOS', '704.06', 526704000, 'Ganancia en venta y/o baja de equipo de cómputo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704070, 'SAT/24-2019', 'RESULTADOS', '704.07', 526704000, 'Ganancia en venta y/o baja de equipo de comunicación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704080, 'SAT/24-2019', 'RESULTADOS', '704.08', 526704000, 'Ganancia en venta y/o baja de activos biológicos, vegetales y semovientes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704090, 'SAT/24-2019', 'RESULTADOS', '704.09', 526704000, 'Ganancia en venta y/o baja de otros activos fijos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704100, 'SAT/24-2019', 'RESULTADOS', '704.1', 526704000, 'Ganancia en venta y/o baja de ferrocarriles', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704110, 'SAT/24-2019', 'RESULTADOS', '704.11', 526704000, 'Ganancia en venta y/o baja de embarcaciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704120, 'SAT/24-2019', 'RESULTADOS', '704.12', 526704000, 'Ganancia en venta y/o baja de aviones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704130, 'SAT/24-2019', 'RESULTADOS', '704.13', 526704000, 'Ganancia en venta y/o baja de troqueles, moldes, matrices y herramental', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704140, 'SAT/24-2019', 'RESULTADOS', '704.14', 526704000, 'Ganancia en venta y/o baja de equipo de comunicaciones telefónicas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704150, 'SAT/24-2019', 'RESULTADOS', '704.15', 526704000, 'Ganancia en venta y/o baja de equipo de comunicación satelital', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704160, 'SAT/24-2019', 'RESULTADOS', '704.16', 526704000, 'Ganancia en venta y/o baja de equipo de adaptaciones para personas con capacidades diferentes', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704170, 'SAT/24-2019', 'RESULTADOS', '704.17', 526704000, 'Ganancia en venta de maquinaria y equipo de generación de energía de fuentes renovables o de sistemas de cogeneración de electricidad eficiente', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704180, 'SAT/24-2019', 'RESULTADOS', '704.18', 526704000, 'Ganancia en venta y/o baja de otra maquinaria y equipo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704190, 'SAT/24-2019', 'RESULTADOS', '704.19', 526704000, 'Ganancia por enajenación de acciones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704200, 'SAT/24-2019', 'RESULTADOS', '704.2', 526704000, 'Ganancia por enajenación de partes sociales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704210, 'SAT/24-2019', 'RESULTADOS', '704.21', 526704000, 'Ingresos por estímulos fiscales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704220, 'SAT/24-2019', 'RESULTADOS', '704.22', 526704000, 'Ingresos por condonación de adeudo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526704230, 'SAT/24-2019', 'RESULTADOS', '704.23', 526704000, 'Otros productos', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526800000, 'SAT/24-2019', 'CTAS DE ORDEN', '800', 0, 'Cuentas de orden', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526801000, 'SAT/24-2019', 'CTAS DE ORDEN', '801', 526800000, 'UFIN del ejercicio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526801010, 'SAT/24-2019', 'CTAS DE ORDEN', '801.01', 526801000, 'UFIN', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526801020, 'SAT/24-2019', 'CTAS DE ORDEN', '801.02', 526801000, 'Contra cuenta UFIN', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526802000, 'SAT/24-2019', 'CTAS DE ORDEN', '802', 526800000, 'CUFIN del ejercicio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526802010, 'SAT/24-2019', 'CTAS DE ORDEN', '802.01', 526802000, 'CUFIN', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526802020, 'SAT/24-2019', 'CTAS DE ORDEN', '802.02', 526802000, 'Contra cuenta CUFIN', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526803000, 'SAT/24-2019', 'CTAS DE ORDEN', '803', 526800000, 'CUFIN de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526803010, 'SAT/24-2019', 'CTAS DE ORDEN', '803.01', 526803000, 'CUFIN de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526803020, 'SAT/24-2019', 'CTAS DE ORDEN', '803.02', 526803000, 'Contra cuenta CUFIN de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526804000, 'SAT/24-2019', 'CTAS DE ORDEN', '804', 526800000, 'CUFINRE del ejercicio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526804010, 'SAT/24-2019', 'CTAS DE ORDEN', '804.01', 526804000, 'CUFINRE', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526804020, 'SAT/24-2019', 'CTAS DE ORDEN', '804.02', 526804000, 'Contra cuenta CUFINRE', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526805000, 'SAT/24-2019', 'CTAS DE ORDEN', '805', 526800000, 'CUFINRE de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526805010, 'SAT/24-2019', 'CTAS DE ORDEN', '805.01', 526805000, 'CUFINRE de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526805020, 'SAT/24-2019', 'CTAS DE ORDEN', '805.02', 526805000, 'Contra cuenta CUFINRE de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526806000, 'SAT/24-2019', 'CTAS DE ORDEN', '806', 526800000, 'CUCA del ejercicio', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526806010, 'SAT/24-2019', 'CTAS DE ORDEN', '806.01', 526806000, 'CUCA', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526806020, 'SAT/24-2019', 'CTAS DE ORDEN', '806.02', 526806000, 'Contra cuenta CUCA', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526807000, 'SAT/24-2019', 'CTAS DE ORDEN', '807', 526800000, 'CUCA de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526807010, 'SAT/24-2019', 'CTAS DE ORDEN', '807.01', 526807000, 'CUCA de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526807020, 'SAT/24-2019', 'CTAS DE ORDEN', '807.02', 526807000, 'Contra cuenta CUCA de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526808000, 'SAT/24-2019', 'CTAS DE ORDEN', '808', 526800000, 'Ajuste anual por inflación acumulable', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526808010, 'SAT/24-2019', 'CTAS DE ORDEN', '808.01', 526808000, 'Ajuste anual por inflación acumulable', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526808020, 'SAT/24-2019', 'CTAS DE ORDEN', '808.02', 526808000, 'Acumulación del ajuste anual inflacionario', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526809000, 'SAT/24-2019', 'CTAS DE ORDEN', '809', 526800000, 'Ajuste anual por inflación deducible', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526809010, 'SAT/24-2019', 'CTAS DE ORDEN', '809.01', 526809000, 'Ajuste anual por inflación deducible', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526809020, 'SAT/24-2019', 'CTAS DE ORDEN', '809.02', 526809000, 'Deducción del ajuste anual inflacionario', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526810000, 'SAT/24-2019', 'CTAS DE ORDEN', '810', 526800000, 'Deducción de inversión', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526810010, 'SAT/24-2019', 'CTAS DE ORDEN', '810.01', 526810000, 'Deducción de inversión', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526810020, 'SAT/24-2019', 'CTAS DE ORDEN', '810.02', 526810000, 'Contra cuenta deducción de inversiones', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526811000, 'SAT/24-2019', 'CTAS DE ORDEN', '811', 526800000, 'Utilidad o pérdida fiscal en venta y/o baja de activo fijo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526811010, 'SAT/24-2019', 'CTAS DE ORDEN', '811.01', 526811000, 'Utilidad o pérdida fiscal en venta y/o baja de activo fijo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526811020, 'SAT/24-2019', 'CTAS DE ORDEN', '811.02', 526811000, 'Contra cuenta utilidad o pérdida fiscal en venta y/o baja de activo fijo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526812000, 'SAT/24-2019', 'CTAS DE ORDEN', '812', 526800000, 'Utilidad o pérdida fiscal en venta acciones o partes sociales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526812010, 'SAT/24-2019', 'CTAS DE ORDEN', '812.01', 526812000, 'Utilidad o pérdida fiscal en venta acciones o partes sociales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526812020, 'SAT/24-2019', 'CTAS DE ORDEN', '812.02', 526812000, 'Contra cuenta utilidad o pérdida fiscal en venta acciones o partes sociales', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526813000, 'SAT/24-2019', 'CTAS DE ORDEN', '813', 526800000, 'Pérdidas fiscales pendientes de amortizar actualizadas de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526813010, 'SAT/24-2019', 'CTAS DE ORDEN', '813.01', 526813000, 'Pérdidas fiscales pendientes de amortizar actualizadas de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526813020, 'SAT/24-2019', 'CTAS DE ORDEN', '813.02', 526813000, 'Actualización de pérdidas fiscales pendientes de amortizar de ejercicios anteriores', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526814000, 'SAT/24-2019', 'CTAS DE ORDEN', '814', 526800000, 'Mercancías recibidas en consignación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526814010, 'SAT/24-2019', 'CTAS DE ORDEN', '814.01', 526814000, 'Mercancías recibidas en consignación', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526814020, 'SAT/24-2019', 'CTAS DE ORDEN', '814.02', 526814000, 'Consignación de mercancías recibidas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526815000, 'SAT/24-2019', 'CTAS DE ORDEN', '815', 526800000, 'Crédito fiscal de IVA e IEPS por la importación de mercancías para empresas certificadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526815010, 'SAT/24-2019', 'CTAS DE ORDEN', '815.01', 526815000, 'Crédito fiscal de IVA e IEPS por la importación de mercancías', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526815020, 'SAT/24-2019', 'CTAS DE ORDEN', '815.02', 526815000, 'Importación de mercancías con aplicación de crédito fiscal de IVA e IEPS', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526816000, 'SAT/24-2019', 'CTAS DE ORDEN', '816', 526800000, 'Crédito fiscal de IVA e IEPS por la importación de activos fijos para empresas certificadas', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526816010, 'SAT/24-2019', 'CTAS DE ORDEN', '816.01', 526816000, 'Crédito fiscal de IVA e IEPS por la importación de activo fijo', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526816020, 'SAT/24-2019', 'CTAS DE ORDEN', '816.02', 526816000, 'Importación de activo fijo con aplicación de crédito fiscal de IVA e IEPS', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526899000, 'SAT/24-2019', 'CTAS DE ORDEN', '899', 526800000, 'Otras cuentas de orden', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526899010, 'SAT/24-2019', 'CTAS DE ORDEN', '899.01', 526899000, 'Otras cuentas de orden', 1 ); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 526899020, 'SAT/24-2019', 'CTAS DE ORDEN', '899.02', 526899000, 'Contra cuenta otras cuentas de orden', 1 ); diff --git a/htdocs/install/mysql/data/llx_c_actioncomm.sql b/htdocs/install/mysql/data/llx_c_actioncomm.sql index cb22ee70ce3..47197af644d 100644 --- a/htdocs/install/mysql/data/llx_c_actioncomm.sql +++ b/htdocs/install/mysql/data/llx_c_actioncomm.sql @@ -48,3 +48,8 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) -- Code used from 3.3+ when type of event is not used insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 40,'AC_OTH_AUTO','systemauto','Other (automatically inserted events)',NULL, 1, 20); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 50,'AC_OTH','system','Other (manually inserted events)',NULL, 1, 5); + +INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 60,'AC_EO_ONLINECONF','module','Online/Virtual conference','conference@eventorganization', 1, 60); +INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 61,'AC_EO_INDOORCONF','module','Indoor conference','conference@eventorganization', 1, 61); +INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 62,'AC_EO_ONLINEBOOTH','module','Online/Virtual booth','booth@eventorganization', 1, 62); +INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 63,'AC_EO_INDOORBOOTH','module','Indoor booth','booth@eventorganization', 1, 63); diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 68566139dec..7f8f3c9aba7 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -48,6 +48,10 @@ UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','D -- For v14 +ALTER TABLE llx_mailing_cibles MODIFY COLUMN tag varchar(64) NULL; +ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_tag (tag); + + ALTER TABLE llx_c_availability ADD COLUMN position integer NOT NULL DEFAULT 0; ALTER TABLE llx_adherent ADD COLUMN ref varchar(30) AFTER rowid; @@ -167,7 +171,7 @@ create table llx_payment_vat ALTER TABLE llx_tva ADD COLUMN paye smallint default 1 NOT NULL; ALTER TABLE llx_tva ADD COLUMN fk_account integer; ---INSERT INTO llx_payment_vat (fk_tva, datec, datep, amount, fk_typepaiement, num_paiement, note, fk_bank, fk_user_creat, fk_user_modif) SELECT rowid, NOW(), datep, amount, COALESCE(fk_typepayment, 0), num_payment, '', fk_bank, fk_user_creat, fk_user_modif FROM llx_tva; +INSERT INTO llx_payment_vat (rowid, fk_tva, datec, datep, amount, fk_typepaiement, num_paiement, note, fk_bank, fk_user_creat, fk_user_modif) SELECT rowid, rowid, NOW(), datep, amount, COALESCE(fk_typepayment, 0), num_payment, 'Created automatically by migration v13 to v14', fk_bank, fk_user_creat, fk_user_modif FROM llx_tva WHERE fk_bank IS NOT NULL; --UPDATE llx_bank_url as url INNER JOIN llx_tva tva ON tva.rowid = url.url_id SET url.type = 'vat', url.label = CONCAT('(', tva.label, ')') WHERE type = 'payment_vat'; --INSERT INTO llx_bank_url (fk_bank, url_id, url, label, type) SELECT b.fk_bank, ptva.rowid, REPLACE(b.url, 'tva/card.php', 'payment_vat/card.php'), '(paiement)', 'payment_vat' FROM llx_bank_url b INNER JOIN llx_tva tva ON (tva.fk_bank = b.fk_bank) INNER JOIN llx_payment_vat ptva on (ptva.fk_bank = b.fk_bank) WHERE type = 'vat'; @@ -188,7 +192,21 @@ ALTER TABLE llx_projet ADD COLUMN accept_booth_suggestions integer DEFAULT 0; ALTER TABLE llx_projet ADD COLUMN price_registration double(24,8); ALTER TABLE llx_projet ADD COLUMN price_booth double(24,8); +ALTER TABLE llx_actioncomm ADD COLUMN num_vote integer DEFAULT NULL AFTER reply_to; +ALTER TABLE llx_actioncomm ADD COLUMN event_paid smallint NOT NULL DEFAULT 0 AFTER num_vote; +ALTER TABLE llx_actioncomm ADD COLUMN status smallint NOT NULL DEFAULT 0 AFTER event_paid; +ALTER TABLE llx_actioncomm ADD COLUMN ref varchar(30) AFTER id; +UPDATE llx_actioncomm SET ref = id WHERE ref = '' OR ref IS NULL; +ALTER TABLE llx_actioncomm MODIFY COLUMN ref varchar(30) NOT NULL; +ALTER TABLE llx_actioncomm ADD UNIQUE INDEX uk_actioncomm_ref (ref, entity); +ALTER TABLE llx_c_actioncomm MODIFY code varchar(50) NOT NULL; +ALTER TABLE llx_c_actioncomm MODIFY module varchar(50) DEFAULT NULL; + +INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 60,'AC_EO_ONLINECONF','module','Online/Virtual conference','conference@eventorganization', 1, 60); +INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 61,'AC_EO_INDOORCONF','module','Indoor conference','conference@eventorganization', 1, 61); +INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 62,'AC_EO_ONLINEBOOTH','module','Online/Virtual booth','booth@eventorganization', 1, 62); +INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 63,'AC_EO_INDOORBOOTH','module','Indoor booth','booth@eventorganization', 1, 63); -- Code enhanced - Standardize field name ALTER TABLE llx_commande CHANGE COLUMN tva total_tva double(24,8) default 0; ALTER TABLE llx_supplier_proposal CHANGE COLUMN tva total_tva double(24,8) default 0; @@ -197,3 +215,44 @@ ALTER TABLE llx_propal CHANGE COLUMN tva total_tva double(24,8) default 0; ALTER TABLE llx_propal CHANGE COLUMN total total_ttc double(24,8) default 0; ALTER TABLE llx_commande_fournisseur CHANGE COLUMN tva total_tva double(24,8) default 0; + +--VMYSQL4.3 ALTER TABLE llx_c_civility CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +--VPGSQL8.2 CREATE SEQUENCE llx_c_civility_rowid_seq OWNED BY llx_c_civility.rowid; +--VPGSQL8.2 ALTER TABLE llx_c_civility ALTER COLUMN rowid SET DEFAULT nextval('llx_c_civility_rowid_seq'); +--VPGSQL8.2 SELECT setval('llx_c_civility_rowid_seq', MAX(rowid)) FROM llx_c_civility; + + +-- Change for salary intent table +create table llx_salary +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet) + label varchar(255), + tms timestamp, + datec datetime, -- Create date + fk_user integer NOT NULL, + datep date, -- payment date + datev date, -- value date (this field should not be here, only into bank tables) + salary double(24,8), -- salary of user when payment was done + amount double(24,8) NOT NULL DEFAULT 0, + fk_projet integer DEFAULT NULL, + datesp date, -- date start period + dateep date, -- date end period + entity integer DEFAULT 1 NOT NULL, -- multi company id + note text, + fk_bank integer, + paye smallint default 1 NOT NULL, + fk_typepayment integer NOT NULL, -- default payment mode for payment + fk_account integer, -- default bank account for payment + fk_user_author integer, -- user creating + fk_user_modif integer -- user making last change +) ENGINE=innodb; + +ALTER TABLE llx_payment_salary CHANGE COLUMN fk_user fk_user integer NULL; +ALTER TABLE llx_payment_salary ADD COLUMN fk_salary integer; + +INSERT INTO llx_salary (rowid, ref, fk_user, amount, fk_projet, fk_typepayment, label, datesp, dateep, entity, note, fk_bank, paye) SELECT ps.rowid, ps.rowid, ps.fk_user, ps.amount, ps.fk_projet, ps.fk_typepayment, ps.label, ps.datesp, ps.dateep, ps.entity, ps.note, ps.fk_bank, 1 FROM llx_payment_salary ps WHERE ps.fk_salary IS NULL; +UPDATE llx_payment_salary as ps SET ps.fk_salary = ps.rowid WHERE ps.fk_salary IS NULL; +UPDATE llx_payment_salary as ps SET ps.ref = ps.rowid WHERE ps.ref IS NULL; + +ALTER TABLE llx_salary CHANGE paye paye smallint default 0 NOT NULL; diff --git a/htdocs/install/mysql/tables/llx_actioncomm.key.sql b/htdocs/install/mysql/tables/llx_actioncomm.key.sql index 64fbe874fc2..ee16386c7c4 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm.key.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm.key.sql @@ -17,7 +17,6 @@ -- -- =========================================================================== - ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_soc (fk_soc); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_contact (fk_contact); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_code (code); @@ -27,5 +26,6 @@ ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_project (fk_project); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_datep (datep); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_datep2 (datep2); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_recurid (recurid); - ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_ref_ext (ref_ext); + +ALTER TABLE llx_actioncomm ADD UNIQUE INDEX uk_actioncomm_ref (ref, entity); diff --git a/htdocs/install/mysql/tables/llx_actioncomm.sql b/htdocs/install/mysql/tables/llx_actioncomm.sql index 82d97d3ec98..9012f6b3a66 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm.sql @@ -24,6 +24,7 @@ create table llx_actioncomm ( id integer AUTO_INCREMENT PRIMARY KEY, + ref varchar(30) NOT NULL, ref_ext varchar(255), -- reference into an external system (not used by dolibarr). Example: An id coming from google calendar has length between 5 and 1024 chars. An event id must follow rule: chars used in base32hex encoding (i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938) entity integer DEFAULT 1 NOT NULL, -- multi company id datep datetime, -- date start @@ -31,7 +32,7 @@ create table llx_actioncomm fk_action integer, -- type of action (optional link with id in llx_c_actioncomm or null) code varchar(50) NULL, -- code of action for automatic action ('AC_OTH_AUTO' for automatic actions, 'AC_EMAILIN_AUTO' for email input, 'AC_xxx' for manual action...) - + datec datetime, -- date creation tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date fk_user_author integer, -- user id of user that has created record @@ -71,7 +72,11 @@ create table llx_actioncomm recurid varchar(128), -- used to store event id to link each other all the repeating event record. It can be the 'iCalUID' as in RFC5545 (an id similar for all the same serie) recurrule varchar(128), -- contains string with ical format recurring rule like 'FREQ=MONTHLY;INTERVAL=2;BYMONTHDAY=19' or 'FREQ=WEEKLY;BYDAY=MO' recurdateend datetime, -- no more recurring event after this date - + + num_vote integer DEFAULT NULL, -- use for Event Organization module + event_paid smallint NOT NULL DEFAULT 0, -- use for Event Organization module + status smallint NOT NULL DEFAULT 0, -- use for Event Organization module for now, but could be use after for event global status + fk_element integer DEFAULT NULL, -- For link to an element (proposal, invoice, order, ...) elementtype varchar(255) DEFAULT NULL, -- For link to an element (proposal, invoice, order, ...) diff --git a/htdocs/install/mysql/tables/llx_c_actioncomm.sql b/htdocs/install/mysql/tables/llx_c_actioncomm.sql index 695aabbe6e4..a2b2dffe8a7 100644 --- a/htdocs/install/mysql/tables/llx_c_actioncomm.sql +++ b/htdocs/install/mysql/tables/llx_c_actioncomm.sql @@ -21,10 +21,10 @@ create table llx_c_actioncomm ( id integer PRIMARY KEY, - code varchar(12) NOT NULL, + code varchar(50) NOT NULL, type varchar(50) DEFAULT 'system' NOT NULL, libelle varchar(48) NOT NULL, - module varchar(16) DEFAULT NULL, + module varchar(50) DEFAULT NULL, active tinyint DEFAULT 1 NOT NULL, todo tinyint, -- deprecated color varchar(9), diff --git a/htdocs/install/mysql/tables/llx_c_civility.sql b/htdocs/install/mysql/tables/llx_c_civility.sql index 1198691ed60..2084b876e7b 100644 --- a/htdocs/install/mysql/tables/llx_c_civility.sql +++ b/htdocs/install/mysql/tables/llx_c_civility.sql @@ -19,7 +19,7 @@ create table llx_c_civility ( - rowid integer PRIMARY KEY, + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL code varchar(6) NOT NULL, label varchar(50), active tinyint DEFAULT 1 NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql b/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql index 709b12de31b..12ae5b5cc17 100644 --- a/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql +++ b/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql @@ -21,3 +21,5 @@ ALTER TABLE llx_mailing_cibles ADD UNIQUE uk_mailing_cibles (fk_mailing, email); ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_email (email); +ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_tag (tag); + diff --git a/htdocs/install/mysql/tables/llx_mailing_cibles.sql b/htdocs/install/mysql/tables/llx_mailing_cibles.sql index 096142b10ad..da0b6c1683a 100644 --- a/htdocs/install/mysql/tables/llx_mailing_cibles.sql +++ b/htdocs/install/mysql/tables/llx_mailing_cibles.sql @@ -28,7 +28,7 @@ create table llx_mailing_cibles firstname varchar(160), email varchar(160) NOT NULL, other varchar(255) NULL, - tag varchar(128) NULL, + tag varchar(64) NULL, -- a unique key as a hash of: dolibarr_main_instance_unique_id;email;lastname;mailing_id;MAILING_EMAIL_UNSUBSCRIBE_KEY statut smallint NOT NULL DEFAULT 0, -- -1 = error, 0 = not sent, ... source_url varchar(255), source_id integer, diff --git a/htdocs/install/mysql/tables/llx_payment_salary.key.sql b/htdocs/install/mysql/tables/llx_payment_salary.key.sql index 946cd1a08ff..2eb07157d09 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary.key.sql +++ b/htdocs/install/mysql/tables/llx_payment_salary.key.sql @@ -24,4 +24,3 @@ ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_datesp (datesp); ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_dateep (dateep); ALTER TABLE llx_payment_salary ADD CONSTRAINT fk_payment_salary_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid); - diff --git a/htdocs/install/mysql/tables/llx_payment_salary.sql b/htdocs/install/mysql/tables/llx_payment_salary.sql index d6ad2ffcfed..308e70effc2 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary.sql +++ b/htdocs/install/mysql/tables/llx_payment_salary.sql @@ -22,7 +22,7 @@ create table llx_payment_salary ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet) tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, datec datetime, -- Create date - fk_user integer NOT NULL, + fk_user integer DEFAULT NULL, datep date, -- payment date datev date, -- value date (this field should not be here, only into bank tables) salary double(24,8), -- salary of user when payment was done @@ -37,5 +37,6 @@ create table llx_payment_salary note text, fk_bank integer, fk_user_author integer, -- user creating - fk_user_modif integer -- user making last change + fk_user_modif integer, -- user making last change + fk_salary integer )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_salary.sql b/htdocs/install/mysql/tables/llx_salary.sql new file mode 100644 index 00000000000..af4b869d9bf --- /dev/null +++ b/htdocs/install/mysql/tables/llx_salary.sql @@ -0,0 +1,44 @@ +-- =================================================================== +-- Copyright (C) 2011-2018 Alexandre Spangaro +-- Copyright (C) 2021 Gauthier VERDOL +-- +-- 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 . +-- +-- =================================================================== + +create table llx_salary +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet) + tms timestamp, + datec datetime, -- Create date + fk_user integer NOT NULL, + datep date, -- payment date + datev date, -- value date (this field should not be here, only into bank tables) + salary double(24,8), -- salary of user when payment was done + amount double(24,8) NOT NULL DEFAULT 0, + fk_projet integer DEFAULT NULL, + fk_typepayment integer NOT NULL, + num_payment varchar(50), -- num cheque or other + label varchar(255), + datesp date, -- date start period + dateep date, -- date end period + entity integer DEFAULT 1 NOT NULL, -- multi company id + note text, + fk_bank integer, + paye smallint default 0 NOT NULL, + fk_account integer, + fk_user_author integer, -- user creating + fk_user_modif integer -- user making last change +)ENGINE=innodb; diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 2a9c2bb11f2..80678abe24f 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -897,7 +897,7 @@ if ($ok && GETPOST('clean_product_stock_batch', 'alpha')) { $sql = "SELECT p.rowid, p.ref, p.tobatch, ps.rowid as psrowid, ps.fk_entrepot, ps.reel, SUM(pb.qty) as reelbatch"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p, ".MAIN_DB_PREFIX."product_stock as ps LEFT JOIN ".MAIN_DB_PREFIX."product_batch as pb ON ps.rowid = pb.fk_product_stock"; $sql .= " WHERE p.rowid = ps.fk_product"; - $sql .= " AND p.tobatch = 1"; + $sql .= " AND p.tobatch > 0"; $sql .= " GROUP BY p.rowid, p.ref, p.tobatch, ps.rowid, ps.fk_entrepot, ps.reel"; $sql .= " HAVING reel != SUM(pb.qty) or SUM(pb.qty) IS NULL"; print $sql; @@ -981,7 +981,7 @@ if ($ok && GETPOST('clean_product_stock_negative_if_batch', 'alpha')) { $sql = "SELECT p.rowid, p.ref, p.tobatch, ps.rowid as psrowid, ps.fk_entrepot, ps.reel, SUM(pb.qty) as reelbatch"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p, ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product_batch as pb"; $sql .= " WHERE p.rowid = ps.fk_product AND ps.rowid = pb.fk_product_stock"; - $sql .= " AND p.tobatch = 1"; + $sql .= " AND p.tobatch > 0"; $sql .= " GROUP BY p.rowid, p.ref, p.tobatch, ps.rowid, ps.fk_entrepot, ps.reel"; $sql .= " HAVING reel != SUM(pb.qty)"; $resql = $db->query($sql); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 9e084932477..c635809404e 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -131,7 +131,7 @@ InvoiceLinesDone=Bound lines of invoices ExpenseReportLines=Lines of expense reports to bind ExpenseReportLinesDone=Bound lines of expense reports IntoAccount=Bind line with the accounting account -TotalForAccount=Total for accounting account +TotalForAccount=Total accounting account Ventilate=Bind diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4f10f9a4dfd..d7c2132a5e9 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -37,6 +37,7 @@ UnlockNewSessions=Remove connection lock YourSession=Your session Sessions=Users Sessions WebUserGroup=Web server user/group +PermissionsOnFiles=Permissions on files PermissionsOnFilesInWebRoot=Permissions on files in web root directory PermissionsOnFile=Permissions on file %s NoSessionFound=Your PHP configuration seems to not allow listing of active sessions. The directory used to save sessions (%s) may be protected (for example by OS permissions or by PHP directive open_basedir). @@ -62,6 +63,7 @@ IfModuleEnabled=Note: yes is effective only if module %s is enabled RemoveLock=Remove/rename file %s if it exists, to allow usage of the Update/Install tool. RestoreLock=Restore file %s, with read permission only, to disable any further use of the Update/Install tool. SecuritySetup=Security setup +PHPSetup=PHP setup SecurityFilesDesc=Define here options related to security about uploading files. ErrorModuleRequirePHPVersion=Error, this module requires PHP version %s or higher ErrorModuleRequireDolibarrVersion=Error, this module requires Dolibarr version %s or higher @@ -348,9 +350,10 @@ LastActivationAuthor=Latest activation author LastActivationIP=Latest activation IP UpdateServerOffline=Update server offline WithCounter=Manage a counter -GenericMaskCodes=You may enter any numbering mask. In this mask, the following tags could be used:
{000000} corresponds to a number which will be incremented on each %s. Enter as many zeros as the desired length of the counter. The counter will be completed by zeros from the left in order to have as many zeros as the mask.
{000000+000} same as previous but an offset corresponding to the number to the right of the + sign is applied starting on first %s.
{000000@x} same as previous but the counter is reset to zero when month x is reached (x between 1 and 12, or 0 to use the early months of fiscal year defined in your configuration, or 99 to reset to zero every month). If this option is used and x is 2 or higher, then sequence {yy}{mm} or {yyyy}{mm} is also required.
{dd} day (01 to 31).
{mm} month (01 to 12).
{yy}, {yyyy} or {y} year over 2, 4 or 1 numbers.
-GenericMaskCodes2={cccc} the client code on n characters
{cccc000} the client code on n characters is followed by a counter dedicated for customer. This counter dedicated to customer is reset at same time than global counter.
{tttt} The code of third party type on n characters (see menu Home - Setup - Dictionary - Types of third parties). If you add this tag, the counter will be different for each type of third party.
-GenericMaskCodes3=All other characters in the mask will remain intact (except * or ? in 13th position in EAN13).
Spaces are not allowed.
In EAN13, the last character after the last } in 13th position should be * or ? . It will be replaced by the calculated key.
+GenericMaskCodes=You may enter any numbering mask. In this mask, the following tags can be used:
{000000} corresponds to a number which will be incremented on each %s. Enter as many zeros as the desired length of the counter. The counter will be completed by zeros from the left in order to have as many zeros as the mask.
{000000+000} same as the previous one but an offset corresponding to the number to the right of the + sign is applied starting on the first %s.
{000000@x} same as the previous one but the counter is reset to zero when month x is reached (x between 1 and 12, or 0 to use the early months of fiscal year defined in your configuration, or 99 to reset to zero every month). If this option is used and x is 2 or higher, then the sequence {yy}{mm} or {yyyy}{mm} is also required.
{dd} day (01 to 31).
{mm} month (01 to 12).
{yy}, {yyyy} or {y} year over 2, 4 or 1 numbers.
+GenericMaskCodes2={cccc} the client code on n characters
{cccc000} the client code on n characters is followed by a counter dedicated to the customer. This counter dedicated to customer is reset at same time as the global counter.
{tttt} The code of third party type on n characters (see menu Home - Setup - Dictionary - Types of third parties). If you add this tag, the counter will be different for each type of third party.
+GenericMaskCodes3=All other characters in the mask will remain intact.
Spaces are not allowed.
+GenericMaskCodes3EAN=All other characters in the mask will remain intact (except * or ? in 13th position in EAN13).
Spaces are not allowed.
In EAN13, the last character after the last } in 13th position should be * or ? . It will be replaced by the calculated key.
GenericMaskCodes4a=Example on the 99th %s of the third party TheCompany, with date 2007-01-31:
GenericMaskCodes4b=Example on third party created on 2007-03-01:
GenericMaskCodes4c=Example on product created on 2007-03-01:
@@ -1249,7 +1252,7 @@ RunningUpdateProcessMayBeRequired=Running the upgrade process seems to be requir YouMustRunCommandFromCommandLineAfterLoginToUser=You must run this command from command line after login to a shell with user %s or you must add -W option at end of command line to provide %s password. YourPHPDoesNotHaveSSLSupport=SSL functions not available in your PHP DownloadMoreSkins=More skins to download -SimpleNumRefModelDesc=Returns the reference number with format %syymm-nnnn where yy is year, mm is month and nnnn is sequential with no reset +SimpleNumRefModelDesc=Returns the reference number in the format %syymm-nnnn where yy is the year, mm is the month and nnnn is a sequential auto-incrementing number with no reset ShowProfIdInAddress=Show professional id with addresses ShowVATIntaInAddress=Hide intra-Community VAT number with addresses TranslationUncomplete=Partial translation @@ -1267,7 +1270,7 @@ MAIN_PROXY_HOST=Proxy server: Name/Address MAIN_PROXY_PORT=Proxy server: Port MAIN_PROXY_USER=Proxy server: Login/User MAIN_PROXY_PASS=Proxy server: Password -DefineHereComplementaryAttributes=Define here any additional/custom attributes that you want to be included for: %s +DefineHereComplementaryAttributes=Define any additional / custom attributes that must be added to: %s ExtraFields=Complementary attributes ExtraFieldsLines=Complementary attributes (lines) ExtraFieldsLinesRec=Complementary attributes (templates invoices lines) @@ -1511,6 +1514,7 @@ LDAPFieldLoginUnix=Login (unix) LDAPFieldLoginExample=Example: uid LDAPFilterConnection=Search filter LDAPFilterConnectionExample=Example: &(objectClass=inetOrgPerson) +LDAPGroupFilterExample=Example: &(objectClass=groupOfUsers) LDAPFieldLoginSamba=Login (samba, activedirectory) LDAPFieldLoginSambaExample=Example: samaccountname LDAPFieldFullname=Full name @@ -2096,7 +2100,7 @@ SwitchThisForABetterSecurity=Switching this value to %s is recommended for more DictionaryProductNature= Nature of product CountryIfSpecificToOneCountry=Country (if specific to a given country) YouMayFindSecurityAdviceHere=You may find security advisory here -ModuleActivatedMayExposeInformation=This module may expose sensitive data. If you don't need it, disable it. +ModuleActivatedMayExposeInformation=This PHP extension may expose sensitive data. If you don't need it, disable it. ModuleActivatedDoNotUseInProduction=A module designed for the development has been enabled. Do not enable it on a production environment. CombinationsSeparator=Separator character for product combinations SeeLinkToOnlineDocumentation=See link to online documention on top menu for examples diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 1060c02ce96..a1e04809a36 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -495,6 +495,7 @@ Reported=Delayed DisabledBecausePayments=Not possible since there are some payments CantRemovePaymentWithOneInvoicePaid=Can't remove payment since there is at least one invoice classified paid CantRemovePaymentVATPaid=Can't remove payment since VAT declaration is classified paid +CantRemovePaymentSalaryPaid=Can't remove payment since salary is classified paid ExpectedToPay=Expected payment CantRemoveConciliatedPayment=Can't remove reconciled payment PayedByThisPayment=Paid by this payment @@ -502,6 +503,7 @@ ClosePaidInvoicesAutomatically=Classify automatically all standard, down payment ClosePaidCreditNotesAutomatically=Classify automatically all credit notes as "Paid" when refund is done entirely. ClosePaidContributionsAutomatically=Classify automatically all social or fiscal contributions as "Paid" when payment is done entirely. ClosePaidVATAutomatically=Classify automatically VAT declaration as "Paid" when payment is done entirely. +ClosePaidSalaryAutomatically=Classify automatically salary as "Paid" when payment is done entirely. AllCompletelyPayedInvoiceWillBeClosed=All invoices with no remainder to pay will be automatically closed with status "Paid". ToMakePayment=Pay ToMakePaymentBack=Pay back diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 2181b48ecb4..21d282cd794 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -68,6 +68,7 @@ ActionAC_OTH_AUTO=Other auto ActionAC_MANUAL=Manually inserted events ActionAC_AUTO=Automatically inserted events ActionAC_OTH_AUTOShort=Other +ActionAC_EVENTORGANIZATION=Event organization events Stats=Sales statistics StatusProsp=Prospect status DraftPropals=Draft commercial proposals diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 23e6cf0d724..35b785c1f7c 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -86,7 +86,7 @@ PaymentCustomerInvoice=Customer invoice payment PaymentSupplierInvoice=vendor invoice payment PaymentSocialContribution=Social/fiscal tax payment PaymentVat=VAT payment -AutomaticCreationPayment=Automatically create a total payment +AutomaticCreationPayment=Automatically record the payment of the salary ListPayment=List of payments ListOfCustomerPayments=List of customer payments ListOfSupplierPayments=List of vendor payments @@ -139,12 +139,16 @@ DateChequeReceived=Check reception date NbOfCheques=No. of checks PaySocialContribution=Pay a social/fiscal tax PayVAT=Pay a VAT declaration +PaySalary=Pay a salary card ConfirmPaySocialContribution=Are you sure you want to classify this social or fiscal tax as paid ? ConfirmPayVAT=Are you sure you want to classify this VAT declaration as paid ? +ConfirmPaySalary=Are you sure you want to classify this salary card as paid? DeleteSocialContribution=Delete a social or fiscal tax payment DeleteVAT=Delete a VAT declaration +DeleteSalary=Delete a salary card ConfirmDeleteSocialContribution=Are you sure you want to delete this social/fiscal tax payment ? ConfirmDeleteVAT=Are you sure you want to delete this VAT declaration ? +ConfirmDeleteSalary=Are you sure you want to delete this salary? ExportDataset_tax_1=Social and fiscal taxes and payments CalcModeVATDebt=Mode %sVAT on commitment accounting%s. CalcModeVATEngagement=Mode %sVAT on incomes-expenses%s. @@ -244,6 +248,7 @@ ACCOUNTING_ACCOUNT_SUPPLIER=Accounting account used for vendor third parties ACCOUNTING_ACCOUNT_SUPPLIER_Desc=The dedicated accounting account defined on third party card will be used for Subledger accounting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated vendor accounting account on third party is not defined. ConfirmCloneTax=Confirm the clone of a social/fiscal tax ConfirmCloneVAT=Confirm the clone of a VAT declaration +ConfirmCloneSalary=Confirm the clone of a salary CloneTaxForNextMonth=Clone it for next month SimpleReport=Simple report AddExtraReport=Extra reports (add foreign and national customer report) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 9e56c5f5c3a..0fd3ab0b2a6 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -291,4 +291,5 @@ WarningSomeBankTransactionByChequeWereRemovedAfter=Some bank transaction were re WarningFailedToAddFileIntoDatabaseIndex=Warning, failed to add file entry into ECM database index table WarningTheHiddenOptionIsOn=Warning, the hidden option %s is on. WarningCreateSubAccounts=Warning, you can't create directly a sub account, you must create a third party or an user and assign them an accounting code to find them in this list -WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection. \ No newline at end of file +WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection. +WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here. \ No newline at end of file diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index eb2cd89adf1..2393a02ee50 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -13,7 +13,7 @@ ToReviewCP=Awaiting approval ApprovedCP=Approved CancelCP=Canceled RefuseCP=Refused -ValidatorCP=Approbator +ValidatorCP=Approver ListeCP=List of leave Leave=Leave request LeaveId=Leave ID @@ -39,11 +39,11 @@ TitreRequestCP=Leave request TypeOfLeaveId=Type of leave ID TypeOfLeaveCode=Type of leave code TypeOfLeaveLabel=Type of leave label -NbUseDaysCP=Number of days of vacation consumed -NbUseDaysCPHelp=The calculation takes into account the non working days and the holidays defined in the dictionary. -NbUseDaysCPShort=Days consumed -NbUseDaysCPShortInMonth=Days consumed in month -DayIsANonWorkingDay=%s is a non working day +NbUseDaysCP=Number of days of leave used +NbUseDaysCPHelp=The calculation takes into account the non-working days and the holidays defined in the dictionary. +NbUseDaysCPShort=Days of leave +NbUseDaysCPShortInMonth=Days of leave in month +DayIsANonWorkingDay=%s is a non-working day DateStartInMonth=Start date in month DateEndInMonth=End date in month EditCP=Edit @@ -55,7 +55,7 @@ TitleDeleteCP=Delete the leave request ConfirmDeleteCP=Confirm the deletion of this leave request? ErrorCantDeleteCP=Error you don't have the right to delete this leave request. CantCreateCP=You don't have the right to make leave requests. -InvalidValidatorCP=You must choose an approbator to your leave request. +InvalidValidatorCP=You must choose the approver for your leave request. NoDateDebut=You must select a start date. NoDateFin=You must select an end date. ErrorDureeCP=Your leave request does not contain working day. @@ -80,14 +80,14 @@ UserCP=User ErrorAddEventToUserCP=An error occurred while adding the exceptional leave. AddEventToUserOkCP=The addition of the exceptional leave has been completed. MenuLogCP=View change logs -LogCP=Log of updates of available vacation days -ActionByCP=Performed by -UserUpdateCP=For the user +LogCP=Log of all updates made to "Balance of Leave" +ActionByCP=Updated by +UserUpdateCP=Updated for PrevSoldeCP=Previous Balance NewSoldeCP=New Balance alreadyCPexist=A leave request has already been done on this period. -FirstDayOfHoliday=First day of vacation -LastDayOfHoliday=Last day of vacation +FirstDayOfHoliday=Beginning day of leave request +LastDayOfHoliday=Ending day of leave request BoxTitleLastLeaveRequests=Latest %s modified leave requests HolidaysMonthlyUpdate=Monthly update ManualUpdate=Manual update @@ -104,8 +104,8 @@ LEAVE_SICK=Sick leave LEAVE_OTHER=Other leave LEAVE_PAID_FR=Paid vacation ## Configuration du Module ## -LastUpdateCP=Latest automatic update of leave allocation -MonthOfLastMonthlyUpdate=Month of latest automatic update of leave allocation +LastUpdateCP=Last automatic update of leave allocation +MonthOfLastMonthlyUpdate=Month of last automatic update of leave allocation UpdateConfCPOK=Updated successfully. Module27130Name= Management of leave requests Module27130Desc= Management of leave requests @@ -125,8 +125,8 @@ HolidaysCanceledBody=Your leave request for %s to %s has been canceled. FollowedByACounter=1: This type of leave need to be followed by a counter. Counter is incremented manually or automatically and when a leave request is validated, counter is decremented.
0: Not followed by a counter. NoLeaveWithCounterDefined=There is no leave types defined that need to be followed by a counter GoIntoDictionaryHolidayTypes=Go into Home - Setup - Dictionaries - Type of leave to setup the different types of leaves. -HolidaySetup=Setup of module Holiday -HolidaysNumberingModules=Leave requests numbering models +HolidaySetup=Setup of module Leave +HolidaysNumberingModules=Numbering models for leave requests TemplatePDFHolidays=Template for leave requests PDF FreeLegalTextOnHolidays=Free text on PDF WatermarkOnDraftHolidayCards=Watermarks on draft leave requests diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 79f3fb3518e..444ceb7f64e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -726,7 +726,7 @@ MenuMembers=Members MenuAgendaGoogle=Google agenda MenuTaxesAndSpecialExpenses=Taxes | Special expenses ThisLimitIsDefinedInSetup=Dolibarr limit (Menu home-setup-security): %s Kb, PHP limit: %s Kb -NoFileFound=No documents saved in this directory +NoFileFound=No documents uploaded CurrentUserLanguage=Current language CurrentTheme=Current theme CurrentMenuManager=Current menu manager diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 3ab83908ff5..36adfd571fb 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -24,3 +24,5 @@ ProductLotSetup=Setup of module lot/serial ShowCurrentStockOfLot=Show current stock for couple product/lot ShowLogOfMovementIfLot=Show log of movements for couple product/lot StockDetailPerBatch=Stock detail per lot +SerialNumberAlreadyInUse=Serial number %s is already used for product %s +TooManyQtyForSerialNumber=You can only have one product %s for serial number %S diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index 7c3c08a65bd..6b4fdc94163 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -2,12 +2,15 @@ SALARIES_ACCOUNTING_ACCOUNT_PAYMENT=Accounting account used for user third parties SALARIES_ACCOUNTING_ACCOUNT_PAYMENT_Desc=The dedicated accounting account defined on user card will be used for Subledger accounting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated user accounting account on user is not defined. SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Accounting account by default for wage payments +CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT=By default, leave empty the option "Automatically create a total payment" when creating a Salary Salary=Salary Salaries=Salaries -NewSalaryPayment=New salary payment +NewSalary=New salary +NewSalaryPayment=New salary card AddSalaryPayment=Add salary payment SalaryPayment=Salary payment SalariesPayments=Salaries payments +SalariesPaymentsOf=Salaries payments of %s ShowSalaryPayment=Show salary payment THM=Average hourly rate TJM=Average daily rate diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index de31172e9d7..1f53a5737ff 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -33,7 +33,7 @@ ExpenseReportCanceledMessage=The expense report %s was canceled.
- User: %s< ExpenseReportPaid=An expense report was paid ExpenseReportPaidMessage=The expense report %s was paid.
- User: %s
- Paid by: %s
Click here to show the expense report: %s TripId=Id expense report -AnyOtherInThisListCanValidate=Person to inform for validation. +AnyOtherInThisListCanValidate=Person to be informed for validating the request. TripSociete=Information company TripNDF=Informations expense report PDFStandardExpenseReports=Standard template to generate a PDF document for expense report diff --git a/htdocs/langs/fr_FR/accountancy.lang b/htdocs/langs/fr_FR/accountancy.lang index 4441dd4e1f9..3b2fc290352 100644 --- a/htdocs/langs/fr_FR/accountancy.lang +++ b/htdocs/langs/fr_FR/accountancy.lang @@ -131,7 +131,7 @@ InvoiceLinesDone=Lignes de factures liées ExpenseReportLines=Lignes de notes de frais à lier ExpenseReportLinesDone=Lignes de notes de frais liées IntoAccount=Lier ligne avec le compte comptable -TotalForAccount=Total pour le compte comptable +TotalForAccount=Total compte comptable Ventilate=Lier diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index 76cba909e2c..94ceb434bfd 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -24,3 +24,5 @@ ProductLotSetup=Configuration du module lot/série ShowCurrentStockOfLot=Afficher le stock actuel pour le couple produit / lot ShowLogOfMovementIfLot=Afficher l'historique des mouvements de couple produit / lot StockDetailPerBatch=Stock détaillé par lot +SerialNumberAlreadyInUse=Le numéro de série %s est déjà utilisé pour le produit %s +TooManyQtyForSerialNumber=Vous ne pouvez avoir qu'un produit %s avec le numéro de série %s diff --git a/htdocs/langs/fr_FR/salaries.lang b/htdocs/langs/fr_FR/salaries.lang index f4138177a16..73ab172a424 100644 --- a/htdocs/langs/fr_FR/salaries.lang +++ b/htdocs/langs/fr_FR/salaries.lang @@ -2,6 +2,7 @@ SALARIES_ACCOUNTING_ACCOUNT_PAYMENT=Compte comptable utilisé pour les utilisateurs SALARIES_ACCOUNTING_ACCOUNT_PAYMENT_Desc=Le compte comptable défini sur la fiche utilisateur sera utilisé uniquement pour la comptabilité auxiliaire. Celui-ci sera utilisé pour le grand livre et comme valeur par défaut de la comptabilité auxiliaire si le compte dédié de l'utilisateur n'est pas défini. SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Compte comptable par défaut pour les paiements de salaires +CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT=Par défaut, laisser vide l’option « Créer automatiquement un règlement total » lors de la création d'un Salaire Salary=Salaire Salaries=Salaires NewSalaryPayment=Nouveau règlement de salaire diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 2b17b0f84f8..b4428312018 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -356,7 +356,7 @@ class MyObject extends CommonObject if (!$error) { // copy external contacts if same company - if (property_exists($this, 'socid') && $this->socid == $object->socid) { + if (property_exists($this, 'fk_soc') && $this->fk_soc == $object->socid) { if ($this->copy_linked_contact($object, 'external') < 0) { $error++; } diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index c5529e54884..d911a53ef5e 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -96,7 +96,7 @@ class Mo extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>'1', 'noteditable'=>1), - 'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:t.status=1', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM", 'css'=>'maxwidth300'), + 'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:t.status=1', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM", 'css'=>'minwidth100 maxwidth300'), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'picto'=>'product'), 'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'1',), @@ -168,7 +168,7 @@ class Mo extends CommonObject /** * @var string Name of subtable line */ - public $table_element_line = 'mo_production'; + public $table_element_line = 'mrp_production'; /** * @var string Field with ID of parent key if this field has a parent @@ -632,9 +632,21 @@ class Mo extends CommonObject $moline->fk_mo = $this->id; $moline->qty = $this->qty; $moline->fk_product = $this->fk_product; - $moline->role = 'toproduce'; $moline->position = 1; + if ($this->fk_bom > 0) { // If a BOM is defined, we know what to consume. + include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; + $bom = new Bom($this->db); + $bom->fetch($this->fk_bom); + if ($bom->bomtype == 1) { + $role = 'toproduce'; + $moline->role = 'toconsume'; + } else { + $role = 'toconsume'; + $moline->role = 'toproduce'; + } + } + $resultline = $moline->create($user, false); // Never use triggers here if ($resultline <= 0) { $error++; @@ -644,9 +656,6 @@ class Mo extends CommonObject } if ($this->fk_bom > 0) { // If a BOM is defined, we know what to consume. - include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; - $bom = new Bom($this->db); - $bom->fetch($this->fk_bom); if ($bom->id > 0) { // Lines to consume if (!$error) { @@ -667,7 +676,7 @@ class Mo extends CommonObject break; } else { $moline->fk_product = $line->fk_product; - $moline->role = 'toconsume'; + $moline->role = $role; $moline->position = $line->position; $moline->qty_frozen = $line->qty_frozen; $moline->disable_stock_change = $line->disable_stock_change; diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index ed78c46f133..89292973214 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -76,7 +76,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // Default sort order (if not yet defined by previous GETPOST) if (!$sortfield) { - $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. + $sortfield = "t.ref"; // Set here default search field. By default 1st field in definition. } if (!$sortorder) { $sortorder = "ASC"; diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 5b01aff6207..6f35f1f1a25 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -48,7 +48,7 @@ $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mocard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); -//$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOST('lineid', 'int'); $collapse = GETPOST('collapse', 'aZ09comma'); @@ -724,6 +724,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ''; } + if ($permissiontodelete) { + print ''; + } print ''; if ($action == 'addconsumeline') { @@ -849,6 +852,17 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($conf->productbatch->enabled) { print ''; // Lot } + if ($permissiontodelete) { + $href = $_SERVER["PHP_SELF"]; + $href .= '?id='.$object->id; + $href .= '&action=deleteline'; + $href .= '&lineid='.$line->id; + print ''; + print ''; + print img_picto('', "delete"); + print ''; + print ''; + } print ''; // Show detailed of already consumed with js code to collapse diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 3eccae1e114..d7080e39417 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1084,11 +1084,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Batch number management if (!empty($conf->productbatch->enabled)) { print ''.$langs->trans("ManageLotSerial").''; - if (empty($conf->global ->MAIN_ADVANCE_NUMLOT)) { - $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch")); - } else { - $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); - } + $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); print $form->selectarray('status_batch', $statutarray, GETPOST('status_batch')); print ''; } @@ -1548,11 +1544,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($conf->productbatch->enabled) { if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { print ''.$langs->trans("ManageLotSerial").''; - if (empty($conf->global ->MAIN_ADVANCE_NUMLOT)) { - $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch")); - } else { - $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); - } + $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); print $form->selectarray('status_batch', $statutarray, $object->status_batch); print ''; } @@ -2040,11 +2032,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($conf->productbatch->enabled)) { if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { print ''.$langs->trans("ManageLotSerial").''; - if (!empty($conf->use_javascript_ajax) && $usercancreate && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE) && empty($conf->global->MAIN_ADVANCE_NUMLOT)) { - print ajax_object_onoff($object, 'status_batch', 'tobatch', 'ProductStatusOnBatch', 'ProductStatusNotOnBatch'); - } else { - print $object->getLibStatut(0, 2); - } + print $object->getLibStatut(0, 2); print ''; } } diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 2f2d24f7458..c38437fb2f0 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -165,9 +165,10 @@ class Products extends DolibarrApi * @param int $mode Use this param to filter list (0 for all, 1 for only product, 2 for only service) * @param int $category Use this param to filter list by category * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" + * @param bool $ids_only Return only IDs of product instead of all properties (faster, above all if list is long) * @return array Array of product objects */ - public function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '') + public function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '', $ids_only = false) { global $db, $conf; @@ -219,9 +220,13 @@ class Products extends DolibarrApi $i = 0; while ($i < $min) { $obj = $this->db->fetch_object($result); - $product_static = new Product($this->db); - if ($product_static->fetch($obj->rowid)) { - $obj_ret[] = $this->_cleanObjectDatas($product_static); + if (!$ids_only) { + $product_static = new Product($this->db); + if ($product_static->fetch($obj->rowid)) { + $obj_ret[] = $this->_cleanObjectDatas($product_static); + } + } else { + $obj_ret[] = $obj->rowid; } $i++; } @@ -1794,24 +1799,24 @@ class Products extends DolibarrApi } /** - * Get properties of a product object - * + * Get properties of 1 product object. * Return an array with product information. * - * @param int $id ID of product - * @param string $ref Ref of element - * @param string $ref_ext Ref ext of element - * @param string $barcode Barcode of element - * @param int $includestockdata Load also information about stock (slower) - * @param bool $includesubproducts Load information about subproducts (if product is a virtual product) - * @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product) - * @return array|mixed Data without useless information + * @param int $id ID of product + * @param string $ref Ref of element + * @param string $ref_ext Ref ext of element + * @param string $barcode Barcode of element + * @param int $includestockdata Load also information about stock (slower) + * @param bool $includesubproducts Load information about subproducts (if product is a virtual product) + * @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product) + * @param bool $includeifobjectisused Check if product object is used and set is_object_used with result. + * @return array|mixed Data without useless information * * @throws RestException 401 * @throws RestException 403 * @throws RestException 404 */ - private function _fetch($id, $ref = '', $ref_ext = '', $barcode = '', $includestockdata = 0, $includesubproducts = false, $includeparentid = false) + private function _fetch($id, $ref = '', $ref_ext = '', $barcode = '', $includestockdata = 0, $includesubproducts = false, $includeparentid = false, $includeifobjectisused = false) { if (empty($id) && empty($ref) && empty($ref_ext) && empty($barcode)) { throw new RestException(400, 'bad value for parameter id, ref, ref_ext or barcode'); @@ -1866,6 +1871,10 @@ class Products extends DolibarrApi } } + if ($includeifobjectisused) { + $this->product->is_object_used = ($this->product->isObjectUsed() > 0); + } + return $this->_cleanObjectDatas($this->product); } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 99e571fb8b7..97daf343d3f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -92,10 +92,10 @@ class Product extends CommonObject public $regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into images.lib.php - /* - * @deprecated - * @see label - */ + /** + * @deprecated + * @see $label + */ public $libelle; /** @@ -407,6 +407,14 @@ class Product extends CommonObject */ public $supplierprices; + /** + * Property set to save result of isObjectUsed(). Used for example by Product API. + * + * @var boolean + */ + public $is_object_used; + + /** * @var array fields of object product */ @@ -4747,10 +4755,10 @@ class Product extends CommonObject if ($type == 2) { switch ($mode) { case 0: - $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial'))); + $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : ($status == 1 ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial'))); return dolGetStatus($label); case 1: - $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort'))); + $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : ($status == 1 ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort'))); return dolGetStatus($label); case 2: return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 1, 2); @@ -4788,10 +4796,10 @@ class Product extends CommonObject $labelStatus = $langs->trans('ProductStatusOnBuyShort'); $labelStatusShort = $langs->trans('ProductStatusOnBuy'); } elseif ($type == 2) { - $labelStatus = ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial')); - $labelStatusShort = ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort')); + $labelStatus = ($status == 1 ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial')); + $labelStatusShort = ($status == 1 ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort')); } - } elseif (! empty($conf->global->MAIN_ADVANCE_NUMLOT) && $type == 2 && $status == 2) { + } elseif ( $type == 2 && $status == 2 ) { $labelStatus = $langs->trans('ProductStatusOnSerial'); $labelStatusShort = $langs->trans('ProductStatusOnSerialShort'); } diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 40a7b3f6f64..dea3b46c946 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -425,7 +425,6 @@ if ($object->id > 0) { print ''; // Line to add a new line in inventory - //if ($action == 'addline') { if ($object->status == $object::STATUS_VALIDATED) { print ''; print ''; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 1e96e7d97f8..5bc973e56b7 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -971,18 +971,13 @@ if ($resql) { // To batch if (!empty($arrayfields['p.tobatch']['checked'])) { print ''; - - if (empty($conf->global ->MAIN_ADVANCE_NUMLOT)) { - print $form->selectyesno('search_tobatch', $search_tobatch, 1, false, 1); - } else { - $statutarray = array( - '-1' => '', - '0' => $langs->trans("ProductStatusNotOnBatchShort"), - '1' => $langs->trans("ProductStatusOnBatchShort"), - '2' => $langs->trans("ProductStatusOnSerialShort") - ); - print $form->selectarray('search_tobatch', $statutarray, $search_tobatch); - } + $statutarray = array( + '-1' => '', + '0' => $langs->trans("ProductStatusNotOnBatchShort"), + '1' => $langs->trans("ProductStatusOnBatchShort"), + '2' => $langs->trans("ProductStatusOnSerialShort") + ); + print $form->selectarray('search_tobatch', $statutarray, $search_tobatch); print ''; } // Country @@ -1672,11 +1667,7 @@ if ($resql) { // Lot/Serial if (!empty($arrayfields['p.tobatch']['checked'])) { print ''; - if (empty($conf->global->MAIN_ADVANCE_NUMLOT)) { - print yn($obj->tobatch); - } else { - print $product_static->getLibStatut(1, 2); - } + print $product_static->getLibStatut(1, 2); print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 408c169e363..2b8561e7d75 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1185,6 +1185,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print dol_get_fiche_head(''); + print '
'; print ''; // VAT @@ -1271,6 +1272,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print '
'; + print '
'; print dol_get_fiche_end(); @@ -1318,6 +1320,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print $langs->trans('UseMultipriceRules').' price_autogen ? 'checked' : '').'>

'; } + print '
'; print ''; print ''; @@ -1392,6 +1395,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print ''; print '
'; + print '
'; //print dol_get_fiche_end(); @@ -1493,7 +1497,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul print ''; // Date - print "".dol_print_date($db->jdate($objp->dp), "dayhour").""; + print "".dol_print_date($db->jdate($objp->dp), "dayhour", 'tzuserrel').""; // Price level if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { @@ -1665,13 +1669,11 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ''; - print dol_get_fiche_head(); - print ''; print ''; print ''; print ''; print ''; @@ -1721,14 +1723,13 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print '
'.$langs->trans('ThirdParty').''; - print $form->select_company('', 'socid', 's.client IN (1,2,3)', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300'); + print img_picto('', 'company').$form->select_company('', 'socid', 's.client IN (1,2,3)', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300'); print '
'; - print dol_get_fiche_end(); print '
'; // Update all child soc print '
'; - print ' '; - print $langs->trans('ForceUpdateChildPriceSoc'); + print ' '; + print ''; print '
'; print ''; @@ -1753,14 +1754,12 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ''; - print dol_get_fiche_head(); - print ''; print ''; - print ''; + print ''; $staticsoc = new Societe($db); $staticsoc->fetch($prodcustprice->fk_soc); - print ""; + print ""; print ''; // Ref. Customer @@ -1768,12 +1767,12 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; // VAT - print ''; // Price base - print ''; print ''; // Price - print ''; - // Update all child soc - print ''; - print ''; - print ''; - print '
'.$langs->trans('ThirdParty').''.$langs->trans('ThirdParty').'".$staticsoc->getNomUrl(1)."".$staticsoc->getNomUrl(1)."
'.$langs->trans("DefaultTaxRate").''; + print '
'.$langs->trans("DefaultTaxRate").''; print $form->load_tva("tva_tx", $prodcustprice->default_vat_code ? $prodcustprice->tva_tx.' ('.$prodcustprice->default_vat_code.')' : $prodcustprice->tva_tx, $mysoc, '', $object->id, $prodcustprice->recuperableonly, $object->type, false, 1); print '
'; + print '
'; print $langs->trans('PriceBase'); print ''; @@ -1782,7 +1781,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print '
'; + print '
'; $text = $langs->trans('SellingPrice'); print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); print ''; @@ -1809,21 +1808,13 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } print '
'; - print ''; - print '
'; - print dol_get_fiche_end(); print '
'; print '
'; - print ' '; - print $langs->trans('ForceUpdateChildPriceSoc'); + print ' '; + print ''; print "
"; print ''; @@ -1866,6 +1857,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ''; + print '
'; print ''; print ''; @@ -1915,8 +1907,8 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ""; - print ''; - print ""; + print ''; + print ""; print '"; print ''; } print "
".$staticsoc->getNomUrl(1)."' . $line->ref_customer . '".dol_print_date($line->datec, "dayhour")."'.$line->ref_customer.'".dol_print_date($line->datec, "dayhour", 'tzuserrel')."'.$langs->trans($line->price_base_type)."'; @@ -1960,6 +1952,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print '
"; + print '
'; } else { print $langs->trans('None'); } @@ -1986,6 +1979,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ''; + print '
'; print ''; if (count($prodcustprice->lines) > 0 || $search_soc) { @@ -2020,7 +2014,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ''; print ''; - print ''; + print ''; print ''; // Line for default price @@ -2081,15 +2075,14 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; if ($user->rights->produit->supprimer || $user->rights->service->supprimer) { - print ''; } print "\n"; @@ -2124,8 +2117,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ""; print ''; - print ""; - + print ""; print '"; print '"; @@ -2185,16 +2178,9 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print "\n"; } } - /*else - { - $colspan=9; - if ($user->rights->produit->supprimer || $user->rights->service->supprimer) $colspan+=1; - print ""; - print ''; - print ""; - }*/ print "
'.$langs->trans("MinPrice").' '.$langs->trans("HT").''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''.$langs->trans("ChangedBy").' 
'; print ''; - print 'id.'">'; + print ''; + print 'id.'">'; print img_info($langs->trans('PriceByCustomerLog')); print ''; print ' '; - print 'id.'">'; + print 'id.'">'; print img_edit('default', 0, 'style="vertical-align: middle;"'); print ''; - print '   '; print '
".$staticsoc->getNomUrl(1)."' . $line->ref_customer . '".dol_print_date($line->datec, "dayhour")."".dol_print_date($line->datec, "dayhour", 'tzuserrel')."'.$langs->trans($line->price_base_type)."'; @@ -2142,6 +2134,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { if (empty($positiverates)) { $positiverates = '0'; } + echo vatrate($positiverates.($line->default_vat_code ? ' ('.$line->default_vat_code.')' : ''), '%', ($line->tva_npr ? $line->tva_npr : $line->recuperableonly)); print "
'.$langs->trans('None').'
"; + print '
'; print ""; } diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 17fe7193658..59bc60f342b 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -192,7 +192,7 @@ class MouvementStock extends CommonObject } } // end hook at beginning - + // Clean parameters $price = price2num($price, 'MU'); // Clean value for the casse we receive a float zero value, to have it a real zero value. if (empty($price)) $price = 0; @@ -568,14 +568,32 @@ class MouvementStock extends CommonObject // Update detail stock for batch product if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { - if ($id_product_batch > 0) + // check unicity for serial numbered equipments ( different for lots managed products) + if ( $product->status_batch == 2 && $qty > 0 ) { - $result = $this->createBatch($id_product_batch, $qty); - } else { - $param_batch = array('fk_product_stock' =>$fk_product_stock, 'batchnumber'=>$batch); - $result = $this->createBatch($param_batch, $qty); + if ( $this->getBatchCount($fk_product, $batch) > 0 ) + { + $error++; + $this->errors[] = $langs->trans("SerialNumberAlreadyInUse", $batch, $product->ref); + } + elseif ( $qty > 1 ) + { + $error++; + $this->errors[] = $langs->trans("TooManyQtyForSerialNumber", $product->ref, $batch); + } + } + + if ( ! $error ) + { + if ($id_product_batch > 0) + { + $result = $this->createBatch($id_product_batch, $qty); + } else { + $param_batch = array('fk_product_stock' =>$fk_product_stock, 'batchnumber'=>$batch); + $result = $this->createBatch($param_batch, $qty); + } + if ($result < 0) $error++; } - if ($result < 0) $error++; } // Update PMP and denormalized value of stock qty at product level @@ -1208,4 +1226,39 @@ class MouvementStock extends CommonObject return $this->deleteCommon($user, $notrigger); //return $this->deleteCommon($user, $notrigger, 1); } + + /** + * Retrieve number of equipments for a product batch + * + * @param int $fk_product Product id + * @param varchar $batch batch number + * @return int <0 if KO, number of equipments if OK + */ + private function getBatchCount($fk_product, $batch) + { + global $conf; + + $cpt = 0; + + $sql = "SELECT sum(pb.qty) as cpt"; + $sql .= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."product_stock as ps ON ps.rowid = pb.fk_product_stock"; + $sql .= " WHERE ps.fk_product = " . $fk_product; + $sql .= " AND pb.batch = '" . $this->db->escape($batch) . "'"; + + $result = $this->db->query($sql); + if ($result) { + if ($this->db->num_rows($result)) { + $obj = $this->db->fetch_object($result); + $cpt = $obj->cpt; + } + + $this->db->free($result); + } else { + dol_print_error($this->db); + return -1; + } + + return $cpt; + } } diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 6aacdca2b6c..32c7f7c6ee3 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -133,18 +133,24 @@ if (empty($reshook)) { $backurlforlist = dol_buildpath('/product/stock/productlot_list.php', 1); if ($action == 'seteatby' && $user->rights->stock->creer) { - $newvalue = dol_mktime(12, 0, 0, $_POST['eatbymonth'], $_POST['eatbyday'], $_POST['eatbyyear']); + $newvalue = dol_mktime(12, 0, 0, GETPOST('eatbymonth', 'int'), GETPOST('eatbyday', 'int'), GETPOST('eatbyyear', 'int')); $result = $object->setValueFrom('eatby', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY'); if ($result < 0) { - dol_print_error($db, $object->error); + setEventMessages($object->error, null, 'errors'); + $action == 'editeatby'; + } else { + $action = 'view'; } } if ($action == 'setsellby' && $user->rights->stock->creer) { - $newvalue = dol_mktime(12, 0, 0, $_POST['sellbymonth'], $_POST['sellbyday'], $_POST['sellbyyear']); + $newvalue = dol_mktime(12, 0, 0, GETPOST('sellbymonth', 'int'), GETPOST('sellbyday', 'int'), GETPOST('sellbyyear', 'int')); $result = $object->setValueFrom('sellby', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY'); if ($result < 0) { - dol_print_error($db, $object->error); + setEventMessages($object->error, null, 'errors'); + $action == 'editsellby'; + } else { + $action = 'view'; } } @@ -172,8 +178,9 @@ if (empty($reshook)) { } } - if ($error) + if ($error) { $action = 'edit_extras'; + } } // Action to add record @@ -415,7 +422,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } - // Other attributes. Fields from hook formObjectOptions and Extrafields. + // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print ''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index fa9dc351a60..353fff374fc 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -6,6 +6,7 @@ * Copyright (C) 2015-2019 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Josep Lluís Amador + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -92,7 +93,7 @@ if (!empty($conf->banque->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; } if (!empty($conf->salaries->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; + require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; } if (!empty($conf->categorie->enabled)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -564,7 +565,7 @@ $listofreferent = array( 'salaries'=>array( 'name'=>"Salaries", 'title'=>"ListSalariesAssociatedProject", - 'class'=>'PaymentSalary', + 'class'=>'Salary', 'table'=>'payment_salary', 'datefieldname'=>'datev', 'margin'=>'minus', diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index fe333a2d01e..32a12ff36fd 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -137,6 +137,7 @@ $arrayfields = array( 't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>8), 't.progress'=>array('label'=>$langs->trans("ProgressDeclared"), 'checked'=>1, 'position'=>9), 't.progress_summary'=>array('label'=>$langs->trans("TaskProgressSummary"), 'checked'=>1, 'position'=>10), + 'c.assigned'=>array('label'=>$langs->trans("TaskRessourceLinks"), 'checked'=>1, 'position'=>11), ); if ($object->usage_bill_time) { $arrayfields['t.tobill'] = array('label'=>$langs->trans("TimeToBill"), 'checked'=>0, 'position'=>11); @@ -808,10 +809,17 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; } } - + // Contacts of task, disabled because available by default jsut after + /* if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) { print ''; } + */ + + if (!empty($arrayfields['c.assigned']['checked'])) { + print ''; + print ''; + } $extrafieldsobjectkey = $taskstatic->table_element; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -863,9 +871,15 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print_liste_field_titre($arrayfields['t.billed']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right '); } } + // Contacts of task, disabled because available by default jsut after + /* if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) { print_liste_field_titre("TaskRessourceLinks", $_SERVER["PHP_SELF"], '', '', $param, $sortfield, $sortorder); } + */ + if (!empty($arrayfields['c.assigned']['checked'])) { + print_liste_field_titre($arrayfields['c.assigned']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right ', ''); + } // Extra fields $disablesortlink = 1; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; diff --git a/htdocs/public/cron/cron_run_jobs_by_url.php b/htdocs/public/cron/cron_run_jobs_by_url.php index e5636e4245a..aaf7e38cac8 100644 --- a/htdocs/public/cron/cron_run_jobs_by_url.php +++ b/htdocs/public/cron/cron_run_jobs_by_url.php @@ -107,6 +107,8 @@ if ($result < 0) { exit; } } +$user->getrights(); + $id = GETPOST('id', 'alpha'); // We accept non numeric id. We will filter later. diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index 929433d88e0..454201203cc 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -46,6 +46,9 @@ if (!defined('NOREQUIREMENU')) { if (!defined('NOIPCHECK')) { define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip } +if (!defined("NOSESSION")) { + define("NOSESSION", '1'); +} /** * Header empty @@ -67,6 +70,8 @@ function llxFooter() require '../../main.inc.php'; +$mtid = GETPOST('mtid'); +$email = GETPOST('email'); $tag = GETPOST('tag'); $securitykey = GETPOST('securitykey'); @@ -83,23 +88,55 @@ if ($securitykey != $conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) { } if (!empty($tag)) { - $statut = '2'; - $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".$statut." WHERE tag='".$db->escape($tag)."'"; - dol_syslog("public/emailing/mailing-read.php : Mail read : ".$sql, LOG_DEBUG); + dol_syslog("public/emailing/mailing-read.php : Update status of email target and thirdparty for tag ".$tag, LOG_DEBUG); + + $sql = "SELECT mc.rowid, mc.email, mc.statut, mc.source_type, mc.source_id, m.entity"; + $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."mailing as m"; + $sql .= " WHERE mc.fk_mailing = m.rowid AND mc.tag='".$db->escape($tag)."'"; $resql = $db->query($sql); + if (!$resql) dol_print_error($db); + + $obj = $db->fetch_object($resql); + + if (empty($obj)) { + print 'Email target not valid. Operation canceled.'; + exit; + } + if (empty($obj->email)) { + print 'Email target not valid. Operation canceled.'; + exit; + } + if ($obj->statut == 2 || $obj->statut == 3) { + print 'Email target already set to read or unsubscribe. Operation canceled.'; + exit; + } + // TODO Test that mtid and email match also with the one found from $tag + /* + if ($obj->email != $email) + { + print 'Email does not match tagnot found. No need to unsubscribe.'; + exit; + } + */ + + //Update status of target + $statut = '2'; + $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".$statut." WHERE rowid = ".((int) $obj->rowid); + $resql = $db->query($sql); + if (!$resql) dol_print_error($db); //Update status communication of thirdparty prospect - $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=3 WHERE fk_stcomm != -1 AND rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag='".$db->escape($tag)."' AND source_type='thirdparty' AND source_id is not null)"; - dol_syslog("public/emailing/mailing-read.php : Mail read thirdparty : ".$sql, LOG_DEBUG); - - $resql = $db->query($sql); + if ($obj->source_id > 0 && $obj->source_type == 'thirdparty' && $obj->entity) { + $sql = "UPDATE ".MAIN_DB_PREFIX.'societe SET fk_stcomm = 3 WHERE fk_stcomm <> -1 AND entity = '.$obj->entity.' AND rowid = '.$obj->source_id; + $resql = $db->query($sql); + } //Update status communication of contact prospect - $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=3 WHERE fk_stcomm != -1 AND rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.tag = '".$db->escape($tag)."' AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)"; - dol_syslog("public/emailing/mailing-read.php : Mail read contact : ".$sql, LOG_DEBUG); - - $resql = $db->query($sql); + if ($obj->source_id > 0 && $obj->source_type == 'contact' && $obj->entity) { + $sql = "UPDATE ".MAIN_DB_PREFIX.'societe SET fk_stcomm = 3 WHERE fk_stcomm <> -1 AND entity = '.$obj->entity.' AND rowid IN (SELECT sc.fk_soc FROM '.MAIN_DB_PREFIX.'socpeople AS sc WHERE sc.rowid = '.$obj->source_id.')'; + $resql = $db->query($sql); + } } $db->close(); diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index 2ef939675cf..9c39dafa18d 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -42,6 +42,9 @@ if (!defined('NOREQUIREMENU')) { if (!defined('NOIPCHECK')) { define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip } +if (!defined("NOSESSION")) { + define("NOSESSION", '1'); +} /** * Header empty @@ -68,6 +71,8 @@ global $user, $conf, $langs; $langs->loadLangs(array("main", "mails")); +$mtid = GETPOST('mtid'); +$email = GETPOST('email'); $tag = GETPOST('tag'); $unsuscrib = GETPOST('unsuscrib'); $securitykey = GETPOST('securitykey'); @@ -88,7 +93,7 @@ if ($securitykey != $conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) { if (!empty($tag) && ($unsuscrib == '1')) { dol_syslog("public/emailing/mailing-unsubscribe.php : Launch unsubscribe requests", LOG_DEBUG); - $sql = "SELECT mc.email, m.entity"; + $sql = "SELECT mc.rowid, mc.email, mc.statut, m.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."mailing as m"; $sql .= " WHERE mc.fk_mailing = m.rowid AND mc.tag='".$db->escape($tag)."'"; @@ -99,10 +104,26 @@ if (!empty($tag) && ($unsuscrib == '1')) { $obj = $db->fetch_object($resql); - if (empty($obj->email)) { - print 'Email not found. No need to unsubscribe.'; + if (empty($obj)) { + print 'Email target not valid. Operation canceled.'; exit; } + if (empty($obj->email)) { + print 'Email target not valid. Operation canceled.'; + exit; + } + if ($obj->statut == 3) { + print 'Email target already set to unsubscribe. Operation canceled.'; + exit; + } + // TODO Test that mtid and email match also with the one found from $tag + /* + if ($obj->email != $email) + { + print 'Email does not match tagnot found. No need to unsubscribe.'; + exit; + } + */ // Update status of mail in recipient mailing list table $statut = '3'; @@ -128,7 +149,7 @@ if (!empty($tag) && ($unsuscrib == '1')) { */ // Update status communication of email (new usage) - $sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_unsubscribe (date_creat, entity, email) VALUES ('".$db->idate(dol_now())."', ".$db->escape($obj->entity).", '".$db->escape($obj->email)."')"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_unsubscribe (date_creat, entity, email, unsubscribegroup, ip) VALUES ('".$db->idate(dol_now())."', ".$db->escape($obj->entity).", '".$db->escape($obj->email)."', '', '".$db->escape(getUserRemoteIP())."')"; $resql = $db->query($sql); //if (! $resql) dol_print_error($db); No test on errors, may fail if already unsubscribed diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index d7ef8cf14e1..0dcf23a9ffb 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -61,6 +61,9 @@ class Dolresource extends CommonObject public $cache_code_type_resource = array(); + /** + * @var Dolresource Clone of object before changing it + */ public $oldcopy; /** diff --git a/htdocs/salaries/admin/salaries.php b/htdocs/salaries/admin/salaries.php index 01f25d56d05..dc0cc5b14a0 100644 --- a/htdocs/salaries/admin/salaries.php +++ b/htdocs/salaries/admin/salaries.php @@ -68,6 +68,14 @@ if ($action == 'update') { } } +$reg = array(); +if (preg_match('/^(set|del)_?([A-Z_]+)$/', $action, $reg)) { + // Set boolean (on/off) constants + if (!dolibarr_set_const($db, $reg[2], ($reg[1] === 'set' ? '1' : '0'), 'chaine', 0, '', $conf->entity) > 0) { + dol_print_error($db); + } +} + /* * View */ @@ -127,7 +135,21 @@ print "\n"; print '
'; -print ''; +print '
'; + +echo '
'; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; + +$key = 'CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT'; +echo ''; + +echo ''; +echo '
' . $langs->trans('Parameter') . '' . $langs->trans('Value') . '
', $langs->trans($key), '', ajax_constantonoff($key), '
'; +echo '
'; // End of page llxFooter(); diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php old mode 100644 new mode 100755 index af2aecdfe14..334ceffb822 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Charlie BENKE * Copyright (C) 2018 Frédéric France + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -24,20 +25,21 @@ * \ingroup salaries * \brief Page of salaries payments */ - require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; if (!empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } // Load translation files required by the page -$langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm")); +$langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm", "trips")); if (!empty($conf->projet->enabled)) { $langs->load("projects"); } @@ -47,11 +49,18 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $accountid = GETPOST('accountid', 'int') > 0 ? GETPOST('accountid', 'int') : 0; $projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int')); +$confirm = GETPOST('confirm'); +if (GETPOSTISSET('auto_create_paiement') || $action === 'add') { + $auto_create_paiement = GETPOST("auto_create_paiement", "int"); +} else { + $auto_create_paiement = empty($conf->global->CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT); +} $datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); $datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); $datesp = dol_mktime(12, 0, 0, GETPOST("datespmonth", 'int'), GETPOST("datespday", 'int'), GETPOST("datespyear", 'int')); $dateep = dol_mktime(12, 0, 0, GETPOST("dateepmonth", 'int'), GETPOST("dateepday", 'int'), GETPOST("dateepyear", 'int')); +$label = GETPOST('label'); // Security check $socid = GETPOST("socid", "int"); @@ -60,7 +69,7 @@ if ($user->socid) { } $result = restrictedArea($user, 'salaries', '', '', ''); -$object = new PaymentSalary($db); +$object = new Salary($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels @@ -85,26 +94,68 @@ if ($action == 'classin' && $user->rights->banque->modifier) { $object->setProject($projectid); } +// set label +if ($action == 'setlabel' && $user->rights->salaries->write) { + $object->fetch($id); + $object->label = $label; + $object->update($user); +} + +// Classify paid +if ($action == 'confirm_paid' && $user->rights->salaries->write && $confirm == 'yes') { + $object->fetch($id); + $result = $object->set_paid($user); +} + +// Reopen +if ($action == 'reopen' && $user->rights->salaries->write) { + $result = $object->fetch($id); + if ($object->paye) { + $result = $object->set_unpaid($user); + if ($result > 0) { + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + exit(); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } +} + +// payment mode +if ($action == 'setmode' && $user->rights->salaries->write) { + $object->fetch($id); + $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + if ($result < 0) + setEventMessages($object->error, $object->errors, 'errors'); +} + +// bank account +if ($action == 'setbankaccount' && $user->rights->salaries->write) { + $object->fetch($id); + $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } +} + if ($action == 'add' && empty($cancel)) { $error = 0; - if (empty($datev)) { - $datev = $datep; - } + if (empty($datev)) $datev = $datep; - $type_payment = dol_getIdFromCode($db, GETPOST("paymenttype", 'alpha'), 'c_paiement', 'code', 'id', 1); + $type_payment = GETPOST("paymenttype", 'alpha'); + $amount = price2num(GETPOST("amount", 'alpha'), 'MT', 2); $object->accountid = GETPOST("accountid", 'int') > 0 ? GETPOST("accountid", "int") : 0; $object->fk_user = GETPOST("fk_user", 'int') > 0 ? GETPOST("fk_user", "int") : 0; $object->datev = $datev; $object->datep = $datep; - $object->amount = price2num(GETPOST("amount", 'alpha')); + $object->amount = $amount; $object->label = GETPOST("label", 'alphanohtml'); $object->datesp = $datesp; $object->dateep = $dateep; $object->note = GETPOST("note", 'restricthtml'); $object->type_payment = ($type_payment > 0 ? $type_payment : 0); - $object->num_payment = GETPOST("num_payment", 'alphanohtml'); $object->fk_user_author = $user->id; $object->fk_project = $projectid; @@ -119,7 +170,11 @@ if ($action == 'add' && empty($cancel)) { $error++; } - if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep)) { + if (!empty($auto_create_paiement) && empty($datep)) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DATE_PAIEMENT")), null, 'errors'); + $error++; + } + if (empty($datesp) || empty($dateep)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $error++; } @@ -127,7 +182,7 @@ if ($action == 'add' && empty($cancel)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Employee")), null, 'errors'); $error++; } - if (empty($type_payment) || $type_payment < 0) { + if (!empty($auto_create_paiement) && (empty($type_payment) || $type_payment < 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors'); $error++; } @@ -135,67 +190,151 @@ if ($action == 'add' && empty($cancel)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } - if (!empty($conf->banque->enabled) && !$object->accountid > 0) { + if (!empty($conf->banque->enabled) && !empty($auto_create_paiement) && !$object->accountid > 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); $error++; } if (!$error) { - $db->begin(); - $ret = $object->create($user); - if ($ret > 0) { - $db->commit(); + if ($ret < 0) $error++; + if (!empty($auto_create_paiement) && !$error) { + $db->begin(); + // Create a line of payments + $paiement = new PaymentSalary($db); + $paiement->chid = $object->id; + $paiement->datepaye = $datep; + $paiement->datev = $datev; + $paiement->amounts = array($object->id=>$amount); // Tableau de montant + $paiement->paiementtype = $type_payment; + $paiement->num_payment = GETPOST("num_payment", 'alphanohtml'); + $paiement->note = GETPOST("note", 'none'); + if (!$error) { + $paymentid = $paiement->create($user, (int) GETPOST('closepaidsalary')); + if ($paymentid < 0) { + $error++; + setEventMessages($paiement->error, null, 'errors'); + $action = 'create'; + } + } + + if (!$error) { + $result = $paiement->addPaymentToBank($user, 'payment_salary', '(SalaryPayment)', GETPOST('accountid', 'int'), '', ''); + if (!($result > 0)) { + $error++; + setEventMessages($paiement->error, null, 'errors'); + } + } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } + } + + if (empty($error)) { if (GETPOST('saveandnew', 'alpha')) { setEventMessages($langs->trans("RecordSaved"), '', 'mesgs'); - header("Location: card.php?action=create&fk_project=".urlencode($projectid)."&accountid=".urlencode($accountid).'&paymenttype='.urlencode(GETPOST('paymenttype', 'az09')).'&datepday='.GETPOST("datepday", 'int').'&datepmonth='.GETPOST("datepmonth", 'int').'&datepyear='.GETPOST("datepyear", 'int')); + header("Location: card.php?action=create&fk_project=" . urlencode($projectid) . "&accountid=" . urlencode($accountid) . '&paymenttype=' . urlencode(GETPOST('paymenttype', 'az09')) . '&datepday=' . GETPOST("datepday", 'int') . '&datepmonth=' . GETPOST("datepmonth", 'int') . '&datepyear=' . GETPOST("datepyear", 'int')); exit; } else { - header("Location: list.php"); + header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $object->id); exit; } - } else { - $db->rollback(); - setEventMessages($object->error, $object->errors, 'errors'); - $action = "create"; } } $action = 'create'; } -if ($action == 'delete') { +if ($action == 'confirm_delete') { $result = $object->fetch($id); + $totalpaye = $object->getSommePaiement(); - if ($object->rappro == 0) { + if (empty($totalpaye)) { $db->begin(); $ret = $object->delete($user); if ($ret > 0) { - if ($object->fk_bank) { - $accountline = new AccountLine($db); - $result = $accountline->fetch($object->fk_bank); - if ($result > 0) { - $result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing) - } - } - - if ($result >= 0) { - $db->commit(); - header("Location: ".DOL_URL_ROOT.'/salaries/list.php'); - exit; - } else { - $object->error = $accountline->error; - $db->rollback(); - setEventMessages($object->error, $object->errors, 'errors'); - } + $db->commit(); + header("Location: ".DOL_URL_ROOT.'/salaries/list.php'); + exit; } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } else { - setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors'); + setEventMessages($langs->trans('DisabledBecausePayments'), null, 'errors'); + } +} + + +if ($action == 'update' && !$_POST["cancel"] && $user->rights->salaries->write) { + $amount = price2num(GETPOST('amount'), 'MT', 2); + + if (empty($amount)) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); + $action = 'edit'; + } elseif (!is_numeric($amount)) { + setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("Amount")), null, 'errors'); + $action = 'create'; + } else { + $result = $object->fetch($id); + + $object->amount = price2num($amount); + $object->datesp = price2num($datesp); + $object->dateep = price2num($dateep); + + $result = $object->update($user); + if ($result <= 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } +} + +if ($action == 'confirm_clone' && $confirm != 'yes') { $action = ''; } + +if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->salaries->write)) { + $db->begin(); + + $originalId = $id; + + $object->fetch($id); + + if ($object->id > 0) { + $object->paye = 0; + $object->id = $object->ref = null; + + if (GETPOST('clone_label', 'alphanohtml')) { + $object->label = GETPOST('clone_label', 'alphanohtml'); + } else { + $object->label = $langs->trans("CopyOf").' '.$object->label; + } + + $newdatestart = dol_mktime(0, 0, 0, GETPOST('clone_date_startmonth', 'int'), GETPOST('clone_date_startday', 'int'), GETPOST('clone_date_startyear', 'int')); + $newdateend = dol_mktime(0, 0, 0, GETPOST('clone_date_endmonth', 'int'), GETPOST('clone_date_endday', 'int'), GETPOST('clone_date_endyear', 'int')); + + if ($newdatestart) $object->datesp = $newdatestart; + if ($newdateend) $object->dateep = $newdateend; + + $id = $object->create($user); + if ($id > 0) { + $db->commit(); + $db->close(); + + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); + exit; + } else { + $id = $originalId; + $db->rollback(); + + setEventMessages($object->error, $object->errors, 'errors'); + } + } else { + $db->rollback(); + dol_print_error($db, $object->error); } } @@ -204,15 +343,13 @@ if ($action == 'delete') { * View */ -llxHeader("", $langs->trans("SalaryPayment")); +llxHeader("", $langs->trans("Salary")); $form = new Form($db); -if (!empty($conf->projet->enabled)) { - $formproject = new FormProjets($db); -} +if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); if ($id) { - $object = new PaymentSalary($db); + $object = new Salary($db); $result = $object->fetch($id); if ($result <= 0) { dol_print_error($db); @@ -247,35 +384,53 @@ if ($action == 'create') { print ''; print ''; - print load_fiche_titre($langs->trans("NewSalaryPayment"), '', 'salary'); + print load_fiche_titre($langs->trans("NewSalary"), '', 'salary'); + + if (!empty($conf->use_javascript_ajax)) { + print "\n".''."\n"; + } print dol_get_fiche_head('', ''); print ''; - // Date payment - print ''; - - // Date value for bank - print ''; - // Employee print ''; // Label print ''; // Date start period @@ -296,29 +451,6 @@ if ($action == 'create') { print ''; print ''; - // Bank - if (!empty($conf->banque->enabled)) { - print ''; - } - - // Type payment - print ''; - - // Number - if (!empty($conf->banque->enabled)) { - // Number - print ''; - print ''."\n"; - } - // Project if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); @@ -328,6 +460,59 @@ if ($action == 'create') { print ''; } + // Comments + print ''; + print ''; + print ''; + print ''; + + print ''; + + // Auto create payment + print ''; + print ''."\n"; // Date payment + + // Bank + if (!empty($conf->banque->enabled)) { + print ''; + } + + // Type payment + print ''; + + // Date payment + print ''; + + // Date value for bank + print ''; + + // Number + if (!empty($conf->banque->enabled)) { + // Number + print ''; + print ''."\n"; + } + + // Bouton Save payment + print ''; + // Other attributes $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -361,16 +546,57 @@ if ($action == 'create') { if ($id) { $head = salaries_prepare_head($object); + if ($action === 'clone') { + $formquestion = array( + array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label), + ); + + //$formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1); + $formquestion[] = array('type' => 'date', 'name' => 'clone_date_start', 'label' => $langs->trans("DateStart"), 'value' => -1); + $formquestion[] = array('type' => 'date', 'name' => 'clone_date_end', 'label' => $langs->trans("DateEnd"), 'value' => -1); + + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneSalary', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 240); + } + + if ($action == 'paid') { + $text = $langs->trans('ConfirmPaySalary'); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans('PaySalary'), $text, "confirm_paid", '', '', 2); + } + + if ($action == 'delete') { + $text = $langs->trans('ConfirmDeleteSalary'); + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteSalary'), $text, 'confirm_delete', '', '', 2); + } + + if ($action == 'edit') { + print "id&action=update\" method=\"post\">"; + print ''; + } + print dol_get_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'salary'); $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; + // Label + if ($action != 'editlabel') { + $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->salaries->write, 'string', '', 0, 1); + $morehtmlref .= $object->label; + } else { + $morehtmlref .= '
'.$langs->trans('Label').' : '; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= ''; + } + // Employee $userstatic = new User($db); $userstatic->fetch($object->fk_user); - $morehtmlref .= $langs->trans('Employee').' : '.$userstatic->getNomUrl(1); + $morehtmlref .= '
' .$langs->trans('Employee').' : '.$userstatic->getNomUrl(1); // Project if (!empty($conf->projet->enabled)) { @@ -384,7 +610,7 @@ if ($id) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= ''; } else { @@ -402,50 +628,92 @@ if ($id) { } } } + $morehtmlref .= '
'; + $totalpaye = $object->getSommePaiement(); + $object->totalpaye = $totalpaye; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); print '
'; + print '
'; print '
'; print '
'; - print $form->editfieldkey('DatePayment', 'datep', '', $object, 0, 'string', '', 1).''; - print $form->selectDate((empty($datep) ? '' : $datep), "datep", 0, 0, 0, 'add', 1, 1); - print '
'; - print $form->editfieldkey('DateValue', 'datev', '', $object, 0).''; - print $form->selectDate((empty($datev) ?-1 : $datev), "datev", '', '', '', 'add', 1, 1); - print '
'; print $form->editfieldkey('Employee', 'fk_user', '', $object, 0, 'string', '', 1).''; $noactive = 0; // We keep active and unactive users - print $form->select_dolusers(GETPOST('fk_user', 'int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, 'AND employee=1', 0, '', 'maxwidth300', $noactive); + print img_picto('', 'user', 'class="paddingrighonly"').$form->select_dolusers(GETPOST('fk_user', 'int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, 'AND employee=1', 0, '', 'maxwidth300', $noactive); print '
'; print $form->editfieldkey('Label', 'label', '', $object, 0, 'string', '', 1).''; - print 'trans("SalaryPayment")).'">'; + print 'trans("Salary")).'">'; print '
'; - print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; - $form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant - print '
'; - print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; - $form->select_types_paiements(GETPOST("paymenttype", 'aZ09'), "paymenttype", '', 2); - print '
'.$langs->trans("Comments").'

'.$langs->trans('AutomaticCreationPayment').'
'; + print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; + print img_picto('', 'bank_account', 'class="paddingrighonly"'); + $form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant + print '
'; + print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; + $form->select_types_paiements(GETPOST("paymenttype", 'aZ09'), "paymenttype", ''); + print '
'; + print $form->editfieldkey('DatePayment', 'datep', '', $object, 0, 'string', '', 1).''; + print $form->selectDate((empty($datep) ? '' : $datep), "datep", 0, 0, 0, 'add', 1, 1); + print '
'; + print $form->editfieldkey('DateValue', 'datev', '', $object, 0).''; + print $form->selectDate((empty($datev) ?-1 : $datev), "datev", '', '', '', 'add', 1, 1); + print '
'; + print $langs->trans("ClosePaidSalaryAutomatically"); + print '
'; - // Label - print ''; + if ($action == 'edit') { + print '"; + } else { + print ""; + print ''; + } - print ""; - print ''; + if ($action == 'edit') { + print '"; + } else { + print ""; + print ''; + } - print ''; - - print ""; + /*print ""; print ''; print '';*/ + + if ($action == 'edit') { + print ''; + } else { + print ''; + } + + // Mode of payment + print ''; - print ''; - + // Bank Account if (!empty($conf->banque->enabled)) { - if ($object->fk_account > 0) { - $bankline = new AccountLine($db); - $bankline->fetch($object->fk_bank); - - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; } // Other attributes @@ -455,20 +723,166 @@ if ($id) { print ''; + print '
'; + print '
'; + + $nbcols = 3; + if (!empty($conf->banque->enabled)) { + $nbcols++; + } + + /* + * Payments + */ + $sql = "SELECT p.rowid, p.num_payment as num_payment, p.datep as dp, p.amount,"; + $sql .= " c.code as type_code,c.libelle as paiement_type,"; + $sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.currency_code as bacurrency_code, ba.fk_accountancy_journal'; + $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepayment = c.id"; + $sql .= ", ".MAIN_DB_PREFIX."salary as salaire"; + $sql .= " WHERE p.fk_salary = ".$id; + $sql .= " AND p.fk_salary = salaire.rowid"; + $sql .= " AND salaire.entity IN (".getEntity('tax').")"; + $sql .= " ORDER BY dp DESC"; + + //print $sql; + $resql = $db->query($sql); + if ($resql) { + $totalpaye = 0; + + $num = $db->num_rows($resql); + $i = 0; $total = 0; + + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("DateStartPeriod").""; + print $form->selectDate($object->datesp, 'datesp', 0, 0, 0, 'datesp', 1); + print "
' . $langs->trans("DateStartPeriod") . ''; + print dol_print_date($object->datesp, 'day'); + print '
'.$langs->trans("DateStartPeriod").''; - print dol_print_date($object->datesp, 'day'); - print '
'.$langs->trans("DateEndPeriod").""; + print $form->selectDate($object->dateep, 'dateep', 0, 0, 0, 'dateep', 1); + print "
' . $langs->trans("DateEndPeriod") . ''; + print dol_print_date($object->dateep, 'day'); + print '
'.$langs->trans("DateEndPeriod").''; - print dol_print_date($object->dateep, 'day'); - print '
'.$langs->trans("DatePayment").''; print dol_print_date($object->datep, 'day'); print '
'.$langs->trans("DateValue").''; print dol_print_date($object->datev, 'day'); + print '
' . $langs->trans("Amount") . '
' . $langs->trans("Amount") . '' . price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency) . '
'; + print ''; + if ($action != 'editmode') + print ''; + print '
'; + print $langs->trans('PaymentMode'); + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; + print '
'; + + if ($action == 'editmode') { + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->type_payment, 'mode_reglement_id'); + } else { + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->type_payment, 'none'); + } print '
'.$langs->trans("Amount").''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('BankTransactionLine').''; - print $bankline->getNomUrl(1, 0, 'showall'); - print '
'; + print ''; } + print '
'; + print $langs->trans('BankAccount'); + print ''; + if ($action != 'editbankaccount' && $user->rights->salaries->write) { + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'
'; + print '
'; + if ($action == 'editbankaccount') { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + } else { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + } + print '
'; + print ''; + print ''; + print ''; + print ''; + if (!empty($conf->banque->enabled)) { + print ''; + } + print ''; + print ''; + + if ($num > 0) { + $bankaccountstatic = new Account($db); + while ($i < $num) { + $objp = $db->fetch_object($resql); + + print ''; + print '\n"; + $labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; + print "\n"; + if (!empty($conf->banque->enabled)) { + $bankaccountstatic->id = $objp->baid; + $bankaccountstatic->ref = $objp->baref; + $bankaccountstatic->label = $objp->baref; + $bankaccountstatic->number = $objp->banumber; + $bankaccountstatic->currency_code = $objp->bacurrency_code; + + if (!empty($conf->accounting->enabled)) { + $bankaccountstatic->account_number = $objp->account_number; + + $accountingjournal = new AccountingJournal($db); + $accountingjournal->fetch($objp->fk_accountancy_journal); + $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); + } + + print ''; + } + print '\n"; + print ""; + $totalpaye += $objp->amount; + $i++; + } + } else { + print ''; + print ''; + print ''; + } + + print '\n"; + print '\n"; + + $resteapayer = $object->amount - $totalpaye; + $cssforamountpaymentcomplete = 'amountpaymentcomplete'; + + print '"; + print '\n"; + + print "
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans('BankAccount').''.$langs->trans("Amount").'
'; + print ''.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp), 'day')."".$labeltype.' '.$objp->num_payment."'; + if ($bankaccountstatic->id) + print $bankaccountstatic->getNomUrl(1, 'transactions'); + print ''.price($objp->amount)."
'.$langs->trans("None").'
'.$langs->trans("AlreadyPaid")." :".price($totalpaye)."
'.$langs->trans("AmountExpected")." :".price($object->amount)."
'.$langs->trans("RemainderToPay")." :'.price($resteapayer)."
"; + print '
'; + + $db->free($resql); + } else { + dol_print_error($db); + } + + print '
'; + print ''; + print ''; + + print '
'; + + + if ($action == 'edit') { + print '
'; + print ''; + print '   '; + print ''; + print '
'; + print "\n"; + } + print dol_get_fiche_end(); // Action buttons print '
'."\n"; - if ($object->rappro == 0) { - if (!empty($user->rights->salaries->delete)) { - print ''; - } else { - print ''; + if ($action != 'edit') { + // Reopen + if ($object->paye && $user->rights->salaries->write) { + print ""; + } + + // Edit + if ($object->paye == 0 && $user->rights->salaries->write) { + print ""; + } + + // Emit payment + if ($object->paye == 0 && ((price2num($object->amount) < 0 && price2num($resteapayer, 'MT') < 0) || (price2num($object->amount) > 0 && price2num($resteapayer, 'MT') > 0)) && $user->rights->salaries->write) { + print ""; + } + + // Classify 'paid' + if ($object->paye == 0 + && ( + (round($resteapayer) <= 0 && $object->amount > 0) + || (round($resteapayer) >= 0 && $object->amount < 0) + ) + && $user->rights->salaries->write) { + print ""; + } + + // Clone + if ($user->rights->salaries->write) { + print ""; + } + + if (!empty($user->rights->salaries->delete) && empty($totalpaye)) { + print ''; + } else { + print ''; } - } else { - print ''; } print "
"; } diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 59cf90e72e7..0feefbfb076 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -19,15 +20,16 @@ /** * \file htdocs/salaries/class/paymentsalary.class.php * \ingroup salaries - * \brief Class for salaries module payment + * \brief File of class to manage payment of salaries */ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; /** - * Class to manage salary payments + * Class to manage payments of salaries */ class PaymentSalary extends CommonObject { @@ -44,34 +46,41 @@ class PaymentSalary extends CommonObject /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ - public $picto = 'salary'; - - public $tms; - - /** - * @var int User ID - */ - public $fk_user; - - public $datep; - public $datev; - public $amount; + public $picto = 'payment'; /** * @var int ID */ - public $fk_project; + public $fk_salary; - public $type_payment; - public $num_payment; + public $datec = ''; + public $tms = ''; + public $datep = ''; /** - * @var string salary payments label + * @deprecated + * @see $amount */ - public $label; + public $total; - public $datesp; - public $dateep; + public $amount; // Total amount of payment + public $amounts = array(); // Array of amounts + + /** + * @var int ID + */ + public $fk_typepayment; + + /** + * @var string + * @deprecated + */ + public $num_paiement; + + /** + * @var string + */ + public $num_payment; /** * @var int ID @@ -88,12 +97,6 @@ class PaymentSalary extends CommonObject */ public $fk_user_modif; - /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. - */ - public $fields = array(); - - /** * Constructor * @@ -102,127 +105,141 @@ class PaymentSalary extends CommonObject public function __construct($db) { $this->db = $db; - $this->element = 'payment_salary'; - $this->table_element = 'payment_salary'; } /** - * Update database + * Create payment of salary into database. + * Use this->amounts to have list of lines for the payment * - * @param User $user User that modify - * @param int $notrigger 0=no, 1=yes (no update trigger) - * @return int <0 if KO, >0 if OK + * @param User $user User making payment + * @param int $closepaidcontrib 1=Also close payed contributions to paid, 0=Do nothing more + * @return int <0 if KO, id of payment if OK */ - public function update($user = null, $notrigger = 0) + public function create($user, $closepaidcontrib = 0) { global $conf, $langs; $error = 0; - // Clean parameters - $this->amount = trim($this->amount); - $this->label = trim($this->label); - $this->note = trim($this->note); + $now = dol_now(); - // Check parameters - if (empty($this->fk_user) || $this->fk_user < 0) { - $this->error = 'ErrorBadParameter'; + dol_syslog(get_class($this)."::create", LOG_DEBUG); + + // Validate parametres + if (!$this->datepaye) { + $this->error = 'ErrorBadValueForParameterCreatePaymentSalary'; return -1; } + // Clean parameters + if (isset($this->fk_salary)) $this->fk_salary = (int) $this->fk_salary; + if (isset($this->amount)) $this->amount = trim($this->amount); + if (isset($this->fk_typepayment)) $this->fk_typepayment = (int) $this->fk_typepayment; + if (isset($this->num_paiement)) $this->num_paiement = trim($this->num_paiement); // deprecated + if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment); + if (isset($this->note)) $this->note = trim($this->note); + if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank; + if (isset($this->fk_user_author)) $this->fk_user_author = (int) $this->fk_user_author; + if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif; + + $totalamount = 0; + foreach ($this->amounts as $key => $value) { // How payment is dispatch + $newvalue = price2num($value, 'MT'); + $this->amounts[$key] = $newvalue; + $totalamount += $newvalue; + } + $totalamount = price2num($totalamount); + + // Check parameters + if ($totalamount == 0) return -1; // On accepte les montants negatifs pour les rejets de prelevement mais pas null + + $this->db->begin(); - // Update request - $sql = "UPDATE ".MAIN_DB_PREFIX."payment_salary SET"; + if ($totalamount != 0) { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_salary (fk_salary, datec, datep, amount,"; + $sql .= " fk_typepayment, num_payment, note, fk_user_author, fk_bank)"; + $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',"; + $sql .= " '".$this->db->idate($this->datepaye)."',"; + $sql .= " ".$totalamount.","; + $sql .= " ".$this->paiementtype.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.","; + $sql .= " 0)"; - $sql .= " tms='".$this->db->idate($this->tms)."',"; - $sql .= " fk_user=".$this->fk_user.","; - $sql .= " datep='".$this->db->idate($this->datep)."',"; - $sql .= " datev='".$this->db->idate($this->datev)."',"; - $sql .= " amount=".price2num($this->amount).","; - $sql .= " fk_projet=".((int) $this->fk_project).","; - $sql .= " fk_typepayment=".$this->fk_typepayment."',"; - $sql .= " num_payment='".$this->db->escape($this->num_payment)."',"; - $sql .= " label='".$this->db->escape($this->label)."',"; - $sql .= " datesp='".$this->db->idate($this->datesp)."',"; - $sql .= " dateep='".$this->db->idate($this->dateep)."',"; - $sql .= " note='".$this->db->escape($this->note)."',"; - $sql .= " fk_bank=".($this->fk_bank > 0 ? (int) $this->fk_bank : "null").","; - $sql .= " fk_user_author=".((int) $this->fk_user_author).","; - $sql .= " fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : 'null'); + $resql = $this->db->query($sql); + if ($resql) { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_salary"); - $sql .= " WHERE rowid=".$this->id; + // Insere tableau des montants / factures + foreach ($this->amounts as $key => $amount) { + $contribid = $key; + if (is_numeric($amount) && $amount <> 0) { + $amount = price2num($amount); - dol_syslog(get_class($this)."::update", LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - $this->error = "Error ".$this->db->lasterror(); - return -1; - } - - // Update extrafield - if (!$error) { - $result = $this->insertExtraFields(); - if ($result < 0) { + // If we want to closed payed invoices + if ($closepaidcontrib) { + $contrib = new Salary($this->db); + $contrib->fetch($contribid); + $paiement = $contrib->getSommePaiement(); + //$creditnotes=$contrib->getSumCreditNotesUsed(); + $creditnotes = 0; + //$deposits=$contrib->getSumDepositsUsed(); + $deposits = 0; + $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT'); + $remaintopay = price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT'); + if ($remaintopay == 0) { + $result = $contrib->set_paid($user); + } else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing."); + } + } + } + } else { $error++; } } - if (!$notrigger) { - // Call trigger - $result = $this->call_trigger('PAYMENT_SALARY_MODIFY', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } + $result = $this->call_trigger('PAYMENTSALARY_CREATE', $user); + if ($result < 0) $error++; - if (!$error) { + if ($totalamount != 0 && !$error) { + $this->amount = $totalamount; + $this->total = $totalamount; // deprecated $this->db->commit(); - return 1; + return $this->id; } else { + $this->error = $this->db->error(); $this->db->rollback(); return -1; } } - /** * Load object in memory from database * - * @param int $id id object - * @param User $user User that load + * @param int $id Id object * @return int <0 if KO, >0 if OK */ - public function fetch($id, $user = null) + public function fetch($id) { global $langs; - $sql = "SELECT"; - $sql .= " s.rowid,"; - - $sql .= " s.tms,"; - $sql .= " s.fk_user,"; - $sql .= " s.datep,"; - $sql .= " s.datev,"; - $sql .= " s.amount,"; - $sql .= " s.fk_projet as fk_project,"; - $sql .= " s.fk_typepayment,"; - $sql .= " s.num_payment,"; - $sql .= " s.label,"; - $sql .= " s.datesp,"; - $sql .= " s.dateep,"; - $sql .= " s.note,"; - $sql .= " s.fk_bank,"; - $sql .= " s.fk_user_author,"; - $sql .= " s.fk_user_modif,"; - $sql .= " b.fk_account,"; - $sql .= " b.fk_type,"; - $sql .= " b.rappro"; - - $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; - $sql .= " WHERE s.rowid = ".$id; + $sql .= " t.rowid,"; + $sql .= " t.fk_salary,"; + $sql .= " t.datec,"; + $sql .= " t.tms,"; + $sql .= " t.datep,"; + $sql .= " t.amount,"; + $sql .= " t.fk_typepayment,"; + $sql .= " t.num_payment as num_payment,"; + $sql .= " t.note,"; + $sql .= " t.fk_bank,"; + $sql .= " t.fk_user_author,"; + $sql .= " t.fk_user_modif,"; + $sql .= " pt.code as type_code, pt.libelle as type_label,"; + $sql .= ' b.fk_account'; + $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id"; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid'; + $sql .= " WHERE t.rowid = ".$id; + // TODO link on entity of tax; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); @@ -230,30 +247,27 @@ class PaymentSalary extends CommonObject if ($this->db->num_rows($resql)) { $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; - $this->ref = $obj->rowid; + $this->id = $obj->rowid; + $this->ref = $obj->rowid; + + $this->fk_salary = $obj->fk_salary; + $this->datec = $this->db->jdate($obj->datec); $this->tms = $this->db->jdate($obj->tms); - $this->fk_user = $obj->fk_user; $this->datep = $this->db->jdate($obj->datep); - $this->datev = $this->db->jdate($obj->datev); $this->amount = $obj->amount; - $this->fk_project = $obj->fk_project; - $this->type_payement = $obj->fk_typepayment; + $this->fk_typepayment = $obj->fk_typepayment; + $this->num_paiement = $obj->num_payment; $this->num_payment = $obj->num_payment; - $this->label = $obj->label; - $this->datesp = $this->db->jdate($obj->datesp); - $this->dateep = $this->db->jdate($obj->dateep); $this->note = $obj->note; $this->fk_bank = $obj->fk_bank; $this->fk_user_author = $obj->fk_user_author; $this->fk_user_modif = $obj->fk_user_modif; - $this->fk_account = $obj->fk_account; - $this->fk_type = $obj->fk_type; - $this->rappro = $obj->rappro; - // Retrieve all extrafield - // fetch optionals attributes and labels - $this->fetch_optionals(); + $this->type_code = $obj->type_code; + $this->type_label = $obj->type_label; + + $this->bank_account = $obj->fk_account; + $this->bank_line = $obj->fk_bank; } $this->db->free($resql); @@ -266,47 +280,162 @@ class PaymentSalary extends CommonObject /** - * Delete object in database + * Update database * - * @param User $user User that delete - * @return int <0 if KO, >0 if OK + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK */ - public function delete($user) + public function update($user = null, $notrigger = 0) { global $conf, $langs; - $error = 0; - // Call trigger - $result = $this->call_trigger('PAYMENT_SALARY_DELETE', $user); - if ($result < 0) { - return -1; + // Clean parameters + + if (isset($this->fk_salary)) $this->fk_salary = (int) $this->fk_salary; + if (isset($this->amount)) $this->amount = trim($this->amount); + if (isset($this->fk_typepayment)) $this->fk_typepayment = (int) $this->fk_typepayment; + if (isset($this->num_paiement)) $this->num_paiement = trim($this->num_paiement); // deprecated + if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment); + if (isset($this->note)) $this->note = trim($this->note); + if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank; + if (isset($this->fk_user_author)) $this->fk_user_author = (int) $this->fk_user_author; + if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif; + + // Check parameters + // Put here code to add control on parameters values + + // Update request + $sql = "UPDATE ".MAIN_DB_PREFIX."payment_salary SET"; + $sql .= " fk_salary=".(isset($this->fk_salary) ? $this->fk_salary : "null").","; + $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').","; + $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').","; + $sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').","; + $sql .= " amount=".(isset($this->amount) ? $this->amount : "null").","; + $sql .= " fk_typepayment=".(isset($this->fk_typepayment) ? $this->fk_typepayment : "null").","; + $sql .= " num_payment=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").","; + $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").","; + $sql .= " fk_bank=".(isset($this->fk_bank) ? $this->fk_bank : "null").","; + $sql .= " fk_user_author=".(isset($this->fk_user_author) ? $this->fk_user_author : "null").","; + $sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? $this->fk_user_modif : "null").""; + $sql .= " WHERE rowid=".$this->id; + + $this->db->begin(); + + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } + + // Commit or rollback + if ($error) { + foreach ($this->errors as $errmsg) { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); + } + $this->db->rollback(); + return -1 * $error; + } else { + $this->db->commit(); + return 1; } - // End call triggers + } - // Delete donation - if (!$error) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary_extrafields"; - $sql .= " WHERE fk_object=".$this->id; - $resql = $this->db->query($sql); - if (!$resql) { - $this->errors[] = $this->db->lasterror(); + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + global $conf, $langs; + $error = 0; + + dol_syslog(get_class($this)."::delete"); + + $this->db->begin(); + + if ($this->bank_line > 0) { + $accline = new AccountLine($this->db); + $accline->fetch($this->bank_line); + $result = $accline->delete(); + if ($result < 0) { + $this->errors[] = $accline->error; $error++; } } - $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary"; - $sql .= " WHERE rowid=".$this->id; + if (!$error) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary"; + $sql .= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - $this->error = "Error ".$this->db->lasterror(); - return -1; + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } } - return 1; + // Commit or rollback + if ($error) { + foreach ($this->errors as $errmsg) { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); + } + $this->db->rollback(); + return -1 * $error; + } else { + $this->db->commit(); + return 1; + } + } + + + + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + public function createFromClone(User $user, $fromid) + { + $error = 0; + + $object = new PaymentSalary($this->db); + + $this->db->begin(); + + // Load source object + $object->fetch($fromid); + $object->id = 0; + $object->statut = 0; + + // Clear fields + // ... + + // Create clone + $object->context['createfromclone'] = 'createfromclone'; + $result = $object->create($user); + + // Other options + if ($result < 0) { + $this->error = $object->error; + $error++; + } + + unset($object->context['createfromclone']); + + // End + if (!$error) { + $this->db->commit(); + return $object->id; + } else { + $this->db->rollback(); + return -1; + } } @@ -321,354 +450,128 @@ class PaymentSalary extends CommonObject { $this->id = 0; + $this->fk_salary = ''; + $this->datec = ''; $this->tms = ''; - $this->fk_user = 1; $this->datep = ''; - $this->datev = ''; $this->amount = ''; - $this->label = ''; - $this->datesp = ''; - $this->dateep = ''; - $this->note = ''; + $this->fk_typepayment = ''; + $this->num_payment = ''; + $this->note_private = ''; + $this->note_public = ''; $this->fk_bank = ''; - $this->fk_user_author = 1; - $this->fk_user_modif = 1; + $this->fk_user_author = ''; + $this->fk_user_modif = ''; } + /** - * Create in database + * Add record into bank for payment with links between this bank record and invoices of payment. + * All payment properties must have been set first like after a call to create(). * - * @param User $user User that create - * @return int <0 if KO, >0 if OK + * @param User $user Object of user making payment + * @param string $mode 'payment_sc' + * @param string $label Label to use in bank record + * @param int $accountid Id of bank account to do link with + * @param string $emetteur_nom Name of transmitter + * @param string $emetteur_banque Name of bank + * @return int <0 if KO, >0 if OK */ - public function create($user) + public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) { - global $conf, $langs; + global $conf; + + // Clean data + $this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement); $error = 0; - $now = dol_now(); - // Clean parameters - $this->amount = price2num(trim($this->amount)); - $this->label = trim($this->label); - $this->note = trim($this->note); - $this->fk_bank = (int) $this->fk_bank; - $this->fk_user_author = (int) $this->fk_user_author; - $this->fk_user_modif = (int) $this->fk_user_modif; + if (!empty($conf->banque->enabled)) { + include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - // Check parameters - if (!$this->label) { - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")); - return -3; - } - if ($this->fk_user <= 0 || $this->fk_user == '') { - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Employee")); - return -4; - } - if ($this->amount < 0 || $this->amount == '') { - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); - return -5; - } - if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) { - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account")); - return -6; - } - if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) { - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); - return -7; - } + $acc = new Account($this->db); + $acc->fetch($accountid); - $this->db->begin(); + $total = $this->amount; - // Insert into llx_payment_salary - $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_salary (fk_user"; - $sql .= ", datep"; - $sql .= ", datev"; - $sql .= ", amount"; - $sql .= ", fk_projet"; - $sql .= ", salary"; - $sql .= ", fk_typepayment"; - $sql .= ", num_payment"; - if ($this->note) { - $sql .= ", note"; - } - $sql .= ", label"; - $sql .= ", datesp"; - $sql .= ", dateep"; - $sql .= ", fk_user_author"; - $sql .= ", datec"; - $sql .= ", fk_bank"; - $sql .= ", entity"; - $sql .= ") "; - $sql .= " VALUES ("; - $sql .= "'".$this->db->escape($this->fk_user)."'"; - $sql .= ", '".$this->db->idate($this->datep)."'"; - $sql .= ", '".$this->db->idate($this->datev)."'"; - $sql .= ", ".$this->amount; - $sql .= ", ".($this->fk_project > 0 ? $this->fk_project : 0); - $sql .= ", ".($this->salary > 0 ? $this->salary : "null"); - $sql .= ", ".$this->db->escape($this->type_payment); - $sql .= ", '".$this->db->escape($this->num_payment)."'"; - if ($this->note) { - $sql .= ", '".$this->db->escape($this->note)."'"; - } - $sql .= ", '".$this->db->escape($this->label)."'"; - $sql .= ", '".$this->db->idate($this->datesp)."'"; - $sql .= ", '".$this->db->idate($this->dateep)."'"; - $sql .= ", '".$this->db->escape($user->id)."'"; - $sql .= ", '".$this->db->idate($now)."'"; - $sql .= ", NULL"; - $sql .= ", ".$conf->entity; - $sql .= ")"; + // Insert payment into llx_bank + $bank_line_id = $acc->addline( + $this->datepaye, + $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example") + $label, + -$total, + $this->num_payment, + '', + $user, + $emetteur_nom, + $emetteur_banque, + '', + $this->datev + ); - dol_syslog(get_class($this)."::create", LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_salary"); + // Mise a jour fk_bank dans llx_paiement. + // On connait ainsi le paiement qui a genere l'ecriture bancaire + if ($bank_line_id > 0) { + $result = $this->update_fk_bank($bank_line_id); + if ($result <= 0) { + $error++; + dol_print_error($this->db); + } - if ($this->id > 0) { - if (!empty($conf->banque->enabled) && !empty($this->amount)) { - // Insert into llx_bank - require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - - $acc = new Account($this->db); - $result = $acc->fetch($this->accountid); + // Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction + $url = ''; + if ($mode == 'payment_salary') $url = DOL_URL_ROOT.'/salaries/payment_salary/card.php?id='; + if ($url) { + $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode); if ($result <= 0) { + $error++; dol_print_error($this->db); } - - // Update extrafield - if (!$error) { - $result = $this->insertExtraFields(); - if ($result < 0) { - $error++; - } - } - - // Insert payment into llx_bank - // Add link 'payment_salary' in bank_url between payment and bank transaction - $bank_line_id = $acc->addline( - $this->datep, - $this->type_payment, - $this->label, - -abs($this->amount), - $this->num_payment, - '', - $user, - '', - '', - '', - $this->datev - ); - - // Update fk_bank into llx_paiement. - // So we know the payment which has generate the banking ecriture - if ($bank_line_id > 0) { - $this->update_fk_bank($bank_line_id); - } else { - $this->error = $acc->error; - $error++; - } - - if (!$error) { - // Add link 'payment_salary' in bank_url between payment and bank transaction - $url = DOL_URL_ROOT.'/salaries/card.php?id='; - - $result = $acc->add_url_line($bank_line_id, $this->id, $url, "(SalaryPayment)", "payment_salary"); - if ($result <= 0) { - $this->error = $acc->error; - $error++; - } - } - - $fuser = new User($this->db); - $fuser->fetch($this->fk_user); - - // Add link 'user' in bank_url between operation and bank transaction - $result = $acc->add_url_line( - $bank_line_id, - $this->fk_user, - DOL_URL_ROOT.'/user/card.php?id=', - $fuser->getFullName($langs), - // $langs->trans("SalaryPayment").' '.$fuser->getFullName($langs).' '.dol_print_date($this->datesp,'dayrfc').' '.dol_print_date($this->dateep,'dayrfc'), - 'user' - ); - - if ($result <= 0) { - $this->error = $acc->error; - $error++; - } } - // Call trigger - $result = $this->call_trigger('PAYMENT_SALARY_CREATE', $user); - if ($result < 0) { - $error++; + // Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment) + $linkaddedforthirdparty = array(); + foreach ($this->amounts as $key => $value) { + if ($mode == 'payment_salary') { + $salary = new Salary($this->db); + $salary->fetch($key); + $result = $acc->add_url_line($bank_line_id, $salary->id, DOL_URL_ROOT.'/salaries/card.php?id=', '('.$salary->label.')', 'salary'); + if ($result <= 0) dol_print_error($this->db); + } } - // End call triggers } else { + $this->error = $acc->error; $error++; } + } - if (!$error) { - $this->db->commit(); - return $this->id; - } else { - $this->db->rollback(); - return -2; - } + if (!$error) { + return 1; } else { - $this->error = $this->db->error(); - $this->db->rollback(); return -1; } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Update link between payment salary and line generate into llx_bank + * Mise a jour du lien entre le paiement de salaire et la ligne dans llx_bank generee * - * @param int $id_bank Id bank account - * @return int <0 if KO, >0 if OK + * @param int $id_bank Id if bank + * @return int >0 if OK, <=0 if KO */ public function update_fk_bank($id_bank) { - // phpcs:enable - $sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_salary SET fk_bank = '.$id_bank; - $sql .= ' WHERE rowid = '.$this->id; + // phpcs:enable + $sql = "UPDATE ".MAIN_DB_PREFIX."payment_salary SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { return 1; } else { - dol_print_error($this->db); - return -1; - } - } - - - /** - * Send name clicable (with possibly the picto) - * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param string $option link option - * @param int $notooltip 1=Disable tooltip - * @param string $morecss Add more css on link - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking - * @return string Chaine with URL - */ - public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) - { - global $db, $conf, $langs, $hookmanager; - - if (!empty($conf->dol_no_mouse_hover)) { - $notooltip = 1; // Force disable tooltips - } - - $result = ''; - - $label = img_picto('', $this->picto).' '.$langs->trans("SalaryPayment").''; - $label .= '
'.$langs->trans('Ref').': '.$this->ref; - if (!empty($this->label)) { - $labeltoshow = $this->label; - $reg = array(); - if (preg_match('/^\((.*)\)$/i', $this->label, $reg)) { - // Label generique car entre parentheses. On l'affiche en le traduisant - if ($reg[1] == 'paiement') { - $reg[1] = 'Payment'; - } - $labeltoshow = $langs->trans($reg[1]); - } - $label .= '
'.$langs->trans('Label').': '.$labeltoshow; - } - - $url = DOL_URL_ROOT.'/salaries/card.php?id='.$this->id; - - if ($option != 'nolink') { - // Add param to save lastsearch_values or not - $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); - if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { - $add_save_lastsearch_values = 1; - } - if ($add_save_lastsearch_values) { - $url .= '&save_lastsearch_values=1'; - } - } - - $linkclose = ''; - if (empty($notooltip)) { - if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $label = $langs->trans("ShowMyObject"); - $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; - } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - - /* - $hookmanager->initHooks(array('myobjectdao')); - $parameters=array('id'=>$this->id); - $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook > 0) $linkclose = $hookmanager->resPrint; - */ - } else { - $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); - } - - $linkstart = ''; - $linkend = ''; - - $result .= $linkstart; - if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); - } - if ($withpicto != 2) { - $result .= $this->ref; - } - $result .= $linkend; - //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); - - global $action, $hookmanager; - $hookmanager->initHooks(array('salarypayment')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); - $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - if ($reshook > 0) { - $result = $hookmanager->resPrint; - } else { - $result .= $hookmanager->resPrint; - } - - return $result; - } - - /** - * Information on record - * - * @param int $id Id of record - * @return void - */ - public function info($id) - { - $sql = 'SELECT ps.rowid, ps.datec, ps.fk_user_author'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'payment_salary as ps'; - $sql .= ' WHERE ps.rowid = '.$id; - - dol_syslog(get_class($this).'::info', LOG_DEBUG); - $result = $this->db->query($sql); - - if ($result) { - if ($this->db->num_rows($result)) { - $obj = $this->db->fetch_object($result); - $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - $this->date_creation = $this->db->jdate($obj->datec); - } - $this->db->free($result); - } else { - dol_print_error($this->db); + $this->error = $this->db->error(); + return 0; } } @@ -684,7 +587,7 @@ class PaymentSalary extends CommonObject return $this->LibStatut($this->statut, $mode); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -694,45 +597,88 @@ class PaymentSalary extends CommonObject */ public function LibStatut($status, $mode = 0) { - // phpcs:enable + // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage $langs->load('compta'); /*if ($mode == 0) - { + { if ($status == 0) return $langs->trans('ToValidate'); if ($status == 1) return $langs->trans('Validated'); - } - if ($mode == 1) - { + } + if ($mode == 1) + { if ($status == 0) return $langs->trans('ToValidate'); if ($status == 1) return $langs->trans('Validated'); - } - if ($mode == 2) - { + } + if ($mode == 2) + { if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate'); if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); - } - if ($mode == 3) - { + } + if ($mode == 3) + { if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1'); if ($status == 1) return img_picto($langs->trans('Validated'),'statut4'); - } - if ($mode == 4) - { + } + if ($mode == 4) + { if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate'); if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); - } - if ($mode == 5) - { + } + if ($mode == 5) + { if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1'); if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); - } - if ($mode == 6) - { + } + if ($mode == 6) + { if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1'); if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); - }*/ + }*/ return ''; } + + /** + * Return clicable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $maxlen Longueur max libelle + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $maxlen = 0) + { + global $langs; + + $result = ''; + + if (empty($this->ref)) $this->ref = $this->lib; + + $label = img_picto('', $this->picto).' '.$langs->trans("SalaryPayment").''; + $label .= '
'.$langs->trans('Ref').': '.$this->ref; + if (!empty($this->label)) { + $labeltoshow = $this->label; + $reg = array(); + if (preg_match('/^\((.*)\)$/i', $this->label, $reg)) { + // Label generique car entre parentheses. On l'affiche en le traduisant + if ($reg[1] == 'paiement') $reg[1] = 'Payment'; + $labeltoshow = $langs->trans($reg[1]); + } + $label .= '
'.$langs->trans('Label').': '.$labeltoshow; + } + if ($this->datep) { + $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->datep, 'day'); + } + + if (!empty($this->id)) { + $link = ''; + $linkend = ''; + + if ($withpicto) $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' '); + if ($withpicto && $withpicto != 2) $result .= ' '; + if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend; + } + + return $result; + } } diff --git a/htdocs/salaries/class/salariesstats.class.php b/htdocs/salaries/class/salariesstats.class.php index 66c0e1e7d1f..7d7f9a7b5f2 100644 --- a/htdocs/salaries/class/salariesstats.class.php +++ b/htdocs/salaries/class/salariesstats.class.php @@ -1,6 +1,7 @@ * Copyright (c) 2018 Fidesio + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -83,7 +84,7 @@ class SalariesStats extends Stats $sql = "SELECT YEAR(datep) as dm, count(*)"; $sql .= " FROM ".$this->from; $sql .= " GROUP BY dm DESC"; - $sql .= " WHERE ".$this->where; + //$sql .= " WHERE ".$this->where; return $this->_getNbByYear($sql); } @@ -101,7 +102,7 @@ class SalariesStats extends Stats $sql = "SELECT MONTH(datep) as dm, count(*)"; $sql .= " FROM ".$this->from; $sql .= " WHERE YEAR(datep) = ".$year; - $sql .= " AND ".$this->where; + //$sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -123,7 +124,7 @@ class SalariesStats extends Stats $sql = "SELECT date_format(datep,'%m') as dm, sum(".$this->field.")"; $sql .= " FROM ".$this->from; $sql .= " WHERE date_format(datep,'%Y') = '".$this->db->escape($year)."'"; - $sql .= " AND ".$this->where; + //$sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -144,7 +145,7 @@ class SalariesStats extends Stats $sql = "SELECT date_format(datep,'%m') as dm, avg(".$this->field.")"; $sql .= " FROM ".$this->from; $sql .= " WHERE date_format(datep,'%Y') = '".$this->db->escape($year)."'"; - $sql .= " AND ".$this->where; + //$sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -160,7 +161,7 @@ class SalariesStats extends Stats { $sql = "SELECT date_format(datep,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg"; $sql .= " FROM ".$this->from; - $sql .= " WHERE ".$this->where; + //$sql .= " WHERE ".$this->where; $sql .= " GROUP BY year"; $sql .= $this->db->order('year', 'DESC'); diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php new file mode 100644 index 00000000000..6990445efd0 --- /dev/null +++ b/htdocs/salaries/class/salary.class.php @@ -0,0 +1,697 @@ + + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2021 Gauthier VERDOL + * + * 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 . + */ + +/** + * \file htdocs/salaries/class/salary.class.php + * \ingroup salaries + * \brief Class for salaries module payment + */ + +// Put here all includes required by your class file +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; + + +/** + * Class to manage salary payments + */ +class Salary extends CommonObject +{ + /** + * @var string ID to identify managed object + */ + public $element = 'salary'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'salary'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'salary'; + + public $tms; + + /** + * @var int User ID + */ + public $fk_user; + + public $datep; + public $datev; + public $amount; + + /** + * @var int ID + */ + public $fk_project; + + public $type_payment; + + /** + * @var string salary payments label + */ + public $label; + + public $datesp; + public $dateep; + + /** + * @var int ID + */ + public $fk_bank; + + /** + * @var int ID + */ + public $fk_user_author; + + /** + * @var int ID + */ + public $fk_user_modif; + + const STATUS_UNPAID = 0; + const STATUS_PAID = 1; + + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + $this->element = 'salary'; + $this->table_element = 'salary'; + } + + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=no, 1=yes (no update trigger) + * @return int <0 if KO, >0 if OK + */ + public function update($user = null, $notrigger = 0) + { + global $conf, $langs; + + $error = 0; + + // Clean parameters + $this->amount = trim($this->amount); + $this->label = trim($this->label); + $this->note = trim($this->note); + + // Check parameters + if (empty($this->fk_user) || $this->fk_user < 0) { + $this->error = 'ErrorBadParameter'; + return -1; + } + + $this->db->begin(); + + // Update request + $sql = "UPDATE ".MAIN_DB_PREFIX."salary SET"; + + $sql .= " tms='".$this->db->idate(dol_now())."',"; + $sql .= " fk_user=".$this->fk_user.","; + /*$sql .= " datep='".$this->db->idate($this->datep)."',"; + $sql .= " datev='".$this->db->idate($this->datev)."',";*/ + $sql .= " amount=".price2num($this->amount).","; + $sql .= " fk_projet=".((int) $this->fk_project).","; + $sql .= " fk_typepayment=".$this->type_payment.","; + $sql .= " label='".$this->db->escape($this->label)."',"; + $sql .= " datesp='".$this->db->idate($this->datesp)."',"; + $sql .= " dateep='".$this->db->idate($this->dateep)."',"; + $sql .= " note='".$this->db->escape($this->note)."',"; + $sql .= " fk_bank=".($this->fk_bank > 0 ? (int) $this->fk_bank : "null").","; + $sql .= " fk_user_author=".((int) $this->fk_user_author).","; + $sql .= " fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : 'null'); + + $sql .= " WHERE rowid=".$this->id; + + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { + $this->error = "Error ".$this->db->lasterror(); + return -1; + } + + // Update extrafield + if (!$error) { + if (!$error) { + $result = $this->insertExtraFields(); + if ($result < 0) { + $error++; + } + } + } + + if (!$notrigger) { + // Call trigger + $result = $this->call_trigger('salary_MODIFY', $user); + if ($result < 0) $error++; + // End call triggers + } + + if (!$error) { + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + return -1; + } + } + + + /** + * Load object in memory from database + * + * @param int $id id object + * @param User $user User that load + * @return int <0 if KO, >0 if OK + */ + public function fetch($id, $user = null) + { + global $langs; + $sql = "SELECT"; + $sql .= " s.rowid,"; + + $sql .= " s.tms,"; + $sql .= " s.fk_user,"; + $sql .= " s.datep,"; + $sql .= " s.datev,"; + $sql .= " s.amount,"; + $sql .= " s.fk_projet as fk_project,"; + $sql .= " s.fk_typepayment,"; + $sql .= " s.label,"; + $sql .= " s.datesp,"; + $sql .= " s.dateep,"; + $sql .= " s.note,"; + $sql .= " s.paye,"; + $sql .= " s.fk_bank,"; + $sql .= " s.fk_user_author,"; + $sql .= " s.fk_user_modif,"; + $sql .= " s.fk_account"; + /*$sql .= " b.fk_type,"; + $sql .= " b.rappro";*/ + + $sql .= " FROM ".MAIN_DB_PREFIX."salary as s"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; + $sql .= " WHERE s.rowid = ".$id; + + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + if ($this->db->num_rows($resql)) { + $obj = $this->db->fetch_object($resql); + + $this->id = $obj->rowid; + $this->ref = $obj->rowid; + $this->tms = $this->db->jdate($obj->tms); + $this->fk_user = $obj->fk_user; + $this->datep = $this->db->jdate($obj->datep); + $this->datev = $this->db->jdate($obj->datev); + $this->amount = $obj->amount; + $this->fk_project = $obj->fk_project; + $this->type_payment = $obj->fk_typepayment; + $this->label = $obj->label; + $this->datesp = $this->db->jdate($obj->datesp); + $this->dateep = $this->db->jdate($obj->dateep); + $this->note = $obj->note; + $this->paye = $obj->paye; + $this->fk_bank = $obj->fk_bank; + $this->fk_user_author = $obj->fk_user_author; + $this->fk_user_modif = $obj->fk_user_modif; + $this->fk_account = $this->accountid = $obj->fk_account; + $this->fk_type = $obj->fk_type; + $this->rappro = $obj->rappro; + + // Retreive all extrafield + // fetch optionals attributes and labels + $this->fetch_optionals(); + } + $this->db->free($resql); + + return 1; + } else { + $this->error = "Error ".$this->db->lasterror(); + return -1; + } + } + + + /** + * Delete object in database + * + * @param User $user User that delete + * @return int <0 if KO, >0 if OK + */ + public function delete($user) + { + global $conf, $langs; + + $error = 0; + + // Call trigger + $result = $this->call_trigger('salary_DELETE', $user); + if ($result < 0) return -1; + // End call triggers + + // Delete extrafields + /*if (!$error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."salary_extrafields"; + $sql .= " WHERE fk_object=".$this->id; + + $resql = $this->db->query($sql); + if (!$resql) + { + $this->errors[] = $this->db->lasterror(); + $error++; + } + }*/ + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."salary"; + $sql .= " WHERE rowid=".$this->id; + + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { + $this->error = "Error ".$this->db->lasterror(); + return -1; + } + + return 1; + } + + + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void + */ + public function initAsSpecimen() + { + $this->id = 0; + + $this->tms = ''; + $this->fk_user = ''; + $this->datep = ''; + $this->datev = ''; + $this->amount = ''; + $this->label = ''; + $this->datesp = ''; + $this->dateep = ''; + $this->note = ''; + $this->fk_bank = ''; + $this->fk_user_author = ''; + $this->fk_user_modif = ''; + } + + /** + * Create in database + * + * @param User $user User that create + * @return int <0 if KO, >0 if OK + */ + public function create($user) + { + global $conf, $langs; + + $error = 0; + $now = dol_now(); + + // Clean parameters + $this->amount = price2num(trim($this->amount)); + $this->label = trim($this->label); + $this->note = trim($this->note); + $this->fk_bank = trim($this->fk_bank); + $this->fk_user_author = trim($this->fk_user_author); + $this->fk_user_modif = trim($this->fk_user_modif); + $this->accountid = trim($this->accountid); + $this->paye = trim($this->paye); + + // Check parameters + if (!$this->label) { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")); + return -3; + } + if ($this->fk_user < 0 || $this->fk_user == '') { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Employee")); + return -4; + } + if ($this->amount < 0 || $this->amount == '') { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); + return -5; + } + /* if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) + { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account")); + return -6; + } + if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) + { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); + return -7; + }*/ + + $this->db->begin(); + + // Insert into llx_salary + $sql = "INSERT INTO ".MAIN_DB_PREFIX."salary (fk_user"; + //$sql .= ", datep"; + //$sql .= ", datev"; + $sql .= ", amount"; + $sql .= ", fk_projet"; + $sql .= ", salary"; + $sql .= ", fk_typepayment"; + $sql .= ", fk_account"; + if ($this->note) $sql .= ", note"; + $sql .= ", label"; + $sql .= ", datesp"; + $sql .= ", dateep"; + $sql .= ", fk_user_author"; + $sql .= ", datec"; + $sql .= ", fk_bank"; + $sql .= ", entity"; + $sql .= ") "; + $sql .= " VALUES ("; + $sql .= "'".$this->db->escape($this->fk_user)."'"; + //$sql .= ", '".$this->db->idate($this->datep)."'"; + //$sql .= ", '".$this->db->idate($this->datev)."'"; + $sql .= ", ".$this->amount; + $sql .= ", ".($this->fk_project > 0 ? $this->fk_project : 0); + $sql .= ", ".($this->salary > 0 ? $this->salary : "null"); + $sql .= ", ".($this->type_payment > 0 ? $this->type_payment : 0); + $sql .= ", ".($this->accountid > 0 ? $this->accountid : "null"); + if ($this->note) $sql .= ", '".$this->db->escape($this->note)."'"; + $sql .= ", '".$this->db->escape($this->label)."'"; + $sql .= ", '".$this->db->idate($this->datesp)."'"; + $sql .= ", '".$this->db->idate($this->dateep)."'"; + $sql .= ", '".$this->db->escape($user->id)."'"; + $sql .= ", '".$this->db->idate($now)."'"; + $sql .= ", NULL"; + $sql .= ", ".$conf->entity; + $sql .= ")"; + + dol_syslog(get_class($this)."::create", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."salary"); + + if ($this->id > 0) { + // Update extrafield + if (!$error) { + if (!$error) { + $result = $this->insertExtraFields(); + if ($result < 0) { + $error++; + } + } + } + + // Call trigger + $result = $this->call_trigger('salary_CREATE', $user); + if ($result < 0) $error++; + // End call triggers + } else $error++; + + if (!$error) { + $this->db->commit(); + return $this->id; + } else { + $this->db->rollback(); + return -2; + } + } else { + $this->error = $this->db->error(); + $this->db->rollback(); + return -1; + } + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update link between payment salary and line generate into llx_bank + * + * @param int $id_bank Id bank account + * @return int <0 if KO, >0 if OK + */ + public function update_fk_bank($id_bank) + { + // phpcs:enable + $sql = 'UPDATE '.MAIN_DB_PREFIX.'salary SET fk_bank = '.$id_bank; + $sql .= ' WHERE rowid = '.$this->id; + $result = $this->db->query($sql); + if ($result) { + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } + + + /** + * Send name clicable (with possibly the picto) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option link option + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + global $db, $conf, $langs, $hookmanager; + global $dolibarr_main_authentication, $dolibarr_main_demo; + global $menumanager; + + if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips + + $result = ''; + + $label = ''.$langs->trans("Salary").''; + $label .= '
'; + $label .= ''.$langs->trans('Ref').': '.$this->ref; + + $url = DOL_URL_ROOT.'/salaries/card.php?id='.$this->id; + + if ($option != 'nolink') { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1; + if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1'; + } + + $linkclose = ''; + if (empty($notooltip)) { + if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { + $label = $langs->trans("ShowMyObject"); + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; + + /* + $hookmanager->initHooks(array('myobjectdao')); + $parameters=array('id'=>$this->id); + $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) $linkclose = $hookmanager->resPrint; + */ + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + + $linkstart = ''; + $linkend = ''; + + $result .= $linkstart; + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto != 2) $result .= $this->ref; + $result .= $linkend; + //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + + global $action, $hookmanager; + $hookmanager->initHooks(array('salarypayment')); + $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) $result = $hookmanager->resPrint; + else $result .= $hookmanager->resPrint; + + return $result; + } + + /** + * Return amount of payments already done + * + * @return int Amount of payment already done, <0 if KO + */ + public function getSommePaiement() + { + $table = 'payment_salary'; + $field = 'fk_salary'; + + $sql = 'SELECT sum(amount) as amount'; + $sql .= ' FROM '.MAIN_DB_PREFIX.$table; + $sql .= ' WHERE '.$field.' = '.$this->id; + + dol_syslog(get_class($this)."::getSommePaiement", LOG_DEBUG); + $resql = $this->db->query($sql); + + if ($resql) { + $amount = 0; + + $obj = $this->db->fetch_object($resql); + if ($obj) $amount = $obj->amount ? $obj->amount : 0; + + $this->db->free($resql); + return $amount; + } else { + return -1; + } + } + + /** + * Information on record + * + * @param int $id Id of record + * @return void + */ + public function info($id) + { + $sql = 'SELECT ps.rowid, ps.datec, ps.fk_user_author'; + $sql .= ' FROM '.MAIN_DB_PREFIX.'salary as ps'; + $sql .= ' WHERE ps.rowid = '.$id; + + dol_syslog(get_class($this).'::info', LOG_DEBUG); + $result = $this->db->query($sql); + + if ($result) { + if ($this->db->num_rows($result)) { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + $this->date_creation = $this->db->jdate($obj->datec); + } + $this->db->free($result); + } else { + dol_print_error($this->db); + } + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Tag social contribution as payed completely + * + * @param User $user Object user making change + * @return int <0 if KO, >0 if OK + */ + public function set_paid($user) + { + // phpcs:enable + $sql = "UPDATE ".MAIN_DB_PREFIX."salary SET"; + $sql .= " paye = 1"; + $sql .= " WHERE rowid = ".$this->id; + $return = $this->db->query($sql); + if ($return) return 1; + else return -1; + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Remove tag payed on social contribution + * + * @param User $user Object user making change + * @return int <0 if KO, >0 if OK + */ + public function set_unpaid($user) + { + // phpcs:enable + $sql = "UPDATE ".MAIN_DB_PREFIX."salary SET"; + $sql .= " paye = 0"; + $sql .= " WHERE rowid = ".$this->id; + $return = $this->db->query($sql); + if ($return) return 1; + else return -1; + } + + + /** + * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @return string Libelle + */ + public function getLibStatut($mode = 0, $alreadypaid = -1) + { + return $this->LibStatut($this->paye, $mode, $alreadypaid); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Renvoi le libelle d'un statut donne + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto + * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @return string Label + */ + public function LibStatut($status, $mode = 0, $alreadypaid = -1) + { + // phpcs:enable + global $langs; + + // Load translation files required by the page + $langs->loadLangs(array("customers", "bills")); + + // We reinit status array to force to redefine them because label may change according to properties values. + $this->labelStatus = array(); + $this->labelStatusShort = array(); + + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { + global $langs; + //$langs->load("mymodule"); + $this->labelStatus[self::STATUS_UNPAID] = $langs->trans('BillStatusNotPaid'); + $this->labelStatus[self::STATUS_PAID] = $langs->trans('BillStatusPaid'); + if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('BillStatusNotPaid'); + $this->labelStatusShort[self::STATUS_PAID] = $langs->trans('BillStatusPaid'); + if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + } + + $statusType = 'status1'; + if ($status == 0 && $alreadypaid <> 0) $statusType = 'status3'; + if ($status == 1) $statusType = 'status6'; + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); + } +} diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index f9be4f70fb0..9534d074d5f 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -7,6 +7,7 @@ * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015-2019 Alexandre Spangaro + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -33,7 +34,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "users", "salaries", "hrm")); @@ -70,7 +71,7 @@ if (!$sortfield) { } -$object = new PaymentSalary($db); +$object = new Salary($db); $object->fetch($id, $ref); $upload_dir = $conf->salaries->dir_output.'/'.dol_sanitizeFileName($object->id); diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index 7c999939570..e0e6aec7f3c 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2015 Laurent Destailleur * Copyright (C) 2015 Charlie BENKE * Copyright (C) 2017-2019 Alexandre Spangaro + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -24,7 +25,7 @@ */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -48,7 +49,7 @@ $result = restrictedArea($user, 'salaries', '', '', ''); llxHeader("", $langs->trans("SalaryPayment")); -$object = new PaymentSalary($db); +$object = new Salary($db); $object->fetch($id); $object->info($id); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 119b224e76b..7bc75f52793 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011-2019 Alexandre Spangaro * Copyright (C) 2015-2016 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -82,10 +83,13 @@ if (!$sortorder) { $search_ref = GETPOST('search_ref', 'int'); $search_user = GETPOST('search_user', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); -$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); -$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); +$search_date_start_from = dol_mktime(0, 0, 0, GETPOST('search_date_start_frommonth', 'int'), GETPOST('search_date_start_fromday', 'int'), GETPOST('search_date_start_fromyear', 'int')); +$search_date_start_to = dol_mktime(23, 59, 59, GETPOST('search_date_start_tomonth', 'int'), GETPOST('search_date_start_today', 'int'), GETPOST('search_date_start_toyear', 'int')); +$search_date_end_from = dol_mktime(0, 0, 0, GETPOST('search_date_end_frommonth', 'int'), GETPOST('search_date_end_fromday', 'int'), GETPOST('search_date_end_fromyear', 'int')); +$search_date_end_to = dol_mktime(23, 59, 59, GETPOST('search_date_end_tomonth', 'int'), GETPOST('search_date_end_today', 'int'), GETPOST('search_date_end_toyear', 'int')); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'int'); +$search_status = GETPOST('search_status', 'int'); $filtre = GETPOST("filtre", 'restricthtml'); @@ -118,6 +122,10 @@ foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { $search[$key] = GETPOST('search_'.$key, 'alpha'); } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } } // List of fields to search into when doing a "search in all" @@ -128,6 +136,27 @@ foreach ($object->fields as $key => $val) { } } +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=>$val['help'] + ); + } +} +// Extra fields +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'); + $permissiontoread = $user->rights->salaries->read; $permissiontoadd = $user->rights->salaries->write; $permissiontodelete = $user->rights->salaries->delete; @@ -160,10 +189,14 @@ if (empty($reshook)) { $search_ref = ""; $search_user = ""; $search_label = ""; - $search_date_start = ''; + $search_date_start_from = ''; + $search_date_start_to = ''; + $search_date_end_from = ''; + $search_date_end_to = ''; $search_date_end = ''; $search_amount = ""; $search_account = ''; + $search_status = ''; $search_type_id = ""; } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') @@ -190,7 +223,7 @@ if (empty($reshook)) { */ $form = new Form($db); -$salstatic = new PaymentSalary($db); +$salstatic = new Salary($db); $userstatic = new User($db); $accountstatic = new Account($db); @@ -198,16 +231,18 @@ $now = dol_now(); //$help_url="EN:Module_BillOfMaterials|FR:Module_BillOfMaterials_FR|ES:Módulo_BillOfMaterials"; $help_url = ''; -$title = $langs->trans('SalariesPayments'); +$title = $langs->trans('Salaries'); $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 .= " s.rowid, s.fk_account, s.paye, s.fk_user, s.amount, s.salary, s.label, s.datesp, s.dateep, ps.fk_typepayment as paymenttype, "; $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel,"; -$sql .= " pst.code as payment_code"; -$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id"; -$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 .= " pst.code as payment_code,"; +$sql .= " SUM(ps.amount) as alreadypayed"; +$sql .= " FROM ".MAIN_DB_PREFIX."salary as s"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as ps ON (ps.fk_salary = s.rowid) "; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON (s.fk_typepayment = pst.id) "; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account ba ON (ba.rowid = s.fk_account), "; +//$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as ps ON ps.fk_salary = s.rowid, "; $sql .= " ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.rowid = s.fk_user"; $sql .= " AND s.entity IN (".getEntity('payment_salaries').")"; @@ -225,11 +260,11 @@ if ($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 (!empty($search_date_start_from) && !empty($search_date_start_to)) { + $sql .= " AND s.datesp BETWEEN '".$db->idate($search_date_start_from)."' AND '".$db->idate($search_date_start_to)."'"; } -if ($search_date_end) { - $sql .= " AND s.datep <= '".$db->idate($search_date_end)."'"; +if (!empty($search_date_end_from) && !empty($search_date_end_to)) { + $sql .= " AND s.dateep BETWEEN '".$db->idate($search_date_end_from)."' AND '".$db->idate($search_date_end_to)."'"; } if ($search_amount) { $sql .= natural_search("s.amount", $search_amount, 1); @@ -237,6 +272,9 @@ if ($search_amount) { if ($search_account > 0) { $sql .= " AND b.fk_account=".((int) $search_account); } +if ($search_status != '' && $search_status >= 0) { + $sql .= " AND s.paye = ".$db->escape($search_status); +} if ($filtre) { $filtre = str_replace(":", "=", $filtre); $sql .= " AND ".$filtre; @@ -244,6 +282,10 @@ if ($filtre) { if ($search_type_id) { $sql .= " AND s.fk_typepayment=".$search_type_id; } +$sql .= " GROUP BY u.rowid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary, u.fk_soc, u.statut,"; +$sql .= " s.rowid, s.fk_account, s.paye, s.fk_user, s.amount, s.salary, s.label, s.datesp, s.dateep, ps.fk_typepayment, s.fk_bank,"; +$sql .= " ba.rowid, ba.ref, ba.number, ba.account_number, ba.fk_accountancy_journal, ba.label,"; +$sql .= " pst.code"; $sql .= $db->order($sortfield, $sortorder); // Count total nb of records @@ -305,12 +347,22 @@ if ($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_status != '' && $search_status != '-1') { + $param .= '&search_status='.urlencode($search_status); } -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')); +if (!empty($search_date_start_from)) { + $param .= '&search_date_start_fromday='.urlencode(GETPOST('search_date_start_fromday')).'&search_date_start_frommonth='.urlencode(GETPOST('search_date_start_frommonth')).'&search_date_start_fromyear='.urlencode(GETPOST('search_date_start_fromyear')); } +if (!empty($search_date_start_to)) { + $param .= "&search_date_start_today=".urlencode(GETPOST('search_date_start_today'))."&search_date_start_tomonth=".urlencode(GETPOST('search_date_start_tomonth'))."&search_date_start_toyear=".urlencode(GETPOST('search_date_start_toyear')); +} +if (!empty($search_date_end_from)) { + $param .= '&search_date_end_fromday='.urlencode(GETPOST('search_date_end_fromday')).'&search_date_end_frommonth='.urlencode(GETPOST('search_date_end_frommonth')).'&search_date_end_fromyear='.urlencode(GETPOST('search_date_end_fromyear')); +} +if (!empty($search_date_end_to)) { + $param .= "&search_date_end_today=".urlencode(GETPOST('search_date_end_today'))."&search_date_end_tomonth=".urlencode(GETPOST('search_date_end_tomonth'))."&search_date_end_toyear=".urlencode(GETPOST('search_date_end_toyear')); +} + // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -367,31 +419,47 @@ print ''; -// Date payment + +// Date start print ''; print '
'; -print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); +print $form->selectDate($search_date_start_from ? $search_date_start_from : -1, 'search_date_start_from', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print '
'; print '
'; -print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); +print $form->selectDate($search_date_start_to ? $search_date_start_to : -1, 'search_date_start_to', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
'; print ''; -// Date value + +// Date End print ''; +print '
'; +print $form->selectDate($search_date_end_from ? $search_date_end_from : -1, 'search_date_end_from', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); +print '
'; +print '
'; +print $form->selectDate($search_date_end_to ? $search_date_end_to : -1, 'search_date_end_to', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); +print '
'; print ''; + // Type print ''; $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16); print ''; -// Account + +// Bank account if (!empty($conf->banque->enabled)) { print ''; $form->select_comptes($search_account, 'search_account', 0, '', 1); print ''; } + // Amount print ''; +print ''; +$liststatus = array('0' => $langs->trans("Unpaid"), '1' => $langs->trans("Paid")); +print $form->selectarray('search_status', $liststatus, $search_status, 1); +print ''; + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -411,15 +479,16 @@ print ''."\n"; // -------------------------------------------------------------------- print ''; 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("Employee", $_SERVER["PHP_SELF"], "u.lastname", "", $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, '', $sortfield, $sortorder, 'center '); -print_liste_field_titre("DateValue", $_SERVER["PHP_SELF"], "s.datev,s.rowid", "", $param, '', $sortfield, $sortorder, 'center '); -print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder); +print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "s.datesp,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "s.dateep,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre("DefaultPaymentMode", $_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("DefaultBankAccount", $_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("Amount", $_SERVER["PHP_SELF"], "s.amount", "", $param, 'class="right"', $sortfield, $sortorder); +print_liste_field_titre('Status', $_SERVER["PHP_SELF"], "s.paye", '', $param, 'class="right"', $sortfield, $sortorder); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields @@ -488,20 +557,20 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $totalarray['nbfield']++; } - // Date payment - print ''.dol_print_date($db->jdate($obj->datep), 'day')."\n"; + // Date Start + print ''.dol_print_date($db->jdate($obj->datesp), 'day')."\n"; if (!$i) { $totalarray['nbfield']++; } - // Date value - print ''.dol_print_date($db->jdate($obj->datev), 'day')."\n"; + // Date End + print ''.dol_print_date($db->jdate($obj->dateep), 'day')."\n"; if (!$i) { $totalarray['nbfield']++; } // Type - print ''.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.''; + print ''.$langs->trans("PaymentTypeShort".$obj->payment_code).''; if (!$i) { $totalarray['nbfield']++; } @@ -509,7 +578,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Account if (!empty($conf->banque->enabled)) { print ''; - if ($obj->fk_bank > 0) { + if ($obj->fk_account > 0) { //$accountstatic->fetch($obj->fk_bank); $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; @@ -523,7 +592,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); } - $accountstatic->label = $obj->blabel; + //$accountstatic->label = $obj->blabel; print $accountstatic->getNomUrl(1); } else { print ' '; @@ -534,6 +603,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } } + // if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; + // Amount print ''.price($obj->amount).''; if (!$i) { @@ -544,6 +615,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } $totalarray['val']['totalttcfield'] += $obj->amount; + print ''.$salstatic->LibStatut($obj->paye, 5, $obj->alreadypayed).''; + if (!$i) $totalarray['nbfield']++; + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook @@ -575,12 +649,14 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; // If no record found if ($num == 0) { - $colspan = 1; + /*$colspan = 1; foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) { $colspan++; } - } + }*/ + $colspan = 9; + if (!empty($conf->banque->enabled)) { $colspan++; } print ''.$langs->trans("NoRecordFound").''; } @@ -597,7 +673,6 @@ print ''."\n"; print ''."\n"; - // End of page llxFooter(); $db->close(); diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php new file mode 100644 index 00000000000..44b6aae4503 --- /dev/null +++ b/htdocs/salaries/paiement_salary.php @@ -0,0 +1,314 @@ + + * Copyright (C) 2016-2018 Frédéric France + * Copyright (C) 2021 Gauthier VERDOL + * + * 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 . + */ + +/** + * \file htdocs/compta/paiement_charge.php + * \ingroup tax + * \brief Page to add payment of a tax + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +// Load translation files required by the page +$langs->load("bills"); + +$chid = GETPOST("id", 'int'); +$action = GETPOST('action', 'alpha'); +$amounts = array(); + +// Security check +$socid = 0; +if ($user->socid > 0) { + $socid = $user->socid; +} + + +/* + * Actions + */ + +if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'yes')) { + $error = 0; + + if ($_POST["cancel"]) { + $loc = DOL_URL_ROOT.'/salaries/card.php?id='.$chid; + header("Location: ".$loc); + exit; + } + + $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); + + if (!(GETPOST("paiementtype", 'int') > 0)) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), null, 'errors'); + $error++; + $action = 'create'; + } + if ($datepaye == '') { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); + $error++; + $action = 'create'; + } + if (!empty($conf->banque->enabled) && !(GETPOST("accountid", 'int') > 0)) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); + $error++; + $action = 'create'; + } + + if (!$error) { + $paymentid = 0; + + // Read possible payments + foreach ($_POST as $key => $value) { + if (substr($key, 0, 7) == 'amount_') { + $other_chid = substr($key, 7); + $amounts[$other_chid] = price2num($_POST[$key]); + } + } + + if (count($amounts) <= 0) { + $error++; + setEventMessages($langs->trans("ErrorNoPaymentDefined"), null, 'errors'); + $action = 'create'; + } + + if (!$error) { + $db->begin(); + + // Create a line of payments + $paiement = new PaymentSalary($db); + $paiement->chid = $chid; + $paiement->datepaye = $datepaye; + $paiement->amounts = $amounts; // Tableau de montant + $paiement->paiementtype = GETPOST("paiementtype", 'alphanohtml'); + $paiement->num_payment = GETPOST("num_payment", 'alphanohtml'); + $paiement->note = GETPOST("note", 'none'); + $paiement->note_private = GETPOST("note", 'none'); + + if (!$error) { + $paymentid = $paiement->create($user, (GETPOST('closepaidsalary') == 'on' ? 1 : 0)); + if ($paymentid < 0) { + $error++; + setEventMessages($paiement->error, null, 'errors'); + $action = 'create'; + } + } + + if (!$error) { + $result = $paiement->addPaymentToBank($user, 'payment_salary', '(SalaryPayment)', GETPOST('accountid', 'int'), '', ''); + if (!($result > 0)) { + $error++; + setEventMessages($paiement->error, null, 'errors'); + $action = 'create'; + } + } + + if (!$error) { + $db->commit(); + $loc = DOL_URL_ROOT.'/salaries/card.php?id='.$chid; + header('Location: '.$loc); + exit; + } else { + $db->rollback(); + } + } + } +} + + +/* + * View + */ + +llxHeader(); + +$form = new Form($db); + + +// Formulaire de creation d'un paiement de charge +if ($action == 'create') { + $salary = new Salary($db); // Salary to pay + $salary->fetch($chid); + $salary->accountid = $salary->fk_account ? $salary->fk_account : $salary->accountid; + $salary->paiementtype = $salary->mode_reglement_id ? $salary->mode_reglement_id : $salary->paiementtype; + + $total = $salary->amount; + if (!empty($conf->use_javascript_ajax)) { + print "\n".''."\n"; + } + + print load_fiche_titre($langs->trans("DoPayment")); + print "
\n"; + + print '
'; + print ''; + print ''; + print ''; + print ''; + + dol_fiche_head('', ''); + + print ''; + + print ''; + print '\n"; + print '\n"; + print '\n"; + /*print '\n"; + print '';*/ + + $sql = "SELECT sum(p.amount) as total"; + $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; + $sql .= " WHERE p.fk_salary = ".$chid; + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); + $sumpaid = $obj->total; + $db->free(); + } + /*print ''; + print '';*/ + + print '"; + print ''; + + print '\n"; + print ''; + + print ''; + print ''; + print ''; + + // Number + print ''; + print ''."\n"; + + print ''; + print ''; + print ''; + print ''; + + print '
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("DateStart")."".dol_print_date($salary->datesp, 'day')."
'.$langs->trans("DateEnd")."".dol_print_date($salary->dateep, 'day')."
'.$langs->trans("Label").''.$salary->label."
'.$langs->trans("DateDue")."".dol_print_date($salary->date_ech,'day')."
'.$langs->trans("Amount")."".price($salary->amount,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("AlreadyPaid").''.price($sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("Date").''; + $datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); + $datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (empty($_POST["remonth"]) ?-1 : $datepaye) : ''; + print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); + print "
'.$langs->trans("PaymentMode").''; + $form->select_types_paiements(isset($_POST["paiementtype"]) ? $_POST["paiementtype"] : $salary->type_payment, "paiementtype"); + print "
'.$langs->trans('AccountToDebit').''; + $form->select_comptes(isset($_POST["accountid"]) ? $_POST["accountid"] : $salary->accountid, "accountid", 0, '', 1); // Show opend bank account list + print '
'.$langs->trans('Numero'); + print ' ('.$langs->trans("ChequeOrTransferNumber").')'; + print '
'.$langs->trans("Comments").'
'; + + dol_fiche_end(); + + /* + * Autres charges impayees + */ + $num = 1; + $i = 0; + + print ''; + print ''; + //print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + $total = 0; + $totalrecu = 0; + + while ($i < $num) { + $objp = $salary; + + print ''; + + if ($objp->dateep > 0) { + print ''."\n"; + } else { + print ''."\n"; + } + + print '"; + + print '"; + + print '"; + + print '"; + + print "\n"; + $total += $objp->total; + $total_ttc += $objp->total_ttc; + $totalrecu += $objp->am; + $i++; + } + if ($i > 1) { + // Print total + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + } + + print "
'.$langs->trans("SocialContribution").''.$langs->trans("DateEnd").''.$langs->trans("Amount").''.$langs->trans("AlreadyPaid").''.$langs->trans("RemainderToPay").''.$langs->trans("Amount").'
'.dol_print_date($objp->dateep, 'day').'!!!'.price($objp->amount)."'.price($sumpaid)."'.price($objp->amount - $sumpaid)."'; + if ($sumpaid < $objp->amount) { + $namef = "amount_".$objp->id; + $nameRemain = "remain_".$objp->id; + if (!empty($conf->use_javascript_ajax)) { + print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'"); + } + $remaintopay = $objp->amount - $sumpaid; + print ''; + print ''; + } else { + print '-'; + } + print "
'.$langs->trans("Total").':'.price($total_ttc).''.price($totalrecu).''.price($total_ttc - $totalrecu).' 
"; + + // Bouton Save payment + print '
'.$langs->trans("ClosePaidSalaryAutomatically"); + print '
'; + print '     '; + print ''; + print '
'; + + print "
\n"; +} + +llxFooter(); +$db->close(); diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php new file mode 100644 index 00000000000..3a8eb998fff --- /dev/null +++ b/htdocs/salaries/payment_salary/card.php @@ -0,0 +1,269 @@ + + * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2021 Gauthier VERDOL + * + * 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 . + */ + +/** + * \file htdocs/compta/payment_sc/card.php + * \ingroup facture + * \brief Onglet payment of a salary + * \remarks Fichier presque identique a fournisseur/paiement/card.php + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; +if (!empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array('bills', 'banks', 'companies', 'salaries')); + +// Security check +$id = GETPOST("id", 'int'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm'); +if ($user->socid) $socid = $user->socid; +// TODO ajouter regle pour restreindre acces paiement +//$result = restrictedArea($user, 'facture', $id,''); + +$object = new PaymentSalary($db); +if ($id > 0) { + $result = $object->fetch($id); + if (!$result) dol_print_error($db, 'Failed to get payment id '.$id); +} + + +/* + * Actions + */ + +// Delete payment +if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->salaries->delete) { + $db->begin(); + + $result = $object->delete($user); + if ($result > 0) { + $db->commit(); + header("Location: ".DOL_URL_ROOT."/salaries/payments.php"); + exit; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $db->rollback(); + } +} + + +/* + * View + */ + +llxHeader(); + +$salary = new Salary($db); + +$form = new Form($db); + +$h = 0; + +$head = array(); + +$head[$h][0] = DOL_URL_ROOT.'/salaries/payment_salary/card.php?id='.$id; +$head[$h][1] = $langs->trans("SalaryPayment"); +$hselected = $h; +$h++; + +/* +$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$id; +$head[$h][1] = $langs->trans("Info"); +$h++; +*/ + + +dol_fiche_head($head, $hselected, $langs->trans("SalaryPayment"), -1, 'payment'); + +/* + * Deletion confirmation of payment + */ +if ($action == 'delete') { + print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeleteSalary"), $langs->trans("ConfirmDeleteSalaryPayment"), 'confirm_delete', '', 0, 2); +} + +/* + * Validation confirmation of payment + */ +/* +if ($action == 'valide') +{ + $facid = $_GET['facid']; + print $form->formconfirm('card.php?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); + +} +*/ + + +$linkback = ''.$langs->trans("BackToList").''; + +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'id', ''); + + +print '
'; +print '
'; + +print ''; + +// Ref +/*print ''; +print '';*/ + +// Date +print ''; + +// Mode +print ''; + +// Numero +print ''; + +// Montant +print ''; + +// Note +print ''; + +// Bank account +if (!empty($conf->banque->enabled)) { + if ($object->bank_account) { + $bankline = new AccountLine($db); + $bankline->fetch($object->bank_line); + + print ''; + print ''; + print ''; + print ''; + } +} + +print '
'.$langs->trans('Ref').''; +print $form->showrefnav($object,'id','',1,'rowid','id'); +print '
'.$langs->trans('Date').''.dol_print_date($object->datep, 'day').'
'.$langs->trans('Mode').''.$langs->trans("PaymentType".$object->type_code).'
'.$langs->trans('Numero').''.$object->num_payment.'
'.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Note').''.nl2br($object->note).'
'.$langs->trans('BankTransactionLine').''; + print $bankline->getNomUrl(1, 0, 'showall'); + print '
'; + +print '
'; + +dol_fiche_end(); + + +/* + * List of salaries payed + */ + +$disable_delete = 0; +$sql = 'SELECT f.rowid as scid, f.label, f.paye, f.amount as sc_amount, ps.amount'; +$sql .= ' FROM '.MAIN_DB_PREFIX.'payment_salary as ps,'.MAIN_DB_PREFIX.'salary as f'; +$sql .= ' WHERE ps.fk_salary = f.rowid'; +$sql .= ' AND f.entity = '.$conf->entity; +$sql .= ' AND ps.rowid = '.$object->id; + +dol_syslog("payment_salary/card.php", LOG_DEBUG); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); + + $i = 0; + $total = 0; + print '
'; + + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + if ($num > 0) { + while ($i < $num) { + $objp = $db->fetch_object($resql); + + print ''; + // Ref + print '\n"; + // Type + print '\n"; + // Label + print ''; + // Expected to pay + print ''; + // Status + print ''; + // Amount payed + print ''; + print "\n"; + if ($objp->paye == 1) { + // If at least one invoice is paid, disable delete + $disable_delete = 1; + } + $total = $total + $objp->amount; + $i++; + } + } + + print "
'.$langs->trans('Salary').''.$langs->trans('Type').''.$langs->trans('Label').''.$langs->trans('ExpectedToPay').''.$langs->trans('Status').''.$langs->trans('PayedByThisPayment').'
'; + $salary->fetch($objp->scid); + print $salary->getNomUrl(1); + print "'; + print $salary->type_label; + /*print $salary->type;*/ + print "'.$objp->label.''.price($objp->sc_amount).''.$salary->getLibStatut(4, $objp->amount).''.price($objp->amount).'
\n"; + print "
"; + + $db->free($resql); +} else { + dol_print_error($db); +} + + + +/* + * Button actions + */ + +print '
'; + +if ($action == '') { + if ($user->rights->salaries->delete) { + if (!$disable_delete) { + print ''.$langs->trans('Delete').''; + } else { + print ''.$langs->trans('Delete').''; + } + } +} + +print '
'; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php new file mode 100644 index 00000000000..5c0b0c73956 --- /dev/null +++ b/htdocs/salaries/payments.php @@ -0,0 +1,513 @@ + + * Copyright (C) 2015-2016 Laurent Destailleur + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2021 Gauthier VERDOL + * + * 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 . + */ + +/** + * \file htdocs/salaries/list.php + * \ingroup salaries + * \brief List of salaries payments + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; + +// 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_ref_salary = GETPOST('search_ref_salary', 'int'); +$search_user = GETPOST('search_user', 'alpha'); +$search_label = GETPOST('search_label', 'alpha'); +$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); +$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); +$search_amount = GETPOST('search_amount', 'alpha'); +$search_account = GETPOST('search_account', 'int'); + +$filtre = GETPOST("filtre", 'restricthtml'); + +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') $search_type_id = $part[1]; + } +} else { + $search_type_id = GETPOST('search_type_id', 'int'); +} + +$childids = $user->getAllChildIds(1); + +// Security check +$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('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_ref_salary = ""; + $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'; + $uploaddir = $conf->salaries->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + + // Validate records + if (!$error && $massaction == 'buildsepa' && $permissiontoadd) { + $objecttmp = new $objectclass($db); + + // TODO + } +} + +/* + * View + */ + +$form = new Form($db); +$salstatic = new Salary($db); +$paymentsalstatic = 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, sal.rowid as id_salary, sal.label, s.datep as datep, b.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,"; +$sql .= " pst.code as payment_code"; +$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; +$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as sal ON (sal.rowid = s.fk_salary)"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id"; +$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 = sal.fk_user"; +$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=".((int) $search_ref); +if ($search_ref_salary) $sql .= " AND sal.rowid=".((int) $search_ref_salary); +if ($search_user) $sql .= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email'), $search_user); +if ($search_label) $sql .= natural_search(array('sal.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=".((int) $search_account); +if ($filtre) { + $filtre = str_replace(":", "=", $filtre); + $sql .= " AND ".$filtre; +} +if ($search_type_id) { + $sql .= " AND s.fk_typepayment=".$search_type_id; +} +$sql .= $db->order($sortfield, $sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + $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; + } +} +// 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 = $nbtotalofrecords; +} else { + if ($limit) $sql .= $db->plimit($limit + 1, $offset); + + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); +} + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url); + +$arrayofselected = is_array($toselect) ? $toselect : array(); + +$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_ref_salary) $param .= '&search_ref_salary='.urlencode($search_ref_salary); +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"), // TODO +); +//if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + +print '
'; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$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 '
'; +print ''."\n"; + +// Fields title search +// -------------------------------------------------------------------- +print ''; +// Ref +print ''; +// Employee +print ''; +// Salary +print ''; +// Label +print ''; +// Date payment +print ''; +// Date value +print ''; +// Type +print ''; +// Account +if (!empty($conf->banque->enabled)) { + print ''; +} +// Amount +print ''; + +// 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 ''; +print ''."\n"; + + +// Fields title label +// -------------------------------------------------------------------- +print ''; +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("Salary", $_SERVER["PHP_SELF"], "sal.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, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre("DateValue", $_SERVER["PHP_SELF"], "b.datev,s.rowid", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pst.code", "", $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 ''."\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 ''; + + $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->id_salary; + $salstatic->ref = $obj->id_salary; + + $paymentsalstatic->id = $obj->rowid; + $paymentsalstatic->ref = $obj->rowid; + + // Ref + print "\n"; + if (!$i) $totalarray['nbfield']++; + + // Employee + print "\n"; + if (!$i) $totalarray['nbfield']++; + + print "\n"; + if (!$i) $totalarray['nbfield']++; + + // Label payment + print "\n"; + if (!$i) $totalarray['nbfield']++; + + // Date payment + print '\n"; + if (!$i) $totalarray['nbfield']++; + + // Date value + print '\n"; + if (!$i) $totalarray['nbfield']++; + + // Type + print ''; + if (!$i) $totalarray['nbfield']++; + + // Account + if (!empty($conf->banque->enabled)) { + print ''; + if (!$i) $totalarray['nbfield']++; + } + + // Amount + print ''; + if (!$i) $totalarray['nbfield']++; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; + $totalarray['val']['totalttcfield'] += $obj->amount; + + // 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 ''; + if (!$i) $totalarray['nbfield']++; + + print ''."\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 ''; +} + + +$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 '
'; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print '
'; +print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); +print '
'; +print '
'; +print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); +print '
'; +print '
'; +print ''; +$form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16); +print ''; + $form->select_comptes($search_account, 'search_account', 0, '', 1); + print ''; +$searchpicto = $form->showFilterButtons(); +print $searchpicto; +print '
".$paymentsalstatic->getNomUrl(1)."".$userstatic->getNomUrl(1)."".$salstatic->getNomUrl(1)."".dol_trunc($obj->label, 40)."'.dol_print_date($db->jdate($obj->datep), 'day')."'.dol_print_date($db->jdate($obj->datev), 'day')."'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.''; + 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->account_number = $obj->account_number; + + $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 ' '; + print ''.price($obj->amount).''; + 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 ''; + } + print '
'.$langs->trans("NoRecordFound").'
'."\n"; +print '
'."\n"; + +print '
'."\n"; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index e6ef351bd4e..ac746a215e3 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Fidesio + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -27,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/salariesstats.class.php'; // Load translation files required by the page -$langs->loadLangs(array("salaries", "companies")); +$langs->loadLangs(array("salaries", "companies", "bills")); $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index be61d3a3436..421a0842d89 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Pierre Chéné * Copyright (C) 2019 Cedric Ancelin - * Copyright (C) 2020 Frédéric France + * Copyright (C) 2020-2021 Frédéric France * * 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 @@ -1845,7 +1845,7 @@ class Thirdparties extends DolibarrApi if (!DolibarrApiAccess::$user->rights->societe->lire) { throw new RestException(401); } - if ($rowid == 0) { + if ($rowid === 0) { $result = $this->company->initAsSpecimen(); } else { $result = $this->company->fetch($rowid, $ref, $ref_ext, $barcode, $idprof1, $idprof2, $idprof3, $idprof4, $idprof5, $idprof6, $email, $ref_alias); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 9b58ea1bc5d..a7ef895041e 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -4,6 +4,7 @@ * Copyright (C) 2013-2015 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2015-2017 Ferran Marcet + * Copyright (C) 2021 Frédéric France * * 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 @@ -472,6 +473,7 @@ if ($sql_select) { $documentstatic->statut = $objp->status; $documentstatic->status = $objp->status; $documentstatic->paye = $objp->paid; + $documentstatic->alreadypaid = $objp->paid; if (is_object($documentstaticline)) { $documentstaticline->statut = $objp->status; @@ -487,6 +489,8 @@ if ($sql_select) { print ''; if ($type_element == 'contract') { print $documentstaticline->getLibStatut(5); + } elseif ($type_element == 'invoice') { + print $documentstatic->getLibStatut(5, $objp->paid); } else { print $documentstatic->getLibStatut(5); } @@ -496,7 +500,9 @@ if ($sql_select) { print ''; // Define text, description and type - $text = ''; $description = ''; $type = 0; + $text = ''; + $description = ''; + $type = 0; // Code to show product duplicated from commonobject->printObjectLine if ($objp->fk_product > 0) { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 0647a11d626..6729a984820 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -29,6 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $hookmanager = new HookManager($db); @@ -47,6 +48,25 @@ $result = restrictedArea($user, 'societe', 0, '', '', '', ''); $thirdparty_static = new Societe($db); +if (!isset($form) || !is_object($form)) { + $form = new Form($db); +} +// Load $resultboxes +$resultboxes = FormOther::getBoxesArea($user, "3"); + +if (GETPOST('addbox')) { + // Add box (when submit is done from a form when ajax disabled) + require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; + $zone = GETPOST('areacode', 'aZ09'); + $userid = GETPOST('userid', 'int'); + $boxorder = GETPOST('boxorder', 'aZ09'); + $boxorder .= GETPOST('boxcombo', 'aZ09'); + $result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid); + if ($result > 0) { + setEventMessages($langs->trans("BoxAdded"), null); + } +} + /* * View @@ -56,11 +76,8 @@ $transAreaType = $langs->trans("ThirdPartiesArea"); $helpurl = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Terceros'; llxHeader("", $langs->trans("ThirdParties"), $helpurl); -$linkback = ''; -print load_fiche_titre($transAreaType, $linkback, 'companies'); - -print '
'; +print load_fiche_titre($transAreaType, $resultboxes['selectboxlist'], 'companies'); /* @@ -115,11 +132,11 @@ if ($result) { dol_print_error($db); } -print '
'; -print ''."\n"; -print ''; +$thirdpartygraph = '
'; +$thirdpartygraph .= '
'.$langs->trans("Statistics").'
'."\n"; +$thirdpartygraph .= ''; if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + (round($third['customer']) ? 1 : 0) + (round($third['supplier']) ? 1 : 0) + (round($third['other']) ? 1 : 0) >= 2)) { - print ''."\n"; + $thirdpartygraph .= $dolgraph->show(); + $thirdpartygraph .= ''."\n"; } else { if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $statstring = ""; @@ -159,25 +176,23 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + $statstring2 .= ''; $statstring2 .= ""; } - print $statstring; - print $statstring2; + $thirdpartygraph .= $statstring; + $thirdpartygraph .= $statstring2; } -print ''; -print '
'.$langs->trans("Statistics").'
'; + $thirdpartygraph .= '
'; $dataseries = array(); if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $dataseries[] = array($langs->trans("Prospects"), round($third['prospect'])); @@ -141,8 +158,8 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); $dolgraph->draw('idgraphthirdparties'); - print $dolgraph->show(); - print '
'.$langs->trans("Suppliers").''.round($third['supplier']).'
'.$langs->trans("UniqueThirdParties").''; -print $total; -print '
'; -print '
'; +$thirdpartygraph .= ''.$langs->trans("UniqueThirdParties").''; +$thirdpartygraph .= $total; +$thirdpartygraph .= ''; +$thirdpartygraph .= ''; +$thirdpartygraph .= '
'; if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $elementtype = 'societe'; - print '
'; - - print '
'; - print ''; - print ''; - print ''; + $thirdpartycateggraph .= ''; + $thirdpartycateggraph .= '
'.$langs->trans("Categories").'
'; + $thirdpartycateggraph .= '
'; + $thirdpartycateggraph .= ''; + $thirdpartycateggraph .= ''; + $thirdpartycateggraph .= ''; + $thirdpartycateggraph .= ''; $total += $obj->nb; $i++; } } } - print ''; - print ''; - print '
'.$langs->trans("Categories").'
'; $sql = "SELECT c.label, count(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; @@ -218,27 +233,25 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); $dolgraph->draw('idgraphcateg'); - print $dolgraph->show(); + $thirdpartycateggraph .= $dolgraph->show(); } else { while ($i < $num) { $obj = $db->fetch_object($result); - print '
'.$obj->label.''.$obj->nb.'
'.$obj->label.''.$obj->nb.'
'.$langs->trans("Total").''; - print $total; - print '
'; - print '
'; + $thirdpartycateggraph .= '
'.$langs->trans("Total").''; + $thirdpartycateggraph .= $total; + $thirdpartycateggraph .= '
'; + $thirdpartycateggraph .= '
'; } -print '
'; - /* * Latest modified third parties @@ -279,14 +292,14 @@ if ($result) { if ($num > 0) { $transRecordedType = $langs->trans("LastModifiedThirdParties", $max); - print "\n\n"; - print '
'; - print ''; + $lastmodified = "\n\n"; + $lastmodified .= '
'; + $lastmodified .= '
'; - print ''; - print ''; - print ''; - print ''."\n"; + $lastmodified .= ''; + $lastmodified .= ''; + $lastmodified .= ''; + $lastmodified .= ''."\n"; while ($i < $num) { $objp = $db->fetch_object($result); @@ -306,37 +319,63 @@ if ($result) { $thirdparty_static->code_compta_fournisseur = $objp->code_compta_fournisseur; $thirdparty_static->code_compta = $objp->code_compta; - print ''; + $lastmodified .= ''; // Name - print '\n"; + $lastmodified .= '\n"; // Type - print ''; + $lastmodified .= ''; // Last modified date - print '"; - print '"; - print "\n"; + $lastmodified .= '"; + $lastmodified .= '"; + $lastmodified .= "\n"; $i++; } $db->free($result); - print "
'.$transRecordedType.' '.$langs->trans("FullList").'
'.$transRecordedType.' '.$langs->trans("FullList").'
'; - print $thirdparty_static->getNomUrl(1); - print "'; + $lastmodified .= $thirdparty_static->getNomUrl(1); + $lastmodified .= "'; - print $thirdparty_static->getTypeUrl(); - print ''; + $lastmodified .= $thirdparty_static->getTypeUrl(); + $lastmodified .= ''; - print dol_print_date($thirdparty_static->date_modification, 'day'); - print "'; - print $thirdparty_static->getLibStatut(3); - print "
'; + $lastmodified .= dol_print_date($thirdparty_static->date_modification, 'day'); + $lastmodified .= "'; + $lastmodified .= $thirdparty_static->getLibStatut(3); + $lastmodified .= "
\n"; - print '
'; - print "\n"; + $lastmodified .= "\n"; + $lastmodified .= '
'; + $lastmodified .= "\n"; } } else { dol_print_error($db); } -print '
'; +//print ''; + +// boxes +print '
'; +print '
'; + +$boxlist = '
'; + +$boxlist .= '
'; +$boxlist .= $thirdpartygraph; +$boxlist .= '
'; +$boxlist .= $thirdpartycateggraph; +$boxlist .= '
'; +$boxlist .= $resultboxes['boxlista']; +$boxlist .= '
'."\n"; + +$boxlist .= '
'; +$boxlist .= $lastmodified; +$boxlist .= '
'; +$boxlist .= $resultboxes['boxlistb']; +$boxlist .= '
'."\n"; + +$boxlist .= '
'; + +print $boxlist; + +print '
'; $parameters = array('user' => $user); $reshook = $hookmanager->executeHooks('dashboardThirdparties', $parameters, $object); // Note that $action and $object may have been modified by hook diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 1d737bf1ef5..ebd126e377f 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -529,17 +529,17 @@ if (empty($reshook)) { $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { $idprod = 0; - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod = GETPOST('idprod', 'int'); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = ''; } $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); $remise_percent = price2num(GETPOST('remise_percent'.$predef), 2); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU'); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); @@ -836,7 +836,7 @@ if (empty($reshook)) { $localtax2_rate = get_localtax($vat_rate, 2, $mysoc, $object->thirdparty); if (GETPOST('price_ht') != '') { - $ht = price2num(GETPOST('price_ht')); + $ht = price2num(GETPOST('price_ht'), '', 2); } if (GETPOST('price_ttc') != '') { @@ -847,7 +847,7 @@ if (empty($reshook)) { $vatratecode = $reg[2]; } - $ttc = price2num(GETPOST('price_ttc')); + $ttc = price2num(GETPOST('price_ttc'), '', 2); $ht = $ttc / (1 + ($vatratecleaned / 100)); } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index b2af9eaa460..ce30f636301 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1606,7 +1606,7 @@ td.showDragHandle { float: left; } .classforhorizontalscrolloftabs #id-right { - width:calc(100% - 210px); + width: calc(100% - 210px); display: inline-block; } @@ -1710,10 +1710,17 @@ div.vmenu, td.vmenu { /* rule to reduce top menu - 3rd reduction: The menu for user is on left */ @media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ { + /* no side-nav */ body.sidebar-collapse .side-nav { display: none; } + /* if no side-nav, we don't need to have width forced */ + .classforhorizontalscrolloftabs #id-right { + width: unset; + display: unset; + } + body.sidebar-collapse .login_block { display: none; } @@ -1767,8 +1774,8 @@ div.vmenu, td.vmenu { div.fiche { - margin-: dol_optimize_smallscreen) ? '30' : '6')); ?>px; - margin-: dol_optimize_smallscreen) ? '28' : '6')); ?>px; + margin-: dol_optimize_smallscreen) ? '32' : '6')); ?>px; + margin-: dol_optimize_smallscreen) ? '30' : '6')); ?>px; @@ -1815,7 +1822,7 @@ div.fichetwothirdright { } ?> } div.fichetwothirdright div.ficheaddleft { - padding-: 20px; + padding-: 28px; } div.fichehalfleft { browser->layout != 'phone') { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index bf31bcfe877..c4730008285 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -712,7 +712,7 @@ class Ticket extends CommonObject if (!empty($filter)) { foreach ($filter as $key => $value) { if (strpos($key, 'date')) { // To allow $filter['YEAR(s.dated)']=>$year - $sql .= ' AND '.$key." = '".$this->db->scape($value)."'"; + $sql .= ' AND '.$key." = '".$this->db->escape($value)."'"; } elseif (($key == 't.fk_user_assign') || ($key == 't.type_code') || ($key == 't.category_code') || ($key == 't.severity_code') || ($key == 't.fk_soc')) { $sql .= " AND ".$key." = '".$this->db->escape($value)."'"; } elseif ($key == 't.fk_statut') { diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 65bf7c5c8ac..df5757992f0 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -6,6 +6,7 @@ * Copyright (C) 2013 Peter Fontaine * Copyright (C) 2015-2016 Marcos García * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -355,13 +356,14 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac if (!empty($conf->salaries->enabled) && $user->rights->salaries->read && (in_array($object->id, $childids) || $object->id == $user->id) ) { - $salary = new PaymentSalary($db); + $payment_salary = new PaymentSalary($db); - $sql = "SELECT ps.rowid, ps.datesp, ps.dateep, ps.amount"; + $sql = "SELECT ps.rowid, s.datesp, s.dateep, ps.amount"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as ps"; - $sql .= " WHERE ps.fk_user = ".$object->id; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON (s.rowid = ps.fk_salary)"; + $sql .= " WHERE s.fk_user = ".$object->id; $sql .= " AND ps.entity = ".$conf->entity; - $sql .= " ORDER BY ps.datesp DESC"; + $sql .= " ORDER BY ps.rowid DESC"; $resql = $db->query($sql); if ($resql) { @@ -370,7 +372,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print ''; print ''; - print '
'; + print ''; print ''; @@ -380,9 +382,9 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print ''; print ''; print '\n"; diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index af0b117bb5e..67c14a4ee5d 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -97,7 +97,11 @@ print "port=".$conf->global->LDAP_SERVER_PORT."\n"; print "login=".$conf->global->LDAP_ADMIN_DN."\n"; print "pass=".preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)."\n"; print "DN to extract=".$conf->global->LDAP_GROUP_DN."\n"; -print 'Filter=('.$conf->global->LDAP_KEY_GROUPS.'=*)'."\n"; +if (!empty($conf->global->LDAP_GROUP_FILTER)) { + print 'Filter=('.$conf->global->LDAP_GROUP_FILTER.')'."\n"; // Note: filter is defined into function getRecords +} else { + print 'Filter=('.$conf->global->LDAP_KEY_GROUPS.'=*)'."\n"; +} print "----- To Dolibarr database:\n"; print "type=".$conf->db->type."\n"; print "host=".$conf->db->host."\n"; @@ -127,7 +131,7 @@ if ($result >= 0) { // We disable synchro Dolibarr-LDAP $conf->global->LDAP_SYNCHRO_ACTIVE = 0; - $ldaprecords = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_GROUPS, $required_fields, 0, array($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)); + $ldaprecords = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_GROUPS, $required_fields, 'group', array($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)); if (is_array($ldaprecords)) { $db->begin(); diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 2a0b8823973..1fb62ecfd0e 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -127,13 +127,14 @@ class FactureRecTest extends PHPUnit\Framework\TestCase } /** - * testFactureCreate + * testFactureRecCreate * * @return int */ public function testFactureRecCreate() { global $conf,$user,$langs,$db; + $conf=$this->savconf; $user=$this->savuser; $langs=$this->savlangs; @@ -141,21 +142,51 @@ class FactureRecTest extends PHPUnit\Framework\TestCase $localobjectinv=new Facture($this->savdb); $localobjectinv->initAsSpecimen(); - $localobjectinv->create($user); + $result = $localobjectinv->create($user); + + print __METHOD__." result=".$result."\n"; $localobject=new FactureRec($this->savdb); $localobject->initAsSpecimen(); - $result=$localobject->create($user, $localobjectinv->id); + $result = $localobject->create($user, $localobjectinv->id); - $this->assertLessThan($result, 0); print __METHOD__." result=".$result."\n"; + $this->assertGreaterThan(0, $result, 'Create recurring invoice from common invoice'); + return $result; } + /** + * testFactureRecFetch + * + * @param int $id Id of created recuriing invoice + * @return int + * + * @depends testFactureRecCreate + * The depends says test is run only if previous is ok + */ + public function testFactureRecFetch($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new FactureRec($this->savdb); + $result = $localobject->fetch($id); + + print __METHOD__." result=".$result."\n"; + $this->assertGreaterThan(0, $result); + return $result; + } + + + /** * Edit an object to test updates * - * @param Facture $localobject Object Facture + * @param FactureRec $localobject Object Facture rec * @return void */ public function changeProperties(&$localobject) diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index f1341c9a042..e43453b26ec 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -108,7 +108,15 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. if (! function_exists('mb_substr')) { - print "\n".__METHOD__." function mb_substr must be enabled.\n"; die(); + print "\n".__METHOD__." function mb_substr must be enabled.\n"; die(1); + } + + if ($conf->global->MAIN_MAX_DECIMALS_UNIT != 5) { + print "\n".__METHOD__." bad setup for number of digits for unit amount. Must be 5 for this test.\n"; die(1); + } + + if ($conf->global->MAIN_MAX_DECIMALS_TOT != 2) { + print "\n".__METHOD__." bad setup for number of digits for unit amount. Must be 2 for this test.\n"; die(1); } print __METHOD__."\n"; @@ -1294,7 +1302,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase $this->assertEquals(1000.123456, price2num('1 000.123456')); // Round down - $this->assertEquals(1000.12, price2num('1 000.123452', 'MT')); + $this->assertEquals(1000.12, price2num('1 000.123452', 'MT'), 'Error in round down with MT'); $this->assertEquals(1000.12345, price2num('1 000.123452', 'MU'), "Test MU"); // Round up diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 32b224bb584..aa57d987238 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -91,6 +91,10 @@ class SocieteTest extends PHPUnit\Framework\TestCase print "\n".__METHOD__." constant MAIN_DISABLEPROFIDRULES must be empty (if a module set it, disable module).\n"; die(); } + if ($langs->defaultlang != 'en_US') { + print "\n".__METHOD__." default language of company must be set to autodetect.\n"; die(); + } + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. print __METHOD__."\n"; @@ -347,9 +351,24 @@ class SocieteTest extends PHPUnit\Framework\TestCase print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertNotEquals($result, ''); + $localobject->country_code = 'FR'; + $result=$localobject->isInEEC(); print __METHOD__." id=".$localobject->id." country_code=".$localobject->country_code." result=".$result."\n"; - $this->assertTrue(true, $result); + $this->assertTrue($result); + + $localobject->country_code = 'US'; + + $result=$localobject->isInEEC(); + print __METHOD__." id=".$localobject->id." country_code=".$localobject->country_code." result=".$result."\n"; + $this->assertFalse($result); + + /*$localobject->country_code = 'GB'; + + $result=$localobject->isInEEC(); + print __METHOD__." id=".$localobject->id." country_code=".$localobject->country_code." result=".$result."\n"; + $this->assertTrue($result); + */ $localobject->info($localobject->id); print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n";
'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.''; print '
'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.'
'; - $salary->id = $objp->rowid; - $salary->ref = $objp->rowid; - print $salary->getNomUrl(1); + $payment_salary->id = $objp->rowid; + $payment_salary->ref = $objp->rowid; + print $payment_salary->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->datesp), 'day')."