-- Copyright (C) 2017 SuperAdmin
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.

--INSERT INTO llx_extrafields( name, entity, label, type, size, elementtype, fieldunique, fieldrequired, perms, pos, alwayseditable, param, list, ishidden) VALUES ('rt', 1, 'Retencion', 'sellist', '', 'facture', '0', '0', null, '1', '0', 'a:1:{s:7:\"options\";a:1:{s:53:\"rete_concepto:concat(concepto,\'- % \',retencion):rowid\";N;}}', 0, 0);
--INSERT INTO llx_extrafields(name, label, type, pos, size, entity, elementtype, fieldunique, fieldrequired, param, alwayseditable, perms, list, ishidden) VALUES('rt', 'Retencion', 'sellist', '1', '', 1, 'facture_fourn', '0', '0', 'a:1:{s:7:\"options\";a:1:{s:53:\"rete_concepto:concat(concepto,\'- % \',retencion):rowid\";N;}}', '0', null, 0, 0);
DELETE FROM llx_concepto;
DELETE FROM llx_cuentasdol;
--INSERT INTO llx_extrafields(name, label, type, pos, size, entity, elementtype, fieldunique, fieldrequired, param, alwayseditable, perms, list,enabled) VALUES('arete', 'applyretentions', 'boolean', '0', '', 1, 'facture', '0', '0', 'a:1:{s:7:\"options\";a:1:{s:0:\"\";N;}}', '1', null, 1,1);
INSERT INTO llx_extrafields( name, entity, label, type, size, elementtype, fieldunique, fieldrequired, perms, langs, pos, alwayseditable, param, list, printable, totalizable, fielddefault, fieldcomputed, fk_user_author, fk_user_modif, datec, enabled, help) VALUES ('arete', 1, 'applyretentions', 'boolean', '', 'facture', 0, 0, null, 'smsrete@smsrete', 0, '1', 'a:1:{s:7:\"options\";a:1:{s:0:\"\";N;}}', '1',  '0',  FALSE, null, null, 1, 1,'2021-12-12 14:46:43','1', null);
INSERT INTO llx_extrafields( name, entity, label, type, size, elementtype, fieldunique, fieldrequired, perms, langs, pos, alwayseditable, param, list, printable, totalizable, fielddefault, fieldcomputed, fk_user_author, fk_user_modif, datec, enabled, help) VALUES ('arete', 1, 'applyretention', 'boolean', '', 'facture_fourn', 0, 0, null, 'smsrete@smsrete', 0, '1', 'a:1:{s:7:\"options\";a:1:{s:0:\"\";N;}}', '1',  '0',  FALSE, null, null, 1, 1,'2021-12-12 14:46:43','1', null);
--INSERT INTO llx_extrafields(name, label, type, pos, size, entity, elementtype, fieldunique, fieldrequired, param, alwayseditable, perms, list,enabled) VALUES('arete', 'applyretention', 'boolean', '0', '', 1, 'facture_fourn', '0', '0', 'a:1:{s:7:\"options\";a:1:{s:0:\"\";N;}}', '1', null, 1,1);
INSERT INTO llx_rete_cuentasdol VALUES
(1, 'Clientes', 'venta', '13.05.05', 1, 0, 'v_c'),
(2, 'IVA', 'venta', '24.08', 0, 1, 'v_i'),
(3, 'Ingresos x Ventas', 'venta', '41.45', 0, 1, 'v_iv'),
(4, 'Compra Mercancia', 'compra', '14.05', 1, 0, 'c_cm'),
(5, 'IVA', 'compra', '24.08', 1, 0, 'c_iva'),
(6, 'Cuentas por Cobrar', 'pago', '13.09', 1, 0, 'v_cc'),
(7, 'Cuentas por Pagar', 'pago', '23.35.95', NULL, 1, 'c_cp');

