From 17c8a32780732fab76c36e86c903291f999d83ce Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 2 Mar 2021 11:00:16 +0100 Subject: [PATCH 01/61] fix civility createion PK --- htdocs/install/mysql/tables/llx_c_civility.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, From 81f54003f6e1d01d694873ea5485f5131843fdd6 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 2 Mar 2021 22:35:47 +0100 Subject: [PATCH 02/61] set migration auto increment --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 5 +++++ 1 file changed, 5 insertions(+) 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..6e5d038f095 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 @@ -197,3 +197,8 @@ 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 OWNED BY llx_c_civility.rowid; +--VPGSQL8.2 ALTER TABLE llx_c_civility ADD PRIMARY KEY (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; From c68230981736518373a5a62d5b93129b9253d714 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 3 Mar 2021 20:27:55 +0100 Subject: [PATCH 03/61] migration ok --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 6e5d038f095..f05b9880bd6 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 @@ -198,7 +198,6 @@ 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 OWNED BY llx_c_civility.rowid; ---VPGSQL8.2 ALTER TABLE llx_c_civility ADD PRIMARY KEY (rowid); +--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; From 71370bd5587eb2af6e04e1f3448c1a71be552a6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Mar 2021 21:18:14 +0100 Subject: [PATCH 04/61] Fix links in cheque receipt pages --- htdocs/compta/bank/line.php | 7 ++++--- htdocs/compta/paiement/cheque/card.php | 20 ++++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 467f6b7b78b..d5d4e767f3f 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -307,11 +307,12 @@ if ($result) $i++; // Bank account - print ''.$langs->trans("Account").''; + print ''.$langs->trans("Account").''; print ''; 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'); } @@ -562,7 +563,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 ""; } diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index c6afa4def1d..0fa9a4f3dd2 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -383,8 +383,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"; @@ -410,6 +411,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++; @@ -493,9 +496,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 ' '; @@ -615,7 +618,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"; @@ -672,8 +675,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 ' '; From aa1551bf1f50a88fc40305ea03c7926cecabc8d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Mar 2021 22:46:25 +0100 Subject: [PATCH 05/61] FIX class not found when creating recuring invoice from invoice+discount --- htdocs/core/tpl/objectline_view.tpl.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index ba0bf6212ac..428fac31789 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -87,28 +87,29 @@ if (($line->info_bits & 2) == 2) { //else $txt=$langs->trans("Discount"); print $txt; print ''; + if ($line->description) { - if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) - { + if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) { + include_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; $discount = new DiscountAbsolute($this->db); $discount->fetch($line->fk_remise_except); print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0)); - } elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) - { + } elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) { + include_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; $discount = new DiscountAbsolute($this->db); $discount->fetch($line->fk_remise_except); print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0)); // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) print ' ('.dol_print_date($discount->datec).')'; - } elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) - { + } elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) { + include_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; $discount = new DiscountAbsolute($this->db); $discount->fetch($line->fk_remise_except); print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0)); - } elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) - { + } elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) { + include_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; $discount = new DiscountAbsolute($this->db); $discount->fetch($line->fk_remise_except); print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0)); From 30dd4ac6ec56365d4a39d001d1f7086dd8d8ff19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Mar 2021 22:52:02 +0100 Subject: [PATCH 06/61] FIX #16530 --- htdocs/compta/facture/class/facture-rec.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 1a50fadcc9c..cdb6b7b83c1 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -335,7 +335,11 @@ 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) From 6503c81f475ab1226b227427d54846ccde100a1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Mar 2021 23:55:28 +0100 Subject: [PATCH 07/61] FIX #16530 --- .../facture/class/facture-rec.class.php | 55 ++++++++++++++----- htdocs/compta/facture/class/facture.class.php | 4 +- test/phpunit/FactureRecTest.php | 33 +++++++++-- 3 files changed, 73 insertions(+), 19 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index cdb6b7b83c1..cb1a8a88141 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -347,8 +347,8 @@ class FactureRec extends CommonInvoice $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]->rowid); @@ -360,6 +360,9 @@ class FactureRec extends CommonInvoice { $error++; } + } elseif ($result2 < 0) { + $this->errors[] = $objectline->error; + $error++; } } } @@ -421,6 +424,7 @@ class FactureRec extends CommonInvoice if ($error) { $this->db->rollback(); + return -3; } else { $this->db->commit(); return $this->id; @@ -516,12 +520,15 @@ class FactureRec extends CommonInvoice $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id'; //$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; - elseif ($ref) $sql .= " AND f.titre='".$this->db->escape($ref)."'"; - /* 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 ($rowid) { + $sql .= ' AND f.rowid='.((int) $rowid); + } elseif ($ref) { + $sql .= " AND f.titre='".$this->db->escape($ref)."'"; + // This field are not used for template invoice + //} elseif ($ref_ext) { $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; } + } else { + $sql .= ' AND f.rowid = 0'; + } $result = $this->db->query($sql); if ($result) @@ -651,11 +658,11 @@ 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.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.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.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.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, 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'; @@ -706,10 +713,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; @@ -1971,6 +1984,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'; @@ -2018,7 +2035,17 @@ 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 6656141593c..e302c83e2d8 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -915,8 +915,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) { @@ -984,6 +985,7 @@ class Facture extends CommonInvoice if (!$error) { $result = $this->update_price(1); + if ($result > 0) { $action = 'create'; diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 0250b659e47..e878aa2a0f3 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -128,7 +128,7 @@ class FactureRecTest extends PHPUnit\Framework\TestCase } /** - * testFactureCreate + * testFactureRecCreate * * @return int */ @@ -142,19 +142,44 @@ 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; + } From 31845e1dae15bac71f55311d24c7f2c9a2543bab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Mar 2021 00:04:43 +0100 Subject: [PATCH 08/61] Fix phpcs --- htdocs/compta/facture/class/facture-rec.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index cb1a8a88141..70fc1ae82d1 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -524,8 +524,8 @@ class FactureRec extends CommonInvoice $sql .= ' AND f.rowid='.((int) $rowid); } elseif ($ref) { $sql .= " AND f.titre='".$this->db->escape($ref)."'"; - // This field are not used for template invoice - //} elseif ($ref_ext) { $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; } + // This field are not used for template invoice + //} elseif ($ref_ext) { $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; } } else { $sql .= ' AND f.rowid = 0'; } From a371647bcac761ae84d475a9a45d99f9bd390cff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Mar 2021 08:52:55 +0100 Subject: [PATCH 09/61] FIX picto on shipment to reset qty to 0. Some quantities were not reset. --- htdocs/expedition/card.php | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 5beeb013dbf..264089ac48a 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1044,15 +1044,7 @@ if ($action == 'create') $i++; } print '}); - jQuery("#autoreset").click(function() { console.log("Reset values to 0"); '; - $i = 0; - while ($i < $numAsked) - { - print 'jQuery("#qtyl'.$i.'").val(0);'."\n"; - if (!empty($conf->productbatch->enabled)) print 'jQuery("#qtyl'.$i.'_'.$i.'").val(0);'."\n"; - $i++; - } - print '}); + jQuery("#autoreset").click(function() { console.log("Reset values to 0"); jQuery(".qtyl").val(0); }); }); '; @@ -1294,7 +1286,7 @@ if ($action == 'create') $deliverableQty = min($quantityToBeDelivered, $batchStock); print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -1327,7 +1319,7 @@ if ($action == 'create') } else { print ''; print ''; - print ' '; + print ' '; print ''; print ''; @@ -1451,7 +1443,7 @@ if ($action == 'create') $deliverableQty = min($quantityToBeDelivered, $batchStock); if ($deliverableQty < 0) $deliverableQty = 0; print ''; - print ''; + print ''; print ''; print ''; @@ -1496,7 +1488,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"); } @@ -2212,7 +2204,7 @@ if ($action == 'create') { print ''; // Qty to ship or shipped - print ''; + print ''; // Batch number managment if ($lines[$i]->entrepot_id == 0) { @@ -2225,7 +2217,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 ''; @@ -2238,7 +2230,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 @@ -2251,7 +2243,7 @@ if ($action == 'create') { 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 @@ -2266,7 +2258,7 @@ if ($action == 'create') print ''; print ''; // Qty to ship or shipped - print ''; + print ''; // Warehouse source print ''; // Batch number managment From 33c4180781900168edf4928bb771ba6fe7052737 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Mar 2021 09:36:19 +0100 Subject: [PATCH 10/61] FIX Timezone management for datetime with modulebuilder --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- htdocs/core/class/commonobject.class.php | 10 ++++--- htdocs/product/stock/productlot_card.php | 30 +++++++++++++-------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 1c874fd2418..f59c80f8916 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -160,7 +160,7 @@ if ($action == 'update' && !empty($permissiontoadd)) } elseif ($object->fields[$key]['type'] == 'date') { $value = dol_mktime(12, 0, 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year')); } 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'), GETPOST($key.'min'), 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year'), '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/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 73a2ae92b3c..bbc7aa39067 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6531,13 +6531,13 @@ abstract class CommonObject elseif ($key == 'status' && method_exists($this, 'getLibStatut')) $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 = ''; } @@ -7587,11 +7587,13 @@ abstract class CommonObject */ public function setVarsFromFetchObj(&$obj) { + global $db; + foreach ($this->fields as $field => $info) { if ($this->isDate($info)) { - if (empty($obj->{$field}) || $obj->{$field} === '0000-00-00 00:00:00' || $obj->{$field} === '1000-01-01 00:00:00') $this->{$field} = 0; - else $this->{$field} = strtotime($obj->{$field}); + if (is_null($obj->{$field}) || $obj->{$field} === '' || $obj->{$field} === '0000-00-00 00:00:00' || $obj->{$field} === '1000-01-01 00:00:00') $this->{$field} = ''; + else $this->{$field} = $db->jdate($obj->{$field}); } elseif ($this->isArray($info)) { if (!empty($obj->{$field})) { diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 0968e2ea7ce..26c388c6b34 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -103,18 +103,26 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if ($action == 'seteatby' && $user->rights->stock->creer) - { - $newvalue = dol_mktime(12, 0, 0, $_POST['eatbymonth'], $_POST['eatbyday'], $_POST['eatbyyear']); + if ($action == 'seteatby' && $user->rights->stock->creer) { + $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); + if ($result < 0) { + 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']); + if ($action == 'setsellby' && $user->rights->stock->creer) { + $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); + if ($result < 0) { + setEventMessages($object->error, null, 'errors'); + $action == 'editsellby'; + } else { + $action = 'view'; + } } if ($action == 'update_extras') @@ -136,8 +144,9 @@ if (empty($reshook)) } } - if ($error) + if ($error) { $action = 'edit_extras'; + } } // Action to add record @@ -346,7 +355,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } // Other attributes - $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print ''; @@ -391,7 +399,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea * Documents generes */ -if (empty($action)) +if (empty($action) || $action == 'view') { print '
'; print ''; // ancre From 5553bae3a19fd01d10312627c07fff7c3c5f63ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Mar 2021 09:44:01 +0100 Subject: [PATCH 11/61] FIX Timezone management for datetime with modulebuilder --- htdocs/core/actions_addupdatedelete.inc.php | 6 +++--- htdocs/mrp/class/mo.class.php | 2 +- htdocs/mrp/mo_list.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index f59c80f8916..cdca2556729 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -69,9 +69,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'), 0, 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'])) { @@ -158,7 +158,7 @@ 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'), GETPOST($key.'day'), GETPOST($key.'year')); // 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'), 'tzuserrel'); } elseif ($object->fields[$key]['type'] == 'duration') { diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 121909eb28a..0f57f52f91a 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',), diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index beeefbd19ff..0008c273d31 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -73,7 +73,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // 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. +if (!$sortfield) $sortfield = "t.ref"; // Set here default search field. By default 1st field in definition. if (!$sortorder) $sortorder = "ASC"; // Security check From bf775855f63037ddc95534fa126623aa04d3a3b6 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 4 Mar 2021 10:28:41 +0100 Subject: [PATCH 12/61] avoid warning into modulebuilder --- htdocs/core/lib/modulebuilder.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 384fd608597..1205cd8606f 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -51,7 +51,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = } // Check parameters - if (count($addfieldentry) > 0) + if (is_array($addfieldentry) && count($addfieldentry) > 0) { if (empty($addfieldentry['name'])) { From 7bc2e1ffad8e6e5381cfac2375d3360161f26c73 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Mar 2021 10:31:31 +0100 Subject: [PATCH 13/61] FIX Timezone management for datetime with modulebuilder and extrafields --- htdocs/core/actions_addupdatedelete.inc.php | 6 ++-- htdocs/core/class/commonobject.class.php | 28 +++++++++++++--- htdocs/core/class/extrafields.class.php | 37 +++++++++++++-------- htdocs/core/tpl/extrafields_view.tpl.php | 15 +++++++-- 4 files changed, 62 insertions(+), 24 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index cdca2556729..3bc8f0040cc 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -71,7 +71,7 @@ if ($action == 'add' && !empty($permissiontoadd)) } elseif ($object->fields[$key]['type'] == 'date') { $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'), 'tzuserrel'); + $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'])) { @@ -158,9 +158,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')); // for date without hour, we use gmt + $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'), 'tzuserrel'); + $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/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bbc7aa39067..af2c902aacb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5962,17 +5962,26 @@ 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 == '') $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); + } 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'))) { @@ -6911,14 +6920,23 @@ abstract class CommonObject if ($action == 'selectlines') { $colspan++; } // 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'))) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index fa81515b90d..7dfc1196a16 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1015,17 +1015,26 @@ class ExtraFields } } - 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 == '') $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); + } 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('int', 'integer'))) { $tmp = explode(',', $size); @@ -1562,11 +1571,11 @@ class ExtraFields if ($type == 'date') { $showsize = 10; - $value = dol_print_date($value, 'day'); + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output } elseif ($type == 'datetime') { $showsize = 19; - $value = dol_print_date($value, 'dayhour'); + $value = dol_print_date($value, 'dayhour', 'tzuserrel'); } elseif ($type == 'int') { $showsize = 10; @@ -2014,12 +2023,10 @@ class ExtraFields if (in_array($key_type, array('date'))) { // Clean parameters - // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime(0, 0, 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); + $value_key = dol_mktime(12, 0, 0, GETPOST("options_".$key."month", 'int'), GETPOST("options_".$key."day", 'int'), GETPOST("options_".$key."year", 'int')); } elseif (in_array($key_type, array('datetime'))) { // Clean parameters - // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); + $value_key = dol_mktime(GETPOST("options_".$key."hour", 'int'), GETPOST("options_".$key."min", 'int'), GETPOST("options_".$key."sec", 'int'), GETPOST("options_".$key."month", 'int'), GETPOST("options_".$key."day", 'int'), GETPOST("options_".$key."year", 'int'), 'tzuserrel'); } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { $value_arr = GETPOST("options_".$key, 'array'); // check if an array if (!empty($value_arr)) { @@ -2086,13 +2093,15 @@ class ExtraFields $key_type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; } - if (in_array($key_type, array('date', 'datetime'))) - { + if (in_array($key_type, array('date'))) { if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) continue; // Value was not provided, we should not set it. // Clean parameters - $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), 0, GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int')); - } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) - { + $value_key = dol_mktime(12, 0, 0, GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int')); + } elseif (in_array($key_type, array('datetime'))) { + if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) continue; // Value was not provided, we should not set it. + // Clean parameters + $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."sec", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int'), 'tzuserrel'); + } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); // Make sure we get an array even if there's only one checkbox diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 9db0ae13824..40ea3e0ce50 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -168,7 +168,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] print ''; // Convert date into timestamp format - if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date', 'datetime'))) + if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date'))) { $datenotinstring = $object->array_options['options_'.$tmpkeyextra]; // print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x'; @@ -177,7 +177,18 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $datenotinstring = $db->jdate($datenotinstring); } //print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); - $value = GETPOSTISSET("options_".$tmpkeyextra) ? dol_mktime(GETPOST("options_".$tmpkeyextra."hour", 'int'), GETPOST("options_".$tmpkeyextra."min", 'int'), 0, GETPOST("options_".$tmpkeyextra."month", 'int'), GETPOST("options_".$tmpkeyextra."day", 'int'), GETPOST("options_".$tmpkeyextra."year", 'int')) : $datenotinstring; + $value = GETPOSTISSET("options_".$tmpkeyextra) ? dol_mktime(12, 0, 0, GETPOST("options_".$tmpkeyextra."month", 'int'), GETPOST("options_".$tmpkeyextra."day", 'int'), GETPOST("options_".$tmpkeyextra."year", 'int')) : $datenotinstring; + } + if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('datetime'))) + { + $datenotinstring = $object->array_options['options_'.$tmpkeyextra]; + // print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x'; + if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) // For backward compatibility + { + $datenotinstring = $db->jdate($datenotinstring); + } + //print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); + $value = GETPOSTISSET("options_".$tmpkeyextra) ? dol_mktime(GETPOST("options_".$tmpkeyextra."hour", 'int'), GETPOST("options_".$tmpkeyextra."min", 'int'), GETPOST("options_".$tmpkeyextra."sec", 'int'), GETPOST("options_".$tmpkeyextra."month", 'int'), GETPOST("options_".$tmpkeyextra."day", 'int'), GETPOST("options_".$tmpkeyextra."year", 'int'), 'tzuserrel') : $datenotinstring; } //TODO Improve element and rights detection From a04a4806e038619646c1e6a2645f7ce6aed38e80 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 4 Mar 2021 11:50:46 +0100 Subject: [PATCH 14/61] Fix: lost selecteds items in ticket creation --- htdocs/core/class/html.formticket.class.php | 7 ++++--- htdocs/ticket/list.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index d7cf03c41e0..2bd674e1c99 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2015 Jean-François FERRY * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2019 Frédéric France + * Copyright (C) 2021 Juanjo Menent * * 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 @@ -503,7 +504,7 @@ class FormTicket print ' selected="selected"'; } elseif ($selected == $id) { print ' selected="selected"'; - } elseif ($arraytypes['use_default'] == "1" && !$empty) { + } elseif ($arraytypes['use_default'] == "1" && !$selected && !$empty) { print ' selected="selected"'; } @@ -598,7 +599,7 @@ class FormTicket print ' selected="selected"'; } elseif ($selected == $id) { print ' selected="selected"'; - } elseif ($arraycategories['use_default'] == "1" && !$empty) { + } elseif ($arraycategories['use_default'] == "1" && !$selected && !$empty) { print ' selected="selected"'; } @@ -699,7 +700,7 @@ class FormTicket print ' selected="selected"'; } elseif ($selected == $id) { print ' selected="selected"'; - } elseif ($arrayseverities['use_default'] == "1" && !$empty) { + } elseif ($arrayseverities['use_default'] == "1" && !$selected && !$empty) { print ' selected="selected"'; } diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index e9b36a2d364..91cefc88d42 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -362,7 +362,7 @@ foreach ($search as $key => $val) } if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all); if ($search_societe) $sql .= natural_search('s.nom', $search_societe); -if ($search_fk_project) $sql .= natural_search('fk_project', $search_fk_project, 2); +if ($search_fk_project > 0) $sql .= natural_search('fk_project', $search_fk_project, 2); if ($search_date_start) $sql .= " AND t.datec >= '".$db->idate($search_date_start)."'"; if ($search_date_end) $sql .= " AND t.datec <= '".$db->idate($search_date_end)."'"; if ($search_dateread_start) $sql .= " AND t.date_read >= '".$db->idate($search_dateread_start)."'"; From c41b59b14c59f9c33c37359e9b17ed71713f59c2 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 4 Mar 2021 14:23:08 +0100 Subject: [PATCH 15/61] Fix : when we have got models in database attached files are cleared even if we did not have selected a model --- htdocs/core/class/html.formmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index d19269ffd5f..b5f1b34b899 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -332,7 +332,7 @@ class FormMail extends Form $langs->loadLangs(array('other', 'mails')); // Clear temp files. Must be done at beginning, before call of triggers - if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) + if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) { $this->clear_attached_files(); } From 6a242edd8bc480c253d40b0c857eadcf60aa3539 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 4 Mar 2021 15:29:47 +0100 Subject: [PATCH 16/61] check unicity of serial number --- htdocs/langs/en_US/productbatch.lang | 2 + htdocs/langs/fr_FR/productbatch.lang | 2 + .../stock/class/mouvementstock.class.php | 47 ++++++++++++++++++- 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 3ab83908ff5..37c34b9caed 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 + diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index 76cba909e2c..edfd928453c 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 + diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 17fe7193658..d7df01e882f 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,6 +568,13 @@ class MouvementStock extends CommonObject // Update detail stock for batch product if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + // check unicity for serial numbered equipments ( different for lots managed products) + if ( $product->status_batch == 2 && $qty > 0 && $this->getBatchCount($fk_product, $batch) > 0 ) + { + $error++; + $this->errors[] = $langs->trans("SerialNumberAlreadyInUse", $batch, $product->ref); + } + if ($id_product_batch > 0) { $result = $this->createBatch($id_product_batch, $qty); @@ -1208,4 +1215,42 @@ class MouvementStock extends CommonObject return $this->deleteCommon($user, $notrigger); //return $this->deleteCommon($user, $notrigger, 1); } + + /** + * Retrieve number of equipments for a product batch + * + * @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 .= " LEFT 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 = '" . $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; + } } From faf7b1d659a600657c962f2ce4e16c13934d3d7c Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 4 Mar 2021 15:31:51 +0100 Subject: [PATCH 17/61] adapt dispatch for serial numbers --- htdocs/fourn/commande/dispatch.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 0ee9e87db4d..78e3884e9c4 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -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 { From a4dcf603ed24c08c49dbc67e88bd3b5db99ed94f Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 4 Mar 2021 15:33:06 +0100 Subject: [PATCH 18/61] fix repair batch stock for batch=2 --- htdocs/install/repair.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); From ffa0e6c3919a9fc2c9a4fd8b23e8c121944c7203 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Mar 2021 10:31:31 +0100 Subject: [PATCH 19/61] FIX Timezone management for datetime on list of events --- htdocs/admin/tools/listevents.php | 41 ++++++++++++++------- htdocs/core/actions_addupdatedelete.inc.php | 6 +-- htdocs/core/class/commonobject.class.php | 28 +++++++++++--- htdocs/core/class/extrafields.class.php | 37 ++++++++++++------- htdocs/core/lib/date.lib.php | 12 ++++-- htdocs/core/tpl/extrafields_view.tpl.php | 15 +++++++- htdocs/cron/list.php | 6 +-- 7 files changed, 100 insertions(+), 45 deletions(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 57fc2d07011..5e6667c58ad 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -63,16 +63,27 @@ $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")); -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")); -else $date_end = -1; +$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 (!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; +} // checks:if date_start>date_end then date_end=date_start + 24 hours 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 { @@ -94,7 +105,6 @@ $date_endyear = $tmp['year']; $arrayfields = array(); - /* * Actions */ @@ -256,19 +266,22 @@ if ($result) // Fields title search print ''; - print ''.$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0).''; + print ''; + 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 ''; // IP print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -278,14 +291,14 @@ if ($result) if (!empty($arrayfields['e.user_agent']['checked'])) { print ''; - print ''; + print ''; print ''; } if (!empty($arrayfields['e.prefix_session']['checked'])) { print ''; - print ''; + print ''; print ''; } @@ -321,7 +334,7 @@ if ($result) print ''; // Date - print ''.dol_print_date($db->jdate($obj->dateevent), '%Y-%m-%d %H:%M:%S').''; + print ''.dol_print_date($db->jdate($obj->dateevent), '%Y-%m-%d %H:%M:%S', 'tzuserrel').''; // Code print ''.$obj->type.''; diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index cdca2556729..3bc8f0040cc 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -71,7 +71,7 @@ if ($action == 'add' && !empty($permissiontoadd)) } elseif ($object->fields[$key]['type'] == 'date') { $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'), 'tzuserrel'); + $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'])) { @@ -158,9 +158,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')); // for date without hour, we use gmt + $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'), 'tzuserrel'); + $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/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bbc7aa39067..af2c902aacb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5962,17 +5962,26 @@ 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 == '') $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); + } 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'))) { @@ -6911,14 +6920,23 @@ abstract class CommonObject if ($action == 'selectlines') { $colspan++; } // 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'))) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index fa81515b90d..7dfc1196a16 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1015,17 +1015,26 @@ class ExtraFields } } - 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 == '') $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); + } 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('int', 'integer'))) { $tmp = explode(',', $size); @@ -1562,11 +1571,11 @@ class ExtraFields if ($type == 'date') { $showsize = 10; - $value = dol_print_date($value, 'day'); + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output } elseif ($type == 'datetime') { $showsize = 19; - $value = dol_print_date($value, 'dayhour'); + $value = dol_print_date($value, 'dayhour', 'tzuserrel'); } elseif ($type == 'int') { $showsize = 10; @@ -2014,12 +2023,10 @@ class ExtraFields if (in_array($key_type, array('date'))) { // Clean parameters - // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime(0, 0, 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); + $value_key = dol_mktime(12, 0, 0, GETPOST("options_".$key."month", 'int'), GETPOST("options_".$key."day", 'int'), GETPOST("options_".$key."year", 'int')); } elseif (in_array($key_type, array('datetime'))) { // Clean parameters - // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); + $value_key = dol_mktime(GETPOST("options_".$key."hour", 'int'), GETPOST("options_".$key."min", 'int'), GETPOST("options_".$key."sec", 'int'), GETPOST("options_".$key."month", 'int'), GETPOST("options_".$key."day", 'int'), GETPOST("options_".$key."year", 'int'), 'tzuserrel'); } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { $value_arr = GETPOST("options_".$key, 'array'); // check if an array if (!empty($value_arr)) { @@ -2086,13 +2093,15 @@ class ExtraFields $key_type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; } - if (in_array($key_type, array('date', 'datetime'))) - { + if (in_array($key_type, array('date'))) { if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) continue; // Value was not provided, we should not set it. // Clean parameters - $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), 0, GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int')); - } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) - { + $value_key = dol_mktime(12, 0, 0, GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int')); + } elseif (in_array($key_type, array('datetime'))) { + if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) continue; // Value was not provided, we should not set it. + // Clean parameters + $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."sec", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int'), 'tzuserrel'); + } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); // Make sure we get an array even if there's only one checkbox diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 4117249a66c..254a1fdebfa 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -517,24 +517,28 @@ function dol_get_last_day($year, $month = 12, $gm = false) * Return GMT time for last hour of a given GMT date (it removes hours, min and second part) * * @param int $date Date + * @param mixed $gm False or 0 or 'tzserver' = Return date to compare with server TZ, + * True or 1 or 'gmt' to compare with GMT date. * @return int Date for last hour of a given date */ -function dol_get_last_hour($date) +function dol_get_last_hour($date, $gm = 'tzserver') { $tmparray = dol_getdate($date); - return dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year'], false); + return dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year'], $gm); } /** * Return GMT time for first hour of a given GMT date (it removes hours, min and second part) * * @param int $date Date + * @param mixed $gm False or 0 or 'tzserver' = Return date to compare with server TZ, + * True or 1 or 'gmt' to compare with GMT date. * @return int Date for last hour of a given date */ -function dol_get_first_hour($date) +function dol_get_first_hour($date, $gm = 'tzserver') { $tmparray = dol_getdate($date); - return dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year'], false); + return dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year'], $gm); } /** Return first day of week for a date. First day of week may be monday if option MAIN_START_WEEK is 1. diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 9db0ae13824..40ea3e0ce50 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -168,7 +168,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] print ''; // Convert date into timestamp format - if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date', 'datetime'))) + if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date'))) { $datenotinstring = $object->array_options['options_'.$tmpkeyextra]; // print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x'; @@ -177,7 +177,18 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $datenotinstring = $db->jdate($datenotinstring); } //print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); - $value = GETPOSTISSET("options_".$tmpkeyextra) ? dol_mktime(GETPOST("options_".$tmpkeyextra."hour", 'int'), GETPOST("options_".$tmpkeyextra."min", 'int'), 0, GETPOST("options_".$tmpkeyextra."month", 'int'), GETPOST("options_".$tmpkeyextra."day", 'int'), GETPOST("options_".$tmpkeyextra."year", 'int')) : $datenotinstring; + $value = GETPOSTISSET("options_".$tmpkeyextra) ? dol_mktime(12, 0, 0, GETPOST("options_".$tmpkeyextra."month", 'int'), GETPOST("options_".$tmpkeyextra."day", 'int'), GETPOST("options_".$tmpkeyextra."year", 'int')) : $datenotinstring; + } + if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('datetime'))) + { + $datenotinstring = $object->array_options['options_'.$tmpkeyextra]; + // print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x'; + if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) // For backward compatibility + { + $datenotinstring = $db->jdate($datenotinstring); + } + //print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); + $value = GETPOSTISSET("options_".$tmpkeyextra) ? dol_mktime(GETPOST("options_".$tmpkeyextra."hour", 'int'), GETPOST("options_".$tmpkeyextra."min", 'int'), GETPOST("options_".$tmpkeyextra."sec", 'int'), GETPOST("options_".$tmpkeyextra."month", 'int'), GETPOST("options_".$tmpkeyextra."day", 'int'), GETPOST("options_".$tmpkeyextra."year", 'int'), 'tzuserrel') : $datenotinstring; } //TODO Improve element and rights detection diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 587bd1b28d1..fe81b57dbf5 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -493,11 +493,11 @@ if ($num > 0) print ''; print ''; - if (!empty($obj->datestart)) { print dol_print_date($db->jdate($obj->datestart), 'dayhour'); } + if (!empty($obj->datestart)) { print dol_print_date($db->jdate($obj->datestart), 'dayhour', 'tzserver'); } print ''; print ''; - if (!empty($obj->dateend)) { print dol_print_date($db->jdate($obj->dateend), 'dayhour'); } + if (!empty($obj->dateend)) { print dol_print_date($db->jdate($obj->dateend), 'dayhour', 'tzserver'); } print ''; print ''; @@ -507,7 +507,7 @@ if ($num > 0) // Date start last run print ''; - if (!empty($datelastrun)) { print dol_print_date($datelastrun, 'dayhoursec'); } + if (!empty($datelastrun)) { print dol_print_date($datelastrun, 'dayhoursec', 'tzserver'); } print ''; // Duration From 53cf042a574ee5d2758a81f8dbca3319c57fd769 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 4 Mar 2021 15:35:53 +0100 Subject: [PATCH 20/61] adapt tobatch import/export --- htdocs/core/modules/modProduct.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index f972c235802..2bd42d64e11 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -587,7 +587,7 @@ class modProduct extends DolibarrModules )); $this->import_regex_array[$r] = array_merge($this->import_regex_array[$r], array( - 'p.tobatch' => '^[0|1]$' + 'p.tobatch' => '^[0|1|2]$' )); $this->import_convertvalue_array[$r] = array_merge($this->import_convertvalue_array[$r], array( @@ -679,7 +679,7 @@ class modProduct extends DolibarrModules //clauses copied from import_fields_array if (!empty($conf->stock->enabled)) { $import_sample = array_merge($import_sample, array( - 'p.tobatch'=>"0 (don't use) / 1 (use batch/serial number)", + 'p.tobatch'=>"0 (don't use) / 1 (use batch) / 2 (use serial number)", 'p.seuil_stock_alerte' => '', 'p.pmp' => '0', 'p.desiredstock' => '' From 83350cde8fd85ca94b69505f047d8284fd9f4e7a Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 4 Mar 2021 15:40:23 +0100 Subject: [PATCH 21/61] remove hidden constant MAIN_ADVANCE_NUMLOT --- htdocs/product/card.php | 18 +++--------------- htdocs/product/class/product.class.php | 10 +++++----- htdocs/product/list.php | 25 ++++++++----------------- 3 files changed, 16 insertions(+), 37 deletions(-) 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/product.class.php b/htdocs/product/class/product.class.php index 99e571fb8b7..072b113df7e 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4747,10 +4747,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 +4788,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/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']++; From dcff298c5fecd68334ec45bc977769dc7ca5754e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Mar 2021 15:57:03 +0100 Subject: [PATCH 22/61] FIX #16533 --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/ticket.lib.php | 161 ++++++++++++++++-------------- htdocs/langs/en_US/errors.lang | 3 +- 3 files changed, 87 insertions(+), 79 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e5f2c2cf826..052e5e3efc9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4029,7 +4029,7 @@ function img_searchclear($titlealt = 'default', $other = '') * @param string $text Text info * @param integer $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto * @param int $nodiv No div - * @param string $admin '1'=Info for admin users. '0'=Info for standard users (change only the look), 'error','xxx'=Other + * @param string $admin '1'=Info for admin users. '0'=Info for standard users (change only the look), 'error', 'warning', 'xxx'=Other * @param string $morecss More CSS ('', 'warning', 'error') * @param string $textfordropdown Show a text to click to dropdown the info box. * @return string String with info text diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index c90892d603c..1500739b7dd 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -280,12 +280,10 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no // Check parameters if (!is_object($filterobj) && !is_object($objcon)) dol_print_error('', 'BadParameter'); - $out = ''; $histo = array(); $numaction = 0; $now = dol_now(); - // Open DSI -- Fix order by -- Begin $sortfield_list = explode(',', $sortfield); $sortfield_label_list = array('a.id' => 'id', 'a.datep' => 'dp', 'a.percent' => 'percent'); $sortfield_new_list = array(); @@ -294,9 +292,8 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no } $sortfield_new = implode(',', $sortfield_new_list); - if (!empty($conf->agenda->enabled)) - { - // Recherche histo sur actioncomm + if (!empty($conf->agenda->enabled)) { + // Search histo on actioncomm if (is_object($objcon) && $objcon->id > 0) { $sql = "SELECT DISTINCT a.id, a.label as label,"; } else { @@ -443,85 +440,95 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $sql = $sql2; } - //TODO Add limit in nb of results - $sql .= $db->order($sortfield_new, $sortorder); + // TODO Add limit in nb of results + if ($sql) { // May not be defined if module Agenda is not enabled and mailing module disabled too + $sql .= $db->order($sortfield_new, $sortorder); - dol_syslog("company.lib::show_actions_done", LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) { - $i = 0; - $num = $db->num_rows($resql); + dol_syslog("company.lib::show_actions_done", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) { + $i = 0; + $num = $db->num_rows($resql); - while ($i < $num) { - $obj = $db->fetch_object($resql); + while ($i < $num) { + $obj = $db->fetch_object($resql); - if ($obj->type == 'action') { - $contactaction = new ActionComm($db); - $contactaction->id = $obj->id; - $result = $contactaction->fetchResources(); - if ($result < 0) { - dol_print_error($db); - setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors'); + if ($obj->type == 'action') { + $contactaction = new ActionComm($db); + $contactaction->id = $obj->id; + $result = $contactaction->fetchResources(); + if ($result < 0) { + dol_print_error($db); + setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors'); + } + + //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; + //elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; + $tododone = ''; + if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone = 'todo'; + + $histo[$numaction] = array( + 'type'=>$obj->type, + 'tododone'=>$tododone, + 'id'=>$obj->id, + 'datestart'=>$db->jdate($obj->dp), + 'dateend'=>$db->jdate($obj->dp2), + 'note'=>$obj->label, + 'message'=>$obj->message, + 'percent'=>$obj->percent, + + 'userid'=>$obj->user_id, + 'login'=>$obj->user_login, + 'userfirstname'=>$obj->user_firstname, + 'userlastname'=>$obj->user_lastname, + 'userphoto'=>$obj->user_photo, + + 'contact_id'=>$obj->fk_contact, + 'socpeopleassigned' => $contactaction->socpeopleassigned, + 'lastname'=>$obj->lastname, + 'firstname'=>$obj->firstname, + 'fk_element'=>$obj->fk_element, + 'elementtype'=>$obj->elementtype, + // Type of event + 'acode'=>$obj->acode, + 'alabel'=>$obj->alabel, + 'libelle'=>$obj->alabel, // deprecated + 'apicto'=>$obj->apicto + ); + } else { + $histo[$numaction] = array( + 'type'=>$obj->type, + 'tododone'=>'done', + 'id'=>$obj->id, + 'datestart'=>$db->jdate($obj->dp), + 'dateend'=>$db->jdate($obj->dp2), + 'note'=>$obj->label, + 'message'=>$obj->message, + 'percent'=>$obj->percent, + 'acode'=>$obj->acode, + + 'userid'=>$obj->user_id, + 'login'=>$obj->user_login, + 'userfirstname'=>$obj->user_firstname, + 'userlastname'=>$obj->user_lastname, + 'userphoto'=>$obj->user_photo + ); } - //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; - //elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; - $tododone = ''; - if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone = 'todo'; - - $histo[$numaction] = array( - 'type'=>$obj->type, - 'tododone'=>$tododone, - 'id'=>$obj->id, - 'datestart'=>$db->jdate($obj->dp), - 'dateend'=>$db->jdate($obj->dp2), - 'note'=>$obj->label, - 'message'=>$obj->message, - 'percent'=>$obj->percent, - - 'userid'=>$obj->user_id, - 'login'=>$obj->user_login, - 'userfirstname'=>$obj->user_firstname, - 'userlastname'=>$obj->user_lastname, - 'userphoto'=>$obj->user_photo, - - 'contact_id'=>$obj->fk_contact, - 'socpeopleassigned' => $contactaction->socpeopleassigned, - 'lastname'=>$obj->lastname, - 'firstname'=>$obj->firstname, - 'fk_element'=>$obj->fk_element, - 'elementtype'=>$obj->elementtype, - // Type of event - 'acode'=>$obj->acode, - 'alabel'=>$obj->alabel, - 'libelle'=>$obj->alabel, // deprecated - 'apicto'=>$obj->apicto - ); - } else { - $histo[$numaction] = array( - 'type'=>$obj->type, - 'tododone'=>'done', - 'id'=>$obj->id, - 'datestart'=>$db->jdate($obj->dp), - 'dateend'=>$db->jdate($obj->dp2), - 'note'=>$obj->label, - 'message'=>$obj->message, - 'percent'=>$obj->percent, - 'acode'=>$obj->acode, - - 'userid'=>$obj->user_id, - 'login'=>$obj->user_login, - 'userfirstname'=>$obj->user_firstname, - 'userlastname'=>$obj->user_lastname, - 'userphoto'=>$obj->user_photo - ); + $numaction++; + $i++; } - - $numaction++; - $i++; + } else { + dol_print_error($db); } - } else { - dol_print_error($db); + } + + // Set $out to sow events + $out = ''; + + if (empty($conf->agenda->enabled)) { + $langs->loadLangs(array("admin", "errors")); + $out = info_admin($langs->trans("WarningModuleXDisabledSoYouMayMissEventHere", $langs->transnoentitiesnoconv("Module2400Name")), 0, 0, 'warning'); } if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email))) { diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index a7a7e12db14..e3d9209f204 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -287,4 +287,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 From 1d2372b9ef9c91b0b2faf75ca9ca4c42014069a8 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 4 Mar 2021 17:47:43 +0100 Subject: [PATCH 23/61] fix for travis and sticker --- htdocs/product/stock/class/mouvementstock.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index d7df01e882f..6e0d3983f06 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1219,7 +1219,9 @@ class MouvementStock extends CommonObject /** * Retrieve number of equipments for a product batch * - * @return int <0 if KO, number of equipments if OK + * @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) { @@ -1231,7 +1233,7 @@ class MouvementStock extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; $sql .= " LEFT 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 = '" . $batch . "'"; + $sql .= " AND pb.batch = '" . $this->db->escape($batch) . "'"; $result = $this->db->query($sql); if ($result) { @@ -1241,12 +1243,11 @@ class MouvementStock extends CommonObject $cpt = $obj->cpt; - } + } $this->db->free($result); } - else - { + else { dol_print_error($this->db); return -1; } From c4ad4a33e4e951812b3ec91e499c352ebb27b915 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 4 Mar 2021 17:49:28 +0100 Subject: [PATCH 24/61] fix for sticker --- .../stock/class/mouvementstock.class.php | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 6e0d3983f06..0bdeee6522d 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1229,29 +1229,29 @@ class MouvementStock extends CommonObject $cpt = 0; - $sql = "SELECT sum(pb.qty) as cpt"; - $sql .= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; - $sql .= " LEFT 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) . "'"; + $sql = "SELECT sum(pb.qty) as cpt"; + $sql .= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; + $sql .= " LEFT 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)) { + $result = $this->db->query($sql); + if ($result) { + if ($this->db->num_rows($result)) { - $obj = $this->db->fetch_object($result); + $obj = $this->db->fetch_object($result); - $cpt = $obj->cpt; + $cpt = $obj->cpt; - } + } - $this->db->free($result); - } - else { - dol_print_error($this->db); - return -1; - } + $this->db->free($result); + } + else { + dol_print_error($this->db); + return -1; + } - return $cpt; + return $cpt; } } From 64036706ed8117c9bce51e60fbf20c201c4e864e Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 4 Mar 2021 17:52:05 +0100 Subject: [PATCH 25/61] fix for sticker --- htdocs/product/stock/class/mouvementstock.class.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 0bdeee6522d..02e3988a477 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1238,16 +1238,12 @@ class MouvementStock extends CommonObject $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 { + } else { dol_print_error($this->db); return -1; } From 2c8808b2ccc00c369a1c7ae5d9876bafaad024a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 4 Mar 2021 20:11:30 +0100 Subject: [PATCH 26/61] Update pre-commit --- dev/examples/git/pre-commit | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/examples/git/pre-commit b/dev/examples/git/pre-commit index 790632dda9e..72b0ca61704 100644 --- a/dev/examples/git/pre-commit +++ b/dev/examples/git/pre-commit @@ -1,5 +1,7 @@ #!/bin/sh -# To install this precommit file: TODO +# 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 +# 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'))));"` From b53d598567b9cd2da8b3e77b4f999b1a3dfa3008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 4 Mar 2021 20:15:37 +0100 Subject: [PATCH 27/61] Update pre-commit --- dev/examples/git/pre-commit | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/examples/git/pre-commit b/dev/examples/git/pre-commit index 72b0ca61704..273fa9f620b 100644 --- a/dev/examples/git/pre-commit +++ b/dev/examples/git/pre-commit @@ -1,6 +1,8 @@ #!/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 From 863ba52b15a90d034382cb8d909adad782c3b062 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Mar 2021 07:59:55 +0100 Subject: [PATCH 28/61] add inner join and test error --- .../stock/class/mouvementstock.class.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 02e3988a477..29eb5a1269f 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -575,14 +575,17 @@ class MouvementStock extends CommonObject $this->errors[] = $langs->trans("SerialNumberAlreadyInUse", $batch, $product->ref); } - if ($id_product_batch > 0) + if ( ! $error ) { - $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 ($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 @@ -1231,7 +1234,7 @@ class MouvementStock extends CommonObject $sql = "SELECT sum(pb.qty) as cpt"; $sql .= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON ps.rowid = pb.fk_product_stock"; + $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) . "'"; From acea36acf2900eda0f87ea1c287916d960fd0093 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Mar 2021 08:39:30 +0100 Subject: [PATCH 29/61] better check for unicity --- htdocs/langs/en_US/productbatch.lang | 2 +- htdocs/langs/fr_FR/productbatch.lang | 2 +- .../product/stock/class/mouvementstock.class.php | 14 +++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 37c34b9caed..36adfd571fb 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -25,4 +25,4 @@ 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/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index edfd928453c..94ceb434bfd 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -25,4 +25,4 @@ 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/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 29eb5a1269f..b7000ebb557 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -569,10 +569,18 @@ class MouvementStock extends CommonObject if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { // check unicity for serial numbered equipments ( different for lots managed products) - if ( $product->status_batch == 2 && $qty > 0 && $this->getBatchCount($fk_product, $batch) > 0 ) + if ( $product->status_batch == 2 && $qty > 0 ) { - $error++; - $this->errors[] = $langs->trans("SerialNumberAlreadyInUse", $batch, $product->ref); + 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 ) From acb87418492dc3884e898a96c943034b10b99909 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Mar 2021 08:40:26 +0100 Subject: [PATCH 30/61] fix typo --- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index b7000ebb557..59bc60f342b 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -576,7 +576,7 @@ class MouvementStock extends CommonObject $error++; $this->errors[] = $langs->trans("SerialNumberAlreadyInUse", $batch, $product->ref); } - elseif { $qty > 1 } + elseif ( $qty > 1 ) { $error++; $this->errors[] = $langs->trans("TooManyQtyForSerialNumber", $product->ref, $batch); From d13ed6bdfbc17d4f3266f6eff08f1cf50ce36dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 5 Mar 2021 08:44:29 +0100 Subject: [PATCH 31/61] Update consumption.php --- htdocs/societe/consumption.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) { From c00d64855a116efac98af9a35c64100c19c4185b Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 5 Mar 2021 09:47:38 +0100 Subject: [PATCH 32/61] Fix #16524 : Add support disassemble BOM --- htdocs/bom/class/bom.class.php | 4 ++-- htdocs/mrp/class/mo.class.php | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) 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/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 3bad9a8a854..d4383de7930 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -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; From ebf92ba4406efc3a49d2d6a855a990f18ac63045 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 5 Mar 2021 08:50:49 +0000 Subject: [PATCH 33/61] Fixing style errors. --- htdocs/mrp/class/mo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index d4383de7930..0b8a68df766 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -641,7 +641,7 @@ class Mo extends CommonObject if ($bom->bomtype == 1) { $role = 'toproduce'; $moline->role = 'toconsume'; - }else { + } else { $role = 'toconsume'; $moline->role = 'toproduce'; } From dd833633925ee261639f8cacf8bf8d1d51c07266 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 5 Mar 2021 10:12:18 +0100 Subject: [PATCH 34/61] FIX : several bugs on salaries + id salary in payments list --- htdocs/salaries/payments.php | 37 +++++++++++++++++++++++++++--------- htdocs/user/bank.php | 4 ++-- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index f87209eee52..5c0b0c73956 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.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 @@ -24,6 +25,7 @@ */ 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'; @@ -68,6 +70,7 @@ 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')); @@ -131,6 +134,7 @@ if (empty($reshook)) { // 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 = ''; @@ -163,7 +167,8 @@ if (empty($reshook)) { */ $form = new Form($db); -$salstatic = new PaymentSalary($db); +$salstatic = new Salary($db); +$paymentsalstatic = new PaymentSalary($db); $userstatic = new User($db); $accountstatic = new Account($db); @@ -174,22 +179,24 @@ $help_url = ''; $title = $langs->trans('SalariesPayments'); $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,"; -$sql .= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,"; +$sql .= " 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 = s.fk_user"; +$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('s.label'), $search_label); +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); @@ -241,6 +248,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($l 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); @@ -292,6 +300,10 @@ print ''; print ''; print ''; print ''; +// Salary +print ''; +print ''; +print ''; // Label print ''; // Date payment @@ -339,10 +351,11 @@ 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("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"], "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("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 @@ -388,17 +401,23 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $userstatic->socid = $obj->fk_soc; $userstatic->statut = $obj->status; - $salstatic->id = $obj->rowid; - $salstatic->ref = $obj->rowid; + $salstatic->id = $obj->id_salary; + $salstatic->ref = $obj->id_salary; + + $paymentsalstatic->id = $obj->rowid; + $paymentsalstatic->ref = $obj->rowid; // Ref - print "".$salstatic->getNomUrl(1)."\n"; + print "".$paymentsalstatic->getNomUrl(1)."\n"; if (!$i) $totalarray['nbfield']++; // Employee print "".$userstatic->getNomUrl(1)."\n"; if (!$i) $totalarray['nbfield']++; + print "".$salstatic->getNomUrl(1)."\n"; + if (!$i) $totalarray['nbfield']++; + // Label payment print "".dol_trunc($obj->label, 40)."\n"; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 39d5266ec57..df5757992f0 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -356,7 +356,7 @@ 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, s.datesp, s.dateep, ps.amount"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as ps"; @@ -372,7 +372,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print ''; print ''; - print ''; // Date - print ""; + print ""; // Price level if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { @@ -1855,6 +1859,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; print ''; + print '
'; print '
'; + print ''; print ''; From 4f1ec058bfb272bc6fa88324a43d3465b1c5ac2c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 5 Mar 2021 11:03:22 +0100 Subject: [PATCH 35/61] Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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.** From f731545af4adb33b28a0703517654013ce9d194d Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 5 Mar 2021 11:14:21 +0100 Subject: [PATCH 36/61] NEW: ldap: filter search on usergroups --- htdocs/admin/ldap_groups.php | 80 +++++++++++++++++++++- htdocs/core/class/ldap.class.php | 5 +- htdocs/core/modules/modLdap.class.php | 1 + htdocs/langs/en_US/admin.lang | 1 + scripts/user/sync_groups_ldap2dolibarr.php | 8 ++- 5 files changed, 90 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 0cd05a53a74..4b7acd2598c 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 ''; print ''; print ''; +// Filter, used to filter search +print ''; +print ''; +print ''; + print '
'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.''; print '
'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.'
'.$langs->trans("LDAPGroupObjectClassListExample").' 
'.$langs->trans("LDAPFilterConnection").''; +print ''; +print ''.$langs->trans("LDAPGroupFilterExample").'
'; print '
'; print ''; @@ -212,10 +221,17 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $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,66 @@ if (function_exists("ldap_connect")) { print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } + + if ($action == 'testsearchgroup') { + // Creation objet + $object = new UserGroup($db); + $object->initAsSpecimen(); + + // 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_USERS, $required_fields, 'group'); + //$ldapgroups = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_USERS, '', 'group'); + + if (is_array($ldapgroups)) { + $liste = array(); + foreach ($ldapgroups as $key => $ldapgroup) { + // Define the label string for this user + $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 user:
\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/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 9963a178d1b..296bfcad852 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -139,6 +139,7 @@ class Ldap $this->groups = $conf->global->LDAP_GROUP_DN; $this->filter = $conf->global->LDAP_FILTER_CONNECTION; // Filter on user + $this->filtergroup = $conf->global->LDAP_GROUP_FILTER; // Filter on groups $this->filtermember = $conf->global->LDAP_MEMBER_FILTER; // Filter on member // Users @@ -935,7 +936,7 @@ class Ldap * @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org) * @param string $useridentifier Name of key field (Ex: uid) * @param array $attributeArray Array of fields required. Note this array must also contains field $useridentifier (Ex: sn,userPassword) - * @param int $activefilter '1' or 'user'=use field this->filter as filter instead of parameter $search, 'member'=use field this->filtermember as filter + * @param int $activefilter '1' or 'user'=use field this->filter as filter instead of parameter $search, 'group'=user field this->filtergroup as filter, 'member'=use field this->filtermember as filter * @param array $attributeAsArray Array of fields wanted as an array not a string * @return array Array of [id_record][ldap_field]=value */ @@ -955,6 +956,8 @@ class Ldap if (!empty($activefilter)) { if (((string) $activefilter == '1' || (string) $activefilter == 'user') && $this->filter) { $filter = '('.$this->filter.')'; + } elseif (((string) $activefilter == 'group') && $this->filtergroup ) { + $filter = '('.$this->filtergroup.')'; } elseif (((string) $activefilter == 'member') && $this->filter) { $filter = '('.$this->filtermember.')'; } else { diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php index 5f4860d0149..8e3463ff4d4 100644 --- a/htdocs/core/modules/modLdap.class.php +++ b/htdocs/core/modules/modLdap.class.php @@ -85,6 +85,7 @@ class modLdap extends DolibarrModules 11=>array('LDAP_FIELD_PHONE', 'chaine', 'telephonenumber', '', 0), 12=>array('LDAP_FIELD_FAX', 'chaine', 'facsimiletelephonenumber', '', 0), 13=>array('LDAP_FIELD_MOBILE', 'chaine', 'mobile', '', 0), + 14=>array('LDAP_GROUP_FILTER', 'chaine', '&(objectClass=groupOfNames)', '', 0), ); // Boxes diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6b481e1357b..a94eaa75dcf 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1512,6 +1512,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 diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index af0b117bb5e..f9725067762 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(); From 25b1469b54bcd6319468e91532d088f78c44f8b9 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 5 Mar 2021 11:18:51 +0100 Subject: [PATCH 37/61] FIX: ldap group search test: bad key used + edit label/comments + remove useless code --- htdocs/admin/ldap_groups.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 4b7acd2598c..d8d12a7e2d3 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -278,10 +278,6 @@ if (function_exists("ldap_connect")) { } if ($action == 'testsearchgroup') { - // Creation objet - $object = new UserGroup($db); - $object->initAsSpecimen(); - // TODO Mutualize code following with other ldap_xxxx.php pages // Test synchro @@ -301,13 +297,13 @@ if (function_exists("ldap_connect")) { $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_USERS, $required_fields, 'group'); - //$ldapgroups = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_USERS, '', 'group'); + $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 user + // Define the label string for this group $label = ''; foreach ($required_fields as $value) { if ($value) { @@ -321,7 +317,7 @@ if (function_exists("ldap_connect")) { } print "
\n"; - print "LDAP search for user:
\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"; From 396fb3fae3eff794b4c7c894a26f0f8899463264 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 5 Mar 2021 11:21:04 +0100 Subject: [PATCH 38/61] FIX: ldap: bad function comment --- htdocs/core/class/ldap.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 296bfcad852..8757666d0b6 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -936,7 +936,7 @@ class Ldap * @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org) * @param string $useridentifier Name of key field (Ex: uid) * @param array $attributeArray Array of fields required. Note this array must also contains field $useridentifier (Ex: sn,userPassword) - * @param int $activefilter '1' or 'user'=use field this->filter as filter instead of parameter $search, 'group'=user field this->filtergroup as filter, 'member'=use field this->filtermember as filter + * @param int $activefilter '1' or 'user'=use field this->filter as filter instead of parameter $search, 'group'=use field this->filtergroup as filter, 'member'=use field this->filtermember as filter * @param array $attributeAsArray Array of fields wanted as an array not a string * @return array Array of [id_record][ldap_field]=value */ From 06cabb35ecb0e570ea0987a1e0b48048ee4d5577 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 5 Mar 2021 10:24:28 +0000 Subject: [PATCH 39/61] Fixing style errors. --- htdocs/admin/ldap_groups.php | 108 ++++++++++----------- htdocs/core/class/ldap.class.php | 2 +- scripts/user/sync_groups_ldap2dolibarr.php | 4 +- 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index d8d12a7e2d3..13532474681 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -58,7 +58,7 @@ if ($action == 'setvalue' && $user->admin) { $error++; } if (!dolibarr_set_const($db, 'LDAP_GROUP_FILTER', GETPOST("filter"), 'chaine', 0, '', $conf->entity)) { - $error++; + $error++; } if (!dolibarr_set_const($db, 'LDAP_GROUP_FIELD_FULLNAME', GETPOST("fieldfullname", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) { $error++; @@ -222,12 +222,12 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { 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); + $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")) { @@ -278,59 +278,59 @@ if (function_exists("ldap_connect")) { } if ($action == 'testsearchgroup') { - // TODO Mutualize code following with other ldap_xxxx.php pages + // TODO Mutualize code following with other ldap_xxxx.php pages - // Test synchro - $ldap = new Ldap(); - $result = $ldap->connect_bind(); + // 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 - ); + 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"))); + // 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'); + // 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'); - } + 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).'
'; - } + 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).'
'; + } } } diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 8757666d0b6..0f97ed878cf 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -957,7 +957,7 @@ class Ldap if (((string) $activefilter == '1' || (string) $activefilter == 'user') && $this->filter) { $filter = '('.$this->filter.')'; } elseif (((string) $activefilter == 'group') && $this->filtergroup ) { - $filter = '('.$this->filtergroup.')'; + $filter = '('.$this->filtergroup.')'; } elseif (((string) $activefilter == 'member') && $this->filter) { $filter = '('.$this->filtermember.')'; } else { diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index f9725067762..67c14a4ee5d 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -98,9 +98,9 @@ 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"; if (!empty($conf->global->LDAP_GROUP_FILTER)) { - print 'Filter=('.$conf->global->LDAP_GROUP_FILTER.')'."\n"; // Note: filter is defined into function getRecords + 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 'Filter=('.$conf->global->LDAP_KEY_GROUPS.'=*)'."\n"; } print "----- To Dolibarr database:\n"; print "type=".$conf->db->type."\n"; From 18fc169cd073b4441c7e8ba27e50ed443601fba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Fri, 5 Mar 2021 11:32:03 +0100 Subject: [PATCH 40/61] Don't discard previously collected data For keeping all previously collected data (i.e. company_... values), one has to merge the array but not to assign a new one. --- .../modules/expedition/doc/doc_generic_shipment_odt.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 82d61a41943..797530a6c13 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -449,7 +449,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition } // Replace tags of object + external modules - $tmparray = $this->get_substitutionarray_shipment($object, $outputlangs); + $tmparray = array_merge($tmparray, $this->get_substitutionarray_shipment($object, $outputlangs)); complete_substitutions_array($tmparray, $outputlangs, $object); // Call the ODTSubstitution hook From 83fa8812f924988a66445820a1685bfd4aad8884 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 5 Mar 2021 11:41:17 +0100 Subject: [PATCH 41/61] NEW : sql migration from llx_tva to llx_payment_vat --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 811c07c98ed..748b0c19ff2 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 @@ -167,7 +167,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, '', 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'; From 7a193b4c87d4eb6120f63f93c0d48a769f56c2a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Mar 2021 14:53:13 +0100 Subject: [PATCH 42/61] Add index on tag. Reduce tag length --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_mailing_cibles.key.sql | 2 ++ htdocs/install/mysql/tables/llx_mailing_cibles.sql | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) 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 811c07c98ed..9e65e1d82ff 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; 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, From 1cd822bd75293df431a7aac5aeab2ceef99415cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Mar 2021 14:54:17 +0100 Subject: [PATCH 43/61] Fix DOS attack on emailings wrappers --- .../modules/mailings/modules_mailings.php | 3 +- htdocs/public/emailing/mailing-read.php | 55 +++++++++++++++---- .../public/emailing/mailing-unsubscribe.php | 25 +++++++-- 3 files changed, 67 insertions(+), 16 deletions(-) diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 5b1530bf02c..8e8c9fe4e4f 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -158,6 +158,7 @@ class MailingTargets // This can't be abstract as it is used for some method public function addTargetsToDatabase($mailing_id, $cibles) { global $conf; + global $dolibarr_main_instance_unique_id; $this->db->begin(); @@ -182,7 +183,7 @@ class MailingTargets // This can't be abstract as it is used for some method $sql .= "'".$this->db->escape($targetarray['other'])."',"; $sql .= "'".$this->db->escape($targetarray['source_url'])."',"; $sql .= (empty($targetarray['source_id']) ? 'null' : "'".$this->db->escape($targetarray['source_id'])."'").","; - $sql .= "'".$this->db->escape(dol_hash($targetarray['email'].';'.$targetarray['lastname'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',"; + $sql .= "'".$this->db->escape(dol_hash($dolibarr_main_instance_unique_id.';'.$targetarray['email'].';'.$targetarray['lastname'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY), 'md5')."',"; $sql .= "'".$this->db->escape($targetarray['source_type'])."')"; dol_syslog(__METHOD__, LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index ccbf8f5c1d3..a2b8fcb574a 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -53,6 +53,8 @@ function llxFooter() require '../../main.inc.php'; +$mtid = GETPOST('mtid'); +$email = GETPOST('email'); $tag = GETPOST('tag'); $securitykey = GETPOST('securitykey'); @@ -71,23 +73,54 @@ 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) { + print 'Email target already set to read. 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 id = ".$obj->rowid; $resql = $db->query($sql); //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 0d62545cf57..5e15769a753 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -58,6 +58,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'); @@ -80,7 +82,7 @@ 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)."'"; @@ -89,11 +91,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'; From 3cfcad284b75604369c3e6cc744ff3d0cb2372ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Mar 2021 17:48:55 +0100 Subject: [PATCH 44/61] Fix unsubscribe to MLs --- htdocs/comm/mailing/card.php | 4 ++-- htdocs/public/emailing/mailing-read.php | 8 +++++--- htdocs/public/emailing/mailing-unsubscribe.php | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index d5187bb2ab8..5148956163e 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -211,8 +211,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)) $onlinepaymentenabled++; diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index a2b8fcb574a..5e05387f664 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -32,6 +32,7 @@ if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not check anti POST attack test if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu 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 @@ -92,8 +93,8 @@ if (!empty($tag)) print 'Email target not valid. Operation canceled.'; exit; } - if ($obj->statut == 2) { - print 'Email target already set to read. Operation canceled.'; + 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 @@ -107,8 +108,9 @@ if (!empty($tag)) //Update status of target $statut = '2'; - $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".$statut." WHERE id = ".$obj->rowid; + $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 if ($obj->source_id > 0 && $obj->source_type == 'thirdparty' && $obj->entity) { diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index 5e15769a753..0e07359c484 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -32,6 +32,7 @@ if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu 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 @@ -134,7 +135,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 From fd17f80bb6defcbd59baba37b9c1517270a2ba73 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 5 Mar 2021 13:34:51 -0800 Subject: [PATCH 45/61] Update llx_accounting_abc.sql Hi, i propose add the 'Catalogo y codigo agrupador fiscal del 2019' it's a list taken from the oficial accounts for the electronic accounting in Mexico indicated by government since 2019 And here is the 'oficial' publication: https://dof.gob.mx/nota_detalle.php?codigo=5559612&fecha=07/05/2019 --- htdocs/install/mysql/data/llx_accounting_abc.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index b5e94449988..8c0442ec9ce 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 - Spanish', 1); From 7e5330496b5cec1b3a4afb2c224294457070d4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 5 Mar 2021 22:50:28 +0100 Subject: [PATCH 46/61] fis tyo --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 4571cbd679c..5f95c7f0dc5 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -711,7 +711,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') { From ba6d2c3444951034f9b14354b9261f699eaf766a Mon Sep 17 00:00:00 2001 From: David Date: Fri, 5 Mar 2021 14:14:18 -0800 Subject: [PATCH 47/61] Create llx_accounting_account_mx.sql Hi, i propose add the 'Catalogo y codigo agrupador fiscal del 2019' it's a list taken from the oficial accounts for the electronic accounting in Mexico indicated by government since 2019 And here is the 'oficial' publication: https://dof.gob.mx/nota_detalle.php?codigo=5559612&fecha=07/05/2019 --- .../mysql/data/llx_accounting_account_mx.sql | 1085 +++++++++++++++++ 1 file changed, 1085 insertions(+) create mode 100644 htdocs/install/mysql/data/llx_accounting_account_mx.sql 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 ); From 5d1b231f0aa7675bf5f2b7c05b1f9dbb665b94d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Mar 2021 09:35:18 +0100 Subject: [PATCH 48/61] doxygen --- htdocs/resource/class/dolresource.class.php | 3 +++ 1 file changed, 3 insertions(+) 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; /** From 7959bc99d71014c539e888920039cffeeb838141 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Mar 2021 10:39:51 +0100 Subject: [PATCH 49/61] Fix phpcs --- htdocs/compta/facture/class/facture-rec.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 1b9a579d1ab..1b8cc0bc1be 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -524,7 +524,6 @@ 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; From 56cbf04e77e92d9579df4fdb45b2a6bca2c17758 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Mar 2021 10:43:01 +0100 Subject: [PATCH 50/61] Update llx_accounting_abc.sql --- htdocs/install/mysql/data/llx_accounting_abc.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index 8c0442ec9ce..3c178f7c70d 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -180,4 +180,4 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE 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 - Spanish', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1); From 3ac9829a147e80b9c9e9ae44054d0c4b4286d8f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Mar 2021 10:50:27 +0100 Subject: [PATCH 51/61] Update 13.0.0-14.0.0.sql --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 748b0c19ff2..27025a45ccb 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 @@ -167,7 +167,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 (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, '', fk_bank, fk_user_creat, fk_user_modif FROM llx_tva WHERE fk_bank IS NOT NULL; +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'; From 0a0bb92689bed8c9d4ea13729ab5b5810eddbb83 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Mar 2021 11:37:23 +0100 Subject: [PATCH 52/61] Fix phpcs --- htdocs/core/class/commonobject.class.php | 6 +- htdocs/core/tpl/extrafields_view.tpl.php | 3 +- test/phpunit/FactureRecTest.php | 106 +++++++++++------------ 3 files changed, 56 insertions(+), 59 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f4bad5e5167..f80fcbce957 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7426,11 +7426,9 @@ abstract class CommonObject } $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'))) - { + 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 - { + 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; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 38fc565ac0e..e43548afc3f 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -213,8 +213,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('datetime'))) { $datenotinstring = $object->array_options['options_'.$tmpkeyextra]; // print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x'; - if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) // For backward compatibility - { + if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) { // For backward compatibility $datenotinstring = $db->jdate($datenotinstring); } //print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index a6e91695782..1fb62ecfd0e 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -126,14 +126,14 @@ class FactureRecTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } - /** - * testFactureRecCreate - * - * @return int - */ - public function testFactureRecCreate() - { - global $conf,$user,$langs,$db; + /** + * testFactureRecCreate + * + * @return int + */ + public function testFactureRecCreate() + { + global $conf,$user,$langs,$db; $conf=$this->savconf; $user=$this->savuser; @@ -147,61 +147,61 @@ class FactureRecTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $localobject=new FactureRec($this->savdb); - $localobject->initAsSpecimen(); - $result = $localobject->create($user, $localobjectinv->id); + $localobject->initAsSpecimen(); + $result = $localobject->create($user, $localobjectinv->id); - print __METHOD__." result=".$result."\n"; - $this->assertGreaterThan(0, $result, 'Create recurring invoice from common invoice'); + print __METHOD__." result=".$result."\n"; + $this->assertGreaterThan(0, $result, 'Create recurring invoice from common invoice'); - return $result; - } + return $result; + } - /** - * testFactureRecFetch - * - * @param int $id Id of created recuriing invoice - * @return int - * + /** + * 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; + * 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); + $localobject=new FactureRec($this->savdb); + $result = $localobject->fetch($id); - print __METHOD__." result=".$result."\n"; - $this->assertGreaterThan(0, $result); - return $result; - } + print __METHOD__." result=".$result."\n"; + $this->assertGreaterThan(0, $result); + return $result; + } - /** - * Edit an object to test updates - * - * @param FactureRec $localobject Object Facture rec - * @return void - */ - public function changeProperties(&$localobject) - { - $localobject->note_private='New note'; - //$localobject->note='New note after update'; - } + /** + * Edit an object to test updates + * + * @param FactureRec $localobject Object Facture rec + * @return void + */ + public function changeProperties(&$localobject) + { + $localobject->note_private='New note'; + //$localobject->note='New note after update'; + } - /** - * Compare all public properties values of 2 objects - * - * @param Object $oA Object operand 1 - * @param Object $oB Object operand 2 - * @param boolean $ignoretype False will not report diff if type of value differs - * @param array $fieldstoignorearray Array of fields to ignore in diff + /** + * Compare all public properties values of 2 objects + * + * @param Object $oA Object operand 1 + * @param Object $oB Object operand 2 + * @param boolean $ignoretype False will not report diff if type of value differs + * @param array $fieldstoignorearray Array of fields to ignore in diff * @return array Array with differences */ public function objCompare($oA, $oB, $ignoretype = true, $fieldstoignorearray = array('id')) From 63aa2f4ec2fc1c6533ca75550758ed5a1dd0a74b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Mar 2021 12:50:38 +0100 Subject: [PATCH 53/61] Fix phpunit --- htdocs/compta/facture/class/facture-rec.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 1b8cc0bc1be..80b49ec7c8c 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -109,6 +109,9 @@ class FactureRec extends CommonInvoice public $suspended; // status + public $auto_validate; + + /** * '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)" @@ -525,8 +528,6 @@ class FactureRec extends CommonInvoice $this->title = $obj->title; $this->ref = $obj->title; $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; @@ -536,7 +537,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; From 4666c7f09022b461eb66d99ba15838c1065bbe46 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Mar 2021 18:41:07 +0100 Subject: [PATCH 54/61] Fix responsive --- htdocs/product/price.php | 36 +++++++++++++++----------------- htdocs/theme/eldy/global.inc.php | 9 +++++++- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 5036a7d0bb8..7538e2875be 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1192,6 +1192,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) print dol_get_fiche_head(''); + print '
'; print '
'; // VAT @@ -1279,6 +1280,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(); @@ -1326,6 +1328,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) print $langs->trans('UseMultipriceRules').' price_autogen ? 'checked' : '').'>

'; } + print '
'; print ''; print ''; @@ -1399,6 +1402,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) print ''; print '
'; + print '
'; //print dol_get_fiche_end(); @@ -1496,7 +1500,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul print '
".dol_print_date($db->jdate($objp->dp), "dayhour")."".dol_print_date($db->jdate($objp->dp), "dayhour", 'tzuserrel')."
'; print ''; @@ -1906,7 +1911,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; print ""; - print ""; + print ""; print '"; print ''; } print "
".$staticsoc->getNomUrl(1)."".dol_print_date($line->datec, "dayhour")."".dol_print_date($line->datec, "dayhour", 'tzuserrel')."'.$langs->trans($line->price_base_type)."'; @@ -1943,6 +1948,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '
"; + print '
'; } else { print $langs->trans('None'); } @@ -1970,6 +1976,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; print ''; + print '
'; print ''; if (count($prodcustprice->lines) > 0 || $search_soc) @@ -2005,7 +2012,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; print ''; print ''; - print ''; + print ''; print ''; // Line for default price @@ -2062,15 +2069,14 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; if ($user->rights->produit->supprimer || $user->rights->service->supprimer) { - print ''; } print "\n"; @@ -2107,8 +2113,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; print ""; - print ""; - + print ""; print '"; print '"; print '"; - if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") - { + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") { //print '"; print ''; } else { @@ -2162,16 +2167,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 '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)."".dol_print_date($line->datec, "dayhour")."".dol_print_date($line->datec, "dayhour", 'tzuserrel')."'.$langs->trans($line->price_base_type)."'; @@ -2117,13 +2122,13 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) if (price2num($line->localtax1_type)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax1_tx); if (price2num($line->localtax2_type)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax2_tx); 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 "'.price($line->price)."' . price($line->price_ttc) . "'.price($resultarray[2]).'
'.$langs->trans('None').'
"; + print '
'; print ""; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index bc6bf8327e9..d6bf65947dd 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1581,7 +1581,7 @@ td.showDragHandle { float: left; } .classforhorizontalscrolloftabs #id-right { - width:calc(100% - 210px); + width: calc(100% - 210px); display: inline-block; } @@ -1685,10 +1685,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; } From 142f87863357fc409e3926b2e60de08c310e5eb8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Mar 2021 18:56:16 +0100 Subject: [PATCH 55/61] Fix look and feel v13 --- htdocs/product/price.php | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 7538e2875be..b783ad5c002 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1649,8 +1649,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) $filter['soc.nom'] = $search_soc; } - if ($action == 'add_customer_price') - { + if ($action == 'add_customer_price') { // Form to add a new customer price $maxpricesupplier = $object->min_recommended_price(); @@ -1661,13 +1660,11 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; print ''; - print dol_get_fiche_head(); - print ''; print ''; print ''; print ''; print ''; @@ -1714,14 +1711,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 ''; @@ -1747,23 +1743,21 @@ 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 ''; // 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 ''; @@ -1772,7 +1766,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 ''; @@ -1800,21 +1794,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 ''; From 91245e22d4c503a40d01a38356e5580a86defe01 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Mar 2021 19:16:09 +0100 Subject: [PATCH 56/61] Fix phpunit phpv8 --- htdocs/compta/facture/class/facture-rec.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 80b49ec7c8c..72096aff0a8 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -79,13 +79,14 @@ 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; @@ -107,6 +108,7 @@ class FactureRec extends CommonInvoice public $usenewprice = 0; + public $date_lim_reglement; public $suspended; // status public $auto_validate; @@ -528,7 +530,6 @@ class FactureRec extends CommonInvoice $this->title = $obj->title; $this->ref = $obj->title; $this->suspended = $obj->suspended; - $this->date = $obj->df; $this->remise_percent = $obj->remise_percent; $this->remise_absolue = $obj->remise_absolue; $this->remise = $obj->remise; @@ -537,8 +538,6 @@ class FactureRec extends CommonInvoice $this->total_localtax1 = $obj->localtax1; $this->total_localtax2 = $obj->localtax2; $this->total_ttc = $obj->total_ttc; - $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; From 0f7085154b71610f3e2e00662a5ecaa638ffe940 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Mar 2021 19:47:55 +0100 Subject: [PATCH 57/61] Fix phpunit --- htdocs/compta/facture/class/facture-rec.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 72096aff0a8..45b81b844ec 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -93,6 +93,8 @@ class FactureRec extends CommonInvoice public $nb_gen_done; public $nb_gen_max; + public $user_author; + /** * @var int Frequency */ @@ -111,7 +113,8 @@ class FactureRec extends CommonInvoice public $date_lim_reglement; public $suspended; // status - public $auto_validate; + 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) /** @@ -549,7 +552,6 @@ 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; From 1ca3e433d2520063ba2f081eae9fa039f2188082 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Mar 2021 19:55:09 +0100 Subject: [PATCH 58/61] Fix phpunit --- htdocs/compta/facture/class/facture-rec.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 45b81b844ec..7d15674e7e7 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -557,7 +557,6 @@ class FactureRec extends CommonInvoice $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->frequency = $obj->frequency; $this->unit_frequency = $obj->unit_frequency; From 1affaa8c8705fd7b50e7d1daf5e8828c120e9892 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Mar 2021 20:26:36 +0100 Subject: [PATCH 59/61] fix phpunit --- htdocs/compta/facture/class/facture-rec.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 7d15674e7e7..7c966fc1b1f 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -557,7 +557,7 @@ class FactureRec extends CommonInvoice $this->user_author = $obj->fk_user_author; $this->modelpdf = $obj->model_pdf; // deprecated $this->model_pdf = $obj->model_pdf; - $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); From a1d97274fb52e3d37179c014330e3a5c1f721fb6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Mar 2021 09:14:23 +0100 Subject: [PATCH 60/61] Clean code for php8 --- .../facture/class/facture-rec.class.php | 10 +++++++ htdocs/compta/facture/class/facture.class.php | 26 ++++++++++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 7c966fc1b1f..360bba67e34 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -116,6 +116,12 @@ class FactureRec extends CommonInvoice 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') @@ -837,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]; @@ -1277,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; @@ -1602,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; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a78fc550150..96af87b81b5 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 */ @@ -446,6 +452,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 +545,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 @@ -1683,7 +1693,7 @@ class Facture extends CommonInvoice $this->fetchPreviousNextSituationInvoice(); } - if ($this->statut == self::STATUS_DRAFT) { + if ($this->status == self::STATUS_DRAFT) { $this->brouillon = 1; } @@ -2584,8 +2594,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) { @@ -2849,6 +2859,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; @@ -2887,7 +2898,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) { @@ -2900,6 +2911,7 @@ class Facture extends CommonInvoice } $next_invoice->brouillon = 1; + foreach ($next_invoice->lines as $line) { $result = $next_invoice->updateline( $line->id, @@ -2995,12 +3007,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 @@ -3362,7 +3376,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) { @@ -3631,7 +3645,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; } From 4d409e23f56e80e3243d80c147052b5cb55da745 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Mar 2021 09:16:33 +0100 Subject: [PATCH 61/61] Missing declaration of properties --- htdocs/compta/facture/class/facture-rec.class.php | 3 +++ htdocs/compta/facture/class/facture.class.php | 1 + 2 files changed, 4 insertions(+) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 360bba67e34..1c4d0e8326f 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -111,6 +111,9 @@ 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 diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 96af87b81b5..dfd50147109 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -177,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