INSERT INTO llx_rete_concepto( concepto, retencion, descripcion, code, aplicar) VALUES
( 'Retencion fte compras 2.5%', 2.5, 'Retencion Fuente Compras', 'v_rfc', 'BI');
INSERT INTO llx_rete_concepto( concepto, retencion, descripcion, code, aplicar) VALUES
( 'Retencion ica 11.04xmil', 1.104, 'Retencion Ica 11.04', 'v_rica', 'BI');
INSERT INTO llx_rete_concepto( concepto, retencion, descripcion, code, aplicar) VALUES
('Retencion Iva 15% del iva', 15, 'Retencion Iva 15% del iva', 'v_riva', 'IV');

INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(1, 'Clientes', 'venta', '13.05.05', 1, 0, 'v_c');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(2, 'IVA', 'venta', '24.08', 0, 1, 'v_i');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(3, 'Ingresos x Ventas', 'venta', '41.45', 0, 1, 'v_iv');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(4, 'Compra Mercancia', 'compra', '14.05', 1, 0, 'c_cm');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(5, 'IVA', 'compra', '24.08', 1, 0, 'c_iva');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(6, 'Cuentas por Cobrar', 'pago', '13.09', 1, 0, 'v_cc');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(7, 'Cuentas por Pagar', 'pago', '23.35.95', 0, 1, 'c_cp');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(8, 'Retencion fte compras 2.5%', 'venta', '13.55.15', 1, 0, 'v_rfc');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(9, 'Retencion ica 11.04xmil', 'venta', '13.55.18', 1, 0, 'v_rica');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(10, 'Retencion Iva 15% del iva', 'venta', '13.55.17', 1, 0, 'v_riva');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(13, 'Retencion fte compras 2.5%', 'compra', '23.65.40', 0, 1, 'v_rfc');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(14, 'Retencion ica 11.04xmil', 'compra', '23.68.8', 0, 1, 'v_rica');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(15, 'Retencion Iva 15% del iva', 'compra', '23.68', 0, 1, 'v_riva');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(16, 'Retencion fte compras 2.5%', 'pago', '23.65.40', 0, 1, 'v_rfc');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(17, 'Retencion ica 11.04xmil', 'pago', '23.68.8', 0, 1, 'v_rica');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(18, 'Retencion Iva 15% del iva', 'pago', '23.68', 0, 1, 'v_riva');
INSERT INTO llx_rete_cuentasdol(rowid, documento, proceso, cuenta, debe, haber, code) VALUES
(19, 'Proveedores', 'compra', '14.05.06', 1, 0, 'c_cm');

INSERT INTO llx_extrafields( name, label, type, pos, size, entity, elementtype, fieldunique,
                            fieldrequired, param, alwayseditable, perms, langs, list, printable,
                            fielddefault, fieldcomputed, fk_user_author, fk_user_modif, datec, enabled, help, totalizable ) VALUES
                                                                                                                                   ('s_rft', 'Retencion Fuente %', 'varchar', 12, '15', 1, 'product', 0, 0, 'a:1:{s:7:\"options\";a:1:{s:0:\"\";N;}}', 1, null, 'smsrete@smsrete', '1', '1', null, null, 1, 1,'2021-12-04 17:04:36', '1', 'Retencion para el Servicio en %', FALSE);

INSERT INTO llx_document_model (nom, type, entity, libelle, description) VALUES ('retex','invoice',1, 'Holds', null);
INSERT INTO llx_extrafields( name, label, type, pos, size, entity, elementtype, fieldunique, fieldrequired, param, alwayseditable, perms, langs, list, printable, fielddefault, fieldcomputed, fk_user_author, fk_user_modif, datec, enabled, help, totalizable ) VALUES('retero', 'retetercero', 'varchar', 12, '12', 0, 'societe', 0, 0, 'a:1:{s:7:\"options\";a:1:{s:0:\"\";N;}}', 1, null, 'smsrete@smsrete', '1', '2', null, null, 1, 1,'2021-12-24 12:27:40', '1', 'helpretetercero', FALSE);
